You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/02/19 10:35:35 UTC

[shardingsphere] branch master updated: Minor refactor and code cleanup (#15514)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 4135ba2  Minor refactor and code cleanup (#15514)
4135ba2 is described below

commit 4135ba24d886a293c8e344ba2d09f084e7611800
Author: 吴伟杰 <wu...@apache.org>
AuthorDate: Sat Feb 19 18:34:33 2022 +0800

    Minor refactor and code cleanup (#15514)
---
 .../db/protocol/error/CustomizedErrorCode.java     | 35 ----------------------
 .../select/projection/ProjectionsContext.java      |  4 +--
 2 files changed, 2 insertions(+), 37 deletions(-)

diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/main/java/org/apache/shardingsphere/db/protocol/error/CustomizedErrorCode.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/main/java/org/apache/shardingsphere/db/protocol/error/CustomizedErrorCode.java
deleted file mode 100644
index 07c415d..0000000
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/main/java/org/apache/shardingsphere/db/protocol/error/CustomizedErrorCode.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.db.protocol.error;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-/**
- * Customized error code.
- */
-@RequiredArgsConstructor
-@Getter
-public final class CustomizedErrorCode implements SQLErrorCode {
-    
-    private final int errorCode;
-    
-    private final String sqlState;
-    
-    private final String errorMessage;
-}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/ProjectionsContext.java b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/ProjectionsContext.java
index e4a5a07..26f2fb0 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/ProjectionsContext.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/ProjectionsContext.java
@@ -46,7 +46,7 @@ public final class ProjectionsContext {
     
     private final Collection<Projection> projections;
     
-    private final Collection<AggregationDistinctProjection> aggregationDistinctProjections = new LinkedList<>();
+    private final Collection<AggregationDistinctProjection> aggregationDistinctProjections;
     
     private final List<Projection> expandProjections;
     
@@ -55,7 +55,7 @@ public final class ProjectionsContext {
         this.stopIndex = stopIndex;
         this.distinctRow = distinctRow;
         this.projections = projections;
-        aggregationDistinctProjections.addAll(createAggregationDistinctProjections());
+        aggregationDistinctProjections = createAggregationDistinctProjections();
         expandProjections = expandProjections();
     }