-
Notifications
You must be signed in to change notification settings - Fork 139
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
@SuppressWarnings("removal") does not work #3402
Comments
After deprecation for removal that method would now need a |
That's what I would expect that it still complains (but need a different suppress. |
Could anyone from JDT please have a look at this? The case described above is causing build-failures in PDE due to new warnings and actually I don't want to remove the suppression now just to add it back later when this is fixed. If you can point me to the place where this can be fixed, I can also have a look by myself. |
See call sites of
In general a good way to find out where different things happen in ECJ is to plant a breakpoint in EVERY Error/Warning/Info diagnostics go through this method. So plant a breakpoint there and give the compiler some workload that would trigger a "relevant" message. Call stack points to the smoking gun 😄 (Sorry that I am personally not able to jump on this task - I am trying to wrap up Enhanced switches redesign/reimplementation before the year end holidays) Good luck. I am available to review PRs though |
Reproduced. Will take a look. |
Hmm... The compiler doesn't report or try to report deprecated warning at all. And the reason for that is, JDT only considers JDK versions for the I don't even know how we can compare the given version |
impossible to compare by design: |
Looking at the javadoc it says:
It does not indicate that this has any relation to the java version at all. In the general section it says:
it does not tell anything that compiler should further analyze the parameters |
@jjohnstn , @stephan-herrmann : from the conversation on #2874 (comment) I see that you both assumed that "since" version in the "Deprecated" annotation will represent JDK version - why ? Isn't the annotation fully generic and can be used to annotate any code and in any version format: https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/lang/Deprecated.html This is the related diff: Do I miss something? |
It seems I was misled by lots of text in https://openjdk.org/jeps/277 speaking about the use of enhanced deprecation in the JDK, where indeed "since" refers to the JDK version. I should have re-checked the specification before commenting in #2874. Sorry. At face value this seems to imply that the compiler can only make sense of the since value when it appears in a JDK class, since JDK versions are the only versions the compiler knows about. But then we'd need to check, if the compiler can tell which classes are from the JDK. If it can't then #2874 should probably reverted in entirety. In that case we should put our money on #3168 instead. I haven't read the full thread above. Does my assessment make sense in this context? |
yes |
Note that JDK also documented that they did not use pure numeric values in the past but also Strings like |
If I look at
org.eclipse.pde.internal.core.product.ArgumentsInfo
it has
but eclipse claims
so far so good, then we can remove it, but now I don't get any warning at all even though a
forRemoval
should be even more servethis was recently changed here:
The text was updated successfully, but these errors were encountered: