You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2021/09/27 10:09:57 UTC

[GitHub] [phoenix] richardantal commented on a change in pull request #1319: PHOENIX-6557 Fix code problems flagged by SpotBugs as High priority

richardantal commented on a change in pull request #1319:
URL: https://github.com/apache/phoenix/pull/1319#discussion_r716462029



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/JONIPattern.java
##########
@@ -17,6 +17,7 @@
  */
 package org.apache.phoenix.expression.util.regex;
 
+import java.nio.charset.StandardCharsets;

Review comment:
       Not used

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
##########
@@ -117,6 +117,7 @@
 
 import org.apache.phoenix.thirdparty.com.google.common.collect.Lists;
 
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;

Review comment:
       not used

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/parse/PFunction.java
##########
@@ -101,11 +101,11 @@ public PFunction(PName tenantId, String functionName, List<FunctionArgument> arg
         this.returnType = PNameFactory.newName(returnType);
         this.functionKey = new PTableKey(this.tenantId, this.functionName.getString());
         this.timeStamp = timeStamp;
-        int estimatedSize = SizedUtil.OBJECT_SIZE * 2 + 23 * SizedUtil.POINTER_SIZE + 4 * SizedUtil.INT_SIZE + 2 * SizedUtil.LONG_SIZE + 2 * SizedUtil.INT_OBJECT_SIZE +
+        estimatedSize = SizedUtil.OBJECT_SIZE * 2 + 23 * SizedUtil.POINTER_SIZE + 4 * SizedUtil.INT_SIZE + 2 * SizedUtil.LONG_SIZE + 2 * SizedUtil.INT_OBJECT_SIZE +

Review comment:
       We could use `this.estimatedSize` here to be more consistent ant with the other lines.

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java
##########
@@ -22,16 +22,20 @@
 import static org.apache.phoenix.schema.types.PDataType.ARRAY_TYPE_SUFFIX;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileReader;

Review comment:
       `java.io.FileReader` not used anymore

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionlessQueryServicesImpl.java
##########
@@ -718,10 +718,6 @@ public void addSchema(PSchema schema) throws SQLException {
 
     @Override
     public MetaDataMutationResult getSchema(String schemaName, long clientTimestamp) throws SQLException {
-        try {
-            PSchema schema = metaData.getSchema(new PTableKey(null, schemaName));
-            new MetaDataMutationResult(MutationCode.SCHEMA_ALREADY_EXISTS, schema, 0);

Review comment:
       I see that your change behaves the same way as it was before but, shouldn't we return this?

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/mapreduce/MultiHfileOutputFormat.java
##########
@@ -493,6 +498,7 @@ private static void writePartitions(Configuration conf, Path partitionsPath,
         TreeSet<TableRowkeyPair> sorted = new TreeSet<TableRowkeyPair>(tablesStartKeys);
 
         TableRowkeyPair first = sorted.first();
+

Review comment:
       nit: extra line

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -312,6 +312,8 @@
 import org.apache.phoenix.thirdparty.com.google.common.collect.Maps;
 import org.apache.phoenix.thirdparty.com.google.common.collect.Sets;
 
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;

Review comment:
       not used

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/schema/stats/GuidePostsInfo.java
##########
@@ -17,6 +17,7 @@
  */
 package org.apache.phoenix.schema.stats;
 
+

Review comment:
       extra line

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/MetaDataUtil.java
##########
@@ -81,6 +82,8 @@
 import org.apache.phoenix.thirdparty.com.google.common.collect.Iterables;
 import org.apache.phoenix.thirdparty.com.google.common.collect.Lists;
 
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;

Review comment:
       not used

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/schema/tool/SchemaSynthesisProcessor.java
##########
@@ -36,8 +36,11 @@
 
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileReader;

Review comment:
       java.io.FileReader not used anymore




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org