Skip to content

ARROW-6331: [Java] Incorporate ErrorProne into the java build#5263

Closed
tianchen92 wants to merge 3 commits intoapache:masterfrom
tianchen92:ARROW-6331
Closed

ARROW-6331: [Java] Incorporate ErrorProne into the java build#5263
tianchen92 wants to merge 3 commits intoapache:masterfrom
tianchen92:ARROW-6331

Conversation

@tianchen92
Copy link
Contributor

Related to ARROW-6331.
Using https://github.com/google/error-prone seems like it would be a good idea to automatically catch more errors.

@tianchen92
Copy link
Contributor Author

cc @emkornfield

@tianchen92 tianchen92 closed this Sep 4, 2019
@tianchen92 tianchen92 reopened this Sep 4, 2019
</profile>

<!-- using github.com/google/error-prone-javac is required when running on JDK 8 -->
<profile>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would request this to be the default please :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tianchen92
I was asking if anyone building arrow now needs to do so using java9 for this to work?
(or) can we continue using jdk8.

If we can continue running using jdk8, the change looks good.

If consumers need java9 to build - then i would request running error prone only if a specific profile is used (for e.g. in the example you have given using profile jdk1.8 activates the check with some special javac properties, meaning you would use a command like mvn -P jdk-18 to activate the profile) This way existing consumers will not be forced to upgrade their entire build chain to java9 to use arrow java.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for clarify, now it works fine with jdk8 :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome..do we also want to modify ci to run this profile, so that it catches further bugs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need do anything, just use 'mvn clean install' will trigger error prone :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good thanks @tianchen92

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@c39e350). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5263   +/-   ##
=========================================
  Coverage          ?    89.7%           
=========================================
  Files             ?      693           
  Lines             ?   104695           
  Branches          ?        0           
=========================================
  Hits              ?    93919           
  Misses            ?    10776           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c39e350...9cb3a86. Read the comment docs.

@tianchen92
Copy link
Contributor Author

cc @emkornfield for comments since you opened this issue.

@emkornfield
Copy link
Contributor

Looks OK to me, I'm not an expert on setting this up, so if it looks ok to @praveenbingo I think we can merge

@kou
Copy link
Member

kou commented Sep 9, 2019

CI on master is red since this merge: https://travis-ci.org/apache/arrow/builds/582523345
Could you take a look the failure log?

@kou
Copy link
Member

kou commented Sep 9, 2019

Does the following message related to this merge?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project arrow-avro: Compilation failure

[ERROR] /build/java/arrow/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBytesConsumer.java:[77,22] error: [SelfAssignment] Variable assigned to itself

[ERROR]     (see https://errorprone.info/bugpattern/SelfAssignment)

[ERROR]   Did you mean to remove this line?

[ERROR] -> [Help 1]

[ERROR] 

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR] 

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

[ERROR] 

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :arrow-avro

@praveenbingo
Copy link
Contributor

@kou Looks like it is related, will put a patch to resolve the same.

@tianchen92
Copy link
Contributor Author

CI on master is red since this merge: https://travis-ci.org/apache/arrow/builds/582523345
Could you take a look the failure log?

Does the following message related to this merge?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project arrow-avro: Compilation failure

[ERROR] /build/java/arrow/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBytesConsumer.java:[77,22] error: [SelfAssignment] Variable assigned to itself

[ERROR]     (see https://errorprone.info/bugpattern/SelfAssignment)

[ERROR]   Did you mean to remove this line?

[ERROR] -> [Help 1]

[ERROR] 

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR] 

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

[ERROR] 

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :arrow-avro

Does the following message related to this merge?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project arrow-avro: Compilation failure

[ERROR] /build/java/arrow/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBytesConsumer.java:[77,22] error: [SelfAssignment] Variable assigned to itself

[ERROR]     (see https://errorprone.info/bugpattern/SelfAssignment)

[ERROR]   Did you mean to remove this line?

[ERROR] -> [Help 1]

[ERROR] 

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR] 

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

[ERROR] 

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :arrow-avro

Thanks for pointing, I guess yes, before this PR merged, there is another PR merged before, so error phone didn't catch the error, I'll take a look and provide a fix.

@praveenbingo
Copy link
Contributor

@tianchen92 - ah looks like you are already on it..pls ping me to merge the same when its ready

@tianchen92
Copy link
Contributor Author

@kou Looks like it is related, will put a patch to resolve the same.

I just see that, I will fix this soon :)

@kou
Copy link
Member

kou commented Sep 9, 2019

Thanks!

pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
Related to [ARROW-6331](https://issues.apache.org/jira/browse/ARROW-6331).
Using https://github.com/google/error-prone seems like it would be a good idea to automatically catch more errors.

Closes apache#5263 from tianchen92/ARROW-6331 and squashes the following commits:

9cb3a86 <tianchen> fix pom properties
bf66186 <tianchen> fix
3cbc00c <tianchen>  Incorporate ErrorProne into the java build

Authored-by: tianchen <niki.lj@alibaba-inc.com>
Signed-off-by: Praveen <praveen@dremio.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants