Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreferJavaTimeOverload generates false positive with jOOQ DSL.val() #1694

Closed
niktekusho opened this issue Jun 22, 2020 · 2 comments
Closed
Assignees

Comments

@niktekusho
Copy link

niktekusho commented Jun 22, 2020

Description of the problem / feature request:

This issue is very similar to #1504.
When I use Jooq's DSL.val(0), ErrorProne emits the PreferJavaTimeOverload warning.
[PreferJavaTimeOverload] If the numeric primitive (0) represents a Instant, please call DSL.val(Instant) instead.
I don't think ErrorProne should emit the warning since DSL.val returns an object with the same generic type:

  • DSL.val(int) returns Field<Integer>
  • while DSL.val(Instant) returns Field<Instant>.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Simply call DSL.val(0).

What version of Error Prone are you using?

2.3.4

Have you found anything relevant by searching the web?

Looking through ErrorProne's issues, I saw #1504, which is very similar to my case.

Since the fix to this issue is virtually the same as #1511, should I open a PR with the fix?

@kluever
Copy link
Member

kluever commented Jun 26, 2020

Thanks for the report - I'll get this fixed up internally.

@kluever kluever self-assigned this Jun 26, 2020
@kluever
Copy link
Member

kluever commented Jun 26, 2020

(Planning on just ignoring any static methods on the entire DSL class.)

Stephan202 pushed a commit to PicnicSupermarket/error-prone that referenced this issue Nov 2, 2020
Fixes google#1694

PiperOrigin-RevId: 318505995

(cherry picked from commit b332c7a)
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

No branches or pull requests

2 participants