[FE Code Style][sub] Adjust some check rules (#9345)

Adjust `RedundantImport`,`UnusedImports`,`EmptyStatement`,`NewlineAtEndOfFile`,`UpperEll`, `AvoidStarImport`, `MissingOverride` rules.
This commit is contained in:
leo65535
2022-05-04 23:34:55 +08:00
committed by GitHub
parent f1aa9668af
commit c5941fd166
99 changed files with 116 additions and 110 deletions

View File

@ -70,4 +70,4 @@ public class AdminCancelRebalanceDiskStmt extends DdlStmt {
public RedirectStatus getRedirectStatus() {
return RedirectStatus.NO_FORWARD;
}
}
}

View File

@ -70,4 +70,4 @@ public class AdminCleanTrashStmt extends DdlStmt {
public RedirectStatus getRedirectStatus() {
return RedirectStatus.NO_FORWARD;
}
}
}

View File

@ -76,4 +76,4 @@ public class AdminRebalanceDiskStmt extends DdlStmt {
public RedirectStatus getRedirectStatus() {
return RedirectStatus.NO_FORWARD;
}
}
}

View File

@ -26,4 +26,4 @@ public enum AlterUserType {
private AlterUserType(String type) {
this.type = type;
}
}
}

View File

@ -127,4 +127,4 @@ public class BackupStmt extends AbstractBackupStmt {
sb.append("\n)");
return sb.toString();
}
}
}

View File

@ -64,4 +64,4 @@ public class BinlogDesc {
}
dataSyncJobType = DataSyncJobType.fromString(properties.get(TYPE));
}
}
}

View File

@ -133,4 +133,4 @@ public class CreateDataSyncJobStmt extends DdlStmt {
public DataSyncJobType getDataSyncJobType() {
return dataSyncJobType;
}
}
}

View File

@ -47,7 +47,7 @@ public class DescriptorTable {
private final HashMap<TupleId, TupleDescriptor> tupleDescs = new HashMap<TupleId, TupleDescriptor>();
// List of referenced tables with no associated TupleDescriptor to ship to the BE.
// For example, the output table of an insert query.
private final List<Table> referencedTables = new ArrayList<Table>();;
private final List<Table> referencedTables = new ArrayList<Table>();
private final IdGenerator<TupleId> tupleIdGenerator_ = TupleId.createGenerator();
private final IdGenerator<SlotId> slotIdGenerator_ = SlotId.createGenerator();
private final HashMap<SlotId, SlotDescriptor> slotDescs = Maps.newHashMap();

View File

@ -56,4 +56,4 @@ public class JobName {
sb.append("`").append(dbName).append("`.`").append(jobName).append("`");
return sb.toString();
}
}
}

View File

@ -53,4 +53,4 @@ public class PauseSyncJobStmt extends DdlStmt {
stringBuilder.append(jobName.toSql());
return stringBuilder.toString();
}
}
}

View File

@ -53,4 +53,4 @@ public class ResumeSyncJobStmt extends DdlStmt {
stringBuilder.append(jobName.toSql());
return stringBuilder.toString();
}
}
}

View File

@ -94,4 +94,4 @@ public class ShowSyncJobStmt extends ShowStmt {
public RedirectStatus getRedirectStatus() {
return RedirectStatus.FORWARD_NO_SYNC;
}
}
}

View File

@ -51,7 +51,7 @@ public class ShowViewStmt extends ShowStmt {
private String db;
private TableName tbl;
private List<View> matchViews = Lists.newArrayList();;
private List<View> matchViews = Lists.newArrayList();
public ShowViewStmt(String db, TableName tbl) {
this.db = db;

View File

@ -327,7 +327,7 @@ public class StmtRewriter {
private static boolean hasSubqueryInDisjunction(Expr expr) {
if (!(expr instanceof CompoundPredicate)) {
return false;
};
}
if (Expr.IS_OR_PREDICATE.apply(expr)) {
return expr.contains(Subquery.class);
}

View File

@ -53,4 +53,4 @@ public class StopSyncJobStmt extends DdlStmt {
stringBuilder.append(jobName.toSql());
return stringBuilder.toString();
}
}
}

View File

@ -32,4 +32,4 @@ public class SyncStmt extends DdlStmt {
public RedirectStatus getRedirectStatus() {
return RedirectStatus.FORWARD_WITH_SYNC;
}
}
}

View File

@ -42,4 +42,4 @@ public class TransactionBeginStmt extends TransactionStmt {
super.analyze(analyzer);
}
}
}

View File

@ -19,4 +19,4 @@ package org.apache.doris.analysis;
public class TransactionCommitStmt extends TransactionStmt {
}
}

View File

@ -19,4 +19,4 @@ package org.apache.doris.analysis;
public class TransactionRollbackStmt extends TransactionStmt {
}
}

View File

@ -31,4 +31,4 @@ public class TransactionStmt extends StatementBase {
public void analyze(Analyzer analyzer) throws AnalysisException, UserException {
super.analyze(analyzer);
}
}
}

View File

@ -1743,7 +1743,7 @@ public class RestoreJob extends AbstractJob {
out.writeLong(entry.getKey());
out.writeLong(entry.getValue());
// It is version hash in the past, but it useless but should compatible with old version so that write 0 here
out.writeLong(0l);
out.writeLong(0L);
}
}

View File

@ -439,7 +439,7 @@ public class CatalogRecycleBin extends MasterDaemon implements Writable {
if (partitionInfo.getType() == PartitionType.RANGE) {
recoverItem = new RangePartitionItem(recoverRange);
} else if (partitionInfo.getType() == PartitionType.LIST) {
recoverItem = recoverPartitionInfo.getListPartitionItem();;
recoverItem = recoverPartitionInfo.getListPartitionItem();
}
// check if partition item is invalid
if (partitionInfo.getAnyIntersectItem(recoverItem, false) != null) {

View File

@ -142,7 +142,7 @@ public class HashDistributionInfo extends DistributionInfo {
}
builder.append("]; ");
builder.append("bucket num: ").append(bucketNum).append("; ");;
builder.append("bucket num: ").append(bucketNum).append("; ");
return builder.toString();
}

View File

@ -68,4 +68,4 @@ public class MetaReplayState {
return resultMap;
}
}
}

View File

@ -76,4 +76,4 @@ public class MultiRowType extends Type {
structStr = structStr.substring(lpad);
return String.format("%sARRAY<%s>", leftPadding, structStr);
}
}
}

View File

@ -57,7 +57,7 @@ public class TempPartitions implements Writable, GsonPostProcessable {
nameToPartition.put(partition.getName(), partition);
}
public long getUpdateTime() {
long updateTime = -1l;
long updateTime = -1L;
for (Partition p : idToPartition.values()) {
if (p.getVisibleVersionTime() > updateTime) {
updateTime = p.getVisibleVersionTime();

View File

@ -52,4 +52,4 @@ public class DefaultDorisLogger extends ExtendedLoggerWrapper implements Taggabl
super.logMessage(fqcn, level, marker, m, t);
tags.next = null;
}
}
}

View File

@ -58,4 +58,4 @@ public class DeleteInfoProcDir implements ProcNodeInterface {
}
return result;
}
}
}

View File

@ -113,4 +113,4 @@ public class NetUtils {
}
return false;
}
}
}

View File

@ -24,4 +24,4 @@ public enum FrontendNodeType {
REPLICA,
INIT,
UNKNOWN
}
}

View File

@ -30,4 +30,4 @@ public class IllegalArgException extends Exception {
public IllegalArgException(String msg, Throwable cause) {
super(msg, cause);
}
}
}

View File

@ -158,7 +158,6 @@ public class ShowAction extends RestBaseController {
parentThread.getParent() != null;
parentThread = parentThread.getParent()) {
}
;
feInfo.put("thread_cnt", String.valueOf(parentThread.activeCount()));
return ResponseEntityBuilder.ok(feInfo);

View File

@ -225,7 +225,7 @@ public class TableQueryPlanAction extends RestBaseController {
Map<String, Node> tabletRoutings = assemblePrunedPartitions(scanRangeLocations);
tabletRoutings.forEach((tabletId, node) -> {
long tablet = Long.parseLong(tabletId);
tablet_info.put(tablet, new TTabletVersionInfo(tablet, node.version, 0l /*version hash*/, node.schemaHash));
tablet_info.put(tablet, new TTabletVersionInfo(tablet, node.version, 0L /*version hash*/, node.schemaHash));
});
tQueryPlanInfo.tablet_info = tablet_info;

View File

@ -336,4 +336,4 @@ public class QueryProfileAction extends RestBaseController {
}
return ResponseEntityBuilder.ok(graph);
}
}
}

