code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
|---|---|---|
public com.squareup.okhttp.Call getCharactersCharacterIdWalletAsync(Integer characterId, String datasource,
String ifNoneMatch, String token, final ApiCallback<Double> callback) throws ApiException {
com.squareup.okhttp.Call call = getCharactersCharacterIdWalletValidateBeforeCall(characterId, datasource,
ifNoneMatch, token, callback);
Type localVarReturnType = new TypeToken<Double>() {
}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
|
class class_name[name] begin[{]
method[getCharactersCharacterIdWalletAsync, return_type[type[com]], modifier[public], parameter[characterId, datasource, ifNoneMatch, token, callback]] begin[{]
local_variable[type[com], call]
local_variable[type[Type], localVarReturnType]
call[apiClient.executeAsync, parameter[member[.call], member[.localVarReturnType], member[.callback]]]
return[member[.call]]
end[}]
END[}]
|
Keyword[public] identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[getCharactersCharacterIdWalletAsync] operator[SEP] identifier[Integer] identifier[characterId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[String] identifier[token] , Keyword[final] identifier[ApiCallback] operator[<] identifier[Double] operator[>] identifier[callback] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[getCharactersCharacterIdWalletValidateBeforeCall] operator[SEP] identifier[characterId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[token] , identifier[callback] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[Double] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[apiClient] operator[SEP] identifier[executeAsync] operator[SEP] identifier[call] , identifier[localVarReturnType] , identifier[callback] operator[SEP] operator[SEP] Keyword[return] identifier[call] operator[SEP]
}
|
public final void setTransactionOutcome(boolean commit, GlobalTransaction globalTransaction, boolean local) {
TransactionStatistics txs = getTransactionStatistic(globalTransaction, local);
if (txs == null) {
log.outcomeOnUnexistingTransaction(globalTransaction == null ? "null" : globalTransaction.globalId(),
commit ? "COMMIT" : "ROLLBACK");
return;
}
txs.setOutcome(commit);
}
|
class class_name[name] begin[{]
method[setTransactionOutcome, return_type[void], modifier[final public], parameter[commit, globalTransaction, local]] begin[{]
local_variable[type[TransactionStatistics], txs]
if[binary_operation[member[.txs], ==, literal[null]]] begin[{]
call[log.outcomeOnUnexistingTransaction, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=globalTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=globalId, postfix_operators=[], prefix_operators=[], qualifier=globalTransaction, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")), TernaryExpression(condition=MemberReference(member=commit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ROLLBACK"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="COMMIT"))]]
return[None]
else begin[{]
None
end[}]
call[txs.setOutcome, parameter[member[.commit]]]
end[}]
END[}]
|
Keyword[public] Keyword[final] Keyword[void] identifier[setTransactionOutcome] operator[SEP] Keyword[boolean] identifier[commit] , identifier[GlobalTransaction] identifier[globalTransaction] , Keyword[boolean] identifier[local] operator[SEP] {
identifier[TransactionStatistics] identifier[txs] operator[=] identifier[getTransactionStatistic] operator[SEP] identifier[globalTransaction] , identifier[local] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[txs] operator[==] Other[null] operator[SEP] {
identifier[log] operator[SEP] identifier[outcomeOnUnexistingTransaction] operator[SEP] identifier[globalTransaction] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[globalTransaction] operator[SEP] identifier[globalId] operator[SEP] operator[SEP] , identifier[commit] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[txs] operator[SEP] identifier[setOutcome] operator[SEP] identifier[commit] operator[SEP] operator[SEP]
}
|
@Override
public void writeExternal(ObjectOutput out)
throws IOException {
out.writeByte(this.type);
switch (this.type) {
case HIJRI:
this.writeHijri(out);
break;
case PERSIAN:
this.writePersian(out);
break;
case COPTIC:
this.writeCoptic(out);
break;
case ETHIOPIAN_DATE:
this.writeEthiopianDate(out);
break;
case ETHIOPIAN_TIME:
this.writeEthiopianTime(out);
break;
case MINGUO:
this.writeMinguo(out);
break;
case JULIAN:
this.writeJulian(out);
break;
case THAI_SOLAR:
this.writeThaiSolar(out);
break;
case JAPANESE:
this.writeJapanese(out);
break;
case INDIAN:
this.writeIndian(out);
break;
case HISTORIC:
this.writeHistoric(out);
break;
case HEBREW_DATE:
this.writeHebrewDate(out);
break;
case HEBREW_TIME:
this.writeHebrewTime(out);
break;
case CHINESE:
case KOREAN:
case VIETNAMESE:
this.writeEAC(out);
break;
case JUCHE:
this.writeJuche(out);
break;
default:
throw new InvalidClassException("Unsupported calendar type.");
}
}
|
class class_name[name] begin[{]
method[writeExternal, return_type[void], modifier[public], parameter[out]] begin[{]
call[out.writeByte, parameter[THIS[member[None.type]]]]
SwitchStatement(cases=[SwitchStatementCase(case=['HIJRI'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeHijri, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PERSIAN'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writePersian, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['COPTIC'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeCoptic, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ETHIOPIAN_DATE'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeEthiopianDate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ETHIOPIAN_TIME'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeEthiopianTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['MINGUO'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeMinguo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['JULIAN'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeJulian, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['THAI_SOLAR'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeThaiSolar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['JAPANESE'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeJapanese, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['INDIAN'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeIndian, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['HISTORIC'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeHistoric, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['HEBREW_DATE'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeHebrewDate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['HEBREW_TIME'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeHebrewTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CHINESE', 'KOREAN', 'VIETNAMESE'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeEAC, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['JUCHE'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeJuche, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported calendar type.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidClassException, sub_type=None)), label=None)])], expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), label=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeExternal] operator[SEP] identifier[ObjectOutput] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[out] operator[SEP] identifier[writeByte] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] {
Keyword[case] identifier[HIJRI] operator[:] Keyword[this] operator[SEP] identifier[writeHijri] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PERSIAN] operator[:] Keyword[this] operator[SEP] identifier[writePersian] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[COPTIC] operator[:] Keyword[this] operator[SEP] identifier[writeCoptic] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ETHIOPIAN_DATE] operator[:] Keyword[this] operator[SEP] identifier[writeEthiopianDate] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ETHIOPIAN_TIME] operator[:] Keyword[this] operator[SEP] identifier[writeEthiopianTime] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[MINGUO] operator[:] Keyword[this] operator[SEP] identifier[writeMinguo] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[JULIAN] operator[:] Keyword[this] operator[SEP] identifier[writeJulian] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[THAI_SOLAR] operator[:] Keyword[this] operator[SEP] identifier[writeThaiSolar] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[JAPANESE] operator[:] Keyword[this] operator[SEP] identifier[writeJapanese] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[INDIAN] operator[:] Keyword[this] operator[SEP] identifier[writeIndian] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[HISTORIC] operator[:] Keyword[this] operator[SEP] identifier[writeHistoric] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[HEBREW_DATE] operator[:] Keyword[this] operator[SEP] identifier[writeHebrewDate] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[HEBREW_TIME] operator[:] Keyword[this] operator[SEP] identifier[writeHebrewTime] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CHINESE] operator[:] Keyword[case] identifier[KOREAN] operator[:] Keyword[case] identifier[VIETNAMESE] operator[:] Keyword[this] operator[SEP] identifier[writeEAC] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[JUCHE] operator[:] Keyword[this] operator[SEP] identifier[writeJuche] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[InvalidClassException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public static List<File> getReports(Configuration settings, final File moduleBaseDir, String reportPathKey) {
String[] reportPaths = settings.getStringArray(reportPathKey);
if (reportPaths == null || reportPaths.length == 0) {
LOG.info("Undefined report path value for key '{}'", reportPathKey);
return Collections.emptyList();
}
List<String> normalizedReportPaths = normalizeReportPaths(moduleBaseDir, reportPaths);
if (LOG.isDebugEnabled()) {
LOG.debug("Scanner uses normalized report path(s): '{}'", String.join(", ", normalizedReportPaths));
}
// Includes array cannot contain null elements
DirectoryScanner directoryScanner = new DirectoryScanner();
directoryScanner.setIncludes(normalizedReportPaths.toArray(new String[normalizedReportPaths.size()]));
directoryScanner.scan();
String[] existingReportPaths = directoryScanner.getIncludedFiles();
if (existingReportPaths.length == 0) {
LOG.warn("Property '{}': cannot find any files matching the Ant pattern(s) '{}'", reportPathKey,
String.join(", ", normalizedReportPaths));
return Collections.emptyList();
}
LOG.info("Parser will parse '{}' report file(s)", existingReportPaths.length);
return Arrays.stream(existingReportPaths).map(File::new).collect(Collectors.toList());
}
|
class class_name[name] begin[{]
method[getReports, return_type[type[List]], modifier[public static], parameter[settings, moduleBaseDir, reportPathKey]] begin[{]
local_variable[type[String], reportPaths]
if[binary_operation[binary_operation[member[.reportPaths], ==, literal[null]], ||, binary_operation[member[reportPaths.length], ==, literal[0]]]] begin[{]
call[LOG.info, parameter[literal["Undefined report path value for key '{}'"], member[.reportPathKey]]]
return[call[Collections.emptyList, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[List], normalizedReportPaths]
if[call[LOG.isDebugEnabled, parameter[]]] begin[{]
call[LOG.debug, parameter[literal["Scanner uses normalized report path(s): '{}'"], call[String.join, parameter[literal[", "], member[.normalizedReportPaths]]]]]
else begin[{]
None
end[}]
local_variable[type[DirectoryScanner], directoryScanner]
call[directoryScanner.setIncludes, parameter[call[normalizedReportPaths.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=normalizedReportPaths, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]]
call[directoryScanner.scan, parameter[]]
local_variable[type[String], existingReportPaths]
if[binary_operation[member[existingReportPaths.length], ==, literal[0]]] begin[{]
call[LOG.warn, parameter[literal["Property '{}': cannot find any files matching the Ant pattern(s) '{}'"], member[.reportPathKey], call[String.join, parameter[literal[", "], member[.normalizedReportPaths]]]]]
return[call[Collections.emptyList, parameter[]]]
else begin[{]
None
end[}]
call[LOG.info, parameter[literal["Parser will parse '{}' report file(s)"], member[existingReportPaths.length]]]
return[call[Arrays.stream, parameter[member[.existingReportPaths]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[File] operator[>] identifier[getReports] operator[SEP] identifier[Configuration] identifier[settings] , Keyword[final] identifier[File] identifier[moduleBaseDir] , identifier[String] identifier[reportPathKey] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[reportPaths] operator[=] identifier[settings] operator[SEP] identifier[getStringArray] operator[SEP] identifier[reportPathKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reportPaths] operator[==] Other[null] operator[||] identifier[reportPaths] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[reportPathKey] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[String] operator[>] identifier[normalizedReportPaths] operator[=] identifier[normalizeReportPaths] operator[SEP] identifier[moduleBaseDir] , identifier[reportPaths] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[normalizedReportPaths] operator[SEP] operator[SEP] operator[SEP]
}
identifier[DirectoryScanner] identifier[directoryScanner] operator[=] Keyword[new] identifier[DirectoryScanner] operator[SEP] operator[SEP] operator[SEP] identifier[directoryScanner] operator[SEP] identifier[setIncludes] operator[SEP] identifier[normalizedReportPaths] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[normalizedReportPaths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[directoryScanner] operator[SEP] identifier[scan] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[existingReportPaths] operator[=] identifier[directoryScanner] operator[SEP] identifier[getIncludedFiles] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existingReportPaths] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[reportPathKey] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[normalizedReportPaths] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
}
identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[existingReportPaths] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[existingReportPaths] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[File] operator[::] Keyword[new] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public <T> int del(T pk) throws SQLException {
if (pk == null) {
return 0;
}
return this.del(Entity.create(tableName).set(primaryKeyField, pk));
}
|
class class_name[name] begin[{]
method[del, return_type[type[int]], modifier[public], parameter[pk]] begin[{]
if[binary_operation[member[.pk], ==, literal[null]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
return[THIS[call[None.del, parameter[call[Entity.create, parameter[member[.tableName]]]]]]]
end[}]
END[}]
|
Keyword[public] operator[<] identifier[T] operator[>] Keyword[int] identifier[del] operator[SEP] identifier[T] identifier[pk] operator[SEP] Keyword[throws] identifier[SQLException] {
Keyword[if] operator[SEP] identifier[pk] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP] identifier[del] operator[SEP] identifier[Entity] operator[SEP] identifier[create] operator[SEP] identifier[tableName] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[primaryKeyField] , identifier[pk] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
protected String serialize(InvocationContext context, Object input) {
if(unavailable || incompatible) {
throw new IllegalStateException(unavailable? ERROR_CONTEXT_UNAVAILABLE :ERROR_CONTEXT_INCOMPATIBLE);
}
try {
return input == null? null :(String) Gson_toJson.invoke(
gson, input, TypeToken_getType.invoke(TypeToken_GET.invoke(null, input.getClass())));
}
catch(Exception e) {
throw new SerializerException(new StringBuilder("JSON serialization failed for request <")
.append(context.getRequest().getName())
.append("> on endpoint <")
.append(context.getEndpoint().getName())
.append(">").toString(), e);
}
}
|
class class_name[name] begin[{]
method[serialize, return_type[type[String]], modifier[protected], parameter[context, input]] begin[{]
if[binary_operation[member[.unavailable], ||, member[.incompatible]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[TernaryExpression(condition=MemberReference(member=unavailable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=ERROR_CONTEXT_INCOMPATIBLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=ERROR_CONTEXT_UNAVAILABLE, 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=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Cast(expression=MethodInvocation(arguments=[MemberReference(member=gson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=TypeToken_GET, selectors=[], type_arguments=None)], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=TypeToken_getType, selectors=[], type_arguments=None)], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=Gson_toJson, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JSON serialization failed for request <")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRequest, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], 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="> on endpoint <")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEndpoint, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], 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), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), 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=SerializerException, 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[}]
|
annotation[@] identifier[Override] Keyword[protected] identifier[String] identifier[serialize] operator[SEP] identifier[InvocationContext] identifier[context] , identifier[Object] identifier[input] operator[SEP] {
Keyword[if] operator[SEP] identifier[unavailable] operator[||] identifier[incompatible] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[unavailable] operator[?] identifier[ERROR_CONTEXT_UNAVAILABLE] operator[:] identifier[ERROR_CONTEXT_INCOMPATIBLE] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[return] identifier[input] operator[==] Other[null] operator[?] Other[null] operator[:] operator[SEP] identifier[String] operator[SEP] identifier[Gson_toJson] operator[SEP] identifier[invoke] operator[SEP] identifier[gson] , identifier[input] , identifier[TypeToken_getType] operator[SEP] identifier[invoke] operator[SEP] identifier[TypeToken_GET] operator[SEP] identifier[invoke] operator[SEP] Other[null] , identifier[input] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SerializerException] operator[SEP] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[context] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[context] operator[SEP] identifier[getEndpoint] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void marshall(UpdateEncryption updateEncryption, ProtocolMarshaller protocolMarshaller) {
if (updateEncryption == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateEncryption.getAlgorithm(), ALGORITHM_BINDING);
protocolMarshaller.marshall(updateEncryption.getKeyType(), KEYTYPE_BINDING);
protocolMarshaller.marshall(updateEncryption.getRoleArn(), ROLEARN_BINDING);
protocolMarshaller.marshall(updateEncryption.getSecretArn(), SECRETARN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
|
class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[updateEncryption, protocolMarshaller]] begin[{]
if[binary_operation[member[.updateEncryption], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=updateEncryption, selectors=[], type_arguments=None), MemberReference(member=ALGORITHM_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKeyType, postfix_operators=[], prefix_operators=[], qualifier=updateEncryption, selectors=[], type_arguments=None), MemberReference(member=KEYTYPE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRoleArn, postfix_operators=[], prefix_operators=[], qualifier=updateEncryption, selectors=[], type_arguments=None), MemberReference(member=ROLEARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSecretArn, postfix_operators=[], prefix_operators=[], qualifier=updateEncryption, selectors=[], type_arguments=None), MemberReference(member=SECRETARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[UpdateEncryption] identifier[updateEncryption] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[updateEncryption] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateEncryption] operator[SEP] identifier[getAlgorithm] operator[SEP] operator[SEP] , identifier[ALGORITHM_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateEncryption] operator[SEP] identifier[getKeyType] operator[SEP] operator[SEP] , identifier[KEYTYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateEncryption] operator[SEP] identifier[getRoleArn] operator[SEP] operator[SEP] , identifier[ROLEARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateEncryption] operator[SEP] identifier[getSecretArn] operator[SEP] operator[SEP] , identifier[SECRETARN_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private void enableMenu(final JMenu menu) {
menu.setEnabled(true);
for (final Component c : menu.getMenuComponents()) {
if (c instanceof JMenu) {
enableMenu((JMenu) c);
} else if (c instanceof JMenuItem) {
((JMenuItem) c).setEnabled(true);
}
}
}
|
class class_name[name] begin[{]
method[enableMenu, return_type[void], modifier[private], parameter[menu]] begin[{]
call[menu.setEnabled, parameter[literal[true]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JMenu, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JMenuItem, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JMenuItem, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JMenu, sub_type=None))], member=enableMenu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMenuComponents, postfix_operators=[], prefix_operators=[], qualifier=menu, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Component, sub_type=None))), label=None)
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[enableMenu] operator[SEP] Keyword[final] identifier[JMenu] identifier[menu] operator[SEP] {
identifier[menu] operator[SEP] identifier[setEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Component] identifier[c] operator[:] identifier[menu] operator[SEP] identifier[getMenuComponents] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] Keyword[instanceof] identifier[JMenu] operator[SEP] {
identifier[enableMenu] operator[SEP] operator[SEP] identifier[JMenu] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] Keyword[instanceof] identifier[JMenuItem] operator[SEP] {
operator[SEP] operator[SEP] identifier[JMenuItem] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[setEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
}
|
public String printRelative(
Instant instant,
ZoneId zoneId
) {
return this.printRelative(Moment.from(instant), Timezone.of(zoneId.getId()), TimeUnit.SECONDS);
}
|
class class_name[name] begin[{]
method[printRelative, return_type[type[String]], modifier[public], parameter[instant, zoneId]] begin[{]
return[THIS[call[None.printRelative, parameter[call[Moment.from, parameter[member[.instant]]], call[Timezone.of, parameter[call[zoneId.getId, parameter[]]]], member[TimeUnit.SECONDS]]]]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[printRelative] operator[SEP] identifier[Instant] identifier[instant] , identifier[ZoneId] identifier[zoneId] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[printRelative] operator[SEP] identifier[Moment] operator[SEP] identifier[from] operator[SEP] identifier[instant] operator[SEP] , identifier[Timezone] operator[SEP] identifier[of] operator[SEP] identifier[zoneId] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP]
}
|
private void processRstFrame() {
int error = ((FrameRstStream) currentFrame).getErrorCode();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "processRstFrame: error received from peer: " + utils.getErrorFromCode(error));
}
this.updateStreamState(StreamState.CLOSED);
}
|
class class_name[name] begin[{]
method[processRstFrame, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[int], error]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[literal["processRstFrame: error received from peer: "], +, call[utils.getErrorFromCode, parameter[member[.error]]]]]]
else begin[{]
None
end[}]
THIS[call[None.updateStreamState, parameter[member[StreamState.CLOSED]]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[processRstFrame] operator[SEP] operator[SEP] {
Keyword[int] identifier[error] operator[=] operator[SEP] operator[SEP] identifier[FrameRstStream] operator[SEP] identifier[currentFrame] operator[SEP] operator[SEP] identifier[getErrorCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[utils] operator[SEP] identifier[getErrorFromCode] operator[SEP] identifier[error] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[updateStreamState] operator[SEP] identifier[StreamState] operator[SEP] identifier[CLOSED] operator[SEP] operator[SEP]
}
|
private void loadSectionBytes() throws IOException {
Preconditions.checkState(size == (int) size,
"section is too large to dump into byte array");
try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
raf.seek(offset);
byte[] bytes = new byte[(int) size];
raf.read(bytes);
sectionbytes = Optional.of(bytes);
}
}
|
class class_name[name] begin[{]
method[loadSectionBytes, return_type[void], modifier[private], parameter[]] begin[{]
call[Preconditions.checkState, parameter[binary_operation[member[.size], ==, Cast(expression=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], literal["section is too large to dump into byte array"]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=seek, postfix_operators=[], prefix_operators=[], qualifier=raf, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Cast(expression=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=bytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=raf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sectionbytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None)), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=raf, type=ReferenceType(arguments=None, dimensions=[], name=RandomAccessFile, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="r")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RandomAccessFile, sub_type=None)))])
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[loadSectionBytes] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[size] operator[==] operator[SEP] Keyword[int] operator[SEP] identifier[size] , literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[RandomAccessFile] identifier[raf] operator[=] Keyword[new] identifier[RandomAccessFile] operator[SEP] identifier[file] , literal[String] operator[SEP] operator[SEP] {
identifier[raf] operator[SEP] identifier[seek] operator[SEP] identifier[offset] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[raf] operator[SEP] identifier[read] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[sectionbytes] operator[=] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[bytes] operator[SEP] operator[SEP]
}
}
|
public ServiceFuture<ImageInner> getByResourceGroupAsync(String resourceGroupName, String imageName, String expand, final ServiceCallback<ImageInner> serviceCallback) {
return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, imageName, expand), serviceCallback);
}
|
class class_name[name] begin[{]
method[getByResourceGroupAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, imageName, expand, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.getByResourceGroupWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.imageName], member[.expand]]], member[.serviceCallback]]]]
end[}]
END[}]
|
Keyword[public] identifier[ServiceFuture] operator[<] identifier[ImageInner] operator[>] identifier[getByResourceGroupAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[imageName] , identifier[String] identifier[expand] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[ImageInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getByResourceGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[imageName] , identifier[expand] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public Integer getIndex4SqlTable(final SQLTable _sqlTable)
{
final Integer ret;
if (this.sqlTable2Index.containsKey(_sqlTable)) {
ret = this.sqlTable2Index.get(_sqlTable);
} else {
Integer max = 0;
for (final Integer index : this.sqlTable2Index.values()) {
if (index > max) {
max = index;
}
}
ret = max + 1;
this.sqlTable2Index.put(_sqlTable, ret);
}
return ret;
}
|
class class_name[name] begin[{]
method[getIndex4SqlTable, return_type[type[Integer]], modifier[public], parameter[_sqlTable]] begin[{]
local_variable[type[Integer], ret]
if[THIS[member[None.sqlTable2Index]call[None.containsKey, parameter[member[._sqlTable]]]]] begin[{]
assign[member[.ret], THIS[member[None.sqlTable2Index]call[None.get, parameter[member[._sqlTable]]]]]
else begin[{]
local_variable[type[Integer], max]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sqlTable2Index, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=index)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None)
assign[member[.ret], binary_operation[member[.max], +, literal[1]]]
THIS[member[None.sqlTable2Index]call[None.put, parameter[member[._sqlTable], member[.ret]]]]
end[}]
return[member[.ret]]
end[}]
END[}]
|
Keyword[public] identifier[Integer] identifier[getIndex4SqlTable] operator[SEP] Keyword[final] identifier[SQLTable] identifier[_sqlTable] operator[SEP] {
Keyword[final] identifier[Integer] identifier[ret] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[sqlTable2Index] operator[SEP] identifier[containsKey] operator[SEP] identifier[_sqlTable] operator[SEP] operator[SEP] {
identifier[ret] operator[=] Keyword[this] operator[SEP] identifier[sqlTable2Index] operator[SEP] identifier[get] operator[SEP] identifier[_sqlTable] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Integer] identifier[max] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Integer] identifier[index] operator[:] Keyword[this] operator[SEP] identifier[sqlTable2Index] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[index] operator[>] identifier[max] operator[SEP] {
identifier[max] operator[=] identifier[index] operator[SEP]
}
}
identifier[ret] operator[=] identifier[max] operator[+] Other[1] operator[SEP] Keyword[this] operator[SEP] identifier[sqlTable2Index] operator[SEP] identifier[put] operator[SEP] identifier[_sqlTable] , identifier[ret] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ret] operator[SEP]
}
|
@Override
public Collection<Timer> getTimers() throws IllegalStateException, EJBException {
assertTimerServiceState();
Object pk = currentPrimaryKey();
final Set<Timer> activeTimers = new HashSet<Timer>();
// get all active timers for this timerservice
synchronized (this.timers) {
for (final TimerImpl timer : this.timers.values()) {
// Less disruptive way to get WFLY-8457 fixed.
if (timer.isActive() || (!timer.isActive() && timer.getState() == TimerState.ACTIVE)) {
if (timer.getPrimaryKey() == null || timer.getPrimaryKey().equals(pk)) {
activeTimers.add(timer);
}
}
}
}
// get all active timers which are persistent, but haven't yet been
// persisted (waiting for tx to complete) that are in the current transaction
for (final TimerImpl timer : getWaitingOnTxCompletionTimers().values()) {
if (timer.isActive()) {
if (timer.getPrimaryKey() == null || timer.getPrimaryKey().equals(pk)) {
activeTimers.add(timer);
}
}
}
return activeTimers;
}
|
class class_name[name] begin[{]
method[getTimers, return_type[type[Collection]], modifier[public], parameter[]] begin[{]
call[.assertTimerServiceState, parameter[]]
local_variable[type[Object], pk]
local_variable[type[Set], activeTimers]
SYNCHRONIZED[THIS[member[None.timers]]] BEGIN[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isActive, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isActive, postfix_operators=[], prefix_operators=['!'], qualifier=timer, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[], type_arguments=None), operandr=MemberReference(member=ACTIVE, postfix_operators=[], prefix_operators=[], qualifier=TimerState, selectors=[]), operator===), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPrimaryKey, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=getPrimaryKey, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[MethodInvocation(arguments=[MemberReference(member=pk, 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=MethodInvocation(arguments=[MemberReference(member=timer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=activeTimers, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=timers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=timer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TimerImpl, sub_type=None))), label=None)
END[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isActive, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPrimaryKey, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=getPrimaryKey, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[MethodInvocation(arguments=[MemberReference(member=pk, 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=MethodInvocation(arguments=[MemberReference(member=timer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=activeTimers, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getWaitingOnTxCompletionTimers, postfix_operators=[], prefix_operators=[], qualifier=, 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=timer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TimerImpl, sub_type=None))), label=None)
return[member[.activeTimers]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Collection] operator[<] identifier[Timer] operator[>] identifier[getTimers] operator[SEP] operator[SEP] Keyword[throws] identifier[IllegalStateException] , identifier[EJBException] {
identifier[assertTimerServiceState] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[pk] operator[=] identifier[currentPrimaryKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[Timer] operator[>] identifier[activeTimers] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Timer] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[timers] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[TimerImpl] identifier[timer] operator[:] Keyword[this] operator[SEP] identifier[timers] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[timer] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[||] operator[SEP] operator[!] identifier[timer] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[&&] identifier[timer] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[==] identifier[TimerState] operator[SEP] identifier[ACTIVE] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[timer] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[timer] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[pk] operator[SEP] operator[SEP] {
identifier[activeTimers] operator[SEP] identifier[add] operator[SEP] identifier[timer] operator[SEP] operator[SEP]
}
}
}
}
Keyword[for] operator[SEP] Keyword[final] identifier[TimerImpl] identifier[timer] operator[:] identifier[getWaitingOnTxCompletionTimers] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[timer] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[timer] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[timer] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[pk] operator[SEP] operator[SEP] {
identifier[activeTimers] operator[SEP] identifier[add] operator[SEP] identifier[timer] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[activeTimers] operator[SEP]
}
|
public void addCustomTrackingParameter(String key, Object value){
if (key == null){
throw new NullPointerException("Key cannot be null.");
}
if (value == null){
throw new NullPointerException("Cannot add a null custom tracking parameter.");
}
else{
List l = customTrackingParameters.get(key);
if (l == null){
l = new ArrayList();
customTrackingParameters.put(key, l);
}
l.add(value);
}
}
|
class class_name[name] begin[{]
method[addCustomTrackingParameter, return_type[void], modifier[public], parameter[key, value]] begin[{]
if[binary_operation[member[.key], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Key cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot add a null custom tracking parameter.")], 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[{]
local_variable[type[List], l]
if[binary_operation[member[.l], ==, literal[null]]] begin[{]
assign[member[.l], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))]
call[customTrackingParameters.put, parameter[member[.key], member[.l]]]
else begin[{]
None
end[}]
call[l.add, parameter[member[.value]]]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addCustomTrackingParameter] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[List] identifier[l] operator[=] identifier[customTrackingParameters] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[==] Other[null] operator[SEP] {
identifier[l] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[customTrackingParameters] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[l] operator[SEP] operator[SEP]
}
identifier[l] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
|
public static void setTemporaryCloudStorageDirectory(Configuration configuration, String path) {
configuration.set(BigQueryConfiguration.TEMP_GCS_PATH_KEY, path);
}
|
class class_name[name] begin[{]
method[setTemporaryCloudStorageDirectory, return_type[void], modifier[public static], parameter[configuration, path]] begin[{]
call[configuration.set, parameter[member[BigQueryConfiguration.TEMP_GCS_PATH_KEY], member[.path]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[setTemporaryCloudStorageDirectory] operator[SEP] identifier[Configuration] identifier[configuration] , identifier[String] identifier[path] operator[SEP] {
identifier[configuration] operator[SEP] identifier[set] operator[SEP] identifier[BigQueryConfiguration] operator[SEP] identifier[TEMP_GCS_PATH_KEY] , identifier[path] operator[SEP] operator[SEP]
}
|
public void wipeBundle (boolean deleteJar)
{
// clear out our cache directory
if (_cache != null) {
FileUtil.recursiveClean(_cache);
}
// delete our unpack stamp file
if (_unpacked != null) {
_unpacked.delete();
}
// clear out any .jarv file that Getdown might be maintaining so
// that we ensure that it is revalidated
File vfile = new File(FileUtil.resuffix(_source, ".jar", ".jarv"));
if (vfile.exists() && !vfile.delete()) {
log.warning("Failed to delete vfile", "file", vfile);
}
// close and delete our source jar file
if (deleteJar && _source != null) {
closeJar();
if (!_source.delete()) {
log.warning("Failed to delete source",
"source", _source, "exists", _source.exists());
}
}
}
|
class class_name[name] begin[{]
method[wipeBundle, return_type[void], modifier[public], parameter[deleteJar]] begin[{]
if[binary_operation[member[._cache], !=, literal[null]]] begin[{]
call[FileUtil.recursiveClean, parameter[member[._cache]]]
else begin[{]
None
end[}]
if[binary_operation[member[._unpacked], !=, literal[null]]] begin[{]
call[_unpacked.delete, parameter[]]
else begin[{]
None
end[}]
local_variable[type[File], vfile]
if[binary_operation[call[vfile.exists, parameter[]], &&, call[vfile.delete, parameter[]]]] begin[{]
call[log.warning, parameter[literal["Failed to delete vfile"], literal["file"], member[.vfile]]]
else begin[{]
None
end[}]
if[binary_operation[member[.deleteJar], &&, binary_operation[member[._source], !=, literal[null]]]] begin[{]
call[.closeJar, parameter[]]
if[call[_source.delete, parameter[]]] begin[{]
call[log.warning, parameter[literal["Failed to delete source"], literal["source"], member[._source], literal["exists"], call[_source.exists, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[wipeBundle] operator[SEP] Keyword[boolean] identifier[deleteJar] operator[SEP] {
Keyword[if] operator[SEP] identifier[_cache] operator[!=] Other[null] operator[SEP] {
identifier[FileUtil] operator[SEP] identifier[recursiveClean] operator[SEP] identifier[_cache] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[_unpacked] operator[!=] Other[null] operator[SEP] {
identifier[_unpacked] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP]
}
identifier[File] identifier[vfile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[FileUtil] operator[SEP] identifier[resuffix] operator[SEP] identifier[_source] , literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vfile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[vfile] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[warning] operator[SEP] literal[String] , literal[String] , identifier[vfile] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[deleteJar] operator[&&] identifier[_source] operator[!=] Other[null] operator[SEP] {
identifier[closeJar] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[_source] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[warning] operator[SEP] literal[String] , literal[String] , identifier[_source] , literal[String] , identifier[_source] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public void convertToMultipart() {
this.method = "POST";
String boundary = UUID.randomUUID().toString().replaceAll("-", "");
setHeader("Content-Type", "multipart/form-data; boundary=----" + boundary);
//add parameters, if available
StringBuilder bodyBuilder = new StringBuilder();
for (Parameter param : parameters) {
bodyBuilder.append("------").append(boundary).append(CRLF);
bodyBuilder.append("Content-Disposition: form-data; name=\"").append(param.getName()).append("\"");
if (param.getType() == IParameter.PARAM_MULTIPART_ATTR) {
bodyBuilder.append("; filename=\"").append(param.getFilename()).append("\"").append(CRLF);
bodyBuilder.append("Content-Type: ").append(param.getContentType());
}
bodyBuilder.append(CRLF).append(CRLF);
bodyBuilder.append(param.getValue());
bodyBuilder.append(CRLF);
}
bodyBuilder.append("------").append(boundary).append("--").append(CRLF);
this.body = bodyBuilder.toString();
this.parameters = new ArrayList<>();
this.sortedParams = null;
}
|
class class_name[name] begin[{]
method[convertToMultipart, return_type[void], modifier[public], parameter[]] begin[{]
assign[THIS[member[None.method]], literal["POST"]]
local_variable[type[String], boundary]
call[.setHeader, parameter[literal["Content-Type"], binary_operation[literal["multipart/form-data; boundary=----"], +, member[.boundary]]]]
local_variable[type[StringBuilder], bodyBuilder]
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=bodyBuilder, selectors=[MethodInvocation(arguments=[MemberReference(member=boundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=CRLF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content-Disposition: form-data; name=\"")], member=append, postfix_operators=[], prefix_operators=[], qualifier=bodyBuilder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], 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), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), operandr=MemberReference(member=PARAM_MULTIPART_ATTR, postfix_operators=[], prefix_operators=[], qualifier=IParameter, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="; filename=\"")], member=append, postfix_operators=[], prefix_operators=[], qualifier=bodyBuilder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFilename, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], 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), MethodInvocation(arguments=[MemberReference(member=CRLF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content-Type: ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=bodyBuilder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getContentType, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CRLF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=bodyBuilder, selectors=[MethodInvocation(arguments=[MemberReference(member=CRLF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, 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=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=bodyBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CRLF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=bodyBuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Parameter, sub_type=None))), label=None)
call[bodyBuilder.append, parameter[literal["------"]]]
assign[THIS[member[None.body]], call[bodyBuilder.toString, parameter[]]]
assign[THIS[member[None.parameters]], 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))]
assign[THIS[member[None.sortedParams]], literal[null]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[convertToMultipart] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[method] operator[=] literal[String] operator[SEP] identifier[String] identifier[boundary] operator[=] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[boundary] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[bodyBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Parameter] identifier[param] operator[:] identifier[parameters] operator[SEP] {
identifier[bodyBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[boundary] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CRLF] operator[SEP] operator[SEP] identifier[bodyBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[param] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[param] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[IParameter] operator[SEP] identifier[PARAM_MULTIPART_ATTR] operator[SEP] {
identifier[bodyBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[param] operator[SEP] identifier[getFilename] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CRLF] operator[SEP] operator[SEP] identifier[bodyBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[param] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[bodyBuilder] operator[SEP] identifier[append] operator[SEP] identifier[CRLF] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CRLF] operator[SEP] operator[SEP] identifier[bodyBuilder] operator[SEP] identifier[append] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bodyBuilder] operator[SEP] identifier[append] operator[SEP] identifier[CRLF] operator[SEP] operator[SEP]
}
identifier[bodyBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[boundary] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CRLF] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[body] operator[=] identifier[bodyBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parameters] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[sortedParams] operator[=] Other[null] operator[SEP]
}
|
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
if (m_isInitialized || tryToInitialize()) {
if (request instanceof HttpServletRequest) {
HttpServletRequest req = (HttpServletRequest)request;
String uri = req.getRequestURI();
if (!uri.matches(m_regex)) {
String adjustedUri = uri.replaceFirst(m_contextPath + "/", m_servletPath);
req.getRequestDispatcher(adjustedUri).forward(request, response);
return;
}
}
}
chain.doFilter(request, response);
}
|
class class_name[name] begin[{]
method[doFilter, return_type[void], modifier[public], parameter[request, response, chain]] begin[{]
if[binary_operation[member[.m_isInitialized], ||, call[.tryToInitialize, parameter[]]]] begin[{]
if[binary_operation[member[.request], instanceof, type[HttpServletRequest]]] begin[{]
local_variable[type[HttpServletRequest], req]
local_variable[type[String], uri]
if[call[uri.matches, parameter[member[.m_regex]]]] begin[{]
local_variable[type[String], adjustedUri]
call[req.getRequestDispatcher, parameter[member[.adjustedUri]]]
return[None]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[chain.doFilter, parameter[member[.request], member[.response]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[doFilter] operator[SEP] identifier[ServletRequest] identifier[request] , identifier[ServletResponse] identifier[response] , identifier[FilterChain] identifier[chain] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] {
Keyword[if] operator[SEP] identifier[m_isInitialized] operator[||] identifier[tryToInitialize] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[request] Keyword[instanceof] identifier[HttpServletRequest] operator[SEP] {
identifier[HttpServletRequest] identifier[req] operator[=] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[request] operator[SEP] identifier[String] identifier[uri] operator[=] identifier[req] operator[SEP] identifier[getRequestURI] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[uri] operator[SEP] identifier[matches] operator[SEP] identifier[m_regex] operator[SEP] operator[SEP] {
identifier[String] identifier[adjustedUri] operator[=] identifier[uri] operator[SEP] identifier[replaceFirst] operator[SEP] identifier[m_contextPath] operator[+] literal[String] , identifier[m_servletPath] operator[SEP] operator[SEP] identifier[req] operator[SEP] identifier[getRequestDispatcher] operator[SEP] identifier[adjustedUri] operator[SEP] operator[SEP] identifier[forward] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
}
identifier[chain] operator[SEP] identifier[doFilter] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP]
}
|
public <U extends T, A, B, C> InitialMatching3<T, U, A, B, C> when(
DecomposableMatchBuilder3<U, A, B, C> decomposableMatchBuilder) {
return new InitialMatching3<>(decomposableMatchBuilder.build(), value);
}
|
class class_name[name] begin[{]
method[when, return_type[type[InitialMatching3]], modifier[public], parameter[decomposableMatchBuilder]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=decomposableMatchBuilder, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=InitialMatching3, sub_type=None))]
end[}]
END[}]
|
Keyword[public] operator[<] identifier[U] Keyword[extends] identifier[T] , identifier[A] , identifier[B] , identifier[C] operator[>] identifier[InitialMatching3] operator[<] identifier[T] , identifier[U] , identifier[A] , identifier[B] , identifier[C] operator[>] identifier[when] operator[SEP] identifier[DecomposableMatchBuilder3] operator[<] identifier[U] , identifier[A] , identifier[B] , identifier[C] operator[>] identifier[decomposableMatchBuilder] operator[SEP] {
Keyword[return] Keyword[new] identifier[InitialMatching3] operator[<] operator[>] operator[SEP] identifier[decomposableMatchBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
|
public void setTimecodeBase(int timecodeBase)
{
if (timecodeBase < 0) {
timecodeBase = 0;
}
if (this.timecodeBase > 0 && timecodeBase != this.timecodeBase) {
this.frames = (int) Math.round((double) this.frames * timecodeBase / this.timecodeBase);
}
this.timecodeBase = timecodeBase;
innerSetDropFrame(this.dropFrame);
}
|
class class_name[name] begin[{]
method[setTimecodeBase, return_type[void], modifier[public], parameter[timecodeBase]] begin[{]
if[binary_operation[member[.timecodeBase], <, literal[0]]] begin[{]
assign[member[.timecodeBase], literal[0]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[THIS[member[None.timecodeBase]], >, literal[0]], &&, binary_operation[member[.timecodeBase], !=, THIS[member[None.timecodeBase]]]]] begin[{]
assign[THIS[member[None.frames]], Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=frames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type=BasicType(dimensions=[], name=double)), operandr=MemberReference(member=timecodeBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=timecodeBase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=/)], member=round, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]
else begin[{]
None
end[}]
assign[THIS[member[None.timecodeBase]], member[.timecodeBase]]
call[.innerSetDropFrame, parameter[THIS[member[None.dropFrame]]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setTimecodeBase] operator[SEP] Keyword[int] identifier[timecodeBase] operator[SEP] {
Keyword[if] operator[SEP] identifier[timecodeBase] operator[<] Other[0] operator[SEP] {
identifier[timecodeBase] operator[=] Other[0] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[timecodeBase] operator[>] Other[0] operator[&&] identifier[timecodeBase] operator[!=] Keyword[this] operator[SEP] identifier[timecodeBase] operator[SEP] {
Keyword[this] operator[SEP] identifier[frames] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[round] operator[SEP] operator[SEP] Keyword[double] operator[SEP] Keyword[this] operator[SEP] identifier[frames] operator[*] identifier[timecodeBase] operator[/] Keyword[this] operator[SEP] identifier[timecodeBase] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[timecodeBase] operator[=] identifier[timecodeBase] operator[SEP] identifier[innerSetDropFrame] operator[SEP] Keyword[this] operator[SEP] identifier[dropFrame] operator[SEP] operator[SEP]
}
|
public void removeWebSocketScope(WebSocketScope webSocketScope) {
log.info("removeWebSocketScope: {}", webSocketScope);
WebSocketScope wsScope = scopes.remove(webSocketScope.getPath());
if (wsScope != null) {
notifyListeners(WebSocketEvent.SCOPE_REMOVED, wsScope);
}
}
|
class class_name[name] begin[{]
method[removeWebSocketScope, return_type[void], modifier[public], parameter[webSocketScope]] begin[{]
call[log.info, parameter[literal["removeWebSocketScope: {}"], member[.webSocketScope]]]
local_variable[type[WebSocketScope], wsScope]
if[binary_operation[member[.wsScope], !=, literal[null]]] begin[{]
call[.notifyListeners, parameter[member[WebSocketEvent.SCOPE_REMOVED], member[.wsScope]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[removeWebSocketScope] operator[SEP] identifier[WebSocketScope] identifier[webSocketScope] operator[SEP] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[webSocketScope] operator[SEP] operator[SEP] identifier[WebSocketScope] identifier[wsScope] operator[=] identifier[scopes] operator[SEP] identifier[remove] operator[SEP] identifier[webSocketScope] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wsScope] operator[!=] Other[null] operator[SEP] {
identifier[notifyListeners] operator[SEP] identifier[WebSocketEvent] operator[SEP] identifier[SCOPE_REMOVED] , identifier[wsScope] operator[SEP] operator[SEP]
}
}
|
public static void waitUntilElementIsInvisible(final String elementLocator) {
logger.entering(elementLocator);
By by = HtmlElementUtils.resolveByType(elementLocator);
ExpectedCondition<Boolean> condition = ExpectedConditions.invisibilityOfElementLocated(by);
waitForCondition(condition);
logger.exiting();
}
|
class class_name[name] begin[{]
method[waitUntilElementIsInvisible, return_type[void], modifier[public static], parameter[elementLocator]] begin[{]
call[logger.entering, parameter[member[.elementLocator]]]
local_variable[type[By], by]
local_variable[type[ExpectedCondition], condition]
call[.waitForCondition, parameter[member[.condition]]]
call[logger.exiting, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[waitUntilElementIsInvisible] operator[SEP] Keyword[final] identifier[String] identifier[elementLocator] operator[SEP] {
identifier[logger] operator[SEP] identifier[entering] operator[SEP] identifier[elementLocator] operator[SEP] operator[SEP] identifier[By] identifier[by] operator[=] identifier[HtmlElementUtils] operator[SEP] identifier[resolveByType] operator[SEP] identifier[elementLocator] operator[SEP] operator[SEP] identifier[ExpectedCondition] operator[<] identifier[Boolean] operator[>] identifier[condition] operator[=] identifier[ExpectedConditions] operator[SEP] identifier[invisibilityOfElementLocated] operator[SEP] identifier[by] operator[SEP] operator[SEP] identifier[waitForCondition] operator[SEP] identifier[condition] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[exiting] operator[SEP] operator[SEP] operator[SEP]
}
|
public String getSemtype() {
if (SurfaceForm_Type.featOkTst && ((SurfaceForm_Type)jcasType).casFeat_semtype == null)
jcasType.jcas.throwFeatMissing("semtype", "ch.epfl.bbp.uima.types.SurfaceForm");
return jcasType.ll_cas.ll_getStringValue(addr, ((SurfaceForm_Type)jcasType).casFeatCode_semtype);}
|
class class_name[name] begin[{]
method[getSemtype, return_type[type[String]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[SurfaceForm_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SurfaceForm_Type, sub_type=None)), ==, literal[null]]]] begin[{]
call[jcasType.jcas.throwFeatMissing, parameter[literal["semtype"], literal["ch.epfl.bbp.uima.types.SurfaceForm"]]]
else begin[{]
None
end[}]
return[call[jcasType.ll_cas.ll_getStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SurfaceForm_Type, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[getSemtype] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[SurfaceForm_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[SurfaceForm_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_semtype] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[SurfaceForm_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_semtype] operator[SEP] operator[SEP]
}
|
private static int[] determineSeparatorCounts(String from, int single_quote) {
int[] result = new int[separators.length];
byte[] bits = from.getBytes();
boolean in_quote = false;
for( int j=0; j< bits.length; j++ ) {
byte c = bits[j];
if( (c == single_quote) || (c == CHAR_DOUBLE_QUOTE) )
in_quote ^= true;
if( !in_quote || c == HIVE_SEP )
for( int i = 0; i < separators.length; ++i)
if (c == separators[i])
++result[i];
}
return result;
}
|
class class_name[name] begin[{]
method[determineSeparatorCounts, return_type[type[int]], modifier[private static], parameter[from, single_quote]] begin[{]
local_variable[type[int], result]
local_variable[type[byte], bits]
local_variable[type[boolean], in_quote]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=bits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=byte)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=single_quote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CHAR_DOUBLE_QUOTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=in_quote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=^=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=in_quote, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HIVE_SEP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=separators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MemberReference(member=result, 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=separators, 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))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bits, 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)
return[member[.result]]
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[determineSeparatorCounts] operator[SEP] identifier[String] identifier[from] , Keyword[int] identifier[single_quote] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[separators] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bits] operator[=] identifier[from] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[in_quote] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[bits] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[byte] identifier[c] operator[=] identifier[bits] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] identifier[single_quote] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] identifier[CHAR_DOUBLE_QUOTE] operator[SEP] operator[SEP] identifier[in_quote] operator[^=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[in_quote] operator[||] identifier[c] operator[==] identifier[HIVE_SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[separators] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[separators] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[++] identifier[result] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public Map<String, Collection<String>> queries() {
Map<String, Collection<String>> queryMap = new LinkedHashMap<>();
this.queries.forEach((key, queryTemplate) -> {
List<String> values = new ArrayList<>(queryTemplate.getValues());
/* add the expanded collection, but lock it */
queryMap.put(key, Collections.unmodifiableList(values));
});
return Collections.unmodifiableMap(queryMap);
}
|
class class_name[name] begin[{]
method[queries, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], queryMap]
THIS[member[None.queries]call[None.forEach, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getValues, postfix_operators=[], prefix_operators=[], qualifier=queryTemplate, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=values)], 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=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=queryMap, selectors=[], type_arguments=None), label=None)], parameters=[InferredFormalParameter(name=key), InferredFormalParameter(name=queryTemplate)])]]]
return[call[Collections.unmodifiableMap, parameter[member[.queryMap]]]]
end[}]
END[}]
|
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[String] operator[>] operator[>] identifier[queries] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[String] operator[>] operator[>] identifier[queryMap] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[queries] operator[SEP] identifier[forEach] operator[SEP] operator[SEP] identifier[key] , identifier[queryTemplate] operator[SEP] operator[->] {
identifier[List] operator[<] identifier[String] operator[>] identifier[values] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[queryTemplate] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[queryMap] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[queryMap] operator[SEP] operator[SEP]
}
|
public static void load(Class<?> restrictionClass) {
if(MASTER_CACHE == null) {
initialize();
}
if(MASTER_CACHE.isEmpty()) {
return;
}
Iterator<Class<?>> iter = MASTER_CACHE.iterator();
while(iter.hasNext()) {
Class<?> clazz = iter.next();
// Skip other classes.
if(!restrictionClass.isAssignableFrom(clazz)) {
continue;
}
// skip abstract / private classes.
if(Modifier.isInterface(clazz.getModifiers()) || Modifier.isAbstract(clazz.getModifiers()) || Modifier.isPrivate(clazz.getModifiers())) {
continue;
}
boolean instantiable = false;
try {
instantiable = clazz.getConstructor() != null;
}
catch(Exception | Error e) {
// ignore
}
try {
instantiable = instantiable || ClassGenericsUtil.getParameterizer(clazz) != null;
}
catch(Exception | Error e) {
// ignore
}
if(!instantiable) {
continue;
}
ELKIServiceRegistry.register(restrictionClass, clazz);
}
}
|
class class_name[name] begin[{]
method[load, return_type[void], modifier[public static], parameter[restrictionClass]] begin[{]
if[binary_operation[member[.MASTER_CACHE], ==, literal[null]]] begin[{]
call[.initialize, parameter[]]
else begin[{]
None
end[}]
if[call[MASTER_CACHE.isEmpty, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[Iterator], iter]
while[call[iter.hasNext, parameter[]]] begin[{]
local_variable[type[Class], clazz]
if[call[restrictionClass.isAssignableFrom, parameter[member[.clazz]]]] begin[{]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[Modifier.isInterface, parameter[call[clazz.getModifiers, parameter[]]]], ||, call[Modifier.isAbstract, parameter[call[clazz.getModifiers, parameter[]]]]], ||, call[Modifier.isPrivate, parameter[call[clazz.getModifiers, parameter[]]]]]] begin[{]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
local_variable[type[boolean], instantiable]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=instantiable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception', 'Error']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=instantiable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=instantiable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameterizer, postfix_operators=[], prefix_operators=[], qualifier=ClassGenericsUtil, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=||)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception', 'Error']))], finally_block=None, label=None, resources=None)
if[member[.instantiable]] begin[{]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
call[ELKIServiceRegistry.register, parameter[member[.restrictionClass], member[.clazz]]]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[load] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[restrictionClass] operator[SEP] {
Keyword[if] operator[SEP] identifier[MASTER_CACHE] operator[==] Other[null] operator[SEP] {
identifier[initialize] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[MASTER_CACHE] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[Iterator] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[iter] operator[=] identifier[MASTER_CACHE] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[restrictionClass] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isInterface] operator[SEP] identifier[clazz] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[clazz] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[Modifier] operator[SEP] identifier[isPrivate] operator[SEP] identifier[clazz] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[boolean] identifier[instantiable] operator[=] literal[boolean] operator[SEP] Keyword[try] {
identifier[instantiable] operator[=] identifier[clazz] operator[SEP] identifier[getConstructor] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] operator[|] identifier[Error] identifier[e] operator[SEP] {
}
Keyword[try] {
identifier[instantiable] operator[=] identifier[instantiable] operator[||] identifier[ClassGenericsUtil] operator[SEP] identifier[getParameterizer] operator[SEP] identifier[clazz] operator[SEP] operator[!=] Other[null] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] operator[|] identifier[Error] identifier[e] operator[SEP] {
}
Keyword[if] operator[SEP] operator[!] identifier[instantiable] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[ELKIServiceRegistry] operator[SEP] identifier[register] operator[SEP] identifier[restrictionClass] , identifier[clazz] operator[SEP] operator[SEP]
}
}
|
int readVarint32() {
byte b; // negative number implies MSB set
if ((b = readByte()) >= 0) {
return b;
}
int result = b & 0x7f;
if ((b = readByte()) >= 0) {
return result | b << 7;
}
result |= (b & 0x7f) << 7;
if ((b = readByte()) >= 0) {
return result | b << 14;
}
result |= (b & 0x7f) << 14;
if ((b = readByte()) >= 0) {
return result | b << 21;
}
result |= (b & 0x7f) << 21;
b = readByte();
if ((b & 0xf0) != 0) {
throw new IllegalArgumentException("Greater than 32-bit varint at position " + (pos() - 1));
}
return result | b << 28;
}
|
class class_name[name] begin[{]
method[readVarint32, return_type[type[int]], modifier[default], parameter[]] begin[{]
local_variable[type[byte], b]
if[binary_operation[assign[member[.b], call[.readByte, parameter[]]], >=, literal[0]]] begin[{]
return[member[.b]]
else begin[{]
None
end[}]
local_variable[type[int], result]
if[binary_operation[assign[member[.b], call[.readByte, parameter[]]], >=, literal[0]]] begin[{]
return[binary_operation[member[.result], |, binary_operation[member[.b], <<, literal[7]]]]
else begin[{]
None
end[}]
assign[member[.result], binary_operation[binary_operation[member[.b], &, literal[0x7f]], <<, literal[7]]]
if[binary_operation[assign[member[.b], call[.readByte, parameter[]]], >=, literal[0]]] begin[{]
return[binary_operation[member[.result], |, binary_operation[member[.b], <<, literal[14]]]]
else begin[{]
None
end[}]
assign[member[.result], binary_operation[binary_operation[member[.b], &, literal[0x7f]], <<, literal[14]]]
if[binary_operation[assign[member[.b], call[.readByte, parameter[]]], >=, literal[0]]] begin[{]
return[binary_operation[member[.result], |, binary_operation[member[.b], <<, literal[21]]]]
else begin[{]
None
end[}]
assign[member[.result], binary_operation[binary_operation[member[.b], &, literal[0x7f]], <<, literal[21]]]
assign[member[.b], call[.readByte, parameter[]]]
if[binary_operation[binary_operation[member[.b], &, literal[0xf0]], !=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Greater than 32-bit varint at position "), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[binary_operation[member[.result], |, binary_operation[member[.b], <<, literal[28]]]]
end[}]
END[}]
|
Keyword[int] identifier[readVarint32] operator[SEP] operator[SEP] {
Keyword[byte] identifier[b] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[b] operator[SEP]
}
Keyword[int] identifier[result] operator[=] identifier[b] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[result] operator[|] identifier[b] operator[<<] Other[7] operator[SEP]
}
identifier[result] operator[|=] operator[SEP] identifier[b] operator[&] literal[Integer] operator[SEP] operator[<<] Other[7] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[result] operator[|] identifier[b] operator[<<] Other[14] operator[SEP]
}
identifier[result] operator[|=] operator[SEP] identifier[b] operator[&] literal[Integer] operator[SEP] operator[<<] Other[14] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[result] operator[|] identifier[b] operator[<<] Other[21] operator[SEP]
}
identifier[result] operator[|=] operator[SEP] identifier[b] operator[&] literal[Integer] operator[SEP] operator[<<] Other[21] operator[SEP] identifier[b] operator[=] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[b] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[pos] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[|] identifier[b] operator[<<] Other[28] operator[SEP]
}
|
public boolean addLogger(Logger logger) {
final String name = logger.getName();
if (name == null) {
throw new NullPointerException();
}
drainLoggerRefQueueBounded();
LoggerContext cx = getUserContext();
if (cx.addLocalLogger(logger, this)) {
// Do we have a per logger handler too?
// Note: this will add a 200ms penalty
loadLoggerHandlers(logger, name, name + ".handlers");
return true;
} else {
return false;
}
}
|
class class_name[name] begin[{]
method[addLogger, return_type[type[boolean]], modifier[public], parameter[logger]] begin[{]
local_variable[type[String], name]
if[binary_operation[member[.name], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.drainLoggerRefQueueBounded, parameter[]]
local_variable[type[LoggerContext], cx]
if[call[cx.addLocalLogger, parameter[member[.logger], THIS[]]]] begin[{]
call[.loadLoggerHandlers, parameter[member[.logger], member[.name], binary_operation[member[.name], +, literal[".handlers"]]]]
return[literal[true]]
else begin[{]
return[literal[false]]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[addLogger] operator[SEP] identifier[Logger] identifier[logger] operator[SEP] {
Keyword[final] identifier[String] identifier[name] operator[=] identifier[logger] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP]
}
identifier[drainLoggerRefQueueBounded] operator[SEP] operator[SEP] operator[SEP] identifier[LoggerContext] identifier[cx] operator[=] identifier[getUserContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cx] operator[SEP] identifier[addLocalLogger] operator[SEP] identifier[logger] , Keyword[this] operator[SEP] operator[SEP] {
identifier[loadLoggerHandlers] operator[SEP] identifier[logger] , identifier[name] , identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[boolean] operator[SEP]
}
}
|
public void setText(final String text, final Serializable... args) {
WComponent body = getBody();
if (body instanceof WText) {
((WText) body).setText(text, args);
} else if (body instanceof WLabel) {
((WLabel) body).setText(text, args);
} else if (body instanceof WButton) {
((WButton) body).setText(text, args);
} else if (body instanceof WLink) {
((WLink) body).setText(text, args);
} else if (body == null) {
setBody(new WText(text, args));
}
}
|
class class_name[name] begin[{]
method[setText, return_type[void], modifier[public], parameter[text, args]] begin[{]
local_variable[type[WComponent], body]
if[binary_operation[member[.body], instanceof, type[WText]]] begin[{]
Cast(expression=MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WText, sub_type=None))
else begin[{]
if[binary_operation[member[.body], instanceof, type[WLabel]]] begin[{]
Cast(expression=MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WLabel, sub_type=None))
else begin[{]
if[binary_operation[member[.body], instanceof, type[WButton]]] begin[{]
Cast(expression=MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WButton, sub_type=None))
else begin[{]
if[binary_operation[member[.body], instanceof, type[WLink]]] begin[{]
Cast(expression=MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WLink, sub_type=None))
else begin[{]
if[binary_operation[member[.body], ==, literal[null]]] begin[{]
call[.setBody, parameter[ClassCreator(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, 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=WText, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setText] operator[SEP] Keyword[final] identifier[String] identifier[text] , Keyword[final] identifier[Serializable] operator[...] identifier[args] operator[SEP] {
identifier[WComponent] identifier[body] operator[=] identifier[getBody] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[body] Keyword[instanceof] identifier[WText] operator[SEP] {
operator[SEP] operator[SEP] identifier[WText] operator[SEP] identifier[body] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[text] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[body] Keyword[instanceof] identifier[WLabel] operator[SEP] {
operator[SEP] operator[SEP] identifier[WLabel] operator[SEP] identifier[body] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[text] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[body] Keyword[instanceof] identifier[WButton] operator[SEP] {
operator[SEP] operator[SEP] identifier[WButton] operator[SEP] identifier[body] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[text] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[body] Keyword[instanceof] identifier[WLink] operator[SEP] {
operator[SEP] operator[SEP] identifier[WLink] operator[SEP] identifier[body] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[text] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[body] operator[==] Other[null] operator[SEP] {
identifier[setBody] operator[SEP] Keyword[new] identifier[WText] operator[SEP] identifier[text] , identifier[args] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private KeyScope resolveIntermediate(final KeyScope scope) {
final Map<String, KeyDef> keys = new HashMap<>(scope.keyDefinition);
for (final Map.Entry<String, KeyDef> e: scope.keyDefinition.entrySet()) {
final KeyDef res = resolveIntermediate(scope, e.getValue(), Collections.singletonList(e.getValue()));
keys.put(e.getKey(), res);
}
final List<KeyScope> children = new ArrayList<>();
for (final KeyScope child: scope.childScopes) {
final KeyScope resolvedChild = resolveIntermediate(child);
children.add(resolvedChild);
}
return new KeyScope(scope.id, scope.name, keys, children);
}
|
class class_name[name] begin[{]
method[resolveIntermediate, return_type[type[KeyScope]], modifier[private], parameter[scope]] begin[{]
local_variable[type[Map], keys]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=singletonList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=resolveIntermediate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=res)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=KeyDef, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=scope.keyDefinition, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=KeyDef, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
local_variable[type[List], children]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveIntermediate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=resolvedChild)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=KeyScope, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resolvedChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=childScopes, postfix_operators=[], prefix_operators=[], qualifier=scope, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=KeyScope, sub_type=None))), label=None)
return[ClassCreator(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=scope, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=scope, selectors=[]), MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=children, 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=KeyScope, sub_type=None))]
end[}]
END[}]
|
Keyword[private] identifier[KeyScope] identifier[resolveIntermediate] operator[SEP] Keyword[final] identifier[KeyScope] identifier[scope] operator[SEP] {
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[KeyDef] operator[>] identifier[keys] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[scope] operator[SEP] identifier[keyDefinition] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[KeyDef] operator[>] identifier[e] operator[:] identifier[scope] operator[SEP] identifier[keyDefinition] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[KeyDef] identifier[res] operator[=] identifier[resolveIntermediate] operator[SEP] identifier[scope] , identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[keys] operator[SEP] identifier[put] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[res] operator[SEP] operator[SEP]
}
Keyword[final] identifier[List] operator[<] identifier[KeyScope] operator[>] identifier[children] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[KeyScope] identifier[child] operator[:] identifier[scope] operator[SEP] identifier[childScopes] operator[SEP] {
Keyword[final] identifier[KeyScope] identifier[resolvedChild] operator[=] identifier[resolveIntermediate] operator[SEP] identifier[child] operator[SEP] operator[SEP] identifier[children] operator[SEP] identifier[add] operator[SEP] identifier[resolvedChild] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[KeyScope] operator[SEP] identifier[scope] operator[SEP] identifier[id] , identifier[scope] operator[SEP] identifier[name] , identifier[keys] , identifier[children] operator[SEP] operator[SEP]
}
|
public Graph build(){
boolean isStartNode = true;
for( Tree<Row> current = root.findPreOrderNext(); current != null; current = current.findPreOrderNext() ){
Node node = nodeBuilder.createNode( current );
if( node == null ){
// The current element does not produce a node. E.g. START, END, ELSE_IF, ELSE, BRANCH
continue;
}
current.getContent().setNode( node );
if( isStartNode ){
graph.setStartNode( node );
isStartNode = false;
}
else{
graph.addNode( node );
}
}
for( Tree<Row> current = root.findPreOrderNext(); current != null; current = current.findPreOrderNext() ){
transitionBuilder.createTransitions( graph, current );
}
return graph;
}
|
class class_name[name] begin[{]
method[build, return_type[type[Graph]], modifier[public], parameter[]] begin[{]
local_variable[type[boolean], isStartNode]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createNode, postfix_operators=[], prefix_operators=[], qualifier=nodeBuilder, selectors=[], type_arguments=None), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getContent, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=isStartNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addNode, postfix_operators=[], prefix_operators=[], qualifier=graph, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStartNode, postfix_operators=[], prefix_operators=[], qualifier=graph, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isStartNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=current, 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=findPreOrderNext, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), name=current)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None))], dimensions=[], name=Tree, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=findPreOrderNext, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None))]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=graph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTransitions, postfix_operators=[], prefix_operators=[], qualifier=transitionBuilder, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=current, 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=findPreOrderNext, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), name=current)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None))], dimensions=[], name=Tree, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=findPreOrderNext, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None))]), label=None)
return[member[.graph]]
end[}]
END[}]
|
Keyword[public] identifier[Graph] identifier[build] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[isStartNode] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Tree] operator[<] identifier[Row] operator[>] identifier[current] operator[=] identifier[root] operator[SEP] identifier[findPreOrderNext] operator[SEP] operator[SEP] operator[SEP] identifier[current] operator[!=] Other[null] operator[SEP] identifier[current] operator[=] identifier[current] operator[SEP] identifier[findPreOrderNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Node] identifier[node] operator[=] identifier[nodeBuilder] operator[SEP] identifier[createNode] operator[SEP] identifier[current] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[==] Other[null] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[current] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] identifier[setNode] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isStartNode] operator[SEP] {
identifier[graph] operator[SEP] identifier[setStartNode] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[isStartNode] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[graph] operator[SEP] identifier[addNode] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[Tree] operator[<] identifier[Row] operator[>] identifier[current] operator[=] identifier[root] operator[SEP] identifier[findPreOrderNext] operator[SEP] operator[SEP] operator[SEP] identifier[current] operator[!=] Other[null] operator[SEP] identifier[current] operator[=] identifier[current] operator[SEP] identifier[findPreOrderNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[transitionBuilder] operator[SEP] identifier[createTransitions] operator[SEP] identifier[graph] , identifier[current] operator[SEP] operator[SEP]
}
Keyword[return] identifier[graph] operator[SEP]
}
|
public boolean containsSymbol(String symbol) {
// search for identical symbol
int bucket = hash(symbol) % fTableSize;
int length = symbol.length();
OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
if (length == entry.characters.length) {
for (int i = 0; i < length; i++) {
if (symbol.charAt(i) != entry.characters[i]) {
continue OUTER;
}
}
return true;
}
}
return false;
}
|
class class_name[name] begin[{]
method[containsSymbol, return_type[type[boolean]], modifier[public], parameter[symbol]] begin[{]
local_variable[type[int], bucket]
local_variable[type[int], length]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=entry.characters, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=symbol, selectors=[], type_arguments=None), operandr=MemberReference(member=characters, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=OUTER, 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=, 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), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=entry, 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=MemberReference(member=fBuckets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[]))]), label=OUTER)
return[literal[false]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[containsSymbol] operator[SEP] identifier[String] identifier[symbol] operator[SEP] {
Keyword[int] identifier[bucket] operator[=] identifier[hash] operator[SEP] identifier[symbol] operator[SEP] operator[%] identifier[fTableSize] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[symbol] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[OUTER] operator[:] Keyword[for] operator[SEP] identifier[Entry] identifier[entry] operator[=] identifier[fBuckets] operator[SEP] identifier[bucket] operator[SEP] operator[SEP] identifier[entry] operator[!=] Other[null] operator[SEP] identifier[entry] operator[=] identifier[entry] operator[SEP] identifier[next] operator[SEP] {
Keyword[if] operator[SEP] identifier[length] operator[==] identifier[entry] operator[SEP] identifier[characters] operator[SEP] identifier[length] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[!=] identifier[entry] operator[SEP] identifier[characters] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
Keyword[continue] identifier[OUTER] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public java.util.List<com.liferay.commerce.product.model.CPDisplayLayout> getCPDisplayLayoutsByUuidAndCompanyId(
String uuid, long companyId) {
return _cpDisplayLayoutLocalService.getCPDisplayLayoutsByUuidAndCompanyId(uuid,
companyId);
}
|
class class_name[name] begin[{]
method[getCPDisplayLayoutsByUuidAndCompanyId, return_type[type[java]], modifier[public], parameter[uuid, companyId]] begin[{]
return[call[_cpDisplayLayoutLocalService.getCPDisplayLayoutsByUuidAndCompanyId, parameter[member[.uuid], member[.companyId]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[product] operator[SEP] identifier[model] operator[SEP] identifier[CPDisplayLayout] operator[>] identifier[getCPDisplayLayoutsByUuidAndCompanyId] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] operator[SEP] {
Keyword[return] identifier[_cpDisplayLayoutLocalService] operator[SEP] identifier[getCPDisplayLayoutsByUuidAndCompanyId] operator[SEP] identifier[uuid] , identifier[companyId] operator[SEP] operator[SEP]
}
|
public static String stripSpaces(String s)
{
StringBuffer buff = new StringBuffer();
for(int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if(c != ' ')
buff.append(c);
}
return buff.toString();
}
|
class class_name[name] begin[{]
method[stripSpaces, return_type[type[String]], modifier[public static], parameter[s]] begin[{]
local_variable[type[StringBuffer], buff]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buff, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[buff.toString, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[stripSpaces] operator[SEP] identifier[String] identifier[s] operator[SEP] {
identifier[StringBuffer] identifier[buff] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] literal[String] operator[SEP] identifier[buff] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
Keyword[return] identifier[buff] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public IfcControllerTypeEnum createIfcControllerTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcControllerTypeEnum result = IfcControllerTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
|
class class_name[name] begin[{]
method[createIfcControllerTypeEnumFromString, return_type[type[IfcControllerTypeEnum]], modifier[public], parameter[eDataType, initialValue]] begin[{]
local_variable[type[IfcControllerTypeEnum], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, 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[}]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] identifier[IfcControllerTypeEnum] identifier[createIfcControllerTypeEnumFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] {
identifier[IfcControllerTypeEnum] identifier[result] operator[=] identifier[IfcControllerTypeEnum] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public ElementRef getElementRef() throws IllegalStateException {
Page p = page;
if(p == null) throw new IllegalStateException("page not set");
PageRef pageRef = p.getPageRef();
String i = getId();
if(i == null) throw new IllegalStateException("page not set so no id generated");
ElementRef er = elementRef;
if(
er == null
// Make sure object still valid
|| !er.getPageRef().equals(pageRef)
|| !er.getId().equals(i)
) {
er = new ElementRef(pageRef, i);
elementRef = er;
}
return er;
}
|
class class_name[name] begin[{]
method[getElementRef, return_type[type[ElementRef]], modifier[public], parameter[]] begin[{]
local_variable[type[Page], p]
if[binary_operation[member[.p], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="page not set")], 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[}]
local_variable[type[PageRef], pageRef]
local_variable[type[String], i]
if[binary_operation[member[.i], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="page not set so no id generated")], 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[}]
local_variable[type[ElementRef], er]
if[binary_operation[binary_operation[binary_operation[member[.er], ==, literal[null]], ||, call[er.getPageRef, parameter[]]], ||, call[er.getId, parameter[]]]] begin[{]
assign[member[.er], ClassCreator(arguments=[MemberReference(member=pageRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, 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=ElementRef, sub_type=None))]
assign[member[.elementRef], member[.er]]
else begin[{]
None
end[}]
return[member[.er]]
end[}]
END[}]
|
Keyword[public] identifier[ElementRef] identifier[getElementRef] operator[SEP] operator[SEP] Keyword[throws] identifier[IllegalStateException] {
identifier[Page] identifier[p] operator[=] identifier[page] operator[SEP] Keyword[if] operator[SEP] identifier[p] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PageRef] identifier[pageRef] operator[=] identifier[p] operator[SEP] identifier[getPageRef] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[i] operator[=] identifier[getId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ElementRef] identifier[er] operator[=] identifier[elementRef] operator[SEP] Keyword[if] operator[SEP] identifier[er] operator[==] Other[null] operator[||] operator[!] identifier[er] operator[SEP] identifier[getPageRef] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[pageRef] operator[SEP] operator[||] operator[!] identifier[er] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[er] operator[=] Keyword[new] identifier[ElementRef] operator[SEP] identifier[pageRef] , identifier[i] operator[SEP] operator[SEP] identifier[elementRef] operator[=] identifier[er] operator[SEP]
}
Keyword[return] identifier[er] operator[SEP]
}
|
private static void addNamedOutput(JobConf conf, String namedOutput,
boolean multi,
Class<? extends OutputFormat> outputFormatClass,
Class<?> keyClass, Class<?> valueClass) {
checkNamedOutputName(namedOutput);
checkNamedOutput(conf, namedOutput, true);
conf.set(NAMED_OUTPUTS, conf.get(NAMED_OUTPUTS, "") + " " + namedOutput);
conf.setClass(MO_PREFIX + namedOutput + FORMAT, outputFormatClass,
OutputFormat.class);
conf.setClass(MO_PREFIX + namedOutput + KEY, keyClass, Object.class);
conf.setClass(MO_PREFIX + namedOutput + VALUE, valueClass, Object.class);
conf.setBoolean(MO_PREFIX + namedOutput + MULTI, multi);
}
|
class class_name[name] begin[{]
method[addNamedOutput, return_type[void], modifier[private static], parameter[conf, namedOutput, multi, outputFormatClass, keyClass, valueClass]] begin[{]
call[.checkNamedOutputName, parameter[member[.namedOutput]]]
call[.checkNamedOutput, parameter[member[.conf], member[.namedOutput], literal[true]]]
call[conf.set, parameter[member[.NAMED_OUTPUTS], binary_operation[binary_operation[call[conf.get, parameter[member[.NAMED_OUTPUTS], literal[""]]], +, literal[" "]], +, member[.namedOutput]]]]
call[conf.setClass, parameter[binary_operation[binary_operation[member[.MO_PREFIX], +, member[.namedOutput]], +, member[.FORMAT]], member[.outputFormatClass], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OutputFormat, sub_type=None))]]
call[conf.setClass, parameter[binary_operation[binary_operation[member[.MO_PREFIX], +, member[.namedOutput]], +, member[.KEY]], member[.keyClass], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
call[conf.setClass, parameter[binary_operation[binary_operation[member[.MO_PREFIX], +, member[.namedOutput]], +, member[.VALUE]], member[.valueClass], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
call[conf.setBoolean, parameter[binary_operation[binary_operation[member[.MO_PREFIX], +, member[.namedOutput]], +, member[.MULTI]], member[.multi]]]
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[void] identifier[addNamedOutput] operator[SEP] identifier[JobConf] identifier[conf] , identifier[String] identifier[namedOutput] , Keyword[boolean] identifier[multi] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[OutputFormat] operator[>] identifier[outputFormatClass] , identifier[Class] operator[<] operator[?] operator[>] identifier[keyClass] , identifier[Class] operator[<] operator[?] operator[>] identifier[valueClass] operator[SEP] {
identifier[checkNamedOutputName] operator[SEP] identifier[namedOutput] operator[SEP] operator[SEP] identifier[checkNamedOutput] operator[SEP] identifier[conf] , identifier[namedOutput] , literal[boolean] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[set] operator[SEP] identifier[NAMED_OUTPUTS] , identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[NAMED_OUTPUTS] , literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[namedOutput] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[setClass] operator[SEP] identifier[MO_PREFIX] operator[+] identifier[namedOutput] operator[+] identifier[FORMAT] , identifier[outputFormatClass] , identifier[OutputFormat] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[setClass] operator[SEP] identifier[MO_PREFIX] operator[+] identifier[namedOutput] operator[+] identifier[KEY] , identifier[keyClass] , identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[setClass] operator[SEP] identifier[MO_PREFIX] operator[+] identifier[namedOutput] operator[+] identifier[VALUE] , identifier[valueClass] , identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[setBoolean] operator[SEP] identifier[MO_PREFIX] operator[+] identifier[namedOutput] operator[+] identifier[MULTI] , identifier[multi] operator[SEP] operator[SEP]
}
|
public void showViewAndWait(Window window, Modality modality) {
if (isPrimaryStageView) {
showView(modality); // this modality will be ignored anyway
return;
}
if (stage == null || currentStageModality != modality || !Objects.equals(stage.getOwner(), window)) {
stage = createStage(modality);
stage.initOwner(window);
}
stage.showAndWait();
}
|
class class_name[name] begin[{]
method[showViewAndWait, return_type[void], modifier[public], parameter[window, modality]] begin[{]
if[member[.isPrimaryStageView]] begin[{]
call[.showView, parameter[member[.modality]]]
return[None]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[member[.stage], ==, literal[null]], ||, binary_operation[member[.currentStageModality], !=, member[.modality]]], ||, call[Objects.equals, parameter[call[stage.getOwner, parameter[]], member[.window]]]]] begin[{]
assign[member[.stage], call[.createStage, parameter[member[.modality]]]]
call[stage.initOwner, parameter[member[.window]]]
else begin[{]
None
end[}]
call[stage.showAndWait, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[showViewAndWait] operator[SEP] identifier[Window] identifier[window] , identifier[Modality] identifier[modality] operator[SEP] {
Keyword[if] operator[SEP] identifier[isPrimaryStageView] operator[SEP] {
identifier[showView] operator[SEP] identifier[modality] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[stage] operator[==] Other[null] operator[||] identifier[currentStageModality] operator[!=] identifier[modality] operator[||] operator[!] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[stage] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] , identifier[window] operator[SEP] operator[SEP] {
identifier[stage] operator[=] identifier[createStage] operator[SEP] identifier[modality] operator[SEP] operator[SEP] identifier[stage] operator[SEP] identifier[initOwner] operator[SEP] identifier[window] operator[SEP] operator[SEP]
}
identifier[stage] operator[SEP] identifier[showAndWait] operator[SEP] operator[SEP] operator[SEP]
}
|
private void validateRebalancePlanState(RebalancePlan rebalancePlan) {
logger.info("Validating rebalance plan state.");
Cluster currentCluster = rebalancePlan.getCurrentCluster();
List<StoreDefinition> currentStores = rebalancePlan.getCurrentStores();
Cluster finalCluster = rebalancePlan.getFinalCluster();
List<StoreDefinition> finalStores = rebalancePlan.getFinalStores();
RebalanceUtils.validateClusterStores(currentCluster, currentStores);
RebalanceUtils.validateClusterStores(finalCluster, finalStores);
RebalanceUtils.validateCurrentFinalCluster(currentCluster, finalCluster);
RebalanceUtils.validateRebalanceStore(currentStores);
RebalanceUtils.validateRebalanceStore(finalStores);
}
|
class class_name[name] begin[{]
method[validateRebalancePlanState, return_type[void], modifier[private], parameter[rebalancePlan]] begin[{]
call[logger.info, parameter[literal["Validating rebalance plan state."]]]
local_variable[type[Cluster], currentCluster]
local_variable[type[List], currentStores]
local_variable[type[Cluster], finalCluster]
local_variable[type[List], finalStores]
call[RebalanceUtils.validateClusterStores, parameter[member[.currentCluster], member[.currentStores]]]
call[RebalanceUtils.validateClusterStores, parameter[member[.finalCluster], member[.finalStores]]]
call[RebalanceUtils.validateCurrentFinalCluster, parameter[member[.currentCluster], member[.finalCluster]]]
call[RebalanceUtils.validateRebalanceStore, parameter[member[.currentStores]]]
call[RebalanceUtils.validateRebalanceStore, parameter[member[.finalStores]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[validateRebalancePlanState] operator[SEP] identifier[RebalancePlan] identifier[rebalancePlan] operator[SEP] {
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Cluster] identifier[currentCluster] operator[=] identifier[rebalancePlan] operator[SEP] identifier[getCurrentCluster] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[StoreDefinition] operator[>] identifier[currentStores] operator[=] identifier[rebalancePlan] operator[SEP] identifier[getCurrentStores] operator[SEP] operator[SEP] operator[SEP] identifier[Cluster] identifier[finalCluster] operator[=] identifier[rebalancePlan] operator[SEP] identifier[getFinalCluster] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[StoreDefinition] operator[>] identifier[finalStores] operator[=] identifier[rebalancePlan] operator[SEP] identifier[getFinalStores] operator[SEP] operator[SEP] operator[SEP] identifier[RebalanceUtils] operator[SEP] identifier[validateClusterStores] operator[SEP] identifier[currentCluster] , identifier[currentStores] operator[SEP] operator[SEP] identifier[RebalanceUtils] operator[SEP] identifier[validateClusterStores] operator[SEP] identifier[finalCluster] , identifier[finalStores] operator[SEP] operator[SEP] identifier[RebalanceUtils] operator[SEP] identifier[validateCurrentFinalCluster] operator[SEP] identifier[currentCluster] , identifier[finalCluster] operator[SEP] operator[SEP] identifier[RebalanceUtils] operator[SEP] identifier[validateRebalanceStore] operator[SEP] identifier[currentStores] operator[SEP] operator[SEP] identifier[RebalanceUtils] operator[SEP] identifier[validateRebalanceStore] operator[SEP] identifier[finalStores] operator[SEP] operator[SEP]
}
|
@UiThread
@Override
public void onBindChildViewHolder(@NonNull HorizontalChildViewHolder childViewHolder, int parentPosition,
int childPosition, @NonNull HorizontalChild horizontalChild) {
childViewHolder.bind(horizontalChild.getChildText());
}
|
class class_name[name] begin[{]
method[onBindChildViewHolder, return_type[void], modifier[public], parameter[childViewHolder, parentPosition, childPosition, horizontalChild]] begin[{]
call[childViewHolder.bind, parameter[call[horizontalChild.getChildText, parameter[]]]]
end[}]
END[}]
|
annotation[@] identifier[UiThread] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onBindChildViewHolder] operator[SEP] annotation[@] identifier[NonNull] identifier[HorizontalChildViewHolder] identifier[childViewHolder] , Keyword[int] identifier[parentPosition] , Keyword[int] identifier[childPosition] , annotation[@] identifier[NonNull] identifier[HorizontalChild] identifier[horizontalChild] operator[SEP] {
identifier[childViewHolder] operator[SEP] identifier[bind] operator[SEP] identifier[horizontalChild] operator[SEP] identifier[getChildText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Nullable
public static String setVariantForView(@NonNull View view, @Nullable String variant) {
String previousVariant = null;
String previousAttribute = null;
for (Map.Entry<String, HashMap<Integer, String>> entry : bindings.entrySet()) {
if (entry.getValue().containsKey(view.getId())) {
previousVariant = entry.getKey();
previousAttribute = entry.getValue().get(view.getId());
bindings.remove(previousVariant);
break;
}
}
mapAttribute(previousAttribute, view.getId(), variant, view.getClass().getSimpleName());
return previousVariant;
}
|
class class_name[name] begin[{]
method[setVariantForView, return_type[type[String]], modifier[public static], parameter[view, variant]] begin[{]
local_variable[type[String], previousVariant]
local_variable[type[String], previousAttribute]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=view, selectors=[], type_arguments=None)], member=containsKey, 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=Assignment(expressionl=MemberReference(member=previousVariant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=previousAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=view, selectors=[], type_arguments=None)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=previousVariant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=bindings, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=bindings, 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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=HashMap, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
call[.mapAttribute, parameter[member[.previousAttribute], call[view.getId, parameter[]], member[.variant], call[view.getClass, parameter[]]]]
return[member[.previousVariant]]
end[}]
END[}]
|
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[String] identifier[setVariantForView] operator[SEP] annotation[@] identifier[NonNull] identifier[View] identifier[view] , annotation[@] identifier[Nullable] identifier[String] identifier[variant] operator[SEP] {
identifier[String] identifier[previousVariant] operator[=] Other[null] operator[SEP] identifier[String] identifier[previousAttribute] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[HashMap] operator[<] identifier[Integer] , identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[bindings] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[view] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[previousVariant] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[previousAttribute] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[view] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bindings] operator[SEP] identifier[remove] operator[SEP] identifier[previousVariant] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
identifier[mapAttribute] operator[SEP] identifier[previousAttribute] , identifier[view] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[variant] , identifier[view] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[previousVariant] operator[SEP]
}
|
private void setLastApplied(long lastApplied) {
// lastApplied should be either equal to or one greater than this.lastApplied.
if (lastApplied > this.lastApplied) {
Assert.arg(lastApplied == this.lastApplied + 1, "lastApplied must be sequential");
this.lastApplied = lastApplied;
// Update the index for each session. This will be used to trigger queries that are awaiting the
// application of specific indexes to the state machine. Setting the session index may cause query
// callbacks to be called and queries to be evaluated.
for (ServerSessionContext session : executor.context().sessions().sessions.values()) {
session.setLastApplied(lastApplied);
}
// Take a state machine snapshot if necessary.
takeSnapshot();
// Install a state machine snapshot if necessary.
installSnapshot();
} else {
Assert.arg(lastApplied == this.lastApplied, "lastApplied cannot be decreased");
}
}
|
class class_name[name] begin[{]
method[setLastApplied, return_type[void], modifier[private], parameter[lastApplied]] begin[{]
if[binary_operation[member[.lastApplied], >, THIS[member[None.lastApplied]]]] begin[{]
call[Assert.arg, parameter[binary_operation[member[.lastApplied], ==, binary_operation[THIS[member[None.lastApplied]], +, literal[1]]], literal["lastApplied must be sequential"]]]
assign[THIS[member[None.lastApplied]], member[.lastApplied]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lastApplied, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLastApplied, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=context, postfix_operators=[], prefix_operators=[], qualifier=executor, selectors=[MethodInvocation(arguments=[], member=sessions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MemberReference(member=sessions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), 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=session)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServerSessionContext, sub_type=None))), label=None)
call[.takeSnapshot, parameter[]]
call[.installSnapshot, parameter[]]
else begin[{]
call[Assert.arg, parameter[binary_operation[member[.lastApplied], ==, THIS[member[None.lastApplied]]], literal["lastApplied cannot be decreased"]]]
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[setLastApplied] operator[SEP] Keyword[long] identifier[lastApplied] operator[SEP] {
Keyword[if] operator[SEP] identifier[lastApplied] operator[>] Keyword[this] operator[SEP] identifier[lastApplied] operator[SEP] {
identifier[Assert] operator[SEP] identifier[arg] operator[SEP] identifier[lastApplied] operator[==] Keyword[this] operator[SEP] identifier[lastApplied] operator[+] Other[1] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[lastApplied] operator[=] identifier[lastApplied] operator[SEP] Keyword[for] operator[SEP] identifier[ServerSessionContext] identifier[session] operator[:] identifier[executor] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] identifier[sessions] operator[SEP] operator[SEP] operator[SEP] identifier[sessions] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
identifier[session] operator[SEP] identifier[setLastApplied] operator[SEP] identifier[lastApplied] operator[SEP] operator[SEP]
}
identifier[takeSnapshot] operator[SEP] operator[SEP] operator[SEP] identifier[installSnapshot] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Assert] operator[SEP] identifier[arg] operator[SEP] identifier[lastApplied] operator[==] Keyword[this] operator[SEP] identifier[lastApplied] , literal[String] operator[SEP] operator[SEP]
}
}
|
public boolean contains(ReadableInterval interval) {
if (interval == null) {
return containsNow();
}
long otherStart = interval.getStartMillis();
long otherEnd = interval.getEndMillis();
long thisStart = getStartMillis();
long thisEnd = getEndMillis();
return (thisStart <= otherStart && otherStart < thisEnd && otherEnd <= thisEnd);
}
|
class class_name[name] begin[{]
method[contains, return_type[type[boolean]], modifier[public], parameter[interval]] begin[{]
if[binary_operation[member[.interval], ==, literal[null]]] begin[{]
return[call[.containsNow, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[long], otherStart]
local_variable[type[long], otherEnd]
local_variable[type[long], thisStart]
local_variable[type[long], thisEnd]
return[binary_operation[binary_operation[binary_operation[member[.thisStart], <=, member[.otherStart]], &&, binary_operation[member[.otherStart], <, member[.thisEnd]]], &&, binary_operation[member[.otherEnd], <=, member[.thisEnd]]]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[contains] operator[SEP] identifier[ReadableInterval] identifier[interval] operator[SEP] {
Keyword[if] operator[SEP] identifier[interval] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[containsNow] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[long] identifier[otherStart] operator[=] identifier[interval] operator[SEP] identifier[getStartMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[otherEnd] operator[=] identifier[interval] operator[SEP] identifier[getEndMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[thisStart] operator[=] identifier[getStartMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[thisEnd] operator[=] identifier[getEndMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[thisStart] operator[<=] identifier[otherStart] operator[&&] identifier[otherStart] operator[<] identifier[thisEnd] operator[&&] identifier[otherEnd] operator[<=] identifier[thisEnd] operator[SEP] operator[SEP]
}
|
public Observable<Void> beginStartAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) {
return beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
|
class class_name[name] begin[{]
method[beginStartAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, labAccountName, labName, environmentSettingName, environmentName]] begin[{]
return[call[.beginStartWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.labAccountName], member[.labName], member[.environmentSettingName], member[.environmentName]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[Void] operator[>] identifier[beginStartAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[labAccountName] , identifier[String] identifier[labName] , identifier[String] identifier[environmentSettingName] , identifier[String] identifier[environmentName] operator[SEP] {
Keyword[return] identifier[beginStartWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[labAccountName] , identifier[labName] , identifier[environmentSettingName] , identifier[environmentName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] , identifier[Void] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
protected void createGenericLoginSuccessEndState(final Flow flow) {
val state = createEndState(flow, CasWebflowConstants.STATE_ID_VIEW_GENERIC_LOGIN_SUCCESS, CasWebflowConstants.VIEW_ID_GENERIC_SUCCESS);
state.getEntryActionList().add(createEvaluateAction("genericSuccessViewAction"));
}
|
class class_name[name] begin[{]
method[createGenericLoginSuccessEndState, return_type[void], modifier[protected], parameter[flow]] begin[{]
local_variable[type[val], state]
call[state.getEntryActionList, parameter[]]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[createGenericLoginSuccessEndState] operator[SEP] Keyword[final] identifier[Flow] identifier[flow] operator[SEP] {
identifier[val] identifier[state] operator[=] identifier[createEndState] operator[SEP] identifier[flow] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_VIEW_GENERIC_LOGIN_SUCCESS] , identifier[CasWebflowConstants] operator[SEP] identifier[VIEW_ID_GENERIC_SUCCESS] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[getEntryActionList] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[createEvaluateAction] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void init(EntityManager entityManager, Object entity) {
// Initialisation des parametres
this.entityManager = entityManager;
this.entity = entity;
}
|
class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[entityManager, entity]] begin[{]
assign[THIS[member[None.entityManager]], member[.entityManager]]
assign[THIS[member[None.entity]], member[.entity]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[EntityManager] identifier[entityManager] , identifier[Object] identifier[entity] operator[SEP] {
Keyword[this] operator[SEP] identifier[entityManager] operator[=] identifier[entityManager] operator[SEP] Keyword[this] operator[SEP] identifier[entity] operator[=] identifier[entity] operator[SEP]
}
|
public void init()
throws IOException
{
long now = CurrentTime.getExactTime();
// server/0263
// _nextRolloverCheckTime = now + _rolloverCheckPeriod;
Path path = getPath();
if (path != null) {
Files.createDirectories(path.getParent());
_rolloverPrefix = path.getName(path.getNameCount() - 1).toString();
long lastModified = Files.getLastModifiedTime(path).toMillis();
if (lastModified <= 0 || now < lastModified) {
lastModified = now;
}
// _calendar.setGMTTime(lastModified);
_nextPeriodEnd = nextRolloverTime(lastModified);
}
else {
_nextPeriodEnd = nextRolloverTime(now);
}
if (_archiveFormat != null || getRolloverPeriod() <= 0) {
}
else if (_rolloverCron != null)
_archiveFormat = _rolloverPrefix + ".%Y%m%d.%H";
else if (getRolloverPeriod() % DAY == 0)
_archiveFormat = _rolloverPrefix + ".%Y%m%d";
else if (getRolloverPeriod() % HOUR == 0)
_archiveFormat = _rolloverPrefix + ".%Y%m%d.%H";
else
_archiveFormat = _rolloverPrefix + ".%Y%m%d.%H%M";
_isInit = true;
_rolloverListener.requeue(_rolloverAlarm);
rollover();
}
|
class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[long], now]
local_variable[type[Path], path]
if[binary_operation[member[.path], !=, literal[null]]] begin[{]
call[Files.createDirectories, parameter[call[path.getParent, parameter[]]]]
assign[member[._rolloverPrefix], call[path.getName, parameter[binary_operation[call[path.getNameCount, parameter[]], -, literal[1]]]]]
local_variable[type[long], lastModified]
if[binary_operation[binary_operation[member[.lastModified], <=, literal[0]], ||, binary_operation[member[.now], <, member[.lastModified]]]] begin[{]
assign[member[.lastModified], member[.now]]
else begin[{]
None
end[}]
assign[member[._nextPeriodEnd], call[.nextRolloverTime, parameter[member[.lastModified]]]]
else begin[{]
assign[member[._nextPeriodEnd], call[.nextRolloverTime, parameter[member[.now]]]]
end[}]
if[binary_operation[binary_operation[member[._archiveFormat], !=, literal[null]], ||, binary_operation[call[.getRolloverPeriod, parameter[]], <=, literal[0]]]] begin[{]
else begin[{]
if[binary_operation[member[._rolloverCron], !=, literal[null]]] begin[{]
assign[member[._archiveFormat], binary_operation[member[._rolloverPrefix], +, literal[".%Y%m%d.%H"]]]
else begin[{]
if[binary_operation[binary_operation[call[.getRolloverPeriod, parameter[]], %, member[.DAY]], ==, literal[0]]] begin[{]
assign[member[._archiveFormat], binary_operation[member[._rolloverPrefix], +, literal[".%Y%m%d"]]]
else begin[{]
if[binary_operation[binary_operation[call[.getRolloverPeriod, parameter[]], %, member[.HOUR]], ==, literal[0]]] begin[{]
assign[member[._archiveFormat], binary_operation[member[._rolloverPrefix], +, literal[".%Y%m%d.%H"]]]
else begin[{]
assign[member[._archiveFormat], binary_operation[member[._rolloverPrefix], +, literal[".%Y%m%d.%H%M"]]]
end[}]
end[}]
end[}]
end[}]
assign[member[._isInit], literal[true]]
call[_rolloverListener.requeue, parameter[member[._rolloverAlarm]]]
call[.rollover, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[init] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[long] identifier[now] operator[=] identifier[CurrentTime] operator[SEP] identifier[getExactTime] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[path] operator[=] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] {
identifier[Files] operator[SEP] identifier[createDirectories] operator[SEP] identifier[path] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[_rolloverPrefix] operator[=] identifier[path] operator[SEP] identifier[getName] operator[SEP] identifier[path] operator[SEP] identifier[getNameCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[lastModified] operator[=] identifier[Files] operator[SEP] identifier[getLastModifiedTime] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[toMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastModified] operator[<=] Other[0] operator[||] identifier[now] operator[<] identifier[lastModified] operator[SEP] {
identifier[lastModified] operator[=] identifier[now] operator[SEP]
}
identifier[_nextPeriodEnd] operator[=] identifier[nextRolloverTime] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[_nextPeriodEnd] operator[=] identifier[nextRolloverTime] operator[SEP] identifier[now] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[_archiveFormat] operator[!=] Other[null] operator[||] identifier[getRolloverPeriod] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] {
}
Keyword[else] Keyword[if] operator[SEP] identifier[_rolloverCron] operator[!=] Other[null] operator[SEP] identifier[_archiveFormat] operator[=] identifier[_rolloverPrefix] operator[+] literal[String] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[getRolloverPeriod] operator[SEP] operator[SEP] operator[%] identifier[DAY] operator[==] Other[0] operator[SEP] identifier[_archiveFormat] operator[=] identifier[_rolloverPrefix] operator[+] literal[String] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[getRolloverPeriod] operator[SEP] operator[SEP] operator[%] identifier[HOUR] operator[==] Other[0] operator[SEP] identifier[_archiveFormat] operator[=] identifier[_rolloverPrefix] operator[+] literal[String] operator[SEP] Keyword[else] identifier[_archiveFormat] operator[=] identifier[_rolloverPrefix] operator[+] literal[String] operator[SEP] identifier[_isInit] operator[=] literal[boolean] operator[SEP] identifier[_rolloverListener] operator[SEP] identifier[requeue] operator[SEP] identifier[_rolloverAlarm] operator[SEP] operator[SEP] identifier[rollover] operator[SEP] operator[SEP] operator[SEP]
}
|
public EpollDatagramChannelConfig setReusePort(boolean reusePort) {
try {
((EpollDatagramChannel) channel).socket.setReusePort(reusePort);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
|
class class_name[name] begin[{]
method[setReusePort, return_type[type[EpollDatagramChannelConfig]], modifier[public], parameter[reusePort]] begin[{]
TryStatement(block=[StatementExpression(expression=Cast(expression=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EpollDatagramChannel, sub_type=None)), label=None), ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChannelException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] identifier[EpollDatagramChannelConfig] identifier[setReusePort] operator[SEP] Keyword[boolean] identifier[reusePort] operator[SEP] {
Keyword[try] {
operator[SEP] operator[SEP] identifier[EpollDatagramChannel] operator[SEP] identifier[channel] operator[SEP] operator[SEP] identifier[socket] operator[SEP] identifier[setReusePort] operator[SEP] identifier[reusePort] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ChannelException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
private void negateRange(final short[] buffer, final int startIndex, final int lastIndex,
final int startRange, final int lastRange) {
// compute the negation into buffer
int outPos = 0;
int inPos = startIndex; // value here always >= valInRange,
// until it is exhausted
// n.b., we can start initially exhausted.
int valInRange = startRange;
for (; valInRange < lastRange && inPos <= lastIndex; ++valInRange) {
if ((short) valInRange != content[inPos]) {
buffer[outPos++] = (short) valInRange;
} else {
++inPos;
}
}
// if there are extra items (greater than the biggest
// pre-existing one in range), buffer them
for (; valInRange < lastRange; ++valInRange) {
buffer[outPos++] = (short) valInRange;
}
if (outPos != buffer.length) {
throw new RuntimeException(
"negateRange: outPos " + outPos + " whereas buffer.length=" + buffer.length);
}
// copy back from buffer...caller must ensure there is room
int i = startIndex;
for (short item : buffer) {
content[i++] = item;
}
}
|
class class_name[name] begin[{]
method[negateRange, return_type[void], modifier[private], parameter[buffer, startIndex, lastIndex, startRange, lastRange]] begin[{]
local_variable[type[int], outPos]
local_variable[type[int], inPos]
local_variable[type[int], valInRange]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Cast(expression=MemberReference(member=valInRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=short)), operandr=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=inPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=inPos, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=outPos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=valInRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=short))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=valInRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lastRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=inPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lastIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), init=None, update=[MemberReference(member=valInRange, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=outPos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=valInRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=short))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=valInRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lastRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=None, update=[MemberReference(member=valInRange, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.outPos], !=, member[buffer.length]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="negateRange: outPos "), operandr=MemberReference(member=outPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" whereas buffer.length="), operator=+), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[]), operator=+)], 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)
else begin[{]
None
end[}]
local_variable[type[int], i]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=BasicType(dimensions=[], name=short))), label=None)
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[negateRange] operator[SEP] Keyword[final] Keyword[short] operator[SEP] operator[SEP] identifier[buffer] , Keyword[final] Keyword[int] identifier[startIndex] , Keyword[final] Keyword[int] identifier[lastIndex] , Keyword[final] Keyword[int] identifier[startRange] , Keyword[final] Keyword[int] identifier[lastRange] operator[SEP] {
Keyword[int] identifier[outPos] operator[=] Other[0] operator[SEP] Keyword[int] identifier[inPos] operator[=] identifier[startIndex] operator[SEP] Keyword[int] identifier[valInRange] operator[=] identifier[startRange] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[valInRange] operator[<] identifier[lastRange] operator[&&] identifier[inPos] operator[<=] identifier[lastIndex] operator[SEP] operator[++] identifier[valInRange] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] Keyword[short] operator[SEP] identifier[valInRange] operator[!=] identifier[content] operator[SEP] identifier[inPos] operator[SEP] operator[SEP] {
identifier[buffer] operator[SEP] identifier[outPos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[short] operator[SEP] identifier[valInRange] operator[SEP]
}
Keyword[else] {
operator[++] identifier[inPos] operator[SEP]
}
}
Keyword[for] operator[SEP] operator[SEP] identifier[valInRange] operator[<] identifier[lastRange] operator[SEP] operator[++] identifier[valInRange] operator[SEP] {
identifier[buffer] operator[SEP] identifier[outPos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[short] operator[SEP] identifier[valInRange] operator[SEP]
}
Keyword[if] operator[SEP] identifier[outPos] operator[!=] identifier[buffer] operator[SEP] identifier[length] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[outPos] operator[+] literal[String] operator[+] identifier[buffer] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
Keyword[int] identifier[i] operator[=] identifier[startIndex] operator[SEP] Keyword[for] operator[SEP] Keyword[short] identifier[item] operator[:] identifier[buffer] operator[SEP] {
identifier[content] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[item] operator[SEP]
}
}
|
public Node importNode(Node importedNode, boolean deep) throws DOMException
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}
|
class class_name[name] begin[{]
method[importNode, return_type[type[Node]], modifier[public], parameter[importedNode, deep]] begin[{]
call[.error, parameter[member[XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED]]]
return[literal[null]]
end[}]
END[}]
|
Keyword[public] identifier[Node] identifier[importNode] operator[SEP] identifier[Node] identifier[importedNode] , Keyword[boolean] identifier[deep] operator[SEP] Keyword[throws] identifier[DOMException] {
identifier[error] operator[SEP] identifier[XMLErrorResources] operator[SEP] identifier[ER_FUNCTION_NOT_SUPPORTED] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
private void initializeConfig() {
this.varDecay = this.config.varDecay;
this.varInc = this.config.varInc;
this.ccminMode = this.config.clauseMin;
this.restartFirst = this.config.restartFirst;
this.restartInc = this.config.restartInc;
this.clauseDecay = this.config.clauseDecay;
this.removeSatisfied = this.config.removeSatisfied;
this.learntsizeFactor = this.config.learntsizeFactor;
this.learntsizeInc = this.config.learntsizeInc;
this.incremental = this.config.incremental;
}
|
class class_name[name] begin[{]
method[initializeConfig, return_type[void], modifier[private], parameter[]] begin[{]
assign[THIS[member[None.varDecay]], THIS[member[None.config]member[None.varDecay]]]
assign[THIS[member[None.varInc]], THIS[member[None.config]member[None.varInc]]]
assign[THIS[member[None.ccminMode]], THIS[member[None.config]member[None.clauseMin]]]
assign[THIS[member[None.restartFirst]], THIS[member[None.config]member[None.restartFirst]]]
assign[THIS[member[None.restartInc]], THIS[member[None.config]member[None.restartInc]]]
assign[THIS[member[None.clauseDecay]], THIS[member[None.config]member[None.clauseDecay]]]
assign[THIS[member[None.removeSatisfied]], THIS[member[None.config]member[None.removeSatisfied]]]
assign[THIS[member[None.learntsizeFactor]], THIS[member[None.config]member[None.learntsizeFactor]]]
assign[THIS[member[None.learntsizeInc]], THIS[member[None.config]member[None.learntsizeInc]]]
assign[THIS[member[None.incremental]], THIS[member[None.config]member[None.incremental]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[initializeConfig] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[varDecay] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[varDecay] operator[SEP] Keyword[this] operator[SEP] identifier[varInc] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[varInc] operator[SEP] Keyword[this] operator[SEP] identifier[ccminMode] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[clauseMin] operator[SEP] Keyword[this] operator[SEP] identifier[restartFirst] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[restartFirst] operator[SEP] Keyword[this] operator[SEP] identifier[restartInc] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[restartInc] operator[SEP] Keyword[this] operator[SEP] identifier[clauseDecay] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[clauseDecay] operator[SEP] Keyword[this] operator[SEP] identifier[removeSatisfied] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[removeSatisfied] operator[SEP] Keyword[this] operator[SEP] identifier[learntsizeFactor] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[learntsizeFactor] operator[SEP] Keyword[this] operator[SEP] identifier[learntsizeInc] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[learntsizeInc] operator[SEP] Keyword[this] operator[SEP] identifier[incremental] operator[=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[incremental] operator[SEP]
}
|
@Override
public Task createTask(Task task) throws NameConflictException {
try {
return taskDao.createTask(task);
} catch (DuplicateKeyException e) {
throw new NameConflictException("Task name is already in use", e);
}
}
|
class class_name[name] begin[{]
method[createTask, return_type[type[Task]], modifier[public], parameter[task]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=task, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTask, postfix_operators=[], prefix_operators=[], qualifier=taskDao, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Task name is already in use"), 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=NameConflictException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DuplicateKeyException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Task] identifier[createTask] operator[SEP] identifier[Task] identifier[task] operator[SEP] Keyword[throws] identifier[NameConflictException] {
Keyword[try] {
Keyword[return] identifier[taskDao] operator[SEP] identifier[createTask] operator[SEP] identifier[task] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DuplicateKeyException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NameConflictException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public int[] getNonZeroIndices() {
int[] indices = new int[values.size()];
for (int i = 0; i < values.size(); ++i)
indices[i] = values.get(i).index;
return indices;
}
|
class class_name[name] begin[{]
method[getNonZeroIndices, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], indices]
ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[MemberReference(member=index, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[member[.indices]]
end[}]
END[}]
|
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[getNonZeroIndices] operator[SEP] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[indices] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[index] operator[SEP] Keyword[return] identifier[indices] operator[SEP]
}
|
public FessMessages addConstraintsUriTypeMessage(String property) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_UriType_MESSAGE));
return this;
}
|
class class_name[name] begin[{]
method[addConstraintsUriTypeMessage, return_type[type[FessMessages]], modifier[public], parameter[property]] begin[{]
call[.assertPropertyNotNull, parameter[member[.property]]]
call[.add, parameter[member[.property], ClassCreator(arguments=[MemberReference(member=CONSTRAINTS_UriType_MESSAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UserMessage, sub_type=None))]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[FessMessages] identifier[addConstraintsUriTypeMessage] operator[SEP] identifier[String] identifier[property] operator[SEP] {
identifier[assertPropertyNotNull] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[property] , Keyword[new] identifier[UserMessage] operator[SEP] identifier[CONSTRAINTS_UriType_MESSAGE] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Deprecated
public static <T extends Comparable<?>> DateTemplate<T> dateTemplate(Class<? extends T> cl,
String template, ImmutableList<?> args) {
return dateTemplate(cl, createTemplate(template), args);
}
|
class class_name[name] begin[{]
method[dateTemplate, return_type[type[DateTemplate]], modifier[public static], parameter[cl, template, args]] begin[{]
return[call[.dateTemplate, parameter[member[.cl], call[.createTemplate, parameter[member[.template]]], member[.args]]]]
end[}]
END[}]
|
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Comparable] operator[<] operator[?] operator[>] operator[>] identifier[DateTemplate] operator[<] identifier[T] operator[>] identifier[dateTemplate] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[cl] , identifier[String] identifier[template] , identifier[ImmutableList] operator[<] operator[?] operator[>] identifier[args] operator[SEP] {
Keyword[return] identifier[dateTemplate] operator[SEP] identifier[cl] , identifier[createTemplate] operator[SEP] identifier[template] operator[SEP] , identifier[args] operator[SEP] operator[SEP]
}
|
@Override
public Color getColorForState(SynthContext ctx, ColorType type) {
return style.getColor(ctx, type);
}
|
class class_name[name] begin[{]
method[getColorForState, return_type[type[Color]], modifier[public], parameter[ctx, type]] begin[{]
return[call[style.getColor, parameter[member[.ctx], member[.type]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Color] identifier[getColorForState] operator[SEP] identifier[SynthContext] identifier[ctx] , identifier[ColorType] identifier[type] operator[SEP] {
Keyword[return] identifier[style] operator[SEP] identifier[getColor] operator[SEP] identifier[ctx] , identifier[type] operator[SEP] operator[SEP]
}
|
@Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPFriendlyURLEntry cpFriendlyURLEntry : findByUuid_C(uuid,
companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpFriendlyURLEntry);
}
}
|
class class_name[name] begin[{]
method[removeByUuid_C, return_type[void], modifier[public], parameter[uuid, companyId]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cpFriendlyURLEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=uuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=companyId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=findByUuid_C, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cpFriendlyURLEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CPFriendlyURLEntry, sub_type=None))), label=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeByUuid_C] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] operator[SEP] {
Keyword[for] operator[SEP] identifier[CPFriendlyURLEntry] identifier[cpFriendlyURLEntry] operator[:] identifier[findByUuid_C] operator[SEP] identifier[uuid] , identifier[companyId] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] {
identifier[remove] operator[SEP] identifier[cpFriendlyURLEntry] operator[SEP] operator[SEP]
}
}
|
public static Bundle of(String key, long value) {
Bundle b = new Bundle(1);
b.putLong(key, value);
return b;
}
|
class class_name[name] begin[{]
method[of, return_type[type[Bundle]], modifier[public static], parameter[key, value]] begin[{]
local_variable[type[Bundle], b]
call[b.putLong, parameter[member[.key], member[.value]]]
return[member[.b]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Bundle] identifier[of] operator[SEP] identifier[String] identifier[key] , Keyword[long] identifier[value] operator[SEP] {
identifier[Bundle] identifier[b] operator[=] Keyword[new] identifier[Bundle] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[b] operator[SEP] identifier[putLong] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[b] operator[SEP]
}
|
@Override
public CommerceCurrency fetchByG_P_A_First(long groupId, boolean primary,
boolean active, OrderByComparator<CommerceCurrency> orderByComparator) {
List<CommerceCurrency> list = findByG_P_A(groupId, primary, active, 0,
1, orderByComparator);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
|
class class_name[name] begin[{]
method[fetchByG_P_A_First, return_type[type[CommerceCurrency]], modifier[public], parameter[groupId, primary, active, orderByComparator]] begin[{]
local_variable[type[List], list]
if[call[list.isEmpty, parameter[]]] begin[{]
return[call[list.get, parameter[literal[0]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[CommerceCurrency] identifier[fetchByG_P_A_First] operator[SEP] Keyword[long] identifier[groupId] , Keyword[boolean] identifier[primary] , Keyword[boolean] identifier[active] , identifier[OrderByComparator] operator[<] identifier[CommerceCurrency] operator[>] identifier[orderByComparator] operator[SEP] {
identifier[List] operator[<] identifier[CommerceCurrency] operator[>] identifier[list] operator[=] identifier[findByG_P_A] operator[SEP] identifier[groupId] , identifier[primary] , identifier[active] , Other[0] , Other[1] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[list] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public void enableOverride(int overrideId, int pathId, String clientUUID) throws Exception {
// get profileId from pathId
int profileId = PathOverrideService.getInstance().getPath(pathId).getProfileId();
int newPriority = 0;
// we want to limit -1, -2 to only be added once since they are the Custom responses/requests
if (overrideId == Constants.PLUGIN_REQUEST_OVERRIDE_CUSTOM) {
if (this.getEnabledEndpoint(pathId, overrideId, null, clientUUID) != null) {
return;
}
}
// need to first determine the highest enabled order value for this path
HashMap<String, Object> priorities = sqlService.getFirstResult(
"SELECT * FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
" WHERE " + Constants.REQUEST_RESPONSE_PATH_ID + "=" + pathId +
" AND " + Constants.GENERIC_CLIENT_UUID + "='" + clientUUID +
"' ORDER BY + " + Constants.ENABLED_OVERRIDES_PRIORITY + " DESC"
);
if (priorities != null) {
newPriority = Integer.valueOf(priorities.get(Constants.ENABLED_OVERRIDES_PRIORITY.toUpperCase()).toString()) + 1;
}
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
PreparedStatement query = null;
ResultSet results = null;
SQLService sqlService = SQLService.getInstance();
com.groupon.odo.proxylib.models.Method method = null;
query = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants.DB_TABLE_OVERRIDE +
" WHERE " + Constants.GENERIC_ID + " = ?"
);
query.setString(1, String.valueOf(overrideId));
results = query.executeQuery();
JSONSerializer serializer = new JSONSerializer();
if (results.next()) {
String className = results.getString(Constants.OVERRIDE_CLASS_NAME);
String methodName = results.getString(Constants.OVERRIDE_METHOD_NAME);
method = PluginManager.getInstance().getMethod(className, methodName);
}
statement = sqlConnection.prepareStatement(
"INSERT INTO " + Constants.DB_TABLE_ENABLED_OVERRIDE +
"(" + Constants.GENERIC_PROFILE_ID + "," + Constants.GENERIC_CLIENT_UUID + "," +
Constants.REQUEST_RESPONSE_PATH_ID + "," + Constants.ENABLED_OVERRIDES_OVERRIDE_ID + "," +
Constants.ENABLED_OVERRIDES_PRIORITY + "," + Constants.ENABLED_OVERRIDES_ARGUMENTS + "," +
Constants.ENABLED_OVERRIDES_RESPONSE_CODE + ")" +
" VALUES (?, ?, ?, ?, ?, ?, ?);"
);
statement.setInt(1, profileId);
statement.setString(2, clientUUID);
statement.setInt(3, pathId);
statement.setInt(4, overrideId);
statement.setInt(5, newPriority);
if (method == null) {
statement.setString(6, "");
} else {
ArrayList<String> argDefaults = new ArrayList<String>();
for (int i = 0; i < method.getMethodArguments().length; i++) {
if (i < method.getMethodDefaultArguments().length && method.getMethodDefaultArguments()[i] != null) {
argDefaults.add(String.valueOf(method.getMethodDefaultArguments()[i]));
} else {
argDefaults.add("");
}
}
statement.setString(6, serializer.serialize(argDefaults));
}
statement.setString(7,"200");
statement.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (statement != null) {
statement.close();
}
} catch (Exception e) {
}
}
}
|
class class_name[name] begin[{]
method[enableOverride, return_type[void], modifier[public], parameter[overrideId, pathId, clientUUID]] begin[{]
local_variable[type[int], profileId]
local_variable[type[int], newPriority]
if[binary_operation[member[.overrideId], ==, member[Constants.PLUGIN_REQUEST_OVERRIDE_CUSTOM]]] begin[{]
if[binary_operation[THIS[call[None.getEnabledEndpoint, parameter[member[.pathId], member[.overrideId], literal[null], member[.clientUUID]]]], !=, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[HashMap], priorities]
if[binary_operation[member[.priorities], !=, literal[null]]] begin[{]
assign[member[.newPriority], binary_operation[call[Integer.valueOf, parameter[call[priorities.get, parameter[call[Constants.ENABLED_OVERRIDES_PRIORITY.toUpperCase, parameter[]]]]]], +, literal[1]]]
else begin[{]
None
end[}]
local_variable[type[PreparedStatement], statement]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=query)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PreparedStatement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=results)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResultSet, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SQLService, selectors=[], type_arguments=None), name=sqlService)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SQLService, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=groupon, sub_type=ReferenceType(arguments=None, dimensions=None, name=odo, sub_type=ReferenceType(arguments=None, dimensions=None, name=proxylib, sub_type=ReferenceType(arguments=None, dimensions=None, name=models, sub_type=ReferenceType(arguments=None, dimensions=None, name=Method, sub_type=None))))))), StatementExpression(expression=Assignment(expressionl=MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SELECT * FROM "), operandr=MemberReference(member=DB_TABLE_OVERRIDE, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" WHERE "), operator=+), operandr=MemberReference(member=GENERIC_ID, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = ?"), operator=+)], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=sqlConnection, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[MemberReference(member=overrideId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=setString, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONSerializer, sub_type=None)), name=serializer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONSerializer, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=results, 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=OVERRIDE_CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), name=className)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=OVERRIDE_METHOD_NAME, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), name=methodName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=PluginManager, selectors=[MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=statement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=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="INSERT INTO "), operandr=MemberReference(member=DB_TABLE_ENABLED_OVERRIDE, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="("), operator=+), operandr=MemberReference(member=GENERIC_PROFILE_ID, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=GENERIC_CLIENT_UUID, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=REQUEST_RESPONSE_PATH_ID, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=ENABLED_OVERRIDES_OVERRIDE_ID, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=ENABLED_OVERRIDES_PRIORITY, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=ENABLED_OVERRIDES_ARGUMENTS, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=ENABLED_OVERRIDES_RESPONSE_CODE, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" VALUES (?, ?, ?, ?, ?, ?, ?);"), operator=+)], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=sqlConnection, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=profileId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MemberReference(member=clientUUID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=pathId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), MemberReference(member=overrideId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), MemberReference(member=newPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=argDefaults)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMethodDefaultArguments, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=<), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMethodDefaultArguments, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=add, postfix_operators=[], prefix_operators=[], qualifier=argDefaults, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMethodDefaultArguments, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=argDefaults, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMethodArguments, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), MethodInvocation(arguments=[MemberReference(member=argDefaults, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=serializer, selectors=[], type_arguments=None)], member=setString, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=setString, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="200")], member=setString, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=executeUpdate, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=statement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)], label=None, resources=[TryResource(annotations=[], modifiers=set(), name=sqlConnection, type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None), value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=sqlService, selectors=[], type_arguments=None))])
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[enableOverride] operator[SEP] Keyword[int] identifier[overrideId] , Keyword[int] identifier[pathId] , identifier[String] identifier[clientUUID] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[int] identifier[profileId] operator[=] identifier[PathOverrideService] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] identifier[pathId] operator[SEP] operator[SEP] identifier[getProfileId] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[newPriority] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[overrideId] operator[==] identifier[Constants] operator[SEP] identifier[PLUGIN_REQUEST_OVERRIDE_CUSTOM] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getEnabledEndpoint] operator[SEP] identifier[pathId] , identifier[overrideId] , Other[null] , identifier[clientUUID] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
}
identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[priorities] operator[=] identifier[sqlService] operator[SEP] identifier[getFirstResult] operator[SEP] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[DB_TABLE_ENABLED_OVERRIDE] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[REQUEST_RESPONSE_PATH_ID] operator[+] literal[String] operator[+] identifier[pathId] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[GENERIC_CLIENT_UUID] operator[+] literal[String] operator[+] identifier[clientUUID] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[ENABLED_OVERRIDES_PRIORITY] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[priorities] operator[!=] Other[null] operator[SEP] {
identifier[newPriority] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[priorities] operator[SEP] identifier[get] operator[SEP] identifier[Constants] operator[SEP] identifier[ENABLED_OVERRIDES_PRIORITY] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP]
}
identifier[PreparedStatement] identifier[statement] operator[=] Other[null] operator[SEP] Keyword[try] operator[SEP] identifier[Connection] identifier[sqlConnection] operator[=] identifier[sqlService] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] {
identifier[PreparedStatement] identifier[query] operator[=] Other[null] operator[SEP] identifier[ResultSet] identifier[results] operator[=] Other[null] operator[SEP] identifier[SQLService] identifier[sqlService] operator[=] identifier[SQLService] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[com] operator[SEP] identifier[groupon] operator[SEP] identifier[odo] operator[SEP] identifier[proxylib] operator[SEP] identifier[models] operator[SEP] identifier[Method] identifier[method] operator[=] Other[null] operator[SEP] identifier[query] operator[=] identifier[sqlConnection] operator[SEP] identifier[prepareStatement] operator[SEP] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[DB_TABLE_OVERRIDE] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[GENERIC_ID] operator[+] literal[String] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setString] operator[SEP] Other[1] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[overrideId] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[=] identifier[query] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] identifier[JSONSerializer] identifier[serializer] operator[=] Keyword[new] identifier[JSONSerializer] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[results] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[className] operator[=] identifier[results] operator[SEP] identifier[getString] operator[SEP] identifier[Constants] operator[SEP] identifier[OVERRIDE_CLASS_NAME] operator[SEP] operator[SEP] identifier[String] identifier[methodName] operator[=] identifier[results] operator[SEP] identifier[getString] operator[SEP] identifier[Constants] operator[SEP] identifier[OVERRIDE_METHOD_NAME] operator[SEP] operator[SEP] identifier[method] operator[=] identifier[PluginManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] identifier[className] , identifier[methodName] operator[SEP] operator[SEP]
}
identifier[statement] operator[=] identifier[sqlConnection] operator[SEP] identifier[prepareStatement] operator[SEP] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[DB_TABLE_ENABLED_OVERRIDE] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[GENERIC_PROFILE_ID] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[GENERIC_CLIENT_UUID] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[REQUEST_RESPONSE_PATH_ID] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[ENABLED_OVERRIDES_OVERRIDE_ID] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[ENABLED_OVERRIDES_PRIORITY] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[ENABLED_OVERRIDES_ARGUMENTS] operator[+] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[ENABLED_OVERRIDES_RESPONSE_CODE] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[profileId] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[setString] operator[SEP] Other[2] , identifier[clientUUID] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[setInt] operator[SEP] Other[3] , identifier[pathId] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[setInt] operator[SEP] Other[4] , identifier[overrideId] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[setInt] operator[SEP] Other[5] , identifier[newPriority] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[==] Other[null] operator[SEP] {
identifier[statement] operator[SEP] identifier[setString] operator[SEP] Other[6] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[argDefaults] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[method] operator[SEP] identifier[getMethodArguments] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[<] identifier[method] operator[SEP] identifier[getMethodDefaultArguments] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[&&] identifier[method] operator[SEP] identifier[getMethodDefaultArguments] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[argDefaults] operator[SEP] identifier[add] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[method] operator[SEP] identifier[getMethodDefaultArguments] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[argDefaults] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
identifier[statement] operator[SEP] identifier[setString] operator[SEP] Other[6] , identifier[serializer] operator[SEP] identifier[serialize] operator[SEP] identifier[argDefaults] operator[SEP] operator[SEP] operator[SEP]
}
identifier[statement] operator[SEP] identifier[setString] operator[SEP] Other[7] , literal[String] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[statement] operator[!=] Other[null] operator[SEP] {
identifier[statement] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
}
}
}
|
public int pkHash(DbMapping dbMapping, Map<String, Object> d) {
return pkHash(dbMapping, d, null);
}
|
class class_name[name] begin[{]
method[pkHash, return_type[type[int]], modifier[public], parameter[dbMapping, d]] begin[{]
return[call[.pkHash, parameter[member[.dbMapping], member[.d], literal[null]]]]
end[}]
END[}]
|
Keyword[public] Keyword[int] identifier[pkHash] operator[SEP] identifier[DbMapping] identifier[dbMapping] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[d] operator[SEP] {
Keyword[return] identifier[pkHash] operator[SEP] identifier[dbMapping] , identifier[d] , Other[null] operator[SEP] operator[SEP]
}
|
public static CodedInput newInstance(final byte[] buf, final int off,
final int len)
{
return new CodedInput(buf, off, len, false);
}
|
class class_name[name] begin[{]
method[newInstance, return_type[type[CodedInput]], modifier[public static], parameter[buf, off, len]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=off, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CodedInput, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[CodedInput] identifier[newInstance] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] , Keyword[final] Keyword[int] identifier[off] , Keyword[final] Keyword[int] identifier[len] operator[SEP] {
Keyword[return] Keyword[new] identifier[CodedInput] operator[SEP] identifier[buf] , identifier[off] , identifier[len] , literal[boolean] operator[SEP] operator[SEP]
}
|
protected boolean close() {
if (isLoaded()) {
for (int i = 0; i < stats.length; i++) {
if (stats[i] != null) {
if (!stats[i].isLoaded()) {
stats[i] = null;
}
}
}
return false;
} else {
return true;
}
}
|
class class_name[name] begin[{]
method[close, return_type[type[boolean]], modifier[protected], parameter[]] begin[{]
if[call[.isLoaded, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=stats, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=isLoaded, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=stats, 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[false]]
else begin[{]
return[literal[true]]
end[}]
end[}]
END[}]
|
Keyword[protected] Keyword[boolean] identifier[close] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isLoaded] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[stats] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[stats] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[stats] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isLoaded] operator[SEP] operator[SEP] operator[SEP] {
identifier[stats] operator[SEP] identifier[i] operator[SEP] operator[=] Other[null] operator[SEP]
}
}
}
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[boolean] operator[SEP]
}
}
|
public CollisionFormula getCollisionFormula(String name)
{
if (formulas.containsKey(name))
{
return formulas.get(name);
}
throw new LionEngineException(ERROR_FORMULA + name);
}
|
class class_name[name] begin[{]
method[getCollisionFormula, return_type[type[CollisionFormula]], modifier[public], parameter[name]] begin[{]
if[call[formulas.containsKey, parameter[member[.name]]]] begin[{]
return[call[formulas.get, parameter[member[.name]]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=ERROR_FORMULA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LionEngineException, sub_type=None)), label=None)
end[}]
END[}]
|
Keyword[public] identifier[CollisionFormula] identifier[getCollisionFormula] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[formulas] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[return] identifier[formulas] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[LionEngineException] operator[SEP] identifier[ERROR_FORMULA] operator[+] identifier[name] operator[SEP] operator[SEP]
}
|
private void pingAtRegularIntervals(WebSocketSession session) {
pingTask = new PingTask(session);
if (pingScheduledExecutorService != null) {
pingScheduledExecutorService.shutdownNow();
}
pingScheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
pingScheduledExecutorService.scheduleAtFixedRate(pingTask, 1L, 30L, TimeUnit.SECONDS);
}
|
class class_name[name] begin[{]
method[pingAtRegularIntervals, return_type[void], modifier[private], parameter[session]] begin[{]
assign[member[.pingTask], ClassCreator(arguments=[MemberReference(member=session, 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=PingTask, sub_type=None))]
if[binary_operation[member[.pingScheduledExecutorService], !=, literal[null]]] begin[{]
call[pingScheduledExecutorService.shutdownNow, parameter[]]
else begin[{]
None
end[}]
assign[member[.pingScheduledExecutorService], call[Executors.newSingleThreadScheduledExecutor, parameter[]]]
call[pingScheduledExecutorService.scheduleAtFixedRate, parameter[member[.pingTask], literal[1L], literal[30L], member[TimeUnit.SECONDS]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[pingAtRegularIntervals] operator[SEP] identifier[WebSocketSession] identifier[session] operator[SEP] {
identifier[pingTask] operator[=] Keyword[new] identifier[PingTask] operator[SEP] identifier[session] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pingScheduledExecutorService] operator[!=] Other[null] operator[SEP] {
identifier[pingScheduledExecutorService] operator[SEP] identifier[shutdownNow] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pingScheduledExecutorService] operator[=] identifier[Executors] operator[SEP] identifier[newSingleThreadScheduledExecutor] operator[SEP] operator[SEP] operator[SEP] identifier[pingScheduledExecutorService] operator[SEP] identifier[scheduleAtFixedRate] operator[SEP] identifier[pingTask] , Other[1L] , Other[30L] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP]
}
|
public static URL[] getLibJars(Configuration conf) throws IOException {
String jars = conf.get("tmpjars");
if(jars==null) {
return null;
}
String[] files = jars.split(",");
URL[] cp = new URL[files.length];
for (int i=0;i<cp.length;i++) {
Path tmp = new Path(files[i]);
cp[i] = FileSystem.getLocal(conf).pathToFile(tmp).toURI().toURL();
}
return cp;
}
|
class class_name[name] begin[{]
method[getLibJars, return_type[type[URL]], modifier[public static], parameter[conf]] begin[{]
local_variable[type[String], jars]
if[binary_operation[member[.jars], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], files]
local_variable[type[URL], cp]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None)), name=tmp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLocal, postfix_operators=[], prefix_operators=[], qualifier=FileSystem, selectors=[MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pathToFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toURI, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toURL, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cp, 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[.cp]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[URL] operator[SEP] operator[SEP] identifier[getLibJars] operator[SEP] identifier[Configuration] identifier[conf] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[jars] operator[=] identifier[conf] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jars] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[files] operator[=] identifier[jars] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[URL] operator[SEP] operator[SEP] identifier[cp] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[files] 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[cp] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Path] identifier[tmp] operator[=] Keyword[new] identifier[Path] operator[SEP] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[cp] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[FileSystem] operator[SEP] identifier[getLocal] operator[SEP] identifier[conf] operator[SEP] operator[SEP] identifier[pathToFile] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[toURL] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[cp] operator[SEP]
}
|
@Override
public void configure(String driverName, String language, List<String> hints) throws UnknownAsrDriverException, AsrDriverConfigurationException {
this.driver = driverManager.getDriver(driverName);
this.lang = language;
this.hints = hints;
}
|
class class_name[name] begin[{]
method[configure, return_type[void], modifier[public], parameter[driverName, language, hints]] begin[{]
assign[THIS[member[None.driver]], call[driverManager.getDriver, parameter[member[.driverName]]]]
assign[THIS[member[None.lang]], member[.language]]
assign[THIS[member[None.hints]], member[.hints]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[configure] operator[SEP] identifier[String] identifier[driverName] , identifier[String] identifier[language] , identifier[List] operator[<] identifier[String] operator[>] identifier[hints] operator[SEP] Keyword[throws] identifier[UnknownAsrDriverException] , identifier[AsrDriverConfigurationException] {
Keyword[this] operator[SEP] identifier[driver] operator[=] identifier[driverManager] operator[SEP] identifier[getDriver] operator[SEP] identifier[driverName] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[lang] operator[=] identifier[language] operator[SEP] Keyword[this] operator[SEP] identifier[hints] operator[=] identifier[hints] operator[SEP]
}
|
@Override
public NotificationResponse fetch(HttpServletRequest request) {
logger.trace("{} invoked for user '{}', but there is nothing to do",
getClass().getSimpleName(), usernameFinder.findUsername(request));
return NotificationResponse.EMPTY_RESPONSE;
}
|
class class_name[name] begin[{]
method[fetch, return_type[type[NotificationResponse]], modifier[public], parameter[request]] begin[{]
call[logger.trace, parameter[literal["{} invoked for user '{}', but there is nothing to do"], call[.getClass, parameter[]], call[usernameFinder.findUsername, parameter[member[.request]]]]]
return[member[NotificationResponse.EMPTY_RESPONSE]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[NotificationResponse] identifier[fetch] operator[SEP] identifier[HttpServletRequest] identifier[request] operator[SEP] {
identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[usernameFinder] operator[SEP] identifier[findUsername] operator[SEP] identifier[request] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[NotificationResponse] operator[SEP] identifier[EMPTY_RESPONSE] operator[SEP]
}
|
void setLoadedLibrary(String aLibraryName, Long aMajorVersion)
{
Set<Long> foundVersions = mLoadedLibraries.get(aLibraryName);
if (foundVersions == null)
{
foundVersions = new HashSet<Long>();
mLoadedLibraries.put(aLibraryName, foundVersions);
}
foundVersions.add(aMajorVersion);
}
|
class class_name[name] begin[{]
method[setLoadedLibrary, return_type[void], modifier[default], parameter[aLibraryName, aMajorVersion]] begin[{]
local_variable[type[Set], foundVersions]
if[binary_operation[member[.foundVersions], ==, literal[null]]] begin[{]
assign[member[.foundVersions], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))]
call[mLoadedLibraries.put, parameter[member[.aLibraryName], member[.foundVersions]]]
else begin[{]
None
end[}]
call[foundVersions.add, parameter[member[.aMajorVersion]]]
end[}]
END[}]
|
Keyword[void] identifier[setLoadedLibrary] operator[SEP] identifier[String] identifier[aLibraryName] , identifier[Long] identifier[aMajorVersion] operator[SEP] {
identifier[Set] operator[<] identifier[Long] operator[>] identifier[foundVersions] operator[=] identifier[mLoadedLibraries] operator[SEP] identifier[get] operator[SEP] identifier[aLibraryName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[foundVersions] operator[==] Other[null] operator[SEP] {
identifier[foundVersions] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Long] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[mLoadedLibraries] operator[SEP] identifier[put] operator[SEP] identifier[aLibraryName] , identifier[foundVersions] operator[SEP] operator[SEP]
}
identifier[foundVersions] operator[SEP] identifier[add] operator[SEP] identifier[aMajorVersion] operator[SEP] operator[SEP]
}
|
@Override
public void setProperty(String name, Object value) {
if (currentBeanConfig != null) {
setPropertyOnBeanConfig(name, value);
}
}
|
class class_name[name] begin[{]
method[setProperty, return_type[void], modifier[public], parameter[name, value]] begin[{]
if[binary_operation[member[.currentBeanConfig], !=, literal[null]]] begin[{]
call[.setPropertyOnBeanConfig, parameter[member[.name], member[.value]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setProperty] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentBeanConfig] operator[!=] Other[null] operator[SEP] {
identifier[setPropertyOnBeanConfig] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
}
|
public Map<String, String> parseSignatureForGenerics(final String signature, final boolean isInterface) {
if (signature == null) {
return Collections.emptyMap();
}
final Map<String, String> genericsMap = new HashMap<>();
SignatureReader sr = new SignatureReader(signature);
StringBuilder sb = new StringBuilder();
TraceSignatureVisitor v = new TraceSignatureVisitor(sb, isInterface) {
String genericName;
@Override
public void visitFormalTypeParameter(final String name) {
genericName = name;
super.visitFormalTypeParameter(name);
}
@Override
public void visitClassType(final String name) {
if (genericName != null) {
genericsMap.put(genericName, 'L' + name + ';');
genericName = null;
}
super.visitClassType(name);
}
};
sr.accept(v);
return genericsMap;
}
|
class class_name[name] begin[{]
method[parseSignatureForGenerics, return_type[type[Map]], modifier[public], parameter[signature, isInterface]] begin[{]
if[binary_operation[member[.signature], ==, literal[null]]] begin[{]
return[call[Collections.emptyMap, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[Map], genericsMap]
local_variable[type[SignatureReader], sr]
local_variable[type[StringBuilder], sb]
local_variable[type[TraceSignatureVisitor], v]
call[sr.accept, parameter[member[.v]]]
return[member[.genericsMap]]
end[}]
END[}]
|
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parseSignatureForGenerics] operator[SEP] Keyword[final] identifier[String] identifier[signature] , Keyword[final] Keyword[boolean] identifier[isInterface] operator[SEP] {
Keyword[if] operator[SEP] identifier[signature] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[genericsMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[SignatureReader] identifier[sr] operator[=] Keyword[new] identifier[SignatureReader] operator[SEP] identifier[signature] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[TraceSignatureVisitor] identifier[v] operator[=] Keyword[new] identifier[TraceSignatureVisitor] operator[SEP] identifier[sb] , identifier[isInterface] operator[SEP] {
identifier[String] identifier[genericName] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitFormalTypeParameter] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] {
identifier[genericName] operator[=] identifier[name] operator[SEP] Keyword[super] operator[SEP] identifier[visitFormalTypeParameter] operator[SEP] identifier[name] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitClassType] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[genericName] operator[!=] Other[null] operator[SEP] {
identifier[genericsMap] operator[SEP] identifier[put] operator[SEP] identifier[genericName] , literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] identifier[genericName] operator[=] Other[null] operator[SEP]
}
Keyword[super] operator[SEP] identifier[visitClassType] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
} operator[SEP] identifier[sr] operator[SEP] identifier[accept] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[return] identifier[genericsMap] operator[SEP]
}
|
public static Segment newSegment(String algorithm)
{
if (algorithm == null)
{
throw new IllegalArgumentException(String.format("非法参数 algorithm == %s", algorithm));
}
algorithm = algorithm.toLowerCase();
if ("viterbi".equals(algorithm) || "维特比".equals(algorithm))
return new ViterbiSegment(); // Viterbi分词器是目前效率和效果的最佳平衡
else if ("dat".equals(algorithm) || "双数组trie树".equals(algorithm))
return new DoubleArrayTrieSegment();
else if ("nshort".equals(algorithm) || "n最短路".equals(algorithm))
return new NShortSegment();
else if ("crf".equals(algorithm) || "条件随机场".equals(algorithm))
try
{
return new CRFLexicalAnalyzer();
}
catch (IOException e)
{
logger.warning("CRF模型加载失败");
throw new RuntimeException(e);
}
else if ("perceptron".equals(algorithm) || "感知机".equals(algorithm))
{
try
{
return new PerceptronLexicalAnalyzer();
}
catch (IOException e)
{
logger.warning("感知机模型加载失败");
throw new RuntimeException(e);
}
}
throw new IllegalArgumentException(String.format("非法参数 algorithm == %s", algorithm));
}
|
class class_name[name] begin[{]
method[newSegment, return_type[type[Segment]], modifier[public static], parameter[algorithm]] begin[{]
if[binary_operation[member[.algorithm], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="非法参数 algorithm == %s"), MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.algorithm], call[algorithm.toLowerCase, parameter[]]]
if[binary_operation[literal["viterbi"], ||, literal["维特比"]]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ViterbiSegment, sub_type=None))]
else begin[{]
if[binary_operation[literal["dat"], ||, literal["双数组trie树"]]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DoubleArrayTrieSegment, sub_type=None))]
else begin[{]
if[binary_operation[literal["nshort"], ||, literal["n最短路"]]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NShortSegment, sub_type=None))]
else begin[{]
if[binary_operation[literal["crf"], ||, literal["条件随机场"]]] begin[{]
TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CRFLexicalAnalyzer, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CRF模型加载失败")], member=warning, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), 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=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)
else begin[{]
if[binary_operation[literal["perceptron"], ||, literal["感知机"]]] begin[{]
TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PerceptronLexicalAnalyzer, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="感知机模型加载失败")], member=warning, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), 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=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)
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="非法参数 algorithm == %s"), MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Segment] identifier[newSegment] operator[SEP] identifier[String] identifier[algorithm] operator[SEP] {
Keyword[if] operator[SEP] identifier[algorithm] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[algorithm] operator[SEP] operator[SEP] operator[SEP]
}
identifier[algorithm] operator[=] identifier[algorithm] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ViterbiSegment] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DoubleArrayTrieSegment] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[NShortSegment] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] Keyword[new] identifier[CRFLexicalAnalyzer] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] Keyword[new] identifier[PerceptronLexicalAnalyzer] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[algorithm] operator[SEP] operator[SEP] operator[SEP]
}
|
private void writePackageFile(File apolloPackageFile) {
try {
JsonWriter writer = JsonWriter.of(Okio.buffer(Okio.sink(apolloPackageFile)));
writer.beginObject();
writer.name("name").value("apollo-android");
writer.name("version").value("0.0.1");
writer.name("description").value("Generates Java code based on a GraphQL schema and query documents. Uses " +
"apollo-codegen under the hood.");
writer.name("name").value("apollo-android");
writer.name("repository");
writer.beginObject();
writer.name("type").value("git");
writer.name("url").value("git+https://github.com/apollostack/apollo-android.git");
writer.endObject();
writer.name("author").value("Apollo");
writer.name("license").value("MIT");
writer.endObject();
writer.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
|
class class_name[name] begin[{]
method[writePackageFile, return_type[void], modifier[private], parameter[apolloPackageFile]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=apolloPackageFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sink, postfix_operators=[], prefix_operators=[], qualifier=Okio, selectors=[], type_arguments=None)], member=buffer, postfix_operators=[], prefix_operators=[], qualifier=Okio, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=JsonWriter, selectors=[], type_arguments=None), name=writer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonWriter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=beginObject, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="apollo-android")], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="version")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.0.1")], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="description")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Generates Java code based on a GraphQL schema and query documents. Uses "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="apollo-codegen under the hood."), operator=+)], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="apollo-android")], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="repository")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=beginObject, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="git")], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="url")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="git+https://github.com/apollostack/apollo-android.git")], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=endObject, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="author")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Apollo")], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="license")], member=name, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MIT")], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=endObject, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[writePackageFile] operator[SEP] identifier[File] identifier[apolloPackageFile] operator[SEP] {
Keyword[try] {
identifier[JsonWriter] identifier[writer] operator[=] identifier[JsonWriter] operator[SEP] identifier[of] operator[SEP] identifier[Okio] operator[SEP] identifier[buffer] operator[SEP] identifier[Okio] operator[SEP] identifier[sink] operator[SEP] identifier[apolloPackageFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[beginObject] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[beginObject] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[endObject] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[endObject] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static String normalizeSpace(final String str) {
if (N.isNullOrEmpty(str)) {
return str;
}
return WHITESPACE_PATTERN.matcher(str.trim()).replaceAll(WD.SPACE);
}
|
class class_name[name] begin[{]
method[normalizeSpace, return_type[type[String]], modifier[public static], parameter[str]] begin[{]
if[call[N.isNullOrEmpty, parameter[member[.str]]]] begin[{]
return[member[.str]]
else begin[{]
None
end[}]
return[call[WHITESPACE_PATTERN.matcher, parameter[call[str.trim, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[normalizeSpace] operator[SEP] Keyword[final] identifier[String] identifier[str] operator[SEP] {
Keyword[if] operator[SEP] identifier[N] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[str] operator[SEP] operator[SEP] {
Keyword[return] identifier[str] operator[SEP]
}
Keyword[return] identifier[WHITESPACE_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[str] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[WD] operator[SEP] identifier[SPACE] operator[SEP] operator[SEP]
}
|
public void initialisePool()
{
Properties loginProperties = createLoginProperties();
if (logger.isDebugEnabled())
{
logger.debug("about to create pool with user-id : " + this.getJdbcUser());
}
ConnectionFactory connectionFactory = createConnectionFactory(loginProperties);
PoolableObjectFactory objectFactoryForConnectionPool = getObjectFactoryForConnectionPool(connectionFactory, connectionPool);
connectionPool = new ObjectPoolWithThreadAffinity(objectFactoryForConnectionPool, this.getPoolSize(),
this.getMaxWait(), this.getPoolSize(), this.getInitialSize(), true, false, this.timeBetweenEvictionRunsMillis,
this.minEvictableIdleTimeMillis, this.softMinEvictableIdleTimeMillis);
dataSource = createPoolingDataSource(connectionPool);
if (this.getInitialSize() > 0)
{
try // test connection
{
this.getConnection().close();
}
catch (Exception e)
{
logger.error("Error initializing pool " + this, e);
}
}
}
|
class class_name[name] begin[{]
method[initialisePool, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Properties], loginProperties]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[binary_operation[literal["about to create pool with user-id : "], +, THIS[call[None.getJdbcUser, parameter[]]]]]]
else begin[{]
None
end[}]
local_variable[type[ConnectionFactory], connectionFactory]
local_variable[type[PoolableObjectFactory], objectFactoryForConnectionPool]
assign[member[.connectionPool], ClassCreator(arguments=[MemberReference(member=objectFactoryForConnectionPool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getPoolSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getMaxWait, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getPoolSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getInitialSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=timeBetweenEvictionRunsMillis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=minEvictableIdleTimeMillis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=softMinEvictableIdleTimeMillis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectPoolWithThreadAffinity, sub_type=None))]
assign[member[.dataSource], call[.createPoolingDataSource, parameter[member[.connectionPool]]]]
if[binary_operation[THIS[call[None.getInitialSize, parameter[]]], >, literal[0]]] begin[{]
TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error initializing pool "), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[initialisePool] operator[SEP] operator[SEP] {
identifier[Properties] identifier[loginProperties] operator[=] identifier[createLoginProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getJdbcUser] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ConnectionFactory] identifier[connectionFactory] operator[=] identifier[createConnectionFactory] operator[SEP] identifier[loginProperties] operator[SEP] operator[SEP] identifier[PoolableObjectFactory] identifier[objectFactoryForConnectionPool] operator[=] identifier[getObjectFactoryForConnectionPool] operator[SEP] identifier[connectionFactory] , identifier[connectionPool] operator[SEP] operator[SEP] identifier[connectionPool] operator[=] Keyword[new] identifier[ObjectPoolWithThreadAffinity] operator[SEP] identifier[objectFactoryForConnectionPool] , Keyword[this] operator[SEP] identifier[getPoolSize] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getMaxWait] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getPoolSize] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getInitialSize] operator[SEP] operator[SEP] , literal[boolean] , literal[boolean] , Keyword[this] operator[SEP] identifier[timeBetweenEvictionRunsMillis] , Keyword[this] operator[SEP] identifier[minEvictableIdleTimeMillis] , Keyword[this] operator[SEP] identifier[softMinEvictableIdleTimeMillis] operator[SEP] operator[SEP] identifier[dataSource] operator[=] identifier[createPoolingDataSource] operator[SEP] identifier[connectionPool] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getInitialSize] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[try] {
Keyword[this] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] Keyword[this] , identifier[e] operator[SEP] operator[SEP]
}
}
}
|
public void compileBatch(String []files)
throws IOException, ClassNotFoundException
{
if (_compileParent) {
try {
if (_loader instanceof Make)
((Make) _loader).make();
} catch (Exception e) {
throw new IOException(e);
}
}
if (files.length == 0)
return;
// only batch a number of files at a time
int batchCount = _maxBatch;
if (batchCount < 0)
batchCount = Integer.MAX_VALUE / 2;
else if (batchCount == 0)
batchCount = 1;
IOException exn = null;
ArrayList<String> uniqueFiles = new ArrayList<String>();
for (int i = 0; i < files.length; i++) {
if (! uniqueFiles.contains(files[i]))
uniqueFiles.add(files[i]);
}
files = new String[uniqueFiles.size()];
uniqueFiles.toArray(files);
LineMap lineMap = null;
_compilerService.compile(this, files, lineMap);
/*
synchronized (LOCK) {
for (int i = 0; i < files.length; i += batchCount) {
int len = files.length - i;
len = Math.min(len, batchCount);
String []batchFiles = new String[len];
System.arraycopy(files, i, batchFiles, 0, len);
Arrays.sort(batchFiles);
try {
compileInt(batchFiles, null);
} catch (IOException e) {
if (exn == null)
exn = e;
else
log.log(Level.WARNING, e.toString(), e);
}
}
}
if (exn != null)
throw exn;
*/
}
|
class class_name[name] begin[{]
method[compileBatch, return_type[void], modifier[public], parameter[files]] begin[{]
if[member[._compileParent]] begin[{]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_loader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Make, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=StatementExpression(expression=Cast(expression=MemberReference(member=_loader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Make, sub_type=None)), label=None))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
if[binary_operation[member[files.length], ==, literal[0]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[int], batchCount]
if[binary_operation[member[.batchCount], <, literal[0]]] begin[{]
assign[member[.batchCount], binary_operation[member[Integer.MAX_VALUE], /, literal[2]]]
else begin[{]
if[binary_operation[member[.batchCount], ==, literal[0]]] begin[{]
assign[member[.batchCount], literal[1]]
else begin[{]
None
end[}]
end[}]
local_variable[type[IOException], exn]
local_variable[type[ArrayList], uniqueFiles]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=uniqueFiles, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=uniqueFiles, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=files, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.files], ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=uniqueFiles, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]
call[uniqueFiles.toArray, parameter[member[.files]]]
local_variable[type[LineMap], lineMap]
call[_compilerService.compile, parameter[THIS[], member[.files], member[.lineMap]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[compileBatch] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[files] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] {
Keyword[if] operator[SEP] identifier[_compileParent] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[_loader] Keyword[instanceof] identifier[Make] operator[SEP] operator[SEP] operator[SEP] identifier[Make] operator[SEP] identifier[_loader] operator[SEP] operator[SEP] identifier[make] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[files] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] operator[SEP] Keyword[int] identifier[batchCount] operator[=] identifier[_maxBatch] operator[SEP] Keyword[if] operator[SEP] identifier[batchCount] operator[<] Other[0] operator[SEP] identifier[batchCount] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[/] Other[2] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[batchCount] operator[==] Other[0] operator[SEP] identifier[batchCount] operator[=] Other[1] operator[SEP] identifier[IOException] identifier[exn] operator[=] Other[null] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[uniqueFiles] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[files] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[uniqueFiles] operator[SEP] identifier[contains] operator[SEP] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[uniqueFiles] operator[SEP] identifier[add] operator[SEP] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[files] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[uniqueFiles] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[uniqueFiles] operator[SEP] identifier[toArray] operator[SEP] identifier[files] operator[SEP] operator[SEP] identifier[LineMap] identifier[lineMap] operator[=] Other[null] operator[SEP] identifier[_compilerService] operator[SEP] identifier[compile] operator[SEP] Keyword[this] , identifier[files] , identifier[lineMap] operator[SEP] operator[SEP]
}
|
protected IAnalysisCache createAnalysisCache() throws IOException {
IAnalysisCache analysisCache = ClassFactory.instance().createAnalysisCache(classPath, bugReporter);
// Register the "built-in" analysis engines
registerBuiltInAnalysisEngines(analysisCache);
// Register analysis engines in plugins
registerPluginAnalysisEngines(detectorFactoryCollection, analysisCache);
// Install the DetectorFactoryCollection as a database
analysisCache.eagerlyPutDatabase(DetectorFactoryCollection.class, detectorFactoryCollection);
Global.setAnalysisCacheForCurrentThread(analysisCache);
return analysisCache;
}
|
class class_name[name] begin[{]
method[createAnalysisCache, return_type[type[IAnalysisCache]], modifier[protected], parameter[]] begin[{]
local_variable[type[IAnalysisCache], analysisCache]
call[.registerBuiltInAnalysisEngines, parameter[member[.analysisCache]]]
call[.registerPluginAnalysisEngines, parameter[member[.detectorFactoryCollection], member[.analysisCache]]]
call[analysisCache.eagerlyPutDatabase, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DetectorFactoryCollection, sub_type=None)), member[.detectorFactoryCollection]]]
call[Global.setAnalysisCacheForCurrentThread, parameter[member[.analysisCache]]]
return[member[.analysisCache]]
end[}]
END[}]
|
Keyword[protected] identifier[IAnalysisCache] identifier[createAnalysisCache] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[IAnalysisCache] identifier[analysisCache] operator[=] identifier[ClassFactory] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[createAnalysisCache] operator[SEP] identifier[classPath] , identifier[bugReporter] operator[SEP] operator[SEP] identifier[registerBuiltInAnalysisEngines] operator[SEP] identifier[analysisCache] operator[SEP] operator[SEP] identifier[registerPluginAnalysisEngines] operator[SEP] identifier[detectorFactoryCollection] , identifier[analysisCache] operator[SEP] operator[SEP] identifier[analysisCache] operator[SEP] identifier[eagerlyPutDatabase] operator[SEP] identifier[DetectorFactoryCollection] operator[SEP] Keyword[class] , identifier[detectorFactoryCollection] operator[SEP] operator[SEP] identifier[Global] operator[SEP] identifier[setAnalysisCacheForCurrentThread] operator[SEP] identifier[analysisCache] operator[SEP] operator[SEP] Keyword[return] identifier[analysisCache] operator[SEP]
}
|
public static BasePackage init() {
if (isInited) return (BasePackage)EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI);
// Obtain or create and register package
BasePackageImpl theBasePackage = (BasePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof BasePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new BasePackageImpl());
isInited = true;
// Obtain or create and register interdependencies
AfplibPackageImpl theAfplibPackage = (AfplibPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI) instanceof AfplibPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI) : AfplibPackage.eINSTANCE);
// Load packages
theAfplibPackage.loadPackage();
// Create package meta-data objects
theBasePackage.createPackageContents();
// Initialize created meta-data
theBasePackage.initializePackageContents();
// Fix loaded packages
theAfplibPackage.fixPackageContents();
// Register package validator
EValidator.Registry.INSTANCE.put
(theBasePackage,
new EValidator.Descriptor() {
public EValidator getEValidator() {
return BaseValidator.INSTANCE;
}
});
// Mark meta-data to indicate it can't be changed
theBasePackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(BasePackage.eNS_URI, theBasePackage);
return theBasePackage;
}
|
class class_name[name] begin[{]
method[init, return_type[type[BasePackage]], modifier[public static], parameter[]] begin[{]
if[member[.isInited]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=BasePackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BasePackage, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[BasePackageImpl], theBasePackage]
assign[member[.isInited], literal[true]]
local_variable[type[AfplibPackageImpl], theAfplibPackage]
call[theAfplibPackage.loadPackage, parameter[]]
call[theBasePackage.createPackageContents, parameter[]]
call[theBasePackage.initializePackageContents, parameter[]]
call[theAfplibPackage.fixPackageContents, parameter[]]
call[EValidator.Registry.INSTANCE.put, parameter[member[.theBasePackage], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MemberReference(member=INSTANCE, postfix_operators=[], prefix_operators=[], qualifier=BaseValidator, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getEValidator, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=EValidator, 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=EValidator, sub_type=ReferenceType(arguments=None, dimensions=None, name=Descriptor, sub_type=None)))]]
call[theBasePackage.freeze, parameter[]]
call[EPackage.Registry.INSTANCE.put, parameter[member[BasePackage.eNS_URI], member[.theBasePackage]]]
return[member[.theBasePackage]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[BasePackage] identifier[init] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isInited] operator[SEP] Keyword[return] operator[SEP] identifier[BasePackage] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[BasePackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[BasePackageImpl] identifier[theBasePackage] operator[=] operator[SEP] identifier[BasePackageImpl] operator[SEP] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[get] operator[SEP] identifier[eNS_URI] operator[SEP] Keyword[instanceof] identifier[BasePackageImpl] operator[?] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[get] operator[SEP] identifier[eNS_URI] operator[SEP] operator[:] Keyword[new] identifier[BasePackageImpl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isInited] operator[=] literal[boolean] operator[SEP] identifier[AfplibPackageImpl] identifier[theAfplibPackage] operator[=] operator[SEP] identifier[AfplibPackageImpl] operator[SEP] 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] Keyword[instanceof] identifier[AfplibPackageImpl] operator[?] 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[:] identifier[AfplibPackage] operator[SEP] identifier[eINSTANCE] operator[SEP] operator[SEP] identifier[theAfplibPackage] operator[SEP] identifier[loadPackage] operator[SEP] operator[SEP] operator[SEP] identifier[theBasePackage] operator[SEP] identifier[createPackageContents] operator[SEP] operator[SEP] operator[SEP] identifier[theBasePackage] operator[SEP] identifier[initializePackageContents] operator[SEP] operator[SEP] operator[SEP] identifier[theAfplibPackage] operator[SEP] identifier[fixPackageContents] operator[SEP] operator[SEP] operator[SEP] identifier[EValidator] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[put] operator[SEP] identifier[theBasePackage] , Keyword[new] identifier[EValidator] operator[SEP] identifier[Descriptor] operator[SEP] operator[SEP] {
Keyword[public] identifier[EValidator] identifier[getEValidator] operator[SEP] operator[SEP] {
Keyword[return] identifier[BaseValidator] operator[SEP] identifier[INSTANCE] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[theBasePackage] operator[SEP] identifier[freeze] operator[SEP] operator[SEP] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[put] operator[SEP] identifier[BasePackage] operator[SEP] identifier[eNS_URI] , identifier[theBasePackage] operator[SEP] operator[SEP] Keyword[return] identifier[theBasePackage] operator[SEP]
}
|
private static Method getAccessibleMethodFromSuperclass
(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
Class<?> parentClazz = clazz.getSuperclass();
while (parentClazz != null) {
if (Modifier.isPublic(parentClazz.getModifiers())) {
try {
return parentClazz.getMethod(methodName, parameterTypes);
} catch (NoSuchMethodException e) {
return null;
}
}
parentClazz = parentClazz.getSuperclass();
}
return null;
}
|
class class_name[name] begin[{]
method[getAccessibleMethodFromSuperclass, return_type[type[Method]], modifier[private static], parameter[clazz, methodName, parameterTypes]] begin[{]
local_variable[type[Class], parentClazz]
while[binary_operation[member[.parentClazz], !=, literal[null]]] begin[{]
if[call[Modifier.isPublic, parameter[call[parentClazz.getModifiers, parameter[]]]]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=parentClazz, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
assign[member[.parentClazz], call[parentClazz.getSuperclass, parameter[]]]
end[}]
return[literal[null]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[Method] identifier[getAccessibleMethodFromSuperclass] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[String] identifier[methodName] , identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[parameterTypes] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[parentClazz] operator[=] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[parentClazz] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isPublic] operator[SEP] identifier[parentClazz] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[parentClazz] operator[SEP] identifier[getMethod] operator[SEP] identifier[methodName] , identifier[parameterTypes] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
identifier[parentClazz] operator[=] identifier[parentClazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@Override
public final void pi(String target, String instruction) throws IllegalStateException, IllegalArgumentException, IOException {
// Check state
if (_state != XMLEventListenerStates.BEFORE_XML_DECLARATION && _state != XMLEventListenerStates.BEFORE_DTD_DECLARATION && _state != XMLEventListenerStates.BEFORE_ROOT_ELEMENT && _state != XMLEventListenerStates.START_TAG_OPEN && _state != XMLEventListenerStates.WITHIN_ELEMENT && _state != XMLEventListenerStates.AFTER_ROOT_ELEMENT) {
throw new IllegalStateException("getState() == " + _state);
// Check arguments
} else if (target == null) {
throw new IllegalArgumentException("target == null");
}
// Temporarily set the state to ERROR_STATE. Unless an exception is
// thrown in the write methods, it will be reset to a valid state.
XMLEventListenerState oldState = _state;
_state = XMLEventListenerStates.ERROR_STATE;
// Complete the start tag if necessary
if (oldState == XMLEventListenerStates.START_TAG_OPEN) {
closeStartTag();
}
// Write the Processing Instruction
_out.write('<');
_out.write('?');
_out.write(target);
if (instruction != null) {
_out.write(' ');
_out.write(instruction);
}
_out.write('?');
_out.write('>');
// Change the state
if (oldState == XMLEventListenerStates.BEFORE_XML_DECLARATION) {
_state = XMLEventListenerStates.BEFORE_DTD_DECLARATION;
} else if (oldState == XMLEventListenerStates.START_TAG_OPEN) {
_state = XMLEventListenerStates.WITHIN_ELEMENT;
} else {
_state = oldState;
}
// State has changed, check
checkInvariants();
}
|
class class_name[name] begin[{]
method[pi, return_type[void], modifier[final public], parameter[target, instruction]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[._state], !=, member[XMLEventListenerStates.BEFORE_XML_DECLARATION]], &&, binary_operation[member[._state], !=, member[XMLEventListenerStates.BEFORE_DTD_DECLARATION]]], &&, binary_operation[member[._state], !=, member[XMLEventListenerStates.BEFORE_ROOT_ELEMENT]]], &&, binary_operation[member[._state], !=, member[XMLEventListenerStates.START_TAG_OPEN]]], &&, binary_operation[member[._state], !=, member[XMLEventListenerStates.WITHIN_ELEMENT]]], &&, binary_operation[member[._state], !=, member[XMLEventListenerStates.AFTER_ROOT_ELEMENT]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getState() == "), operandr=MemberReference(member=_state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
if[binary_operation[member[.target], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="target == 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[}]
end[}]
local_variable[type[XMLEventListenerState], oldState]
assign[member[._state], member[XMLEventListenerStates.ERROR_STATE]]
if[binary_operation[member[.oldState], ==, member[XMLEventListenerStates.START_TAG_OPEN]]] begin[{]
call[.closeStartTag, parameter[]]
else begin[{]
None
end[}]
call[_out.write, parameter[literal['<']]]
call[_out.write, parameter[literal['?']]]
call[_out.write, parameter[member[.target]]]
if[binary_operation[member[.instruction], !=, literal[null]]] begin[{]
call[_out.write, parameter[literal[' ']]]
call[_out.write, parameter[member[.instruction]]]
else begin[{]
None
end[}]
call[_out.write, parameter[literal['?']]]
call[_out.write, parameter[literal['>']]]
if[binary_operation[member[.oldState], ==, member[XMLEventListenerStates.BEFORE_XML_DECLARATION]]] begin[{]
assign[member[._state], member[XMLEventListenerStates.BEFORE_DTD_DECLARATION]]
else begin[{]
if[binary_operation[member[.oldState], ==, member[XMLEventListenerStates.START_TAG_OPEN]]] begin[{]
assign[member[._state], member[XMLEventListenerStates.WITHIN_ELEMENT]]
else begin[{]
assign[member[._state], member[.oldState]]
end[}]
end[}]
call[.checkInvariants, parameter[]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[pi] operator[SEP] identifier[String] identifier[target] , identifier[String] identifier[instruction] operator[SEP] Keyword[throws] identifier[IllegalStateException] , identifier[IllegalArgumentException] , identifier[IOException] {
Keyword[if] operator[SEP] identifier[_state] operator[!=] identifier[XMLEventListenerStates] operator[SEP] identifier[BEFORE_XML_DECLARATION] operator[&&] identifier[_state] operator[!=] identifier[XMLEventListenerStates] operator[SEP] identifier[BEFORE_DTD_DECLARATION] operator[&&] identifier[_state] operator[!=] identifier[XMLEventListenerStates] operator[SEP] identifier[BEFORE_ROOT_ELEMENT] operator[&&] identifier[_state] operator[!=] identifier[XMLEventListenerStates] operator[SEP] identifier[START_TAG_OPEN] operator[&&] identifier[_state] operator[!=] identifier[XMLEventListenerStates] operator[SEP] identifier[WITHIN_ELEMENT] operator[&&] identifier[_state] operator[!=] identifier[XMLEventListenerStates] operator[SEP] identifier[AFTER_ROOT_ELEMENT] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[_state] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[XMLEventListenerState] identifier[oldState] operator[=] identifier[_state] operator[SEP] identifier[_state] operator[=] identifier[XMLEventListenerStates] operator[SEP] identifier[ERROR_STATE] operator[SEP] Keyword[if] operator[SEP] identifier[oldState] operator[==] identifier[XMLEventListenerStates] operator[SEP] identifier[START_TAG_OPEN] operator[SEP] {
identifier[closeStartTag] operator[SEP] operator[SEP] operator[SEP]
}
identifier[_out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[_out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[_out] operator[SEP] identifier[write] operator[SEP] identifier[target] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[instruction] operator[!=] Other[null] operator[SEP] {
identifier[_out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[_out] operator[SEP] identifier[write] operator[SEP] identifier[instruction] operator[SEP] operator[SEP]
}
identifier[_out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[_out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldState] operator[==] identifier[XMLEventListenerStates] operator[SEP] identifier[BEFORE_XML_DECLARATION] operator[SEP] {
identifier[_state] operator[=] identifier[XMLEventListenerStates] operator[SEP] identifier[BEFORE_DTD_DECLARATION] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[oldState] operator[==] identifier[XMLEventListenerStates] operator[SEP] identifier[START_TAG_OPEN] operator[SEP] {
identifier[_state] operator[=] identifier[XMLEventListenerStates] operator[SEP] identifier[WITHIN_ELEMENT] operator[SEP]
}
Keyword[else] {
identifier[_state] operator[=] identifier[oldState] operator[SEP]
}
identifier[checkInvariants] operator[SEP] operator[SEP] operator[SEP]
}
|
private void handleConnectResponse(ConnectResponse response, Throwable error, CompletableFuture<Connection> future) {
if (open) {
if (error == null) {
LOGGER.trace("{} - Received {}", id, response);
// If the connection was successfully created, immediately send a keep-alive request
// to the server to ensure we maintain our session and get an updated list of server addresses.
if (response.status() == Response.Status.OK) {
selector.reset(response.leader(), response.members());
future.complete(connection);
} else {
connect(future);
}
} else {
LOGGER.debug("{} - Failed to connect! Reason: {}", id, error);
connect(future);
}
}
}
|
class class_name[name] begin[{]
method[handleConnectResponse, return_type[void], modifier[private], parameter[response, error, future]] begin[{]
if[member[.open]] begin[{]
if[binary_operation[member[.error], ==, literal[null]]] begin[{]
call[LOGGER.trace, parameter[literal["{} - Received {}"], member[.id], member[.response]]]
if[binary_operation[call[response.status, parameter[]], ==, member[Response.Status.OK]]] begin[{]
call[selector.reset, parameter[call[response.leader, parameter[]], call[response.members, parameter[]]]]
call[future.complete, parameter[member[.connection]]]
else begin[{]
call[.connect, parameter[member[.future]]]
end[}]
else begin[{]
call[LOGGER.debug, parameter[literal["{} - Failed to connect! Reason: {}"], member[.id], member[.error]]]
call[.connect, parameter[member[.future]]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[handleConnectResponse] operator[SEP] identifier[ConnectResponse] identifier[response] , identifier[Throwable] identifier[error] , identifier[CompletableFuture] operator[<] identifier[Connection] operator[>] identifier[future] operator[SEP] {
Keyword[if] operator[SEP] identifier[open] operator[SEP] {
Keyword[if] operator[SEP] identifier[error] operator[==] Other[null] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[id] , identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[status] operator[SEP] operator[SEP] operator[==] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[OK] operator[SEP] {
identifier[selector] operator[SEP] identifier[reset] operator[SEP] identifier[response] operator[SEP] identifier[leader] operator[SEP] operator[SEP] , identifier[response] operator[SEP] identifier[members] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[future] operator[SEP] identifier[complete] operator[SEP] identifier[connection] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[connect] operator[SEP] identifier[future] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[id] , identifier[error] operator[SEP] operator[SEP] identifier[connect] operator[SEP] identifier[future] operator[SEP] operator[SEP]
}
}
}
|
public static String ceylonModuleBaseName(final String groupId, final String artifactId) {
if (groupId == null || artifactId == null || "".equals(artifactId) || artifactId.contains(".")) {
throw new IllegalArgumentException(" Null or empty, or '.' is not allowed in artifactId");
}
return groupId + GROUP_SEPARATOR + artifactId;
}
|
class class_name[name] begin[{]
method[ceylonModuleBaseName, return_type[type[String]], modifier[public static], parameter[groupId, artifactId]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.groupId], ==, literal[null]], ||, binary_operation[member[.artifactId], ==, literal[null]]], ||, literal[""]], ||, call[artifactId.contains, parameter[literal["."]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Null or empty, or '.' is not allowed in artifactId")], 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[binary_operation[binary_operation[member[.groupId], +, member[.GROUP_SEPARATOR]], +, member[.artifactId]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[ceylonModuleBaseName] operator[SEP] Keyword[final] identifier[String] identifier[groupId] , Keyword[final] identifier[String] identifier[artifactId] operator[SEP] {
Keyword[if] operator[SEP] identifier[groupId] operator[==] Other[null] operator[||] identifier[artifactId] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[artifactId] operator[SEP] operator[||] identifier[artifactId] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[groupId] operator[+] identifier[GROUP_SEPARATOR] operator[+] identifier[artifactId] operator[SEP]
}
|
protected static SqlParts sqlToSortIds(Set<String> docIdSet,
List<FieldSort> sortDocument,
List<Index> indexes) throws QueryException {
String chosenIndex = chooseIndexForSort(sortDocument, indexes);
if (chosenIndex == null) {
String msg = String.format(Locale.ENGLISH, "No single index can satisfy order %s", sortDocument);
logger.log(Level.SEVERE, msg);
throw new QueryException(msg);
}
String indexTable = QueryImpl.tableNameForIndex(chosenIndex);
// for small result sets:
// SELECT _id FROM idx WHERE _id IN (?, ?) ORDER BY fieldName ASC, fieldName2 DESC
// for large result sets:
// SELECT _id FROM idx ORDER BY fieldName ASC, fieldName2 DESC
List<String> orderClauses = new ArrayList<String>();
for (FieldSort clause : sortDocument) {
String fieldName = clause.field;
String direction = clause.sort == FieldSort.Direction.ASCENDING ? "asc" : "desc";
String orderClause = String.format("\"%s\" %s", fieldName, direction.toUpperCase(Locale.ENGLISH));
orderClauses.add(orderClause);
}
// If we have few results, it's more efficient to reduce the search space
// for SQLite. 500 placeholders should be a safe value.
List<String> parameterList = new ArrayList<String>();
String whereClause = "";
if (docIdSet.size() < SMALL_RESULT_SET_SIZE_THRESHOLD) {
List<String> placeholders = new ArrayList<String>();
for (String docId : docIdSet) {
placeholders.add("?");
parameterList.add(docId);
}
whereClause = String.format("WHERE _id IN (%s)", Misc.join(", ", placeholders));
}
String orderBy = Misc.join(", ", orderClauses);
String sql = String.format("SELECT DISTINCT _id FROM %s %s ORDER BY %s", indexTable,
whereClause,
orderBy);
String[] parameters = new String[parameterList.size()];
return SqlParts.partsForSql(sql, parameterList.toArray(parameters));
}
|
class class_name[name] begin[{]
method[sqlToSortIds, return_type[type[SqlParts]], modifier[static protected], parameter[docIdSet, sortDocument, indexes]] begin[{]
local_variable[type[String], chosenIndex]
if[binary_operation[member[.chosenIndex], ==, literal[null]]] begin[{]
local_variable[type[String], msg]
call[logger.log, parameter[member[Level.SEVERE], member[.msg]]]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, 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=QueryException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], indexTable]
local_variable[type[List], orderClauses]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=clause, selectors=[]), name=fieldName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=sort, postfix_operators=[], prefix_operators=[], qualifier=clause, selectors=[]), operandr=MemberReference(member=ASCENDING, postfix_operators=[], prefix_operators=[], qualifier=FieldSort.Direction, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="desc"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="asc")), name=direction)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"%s\" %s"), MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=ENGLISH, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[])], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=direction, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), name=orderClause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=orderClause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=orderClauses, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sortDocument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=clause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldSort, sub_type=None))), label=None)
local_variable[type[List], parameterList]
local_variable[type[String], whereClause]
if[binary_operation[call[docIdSet.size, parameter[]], <, member[.SMALL_RESULT_SET_SIZE_THRESHOLD]]] begin[{]
local_variable[type[List], placeholders]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="?")], member=add, postfix_operators=[], prefix_operators=[], qualifier=placeholders, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=docId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=parameterList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=docIdSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=docId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
assign[member[.whereClause], call[String.format, parameter[literal["WHERE _id IN (%s)"], call[Misc.join, parameter[literal[", "], member[.placeholders]]]]]]
else begin[{]
None
end[}]
local_variable[type[String], orderBy]
local_variable[type[String], sql]
local_variable[type[String], parameters]
return[call[SqlParts.partsForSql, parameter[member[.sql], call[parameterList.toArray, parameter[member[.parameters]]]]]]
end[}]
END[}]
|
Keyword[protected] Keyword[static] identifier[SqlParts] identifier[sqlToSortIds] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[docIdSet] , identifier[List] operator[<] identifier[FieldSort] operator[>] identifier[sortDocument] , identifier[List] operator[<] identifier[Index] operator[>] identifier[indexes] operator[SEP] Keyword[throws] identifier[QueryException] {
identifier[String] identifier[chosenIndex] operator[=] identifier[chooseIndexForSort] operator[SEP] identifier[sortDocument] , identifier[indexes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[chosenIndex] operator[==] Other[null] operator[SEP] {
identifier[String] identifier[msg] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] , literal[String] , identifier[sortDocument] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , identifier[msg] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[QueryException] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
identifier[String] identifier[indexTable] operator[=] identifier[QueryImpl] operator[SEP] identifier[tableNameForIndex] operator[SEP] identifier[chosenIndex] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[orderClauses] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FieldSort] identifier[clause] operator[:] identifier[sortDocument] operator[SEP] {
identifier[String] identifier[fieldName] operator[=] identifier[clause] operator[SEP] identifier[field] operator[SEP] identifier[String] identifier[direction] operator[=] identifier[clause] operator[SEP] identifier[sort] operator[==] identifier[FieldSort] operator[SEP] identifier[Direction] operator[SEP] identifier[ASCENDING] operator[?] literal[String] operator[:] literal[String] operator[SEP] identifier[String] identifier[orderClause] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[fieldName] , identifier[direction] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] operator[SEP] identifier[orderClauses] operator[SEP] identifier[add] operator[SEP] identifier[orderClause] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[String] operator[>] identifier[parameterList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[whereClause] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[docIdSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[SMALL_RESULT_SET_SIZE_THRESHOLD] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[placeholders] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[docId] operator[:] identifier[docIdSet] operator[SEP] {
identifier[placeholders] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[parameterList] operator[SEP] identifier[add] operator[SEP] identifier[docId] operator[SEP] operator[SEP]
}
identifier[whereClause] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[Misc] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[placeholders] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[orderBy] operator[=] identifier[Misc] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[orderClauses] operator[SEP] operator[SEP] identifier[String] identifier[sql] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[indexTable] , identifier[whereClause] , identifier[orderBy] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[parameters] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[parameterList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[SqlParts] operator[SEP] identifier[partsForSql] operator[SEP] identifier[sql] , identifier[parameterList] operator[SEP] identifier[toArray] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] operator[SEP]
}
|
public List<Note> getMergeRequestNotes(Object projectIdOrPath, Integer mergeRequestIid, int page, int perPage) throws GitLabApiException {
return (getMergeRequestNotes(projectIdOrPath, mergeRequestIid, null, null, page, perPage));
}
|
class class_name[name] begin[{]
method[getMergeRequestNotes, return_type[type[List]], modifier[public], parameter[projectIdOrPath, mergeRequestIid, page, perPage]] begin[{]
return[call[.getMergeRequestNotes, parameter[member[.projectIdOrPath], member[.mergeRequestIid], literal[null], literal[null], member[.page], member[.perPage]]]]
end[}]
END[}]
|
Keyword[public] identifier[List] operator[<] identifier[Note] operator[>] identifier[getMergeRequestNotes] operator[SEP] identifier[Object] identifier[projectIdOrPath] , identifier[Integer] identifier[mergeRequestIid] , Keyword[int] identifier[page] , Keyword[int] identifier[perPage] operator[SEP] Keyword[throws] identifier[GitLabApiException] {
Keyword[return] operator[SEP] identifier[getMergeRequestNotes] operator[SEP] identifier[projectIdOrPath] , identifier[mergeRequestIid] , Other[null] , Other[null] , identifier[page] , identifier[perPage] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setXPEXTENT(Integer newXPEXTENT) {
Integer oldXPEXTENT = xpextent;
xpextent = newXPEXTENT;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.PTD1__XPEXTENT, oldXPEXTENT, xpextent));
}
|
class class_name[name] begin[{]
method[setXPEXTENT, return_type[void], modifier[public], parameter[newXPEXTENT]] begin[{]
local_variable[type[Integer], oldXPEXTENT]
assign[member[.xpextent], member[.newXPEXTENT]]
if[call[.eNotificationRequired, parameter[]]] begin[{]
call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=PTD1__XPEXTENT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldXPEXTENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xpextent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ENotificationImpl, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setXPEXTENT] operator[SEP] identifier[Integer] identifier[newXPEXTENT] operator[SEP] {
identifier[Integer] identifier[oldXPEXTENT] operator[=] identifier[xpextent] operator[SEP] identifier[xpextent] operator[=] identifier[newXPEXTENT] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[PTD1__XPEXTENT] , identifier[oldXPEXTENT] , identifier[xpextent] operator[SEP] operator[SEP] operator[SEP]
}
|
public static List<String> readLines(CharSequence self) throws IOException {
return IOGroovyMethods.readLines(new StringReader(self.toString()));
}
|
class class_name[name] begin[{]
method[readLines, return_type[type[List]], modifier[public static], parameter[self]] begin[{]
return[call[IOGroovyMethods.readLines, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=self, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringReader, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[readLines] operator[SEP] identifier[CharSequence] identifier[self] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[IOGroovyMethods] operator[SEP] identifier[readLines] operator[SEP] Keyword[new] identifier[StringReader] operator[SEP] identifier[self] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setStyle(StyleRow styleRow, GeometryType geometryType) {
if (geometryType != null) {
if (styleRow != null) {
styles.put(geometryType, styleRow);
} else {
styles.remove(geometryType);
}
} else {
defaultStyle = styleRow;
}
}
|
class class_name[name] begin[{]
method[setStyle, return_type[void], modifier[public], parameter[styleRow, geometryType]] begin[{]
if[binary_operation[member[.geometryType], !=, literal[null]]] begin[{]
if[binary_operation[member[.styleRow], !=, literal[null]]] begin[{]
call[styles.put, parameter[member[.geometryType], member[.styleRow]]]
else begin[{]
call[styles.remove, parameter[member[.geometryType]]]
end[}]
else begin[{]
assign[member[.defaultStyle], member[.styleRow]]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setStyle] operator[SEP] identifier[StyleRow] identifier[styleRow] , identifier[GeometryType] identifier[geometryType] operator[SEP] {
Keyword[if] operator[SEP] identifier[geometryType] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[styleRow] operator[!=] Other[null] operator[SEP] {
identifier[styles] operator[SEP] identifier[put] operator[SEP] identifier[geometryType] , identifier[styleRow] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[styles] operator[SEP] identifier[remove] operator[SEP] identifier[geometryType] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[defaultStyle] operator[=] identifier[styleRow] operator[SEP]
}
}
|
public static base_responses clear(nitro_service client, gslbldnsentries resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
gslbldnsentries clearresources[] = new gslbldnsentries[resources.length];
for (int i=0;i<resources.length;i++){
clearresources[i] = new gslbldnsentries();
}
result = perform_operation_bulk_request(client, clearresources,"clear");
}
return result;
}
|
class class_name[name] begin[{]
method[clear, return_type[type[base_responses]], modifier[public static], parameter[client, resources]] begin[{]
local_variable[type[base_responses], result]
if[binary_operation[binary_operation[member[.resources], !=, literal[null]], &&, binary_operation[member[resources.length], >, literal[0]]]] begin[{]
local_variable[type[gslbldnsentries], clearresources]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=clearresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=gslbldnsentries, 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=resources, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.result], call[.perform_operation_bulk_request, parameter[member[.client], member[.clearresources], literal["clear"]]]]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[base_responses] identifier[clear] operator[SEP] identifier[nitro_service] identifier[client] , identifier[gslbldnsentries] identifier[resources] operator[SEP] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[base_responses] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[!=] Other[null] operator[&&] identifier[resources] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[gslbldnsentries] identifier[clearresources] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[gslbldnsentries] operator[SEP] identifier[resources] 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[resources] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[clearresources] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[gslbldnsentries] operator[SEP] operator[SEP] operator[SEP]
}
identifier[result] operator[=] identifier[perform_operation_bulk_request] operator[SEP] identifier[client] , identifier[clearresources] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static final Mem tword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
return _ptr_build_abs(target, disp, segmentPrefix, SIZE_TWORD);
}
|
class class_name[name] begin[{]
method[tword_ptr_abs, return_type[type[Mem]], modifier[final public static], parameter[target, disp, segmentPrefix]] begin[{]
return[call[._ptr_build_abs, parameter[member[.target], member[.disp], member[.segmentPrefix], member[.SIZE_TWORD]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[final] identifier[Mem] identifier[tword_ptr_abs] operator[SEP] Keyword[long] identifier[target] , Keyword[long] identifier[disp] , identifier[SEGMENT] identifier[segmentPrefix] operator[SEP] {
Keyword[return] identifier[_ptr_build_abs] operator[SEP] identifier[target] , identifier[disp] , identifier[segmentPrefix] , identifier[SIZE_TWORD] operator[SEP] operator[SEP]
}
|
@Override
public boolean rename(String newStorageName) {
assertConnectionOpen();
if(storageName.equals(newStorageName)) {
return false;
}
blockedStorageClose(StorageType.PRIMARY_STORAGE);
blockedStorageClose(StorageType.SECONDARY_STORAGE);
try {
moveDirectory(getRootPath(storageName), getRootPath(newStorageName));
}
catch (IOException ex) {
throw new UncheckedIOException(ex);
}
logger.trace("Renamed storage {} to {}", storageName, newStorageName);
storageName = newStorageName;
return true;
}
|
class class_name[name] begin[{]
method[rename, return_type[type[boolean]], modifier[public], parameter[newStorageName]] begin[{]
call[.assertConnectionOpen, parameter[]]
if[call[storageName.equals, parameter[member[.newStorageName]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
call[.blockedStorageClose, parameter[member[StorageType.PRIMARY_STORAGE]]]
call[.blockedStorageClose, parameter[member[StorageType.SECONDARY_STORAGE]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=storageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=newStorageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=moveDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UncheckedIOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None)
call[logger.trace, parameter[literal["Renamed storage {} to {}"], member[.storageName], member[.newStorageName]]]
assign[member[.storageName], member[.newStorageName]]
return[literal[true]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[rename] operator[SEP] identifier[String] identifier[newStorageName] operator[SEP] {
identifier[assertConnectionOpen] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[storageName] operator[SEP] identifier[equals] operator[SEP] identifier[newStorageName] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[blockedStorageClose] operator[SEP] identifier[StorageType] operator[SEP] identifier[PRIMARY_STORAGE] operator[SEP] operator[SEP] identifier[blockedStorageClose] operator[SEP] identifier[StorageType] operator[SEP] identifier[SECONDARY_STORAGE] operator[SEP] operator[SEP] Keyword[try] {
identifier[moveDirectory] operator[SEP] identifier[getRootPath] operator[SEP] identifier[storageName] operator[SEP] , identifier[getRootPath] operator[SEP] identifier[newStorageName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UncheckedIOException] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[storageName] , identifier[newStorageName] operator[SEP] operator[SEP] identifier[storageName] operator[=] identifier[newStorageName] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
private ItemData updatePathIfNeeded(ItemData data) throws IllegalPathException
{
if (data == null || changesLog.getAllPathsChanged() == null)
return data;
List<ItemState> states = changesLog.getAllPathsChanged();
for (int i = 0, length = states.size(); i < length; i++)
{
ItemState state = states.get(i);
if (data.getQPath().isDescendantOf(state.getOldPath()))
{
data = updatePath(state.getOldPath(), state.getData().getQPath(), data);
}
}
return data;
}
|
class class_name[name] begin[{]
method[updatePathIfNeeded, return_type[type[ItemData]], modifier[private], parameter[data]] begin[{]
if[binary_operation[binary_operation[member[.data], ==, literal[null]], ||, binary_operation[call[changesLog.getAllPathsChanged, parameter[]], ==, literal[null]]]] begin[{]
return[member[.data]]
else begin[{]
None
end[}]
local_variable[type[List], states]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=states, selectors=[], type_arguments=None), name=state)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ItemState, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getQPath, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOldPath, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[], type_arguments=None)], member=isDescendantOf, 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=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOldPath, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[MethodInvocation(arguments=[], member=getQPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updatePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=states, selectors=[], type_arguments=None), name=length)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.data]]
end[}]
END[}]
|
Keyword[private] identifier[ItemData] identifier[updatePathIfNeeded] operator[SEP] identifier[ItemData] identifier[data] operator[SEP] Keyword[throws] identifier[IllegalPathException] {
Keyword[if] operator[SEP] identifier[data] operator[==] Other[null] operator[||] identifier[changesLog] operator[SEP] identifier[getAllPathsChanged] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] Keyword[return] identifier[data] operator[SEP] identifier[List] operator[<] identifier[ItemState] operator[>] identifier[states] operator[=] identifier[changesLog] operator[SEP] identifier[getAllPathsChanged] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[length] operator[=] identifier[states] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[ItemState] identifier[state] operator[=] identifier[states] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[getQPath] operator[SEP] operator[SEP] operator[SEP] identifier[isDescendantOf] operator[SEP] identifier[state] operator[SEP] identifier[getOldPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[data] operator[=] identifier[updatePath] operator[SEP] identifier[state] operator[SEP] identifier[getOldPath] operator[SEP] operator[SEP] , identifier[state] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[getQPath] operator[SEP] operator[SEP] , identifier[data] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[data] operator[SEP]
}
|
public String getTableNames(boolean bAddQuotes)
{
return (m_tableName == null) ? Record.formatTableNames(USER_LOG_FILE, bAddQuotes) : super.getTableNames(bAddQuotes);
}
|
class class_name[name] begin[{]
method[getTableNames, return_type[type[String]], modifier[public], parameter[bAddQuotes]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=m_tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=SuperMethodInvocation(arguments=[MemberReference(member=bAddQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTableNames, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=USER_LOG_FILE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bAddQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=formatTableNames, postfix_operators=[], prefix_operators=[], qualifier=Record, selectors=[], type_arguments=None))]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[getTableNames] operator[SEP] Keyword[boolean] identifier[bAddQuotes] operator[SEP] {
Keyword[return] operator[SEP] identifier[m_tableName] operator[==] Other[null] operator[SEP] operator[?] identifier[Record] operator[SEP] identifier[formatTableNames] operator[SEP] identifier[USER_LOG_FILE] , identifier[bAddQuotes] operator[SEP] operator[:] Keyword[super] operator[SEP] identifier[getTableNames] operator[SEP] identifier[bAddQuotes] operator[SEP] operator[SEP]
}
|
public Observable<List<EntityRole>> getPatternAnyEntityRolesAsync(UUID appId, String versionId, UUID entityId) {
return getPatternAnyEntityRolesWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<List<EntityRole>>, List<EntityRole>>() {
@Override
public List<EntityRole> call(ServiceResponse<List<EntityRole>> response) {
return response.body();
}
});
}
|
class class_name[name] begin[{]
method[getPatternAnyEntityRolesAsync, return_type[type[Observable]], modifier[public], parameter[appId, versionId, entityId]] begin[{]
return[call[.getPatternAnyEntityRolesWithServiceResponseAsync, parameter[member[.appId], member[.versionId], member[.entityId]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[List] operator[<] identifier[EntityRole] operator[>] operator[>] identifier[getPatternAnyEntityRolesAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[UUID] identifier[entityId] operator[SEP] {
Keyword[return] identifier[getPatternAnyEntityRolesWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] , identifier[entityId] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[EntityRole] operator[>] operator[>] , identifier[List] operator[<] identifier[EntityRole] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[EntityRole] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[EntityRole] operator[>] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static MessageSecurityMetadataSource createExpressionMessageMetadataSource(
LinkedHashMap<MessageMatcher<?>, String> matcherToExpression, SecurityExpressionHandler<Message<Object>> handler) {
LinkedHashMap<MessageMatcher<?>, Collection<ConfigAttribute>> matcherToAttrs = new LinkedHashMap<MessageMatcher<?>, Collection<ConfigAttribute>>();
for (Map.Entry<MessageMatcher<?>, String> entry : matcherToExpression.entrySet()) {
MessageMatcher<?> matcher = entry.getKey();
String rawExpression = entry.getValue();
Expression expression = handler.getExpressionParser().parseExpression(
rawExpression);
ConfigAttribute attribute = new MessageExpressionConfigAttribute(expression);
matcherToAttrs.put(matcher, Arrays.asList(attribute));
}
return new DefaultMessageSecurityMetadataSource(matcherToAttrs);
}
|
class class_name[name] begin[{]
method[createExpressionMessageMetadataSource, return_type[type[MessageSecurityMetadataSource]], modifier[public static], parameter[matcherToExpression, handler]] begin[{]
local_variable[type[LinkedHashMap], matcherToAttrs]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=matcher)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=MessageMatcher, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=rawExpression)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getExpressionParser, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[MethodInvocation(arguments=[MemberReference(member=rawExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseExpression, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=expression)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Expression, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=expression, 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=MessageExpressionConfigAttribute, sub_type=None)), name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigAttribute, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=matcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=matcherToAttrs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=matcherToExpression, 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=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=MessageMatcher, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[ClassCreator(arguments=[MemberReference(member=matcherToAttrs, 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=DefaultMessageSecurityMetadataSource, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[MessageSecurityMetadataSource] identifier[createExpressionMessageMetadataSource] operator[SEP] identifier[LinkedHashMap] operator[<] identifier[MessageMatcher] operator[<] operator[?] operator[>] , identifier[String] operator[>] identifier[matcherToExpression] , identifier[SecurityExpressionHandler] operator[<] identifier[Message] operator[<] identifier[Object] operator[>] operator[>] identifier[handler] operator[SEP] {
identifier[LinkedHashMap] operator[<] identifier[MessageMatcher] operator[<] operator[?] operator[>] , identifier[Collection] operator[<] identifier[ConfigAttribute] operator[>] operator[>] identifier[matcherToAttrs] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[MessageMatcher] operator[<] operator[?] operator[>] , identifier[Collection] operator[<] identifier[ConfigAttribute] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[MessageMatcher] operator[<] operator[?] operator[>] , identifier[String] operator[>] identifier[entry] operator[:] identifier[matcherToExpression] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[MessageMatcher] operator[<] operator[?] operator[>] identifier[matcher] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[rawExpression] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Expression] identifier[expression] operator[=] identifier[handler] operator[SEP] identifier[getExpressionParser] operator[SEP] operator[SEP] operator[SEP] identifier[parseExpression] operator[SEP] identifier[rawExpression] operator[SEP] operator[SEP] identifier[ConfigAttribute] identifier[attribute] operator[=] Keyword[new] identifier[MessageExpressionConfigAttribute] operator[SEP] identifier[expression] operator[SEP] operator[SEP] identifier[matcherToAttrs] operator[SEP] identifier[put] operator[SEP] identifier[matcher] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[DefaultMessageSecurityMetadataSource] operator[SEP] identifier[matcherToAttrs] operator[SEP] operator[SEP]
}
|
private ArrayList<Rect> calculateAllBounds(Paint paint) {
ArrayList<Rect> list = new ArrayList<Rect>();
//For each views (If no values then add a fake one)
final int count = mRecyclerView.getAdapter().getItemCount();
final int width = getWidth();
final int halfWidth = width / 2;
for (int i = 0; i < count; i++) {
Rect bounds = calcBounds(i, paint);
int w = bounds.right - bounds.left;
int h = bounds.bottom - bounds.top;
bounds.left = (int)(halfWidth - (w / 2f) + ((i - mCurrentPage - mPageOffset) * width));
bounds.right = bounds.left + w;
bounds.top = 0;
bounds.bottom = h;
list.add(bounds);
}
return list;
}
|
class class_name[name] begin[{]
method[calculateAllBounds, return_type[type[ArrayList]], modifier[private], parameter[paint]] begin[{]
local_variable[type[ArrayList], list]
local_variable[type[int], count]
local_variable[type[int], width]
local_variable[type[int], halfWidth]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=calcBounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=bounds)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Rect, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), operandr=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), operator=-), name=w)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=bottom, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), operandr=MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), operator=-), name=h)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=halfWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2f), operator=/), operator=-), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mCurrentPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=mPageOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), type=BasicType(dimensions=[], name=int))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), operandr=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bottom, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), type==, value=MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.list]]
end[}]
END[}]
|
Keyword[private] identifier[ArrayList] operator[<] identifier[Rect] operator[>] identifier[calculateAllBounds] operator[SEP] identifier[Paint] identifier[paint] operator[SEP] {
identifier[ArrayList] operator[<] identifier[Rect] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Rect] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[count] operator[=] identifier[mRecyclerView] operator[SEP] identifier[getAdapter] operator[SEP] operator[SEP] operator[SEP] identifier[getItemCount] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[width] operator[=] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[halfWidth] operator[=] identifier[width] operator[/] Other[2] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Rect] identifier[bounds] operator[=] identifier[calcBounds] operator[SEP] identifier[i] , identifier[paint] operator[SEP] operator[SEP] Keyword[int] identifier[w] operator[=] identifier[bounds] operator[SEP] identifier[right] operator[-] identifier[bounds] operator[SEP] identifier[left] operator[SEP] Keyword[int] identifier[h] operator[=] identifier[bounds] operator[SEP] identifier[bottom] operator[-] identifier[bounds] operator[SEP] identifier[top] operator[SEP] identifier[bounds] operator[SEP] identifier[left] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[halfWidth] operator[-] operator[SEP] identifier[w] operator[/] literal[Float] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[i] operator[-] identifier[mCurrentPage] operator[-] identifier[mPageOffset] operator[SEP] operator[*] identifier[width] operator[SEP] operator[SEP] operator[SEP] identifier[bounds] operator[SEP] identifier[right] operator[=] identifier[bounds] operator[SEP] identifier[left] operator[+] identifier[w] operator[SEP] identifier[bounds] operator[SEP] identifier[top] operator[=] Other[0] operator[SEP] identifier[bounds] operator[SEP] identifier[bottom] operator[=] identifier[h] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[bounds] operator[SEP] operator[SEP]
}
Keyword[return] identifier[list] operator[SEP]
}
|
public static StringUtils getStringUtils() {
if (stringUtils == null) {
try {
Class clazz = Class.forName(STRING_UTILS);
stringUtils = (StringUtils) clazz.newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
LOGGER.warn("Cannot instanciate util: {}", e.getMessage());
throw new IllegalStateException(e);
}
}
return stringUtils;
}
|
class class_name[name] begin[{]
method[getStringUtils, return_type[type[StringUtils]], modifier[public static], parameter[]] begin[{]
if[binary_operation[member[.stringUtils], ==, literal[null]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=STRING_UTILS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stringUtils, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=StringUtils, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot instanciate util: {}"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), 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=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException', 'InstantiationException', 'IllegalAccessException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.stringUtils]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[StringUtils] identifier[getStringUtils] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[stringUtils] operator[==] Other[null] operator[SEP] {
Keyword[try] {
identifier[Class] identifier[clazz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[STRING_UTILS] operator[SEP] operator[SEP] identifier[stringUtils] operator[=] operator[SEP] identifier[StringUtils] operator[SEP] identifier[clazz] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] operator[|] identifier[InstantiationException] operator[|] identifier[IllegalAccessException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[stringUtils] operator[SEP]
}
|
@Nonnull
public static ICommonsList <String> getSplitToList (@Nullable final CharSequence sText,
@Nonnull @RegEx final String sRegEx)
{
return new CommonsArrayList <> (getSplitToArray (sText, sRegEx));
}
|
class class_name[name] begin[{]
method[getSplitToList, return_type[type[ICommonsList]], modifier[public static], parameter[sText, sRegEx]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=sText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sRegEx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSplitToArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=CommonsArrayList, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[ICommonsList] operator[<] identifier[String] operator[>] identifier[getSplitToList] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[CharSequence] identifier[sText] , annotation[@] identifier[Nonnull] annotation[@] identifier[RegEx] Keyword[final] identifier[String] identifier[sRegEx] operator[SEP] {
Keyword[return] Keyword[new] identifier[CommonsArrayList] operator[<] operator[>] operator[SEP] identifier[getSplitToArray] operator[SEP] identifier[sText] , identifier[sRegEx] operator[SEP] operator[SEP] operator[SEP]
}
|
private String getObjectOID(org.omg.CORBA.Object object) {
String oid = null;
try {
byte[] oidBytes = this.poa.reference_to_id(object);
if (oidBytes != null)
oid = new String(oidBytes, StandardCharsets.UTF_8);
} catch (Exception e) {
IIOPLogger.ROOT_LOGGER.debug("Unable to obtain id from object", e);
}
return oid;
}
|
class class_name[name] begin[{]
method[getObjectOID, return_type[type[String]], modifier[private], parameter[object]] begin[{]
local_variable[type[String], oid]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=poa, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reference_to_id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=oidBytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=oidBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=oidBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=StandardCharsets, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))), label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to obtain id from object"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=IIOPLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.oid]]
end[}]
END[}]
|
Keyword[private] identifier[String] identifier[getObjectOID] operator[SEP] identifier[org] operator[SEP] identifier[omg] operator[SEP] identifier[CORBA] operator[SEP] identifier[Object] identifier[object] operator[SEP] {
identifier[String] identifier[oid] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[byte] operator[SEP] operator[SEP] identifier[oidBytes] operator[=] Keyword[this] operator[SEP] identifier[poa] operator[SEP] identifier[reference_to_id] operator[SEP] identifier[object] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oidBytes] operator[!=] Other[null] operator[SEP] identifier[oid] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[oidBytes] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[IIOPLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[oid] operator[SEP]
}
|
public final @NotNull S isGreaterThanOrEqualTo(@Nullable T other) {
isNotNull();
if (actual.compareTo(other) >= 0) {
return myself();
}
failIfCustomMessageIsSet();
throw failure(unexpectedLessThan(actual, other));
}
|
class class_name[name] begin[{]
method[isGreaterThanOrEqualTo, return_type[type[S]], modifier[final public], parameter[other]] begin[{]
call[.isNotNull, parameter[]]
if[binary_operation[call[actual.compareTo, parameter[member[.other]]], >=, literal[0]]] begin[{]
return[call[.myself, parameter[]]]
else begin[{]
None
end[}]
call[.failIfCustomMessageIsSet, parameter[]]
ThrowStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpectedLessThan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[final] annotation[@] identifier[NotNull] identifier[S] identifier[isGreaterThanOrEqualTo] operator[SEP] annotation[@] identifier[Nullable] identifier[T] identifier[other] operator[SEP] {
identifier[isNotNull] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[actual] operator[SEP] identifier[compareTo] operator[SEP] identifier[other] operator[SEP] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[myself] operator[SEP] operator[SEP] operator[SEP]
}
identifier[failIfCustomMessageIsSet] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[failure] operator[SEP] identifier[unexpectedLessThan] operator[SEP] identifier[actual] , identifier[other] operator[SEP] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.