You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "vibhatha (via GitHub)" <gi...@apache.org> on 2024/01/09 08:17:31 UTC

[PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

vibhatha opened a new pull request, #39529:
URL: https://github.com/apache/arrow/pull/39529

   ### Rationale for this change
   
   This PR fixes the warnings generated by the errorprone library. 
   
   ### What changes are included in this PR?
   
   Updating the code to remove warnings. 
   
   ### Are these changes tested?
   
   Tested by existing test cases.
   
   ### Are there any user-facing changes?
   
   No


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457103011


##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   Also thinking about it
   
   `10L`  is `long` and `resultSet.get(i)` is `Long`



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456766582


##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   Ah I couldn't agree more, but honestly I was naively making the changes based on the suggestion in the warning. Sorry about that. Let me reiterate this step.



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456764850


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/dictionary/TestHashTableDictionaryEncoder.java:
##########
@@ -17,12 +17,12 @@
 
 package org.apache.arrow.algorithm.dictionary;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   @lidavidm I found out other places (not made by this PR but by other PRs which are not marked as warnings) where static import is used, but I decided to work on it in a follow up PR. 
   Hope that's okay? 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1884226398

   Revision: 85c5f9fcaeb68345f338673b27213e97c988d68f
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-f76ced9dc5](https://github.com/ursacomputing/crossbow/branches/all?query=actions-f76ced9dc5)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-f76ced9dc5-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7470822830/job/20330096286)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-f76ced9dc5-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7470822864/job/20330095854)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-f76ced9dc5-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7470822850/job/20330095636)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-f76ced9dc5-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7470822841/job/20330095621)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-f76ced9dc5-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7470822828/job/20330095638)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-f76ced9dc5-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7470822860/job/20330095858)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456718889


##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   Ah I see. I will specify it here explicitly here. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1886889941

   Revision: 8499caf1a98954aae7b8d2b4b49730cfd2d4c8e3
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-7a3a344533](https://github.com/ursacomputing/crossbow/branches/all?query=actions-7a3a344533)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-7a3a344533-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7487848653/job/20381088892)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-7a3a344533-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7487848740/job/20381088121)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-7a3a344533-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7487848509/job/20381087562)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-7a3a344533-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7487848515/job/20381087544)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-7a3a344533-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7487848510/job/20381087520)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-7a3a344533-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7487848656/job/20381087866)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457088416


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestCompositeVectorComparator.java:
##########
@@ -17,6 +17,8 @@
 
 package org.apache.arrow.algorithm.sort;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   Cleared out all the ones I have introduced in this PR. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1887613796

   Revision: 57445c680643297cb977b5d687df0d7370ed01c5
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-bde21cc636](https://github.com/ursacomputing/crossbow/branches/all?query=actions-bde21cc636)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-bde21cc636-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7492230910/job/20395294385)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-bde21cc636-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7492230615/job/20395291936)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-bde21cc636-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7492230576/job/20395291970)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-bde21cc636-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7492230880/job/20395292859)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-bde21cc636-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7492230597/job/20395291951)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-bde21cc636-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7492230572/job/20395291956)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1886882750

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1462666151


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/dictionary/TestHashTableDictionaryEncoder.java:
##########
@@ -17,12 +17,12 @@
 
 package org.apache.arrow.algorithm.dictionary;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   Got it. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1455672602


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/dictionary/TestHashTableDictionaryEncoder.java:
##########
@@ -17,12 +17,12 @@
 
 package org.apache.arrow.algorithm.dictionary;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   Let's avoid static imports, or at least, pick one way of doing it and stick to it.



##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/dictionary/TestLinearDictionaryEncoder.java:
##########
@@ -17,12 +17,12 @@
 
 package org.apache.arrow.algorithm.dictionary;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   Ditto.



##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestServerMiddleware.java:
##########
@@ -186,7 +184,7 @@ public void doGetUncaught() {
           Assertions.assertEquals(FlightStatusCode.OK, status.code());
           Assertions.assertNull(status.cause());
           Assertions.assertNotNull(err);
-          Assertions.assertEquals(EXPECTED_EXCEPTION.getMessage(), err.getMessage());
+          Assertions.assertEquals(new RuntimeException("test").getMessage(), err.getMessage());

Review Comment:
   Probably just hardcode "test" here instead of bouncing through the exception



##########
java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImpl.java:
##########
@@ -33,6 +33,8 @@
 import org.apache.calcite.avatica.ConnectionConfigImpl;
 import org.apache.calcite.avatica.ConnectionProperty;
 
+import com.google.common.base.Ascii;

Review Comment:
   Ditto.



##########
java/vector/src/main/java/org/apache/arrow/vector/VectorSchemaRoot.java:
##########
@@ -339,6 +339,7 @@ public VectorSchemaRoot slice(int index, int length) {
   /**
    * Determine if two VectorSchemaRoots are exactly equal.
    */
+

Review Comment:
   Did you mean to do this?



##########
java/vector/src/test/java/org/apache/arrow/vector/TestMapVector.java:
##########
@@ -571,18 +571,18 @@ public void testMapWithListValue() throws Exception {
       assertEquals(1L, getResultKey(resultStruct));
       ArrayList<Long> list = (ArrayList<Long>) getResultValue(resultStruct);
       assertEquals(3, list.size()); // value is a list with 3 elements
-      assertEquals(new Long(50), list.get(0));
-      assertEquals(new Long(100), list.get(1));
-      assertEquals(new Long(200), list.get(2));
+      assertEquals(Long.valueOf(50), list.get(0));

Review Comment:
   ditto (I'm not going to point out all of these)



##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestDictionaryUtils.java:
##########
@@ -78,7 +79,7 @@ public void testCreateSchema() {
       Schema newSchema = DictionaryUtils.generateSchema(schema, dictProvider, dictionaryUsed);
 
       // assert that a new schema is created.
-      assertTrue(schema != newSchema);
+      assertNotEquals(schema, newSchema);

Review Comment:
   Shouldn't this be assertNotSame?



##########
java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/GetReadableBuffer.java:
##########
@@ -51,7 +51,7 @@ public class GetReadableBuffer {
       tmpField = f;
       tmpClazz = clazz;
     } catch (Exception e) {
-      new RuntimeException("Failed to initialize GetReadableBuffer, falling back to slow path", e).printStackTrace();
+      throw new RuntimeException("Failed to initialize GetReadableBuffer, falling back to slow path", e);

Review Comment:
   This is intentionally NOT throwing.



##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   no version?



##########
java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/AddWritableBuffer.java:
##########
@@ -72,7 +72,7 @@ public class AddWritableBuffer {
       tmpBufChainOut = tmpBufChainOut2;
 
     } catch (Exception ex) {
-      new RuntimeException("Failed to initialize AddWritableBuffer, falling back to slow path", ex).printStackTrace();
+      throw new RuntimeException("Failed to initialize AddWritableBuffer, falling back to slow path", ex);

Review Comment:
   This is very much intentionally NOT throwing.



##########
java/flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightStatementExecuteUpdateTest.java:
##########
@@ -207,9 +207,12 @@ public void testShouldFailToPrepareStatementForBadStatement() {
        * we simply throw an `IllegalArgumentException` for queries not registered
        * in our `MockFlightSqlProducer`.
        */
+      String expectedMessage = format("Error while executing SQL \"%s\": " +
+          "org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT: Query not found",

Review Comment:
   Yeah, something is wrong with the exception class. INVALID_ARGUMENT seems like a fine addition but the exception name shouldn't be there.



##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestFlightService.java:
##########
@@ -149,12 +150,14 @@ public FlightInfo getFlightInfo(CallContext context,
       FlightInfo flightInfo = client.getInfo(FlightDescriptor.path("test"));
       Assertions.assertEquals(Optional.empty(), flightInfo.getSchemaOptional());
       Assertions.assertEquals(new Schema(Collections.emptyList()), flightInfo.getSchema());
-      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes());
+      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes(StandardCharsets.UTF_8));
 
       Exception e = Assertions.assertThrows(
           FlightRuntimeException.class,
           () -> client.getSchema(FlightDescriptor.path("test")));
-      Assertions.assertEquals("No schema is present in FlightInfo", e.getMessage());
+      String expectedMessage = "org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT:" +

Review Comment:
   We don't want the exception name in getMessage, I think - that would be provided by toString already. Can you confirm what an exception looks like when printed?



##########
java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/utils/UrlParser.java:
##########
@@ -22,6 +22,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import com.google.common.base.Splitter;

Review Comment:
   Ditto.



##########
java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriver.java:
##########
@@ -43,6 +44,9 @@
 import org.apache.calcite.avatica.Meta;
 import org.apache.calcite.avatica.UnregisteredDriver;
 
+import com.google.common.base.Ascii;
+import com.google.common.base.Splitter;

Review Comment:
   Let's not take on more usage of Guava than we absolutely have to. Can we suppress those and undo this?



##########
java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/example/FlightSqlExample.java:
##########
@@ -140,6 +141,7 @@
 import org.apache.commons.pool2.impl.GenericObjectPool;
 import org.slf4j.Logger;
 
+import com.google.common.base.Splitter;

Review Comment:
   Ditto.



##########
java/vector/src/test/java/org/apache/arrow/vector/TestListVector.java:
##########
@@ -107,9 +107,9 @@ public void testCopyFrom() throws Exception {
       Object result = outVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(1), (Long) resultSet.get(0));
-      assertEquals(new Long(2), (Long) resultSet.get(1));
-      assertEquals(new Long(3), (Long) resultSet.get(2));
+      assertEquals(Long.valueOf(1), resultSet.get(0));

Review Comment:
   same here - 1L?



##########
java/vector/src/main/java/org/apache/arrow/vector/util/Text.java:
##########
@@ -202,15 +202,17 @@ public int find(String what, int start) {
   public void set(String string) {
     try {
       ByteBuffer bb = encode(string, true);
-      bytes = bb.array();
+      bytes = new byte[bb.remaining()];
+      bb.get(bytes);
+      bb.position(bb.position() - bytes.length); // move it back so we can decode it

Review Comment:
   This is an extra allocation, what's the reason for this?



##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestCompositeVectorComparator.java:
##########
@@ -17,6 +17,8 @@
 
 package org.apache.arrow.algorithm.sort;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   Ditto (I'm not going to point out all the rest)



##########
java/vector/src/main/java/org/apache/arrow/vector/complex/impl/PromotableWriter.java:
##########
@@ -301,13 +302,15 @@ public boolean isEmptyStruct() {
     return writer.isEmptyStruct();
   }
 
+  @Override
   protected FieldWriter getWriter() {
     return writer;
   }
 
   private FieldWriter promoteToUnion() {
     String name = vector.getField().getName();
-    TransferPair tp = vector.getTransferPair(vector.getMinorType().name().toLowerCase(), vector.getAllocator());
+    TransferPair tp = vector.getTransferPair(vector.getMinorType().name().toLowerCase(Locale.getDefault()),
+        vector.getAllocator());

Review Comment:
   Hmm, setting aside the question of why we lowercase in the first place, we should use Locale.ROOT to be consistent?



##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   weird; wouldn't 200L be ok here?



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457087148


##########
java/vector/src/main/java/org/apache/arrow/vector/util/Text.java:
##########
@@ -202,15 +202,17 @@ public int find(String what, int start) {
   public void set(String string) {
     try {
       ByteBuffer bb = encode(string, true);
-      bytes = bb.array();
+      bytes = new byte[bb.remaining()];
+      bb.get(bytes);
+      bb.position(bb.position() - bytes.length); // move it back so we can decode it

Review Comment:
   I reversed the change to check the original warning message, it doesn't show up anymore. 
   This could be because of https://github.com/apache/arrow/pull/39452 and me not rebasing at the time :thinking: 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1895829717

   At the end of this we should also be making warnings into errors so that these don't come back up.


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1459043125


##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   No, can we use the `protobuf.version` property to be consistent?



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1884224859

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1889100516

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1895913415

   Agreed @lidavidm. Probably need to complete the follow up PR to do that. Also what would be the best way to fail builds with warnings? 


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1895227625

   ```
   Only contributors can submit requests to this bot. Please ask someone from the community for help with getting the first commit in.
   The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/7552386532
   ```


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1898056884

   Revision: 7975bacf2fed3d12345a25e2a1df36c91522ff4d
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-54bbafd74e](https://github.com/ursacomputing/crossbow/branches/all?query=actions-54bbafd74e)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-54bbafd74e-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7567553504/job/20606952065)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-54bbafd74e-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7567553441/job/20606950961)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-54bbafd74e-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7567553433/job/20606950723)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-54bbafd74e-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7567553443/job/20606950744)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-54bbafd74e-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7567553500/job/20606951039)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-54bbafd74e-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7567553450/job/20606950728)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1899486512

   Revision: d34ced20681d99eba096a1f275f87aa0b7923fc6
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-70ae8970fe](https://github.com/ursacomputing/crossbow/branches/all?query=actions-70ae8970fe)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-70ae8970fe-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7578174223/job/20640322437)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-70ae8970fe-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7578174275/job/20640322085)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-70ae8970fe-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7578174208/job/20640321884)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-70ae8970fe-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7578174346/job/20640322218)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-70ae8970fe-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7578174227/job/20640321869)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-70ae8970fe-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7578174341/job/20640322158)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1462100269


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/dictionary/TestHashTableDictionaryEncoder.java:
##########
@@ -17,12 +17,12 @@
 
 package org.apache.arrow.algorithm.dictionary;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   A separate PR is fine. Also I think static imports of assert methods are fine in tests.



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1900510924

   Revision: 6b73afae7d722a657eeeba1b09018ee05b65773e
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-be3e8b4a7e](https://github.com/ursacomputing/crossbow/branches/all?query=actions-be3e8b4a7e)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-be3e8b4a7e-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7585025635/job/20659967928)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-be3e8b4a7e-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7585025585/job/20659965860)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-be3e8b4a7e-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7585025653/job/20659965985)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-be3e8b4a7e-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7585025619/job/20659965889)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-be3e8b4a7e-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7585025821/job/20659966882)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-be3e8b4a7e-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7585025624/job/20659965824)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456765175


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/dictionary/TestHashTableDictionaryEncoder.java:
##########
@@ -17,12 +17,12 @@
 
 package org.apache.arrow.algorithm.dictionary;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   I listed the classes as follows
   1. `ArrowFlightJdbcVarCharVectorAccessorTest`
   2. `FlightSqlExample` 
   3. `JsonFileReader`
   4. `ArrowFlightJdbcBinaryVectorAccessorTest`
   5. `ArrowFlightJdbcVarCharVectorAccessor`



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1898053283

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1899484669

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1896080361

   Revision: 56a95fdba45551a6aa9aa5c278f5312f36e74ce4
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-e636476297](https://github.com/ursacomputing/crossbow/branches/all?query=actions-e636476297)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-e636476297-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7558192623/job/20579136002)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-e636476297-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7558192678/job/20579134356)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-e636476297-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7558192758/job/20579134909)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-e636476297-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7558192950/job/20579135610)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-e636476297-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7558192904/job/20579135595)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-e636476297-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7558192825/job/20579135042)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1896123939

   > Agreed @lidavidm. Probably need to complete the follow up PR to do that. Also what would be the best way to fail builds with warnings?
   
   Pass `-Werror` to javac in maven


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1462672772


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/dictionary/TestHashTableDictionaryEncoder.java:
##########
@@ -17,12 +17,12 @@
 
 package org.apache.arrow.algorithm.dictionary;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   https://github.com/apache/arrow/issues/39752



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1905234297

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1884125988

   Revision: 4d87301271b4e1d82717d6029e504565de773cde
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-4547e26b60](https://github.com/ursacomputing/crossbow/branches/all?query=actions-4547e26b60)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-4547e26b60-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7469876300/job/20327678800)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-4547e26b60-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7469876198/job/20327677538)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-4547e26b60-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7469876212/job/20327677541)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-4547e26b60-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7469876206/job/20327677518)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-4547e26b60-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7469876230/job/20327677714)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-4547e26b60-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7469876211/job/20327677519)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1884339632

   Revision: 5226173f1adaf9cb8959b6619360bc8d69456fc0
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-04546ec6e4](https://github.com/ursacomputing/crossbow/branches/all?query=actions-04546ec6e4)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-04546ec6e4-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7471770488/job/20332625177)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-04546ec6e4-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7471770429/job/20332624269)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-04546ec6e4-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7471770427/job/20332624253)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-04546ec6e4-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7471770485/job/20332624409)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-04546ec6e4-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7471770460/job/20332624365)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-04546ec6e4-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7471770502/job/20332624547)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1886437995

   Revision: c09a3d81681f24841016e1037415ed05b1b2f339
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-053fa63473](https://github.com/ursacomputing/crossbow/branches/all?query=actions-053fa63473)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-053fa63473-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7485501449/job/20374058318)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-053fa63473-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7485501414/job/20374057445)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-053fa63473-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7485501408/job/20374057452)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-053fa63473-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7485501407/job/20374057451)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-053fa63473-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7485501474/job/20374057787)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-053fa63473-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7485501586/job/20374058024)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1462099604


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestFlightService.java:
##########
@@ -149,12 +150,14 @@ public FlightInfo getFlightInfo(CallContext context,
       FlightInfo flightInfo = client.getInfo(FlightDescriptor.path("test"));
       Assertions.assertEquals(Optional.empty(), flightInfo.getSchemaOptional());
       Assertions.assertEquals(new Schema(Collections.emptyList()), flightInfo.getSchema());
-      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes());
+      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes(StandardCharsets.UTF_8));
 
       Exception e = Assertions.assertThrows(
           FlightRuntimeException.class,
           () -> client.getSchema(FlightDescriptor.path("test")));
-      Assertions.assertEquals("No schema is present in FlightInfo", e.getMessage());
+      String expectedMessage = "org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT:" +

Review Comment:
   It is because you are overriding getMessage



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1889106752

   Revision: 70e9efaf083d4e34bdd5911a2215600ade899e57
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-076ac97685](https://github.com/ursacomputing/crossbow/branches/all?query=actions-076ac97685)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-076ac97685-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7502364807/job/20424862484)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-076ac97685-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7502364791/job/20424861213)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-076ac97685-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7502364903/job/20424861612)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-076ac97685-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7502364955/job/20424861717)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-076ac97685-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7502364817/job/20424861177)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-076ac97685-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7502365292/job/20424862817)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457075679


##########
java/vector/src/main/java/org/apache/arrow/vector/VectorSchemaRoot.java:
##########
@@ -339,6 +339,7 @@ public VectorSchemaRoot slice(int index, int length) {
   /**
    * Determine if two VectorSchemaRoots are exactly equal.
    */
+

Review Comment:
   Ah this is a mistake. I am removing it. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456690127


##########
java/algorithm/src/test/java/org/apache/arrow/algorithm/dictionary/TestHashTableDictionaryEncoder.java:
##########
@@ -17,12 +17,12 @@
 
 package org.apache.arrow.algorithm.dictionary;
 
+import static java.nio.charset.StandardCharsets.UTF_8;

Review Comment:
   Definitely. I think my realization happened half way into this. I will refactor. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457112098


##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   `long actual = dataVector.getObject(offset);` 
   We should probably change this and then do the rest?



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1903156962

   Revision: 190e6dfd0fb0e5a2bdb632e542c4ac12f61c95b9
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-142142f8e6](https://github.com/ursacomputing/crossbow/branches/all?query=actions-142142f8e6)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-142142f8e6-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7606256662/job/20711748981)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-142142f8e6-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7606256683/job/20711748494)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-142142f8e6-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7606256682/job/20711748481)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-142142f8e6-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7606256685/job/20711748485)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-142142f8e6-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7606256663/job/20711748493)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-142142f8e6-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7606256712/job/20711748758)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm merged PR #39529:
URL: https://github.com/apache/arrow/pull/39529


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457773085


##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   Aha...In that case valueOf like you have is OK then. Thanks.



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456689761


##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   I assumed it would take from the bom? The same version used for `protobuf-java`, I could be wrong. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456851574


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestFlightService.java:
##########
@@ -149,12 +150,14 @@ public FlightInfo getFlightInfo(CallContext context,
       FlightInfo flightInfo = client.getInfo(FlightDescriptor.path("test"));
       Assertions.assertEquals(Optional.empty(), flightInfo.getSchemaOptional());
       Assertions.assertEquals(new Schema(Collections.emptyList()), flightInfo.getSchema());
-      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes());
+      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes(StandardCharsets.UTF_8));
 
       Exception e = Assertions.assertThrows(
           FlightRuntimeException.class,
           () -> client.getSchema(FlightDescriptor.path("test")));
-      Assertions.assertEquals("No schema is present in FlightInfo", e.getMessage());
+      String expectedMessage = "org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT:" +

Review Comment:
   Ah I see your point, the output looks as follows
   
   ```java
   System.out.println(e.getMessage());
   System.out.println(e);
   System.out.println(e.toString());
   ```
   Ouput
   
   ```bash
   org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT: No schema is present in FlightInfo
   org.apache.arrow.flight.FlightRuntimeException: org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT: No schema is present in FlightInfo
   org.apache.arrow.flight.FlightRuntimeException: org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT: No schema is present in FlightInfo
   ```



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1900507453

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1459171627


##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   gah, sorry, I realized we use a mix of BOM and protobuf.version...let's revert this and go back to using the BOM.
   
   Can you file an issue to have Gandiva and Dataset use the BOM instead of defining their own protobuf.version?



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1462672275


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestFlightService.java:
##########
@@ -149,12 +150,14 @@ public FlightInfo getFlightInfo(CallContext context,
       FlightInfo flightInfo = client.getInfo(FlightDescriptor.path("test"));
       Assertions.assertEquals(Optional.empty(), flightInfo.getSchemaOptional());
       Assertions.assertEquals(new Schema(Collections.emptyList()), flightInfo.getSchema());
-      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes());
+      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes(StandardCharsets.UTF_8));
 
       Exception e = Assertions.assertThrows(
           FlightRuntimeException.class,
           () -> client.getSchema(FlightDescriptor.path("test")));
-      Assertions.assertEquals("No schema is present in FlightInfo", e.getMessage());
+      String expectedMessage = "org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT:" +

Review Comment:
   Ah got it. Thanks David. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1462099227


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestDictionaryUtils.java:
##########
@@ -78,7 +79,7 @@ public void testCreateSchema() {
       Schema newSchema = DictionaryUtils.generateSchema(schema, dictProvider, dictionaryUsed);
 
       // assert that a new schema is created.
-      assertTrue(schema != newSchema);
+      assertNotEquals(schema, newSchema);

Review Comment:
   Look at the comment; this is explicitly about a new object



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1907219910

   After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit ae9c0a96a0a7dbf4710bb16cf043269a1bc33aa7.
   
   There were no benchmark performance regressions. 🎉
   
   The [full Conbench report](https://github.com/apache/arrow/runs/20798184739) has more details.


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1884337240

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456854517


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestFlightService.java:
##########
@@ -149,12 +150,14 @@ public FlightInfo getFlightInfo(CallContext context,
       FlightInfo flightInfo = client.getInfo(FlightDescriptor.path("test"));
       Assertions.assertEquals(Optional.empty(), flightInfo.getSchemaOptional());
       Assertions.assertEquals(new Schema(Collections.emptyList()), flightInfo.getSchema());
-      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes());
+      Assertions.assertArrayEquals(flightInfo.getAppMetadata(), "foo".getBytes(StandardCharsets.UTF_8));
 
       Exception e = Assertions.assertThrows(
           FlightRuntimeException.class,
           () -> client.getSchema(FlightDescriptor.path("test")));
-      Assertions.assertEquals("No schema is present in FlightInfo", e.getMessage());
+      String expectedMessage = "org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT:" +

Review Comment:
   It occurs to me that I have introduced something in this PR which causes this. :thinking: 
   



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456844308


##########
java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestDictionaryUtils.java:
##########
@@ -78,7 +79,7 @@ public void testCreateSchema() {
       Schema newSchema = DictionaryUtils.generateSchema(schema, dictProvider, dictionaryUsed);
 
       // assert that a new schema is created.
-      assertTrue(schema != newSchema);
+      assertNotEquals(schema, newSchema);

Review Comment:
   Just curious, if we use assertNotSame, it would mean that it is not the same object in memory. But in this case, I thought we are merely checking the status of the created objects. Please correct me if I am wrong. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456718889


##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   Ah I see. I will specify it here explicitly. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456816774


##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   Adding `<version>3.23.1</version>`



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456766582


##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   Ah I couldn't agree more, but I honestly I was naively making the changes based on the suggestion in the warning. Sorry about that. Let me reiterate this step.



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457697965


##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   There is a problem if we just do `assertEquals(200L, actual)`
   
   ```bash
   error: reference to assertEquals is ambiguous
     both method assertEquals(long,long) in Assert and method assertEquals(Object,Object) in Assert match
   ```
   won't compile. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1461325512


##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   @lidavidm solved the issue here and filed an issue to fix Gandiva and Dataset: https://github.com/apache/arrow/issues/39727



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1903150867

   @lidavidm addressed the reviews, but there are some open questions. Appreciate your feedback. 


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1462672450


##########
java/flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightStatementExecuteUpdateTest.java:
##########
@@ -207,9 +207,12 @@ public void testShouldFailToPrepareStatementForBadStatement() {
        * we simply throw an `IllegalArgumentException` for queries not registered
        * in our `MockFlightSqlProducer`.
        */
+      String expectedMessage = format("Error while executing SQL \"%s\": " +
+          "org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT: Query not found",

Review Comment:
   Resolved: happened because of overriding `getMessage` instead of `toString` 



##########
java/flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightStatementExecuteUpdateTest.java:
##########
@@ -207,9 +207,12 @@ public void testShouldFailToPrepareStatementForBadStatement() {
        * we simply throw an `IllegalArgumentException` for queries not registered
        * in our `MockFlightSqlProducer`.
        */
+      String expectedMessage = format("Error while executing SQL \"%s\": " +
+          "org.apache.arrow.flight.FlightRuntimeException: INVALID_ARGUMENT: Query not found",

Review Comment:
   Will be pushing this next. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1905236102

   Revision: c1cb67175bc635e514daa1f9b25ace9a3369946d
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-a48ea38acd](https://github.com/ursacomputing/crossbow/branches/all?query=actions-a48ea38acd)
   
   |Task|Status|
   |----|------|
   |java-jars|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a48ea38acd-github-java-jars)](https://github.com/ursacomputing/crossbow/actions/runs/7620698373/job/20755851141)|
   |verify-rc-source-java-linux-almalinux-8-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a48ea38acd-github-verify-rc-source-java-linux-almalinux-8-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7620698366/job/20755850204)|
   |verify-rc-source-java-linux-conda-latest-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a48ea38acd-github-verify-rc-source-java-linux-conda-latest-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7620698358/job/20755850340)|
   |verify-rc-source-java-linux-ubuntu-20.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a48ea38acd-github-verify-rc-source-java-linux-ubuntu-20.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7620698363/job/20755850216)|
   |verify-rc-source-java-linux-ubuntu-22.04-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a48ea38acd-github-verify-rc-source-java-linux-ubuntu-22.04-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7620698362/job/20755850203)|
   |verify-rc-source-java-macos-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-a48ea38acd-github-verify-rc-source-java-macos-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/7620698402/job/20755850354)|


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1895237335

   Since this PR is already too long, I will be creating a follow up PR to fix the warnings in the following modules
   
   1. adapter
   2. c
   3. dataset
   4. format
   5. gandiva
   6. maven
   7. memory
   8. performance
   
   Will be addressed here: https://github.com/apache/arrow/issues/39649


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1896075656

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1895227051

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1887610082

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1886435217

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457462946


##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   No, I think it's fine to use 10L and rely on autoboxing. And since resultSet.get may return null it's not valid to assume it'll be non-null.



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456688805


##########
java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriver.java:
##########
@@ -43,6 +44,9 @@
 import org.apache.calcite.avatica.Meta;
 import org.apache.calcite.avatica.UnregisteredDriver;
 
+import com.google.common.base.Ascii;
+import com.google.common.base.Splitter;

Review Comment:
   Yes we definitely should be able to. I will clean this up. 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1456718434


##########
java/flight/flight-core/pom.xml:
##########
@@ -86,6 +86,10 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>

Review Comment:
   We don't use a bom for protobuf-java.



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457090226


##########
java/vector/src/main/java/org/apache/arrow/vector/complex/impl/PromotableWriter.java:
##########
@@ -301,13 +302,15 @@ public boolean isEmptyStruct() {
     return writer.isEmptyStruct();
   }
 
+  @Override
   protected FieldWriter getWriter() {
     return writer;
   }
 
   private FieldWriter promoteToUnion() {
     String name = vector.getField().getName();
-    TransferPair tp = vector.getTransferPair(vector.getMinorType().name().toLowerCase(), vector.getAllocator());
+    TransferPair tp = vector.getTransferPair(vector.getMinorType().name().toLowerCase(Locale.getDefault()),
+        vector.getAllocator());

Review Comment:
   Right! I had doubts between the right one `ROOT` or `getDefault()`, let's use `ROOT`



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on code in PR #39529:
URL: https://github.com/apache/arrow/pull/39529#discussion_r1457115555


##########
java/vector/src/test/java/org/apache/arrow/vector/TestLargeListVector.java:
##########
@@ -723,23 +723,23 @@ public void testGetBufferAddress() throws Exception {
       Object result = listVector.getObject(0);
       ArrayList<Long> resultSet = (ArrayList<Long>) result;
       assertEquals(3, resultSet.size());
-      assertEquals(new Long(50), resultSet.get(0));
-      assertEquals(new Long(100), resultSet.get(1));
-      assertEquals(new Long(200), resultSet.get(2));
+      assertEquals(Long.valueOf(50), resultSet.get(0));
+      assertEquals(Long.valueOf(100), resultSet.get(1));
+      assertEquals(Long.valueOf(200), resultSet.get(2));

Review Comment:
   Shall we do it like this? 



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1899520008

   @lidavidm not sure if the `java-jars` is failing because of a change made in this PR. 


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1903151875

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1904352222

   The only thing I have is to fix the exception message


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-39330: [Java][CI] Fix or suppress spurious errorprone warnings [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on PR #39529:
URL: https://github.com/apache/arrow/pull/39529#issuecomment-1884124547

   @github-actions crossbow submit *java*


-- 
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: github-unsubscribe@arrow.apache.org

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