View File

@ -207,4 +207,4 @@ public class LdapClient {
private static String getUserFilter(String userFilter, String userName) {
return userFilter.replaceAll("\\{login}", userName);
}
}
}

View File

@ -489,7 +489,6 @@ public class LoadJob implements Writable {
public void setHadoopEtlJobId(String etlJobId) {
if (etlJobType == EtlJobType.HADOOP) {
((HadoopEtlJobInfo) etlJobInfo).setEtlJobId(etlJobId);
;
}
}

View File

@ -63,7 +63,7 @@ public class PartitionLoadInfo implements Writable {
public void write(DataOutput out) throws IOException {
out.writeLong(version);
// Versionhash useless just for compatible
out.writeLong(0l);
out.writeLong(0L);
int count = 0;
if (sources == null) {

View File

@ -55,10 +55,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

View File

@ -102,4 +102,4 @@ public class SyncChannel {
public void setPartitions(PartitionNames partitionNames) {
this.partitionNames = partitionNames;
}
}
}

View File

@ -23,4 +23,4 @@ public interface SyncChannelCallback {
public void onFailed(String errMsg);
}
}

View File

@ -55,4 +55,4 @@ public class SyncChannelHandle implements SyncChannelCallback {
public Status getStatus() {
return latch.getStatus();
}
}
}

View File

@ -47,4 +47,4 @@ public class SyncDataConsumer extends SyncLifeCycle {
@Override
public void process() {
}
}
}

View File

@ -33,4 +33,4 @@ public class SyncDataReceiver extends SyncLifeCycle {
public void process() {
}
}
}

View File

@ -91,4 +91,4 @@ public class SyncFailMsg implements Writable {
return msgType.equals(other.msgType)
&& msg.equals(other.msg);
}
}
}

View File

@ -467,4 +467,4 @@ public abstract class SyncJob implements Writable {
public long getFinishTimeMs() {
return finishTimeMs;
}
}
}

View File

@ -74,4 +74,4 @@ public abstract class SyncLifeCycle {
}
}
}
}
}

View File

@ -62,4 +62,4 @@ public class SyncTxnParam {
public Backend getBackend() {
return backend;
}
}
}

View File

@ -24,4 +24,4 @@ public class CanalConfigs {
// Maximal waiting time for consumer to poll one batch
public static long pollWaitingTimeoutMs = 80L;
}
}

View File

@ -472,4 +472,4 @@ public class CanalSyncDataConsumer extends SyncDataConsumer {
private void releaseGetLock() {
getLock.unlock();
}
}
}

View File

@ -113,4 +113,4 @@ public class CanalSyncDataReceiver extends SyncDataReceiver {
private void releaseGetLock() {
getLock.unlock();
}
}
}

View File

@ -234,4 +234,4 @@ public class CanalUtils {
return false;
}
}
}
}

View File

@ -113,4 +113,4 @@ public class SyncCanalClient {
public String getPositionInfo() {
return consumer.getPositionInfo();
}
}
}

View File

@ -49,4 +49,4 @@ public class Data<T> {
public boolean isNotEmpty() {
return datas.size() > 0;
}
}
}

View File

@ -70,4 +70,4 @@ public class Events<T, P> {
public long getMemSize() {
return this.memSize;
}
}
}

View File

@ -173,4 +173,4 @@ public class EntryPosition {
}
return result;
}
}
}

View File

@ -95,4 +95,4 @@ public class PositionMeta<T> {
this.batches.clear();
this.commitPositions.clear();
}
}
}

View File

@ -85,4 +85,4 @@ public class PositionRange<T> {
return true;
}
}
}

View File

@ -82,7 +82,7 @@ public class PaloAuth implements Writable {
private TablePrivTable tablePrivTable = new TablePrivTable();
private ResourcePrivTable resourcePrivTable = new ResourcePrivTable();
private RoleManager roleManager = new RoleManager();;
private RoleManager roleManager = new RoleManager();
private UserPropertyMgr propertyMgr = new UserPropertyMgr();
private LdapInfo ldapInfo = new LdapInfo();

View File

@ -88,4 +88,4 @@ public class RefreshExternalTableInfo implements Writable {
return (dbName.equals(info.dbName))
&& (tableName.equals(info.tableName)) && (newSchema.equals(newSchema));
}
}
}

View File

@ -409,4 +409,4 @@ public class GsonUtils {
}
}
}
}

View File

@ -321,4 +321,4 @@ public final class RuntimeTypeAdapterFactory<T> implements TypeAdapterFactory {
}
}.nullSafe();
}
}
}

View File

@ -71,4 +71,4 @@ public class OdbcTableSink extends DataSink {
public DataPartition getOutputPartition() {
return null;
}
}
}

View File

@ -454,4 +454,4 @@ public final class RuntimeFilter {
Joiner.on(", ").join(targets) + " " +
"Selectivity: " + getSelectivity();
}
}
}

View File

@ -199,4 +199,4 @@ class PluginZip {
InputStream getInputStreamFromUrl(String url) throws IOException {
return Util.getInputStreamFromUrl(url, null, HTTP_TIMEOUT_MS, HTTP_TIMEOUT_MS);
}
}
}

View File

@ -23,7 +23,6 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.doris.qe.QueryDetail;
// Queue of QueryDetail.
// It's used to collect queries for monitor.

View File

@ -562,7 +562,6 @@ public class PartitionRange {
return null;
}
PartitionColumnFilter partitionColumnFilter = new PartitionColumnFilter();
;
for (Expr expr : partitionKeyPredicate.getChildren()) {
if (expr instanceof BinaryPredicate) {
BinaryPredicate binPredicate = (BinaryPredicate) expr;

View File

@ -30,4 +30,4 @@ public @interface FEFunction {
String[] argTypes();
String returnType();
}
}

View File

@ -44,7 +44,7 @@ public class CheckConsistencyTask extends AgentTask {
}
public TCheckConsistencyReq toThrift() {
TCheckConsistencyReq request = new TCheckConsistencyReq(tabletId, schemaHash, version, 0l);
TCheckConsistencyReq request = new TCheckConsistencyReq(tabletId, schemaHash, version, 0L);
return request;
}
}

View File

@ -151,4 +151,4 @@ public class UpdateTabletMetaInfoTask extends AgentTask {
updateTabletMetaInfoReq.setTabletMetaInfos(metaInfos);
return updateTabletMetaInfoReq;
}
}
}

View File

@ -30,4 +30,4 @@ public class IllegalTransactionParameterException extends UserException {
public IllegalTransactionParameterException(String msg, Throwable e) {
super(msg, e);
}
}
}

View File

@ -122,4 +122,4 @@ public class AlterTableStmtTest {
stmt.toSql());
Assert.assertEquals("testCluster:testDb", stmt.getTbl().getDb());
}
}
}

View File

@ -123,4 +123,4 @@ public class BinaryPredicateTest {
Assert.assertFalse(range.hasLowerBound());
}
}
}

View File

@ -44,4 +44,4 @@ public class ColumnPositionTest {
pos.analyze();
Assert.fail("No exception throws.");
}
}
}

View File

@ -180,4 +180,4 @@ public class CreateDataSyncJobStmtTest {
} catch (UserException e) {
}
}
}
}

View File

@ -86,4 +86,4 @@ public class CreateDbStmtTest {
stmt.analyze(analyzer);
Assert.fail("No exception throws.");
}
}
}

View File

@ -49,4 +49,4 @@ public class CreateIndexClauseTest {
clause.analyze(analyzer);
}
}
}

View File

@ -323,4 +323,4 @@ public class BrokerUtilTest {
Assert.fail(e.getMessage());
}
}
}
}

View File

@ -409,4 +409,4 @@ public class CanalSyncJobTest {
Assert.fail(e.getMessage());
}
}
}
}

View File

@ -91,4 +91,4 @@ public class CanalTestUtil {
}
}
}

View File

@ -118,4 +118,4 @@ public class AuditEventProcessorTest {
long total = System.currentTimeMillis() - start;
System.out.println("total(ms): " + total + ", avg: " + total / 10000.0);
}
}
}