Skip to content

Commit

Permalink
apacheGH-43962: [Java] Consider warnings as errors for Adapter Module (
Browse files Browse the repository at this point in the history
…apache#43963)

### Rationale for this change

This PR configs the build such that warnings are considered as errors in the Adapter module. And corresponding code changes have also been made. 

### What changes are included in this PR?

Adding flags to consider warnings as errors in javac and fixing the corresponding errors. 

### Are these changes tested?

Tested by existing test cases. 

### Are there any user-facing changes?

N/A
* GitHub Issue: apache#43962

Authored-by: Vibhatha Lakmal Abeykoon <vibhatha@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
  • Loading branch information
vibhatha authored Sep 11, 2024
1 parent 2c44bcc commit 2a793d6
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 0 deletions.
14 changes: 14 additions & 0 deletions java/adapter/avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,18 @@ under the License.
<version>${dep.avro.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration combine.children="append">
<compilerArgs>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
public class AvroToArrowIteratorTest extends AvroTestBase {

@BeforeEach
@Override
public void init() {
final BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);
this.config = new AvroToArrowConfigBuilder(allocator).setTargetBatchSize(3).build();
Expand Down
9 changes: 9 additions & 0 deletions java/adapter/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ under the License.
<argLine>--add-reads=org.apache.arrow.adapter.jdbc=com.fasterxml.jackson.dataformat.yaml --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED -Duser.timezone=UTC</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration combine.children="append">
<compilerArgs>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public static Stream<Arguments> getTestData()
*/
@ParameterizedTest
@MethodSource("getTestData")
@Override
public void testJdbcToArrowValues(Table table)
throws SQLException, IOException, ClassNotFoundException {
this.initializeDatabase(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public static Stream<Arguments> getTestData()
/** Test Method to test JdbcToArrow Functionality for various H2 DB based datatypes. */
@ParameterizedTest
@MethodSource("getTestData")
@Override
public void testJdbcToArrowValues(Table table)
throws SQLException, IOException, ClassNotFoundException {
this.initializeDatabase(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static Stream<Arguments> getTestData() throws IOException {
/** Test Method to test JdbcToArrow Functionality for Map form Types.OTHER column. */
@ParameterizedTest
@MethodSource("getTestData")
@Override
public void testJdbcToArrowValues(Table table)
throws SQLException, IOException, ClassNotFoundException {
this.initializeDatabase(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public static Stream<Arguments> getTestData()
*/
@ParameterizedTest
@MethodSource("getTestData")
@Override
public void testJdbcToArrowValues(Table table)
throws SQLException, IOException, ClassNotFoundException {
this.initializeDatabase(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public static Stream<Arguments> getTestData()
*/
@ParameterizedTest
@MethodSource("getTestData")
@Override
public void testJdbcToArrowValues(Table table)
throws SQLException, IOException, ClassNotFoundException {
this.initializeDatabase(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public static Stream<Arguments> getTestData()
*/
@ParameterizedTest
@MethodSource("getTestData")
@Override
public void testJdbcToArrowValues(Table table)
throws SQLException, IOException, ClassNotFoundException {
this.initializeDatabase(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public static Stream<Arguments> getTestData()
*/
@ParameterizedTest
@MethodSource("getTestData")
@Override
public void testJdbcToArrowValues(Table table)
throws SQLException, IOException, ClassNotFoundException {
this.initializeDatabase(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class JdbcToArrowVectorIteratorTest extends JdbcToArrowTest {

@ParameterizedTest
@MethodSource("getTestData")
@Override
public void testJdbcToArrowValues(Table table)
throws SQLException, IOException, ClassNotFoundException {
this.initializeDatabase(table);
Expand Down
9 changes: 9 additions & 0 deletions java/adapter/orc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ under the License.
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration combine.children="append">
<compilerArgs>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 2a793d6

Please sign in to comment.