-
Notifications
You must be signed in to change notification settings - Fork 34
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
False positives when using DateTimeFormatter fluent builder #181
Comments
Hi, I would indeeed see this as a false positive, but I have no idea how to fix this issue without additional program logic inside forbiddenapis. Do you have an idea how to "work around" this? What would be the correct way to call this without falling back to a String pattern and still giving a locale? If there is no workaround, this is indeed a bug which may need logic in forbiddenapi's code, although I am strictly against hacking workaround logic (which isn't easy to do anyways). |
FYI, the following quote from the Javadocs already makes clear where the problem comes from:
Uwe |
I don't think you can reasonably fix this: imagine that fluent builder is passed as an argument to a different function which sets the locale (and other possible dynamic scenarios)... You can't determine what's going to happen to it up front. The only workaround I see is to mark this type of expression with a suppressed check in the code. |
Maybe i am old-fashioned but i prefer functions that have inputs and return values, the problem here is just a garbage API... |
Thanks @dweiss - that's the same conclusion, I'd close this issue as "won't fix". It's not a bug in forbiddenapis, it's a bug in the API. |
Anyways, I found a bug in the signaturesfile of JDK-8 (which is inherited): |
I opened #182 about the missing method. I found it by staring at the API for an hour :-) |
Starring can be good, Uwe. :) |
If you stare (not star) at this picture for an hour in the highest resolution a lot can happen: https://commons.wikimedia.org/wiki/File:The_Garden_of_earthly_delights.jpg |
An error is raised for Java 11 code with forbidden-apis version 3.1:
Error is:
Do you consider this case a false positive error as
locale
is defined after method call with fluent builder pattern?The text was updated successfully, but these errors were encountered: