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

@SuppressWarnings("removal") does not work #3402

Open
laeubi opened this issue Dec 4, 2024 · 4 comments
Open

@SuppressWarnings("removal") does not work #3402

laeubi opened this issue Dec 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@laeubi
Copy link
Contributor

laeubi commented Dec 4, 2024

If I look at

org.eclipse.pde.internal.core.product.ArgumentsInfo

it has

	@SuppressWarnings("deprecation")
	@Override
	public String getCompleteProgramArguments(String os, String arch) {

but eclipse claims

Unnecessary @SuppressWarnings("deprecation")

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 serve

grafik

this was recently changed here:

@jukzi
Copy link
Contributor

jukzi commented Dec 4, 2024

After deprecation for removal that method would now need a @SuppressWarnings("removal") instead. However it does not work in this case -> bug
see also #469 @subyssurendran666

@jukzi jukzi added the bug Something isn't working label Dec 4, 2024
@jukzi jukzi changed the title Deprecate for removal does not give a warning anymore @SuppressWarnings("removal") does not work Dec 4, 2024
@laeubi
Copy link
Contributor Author

laeubi commented Dec 4, 2024

After deprecation for removal that method would now need a @SuppressWarnings("removal") instead.

That's what I would expect that it still complains (but need a different suppress.

@HannesWell
Copy link
Contributor

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.

@srikanth-sankaran
Copy link
Contributor

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 org.eclipse.jdt.internal.compiler.problem.ProblemReporter.unusedWarningToken(Expression) for the logic that emits the Unnecessary @SuppressWarnings(\<Token\>)

org.eclipse.jdt.internal.compiler.ast.Annotation.recordSuppressWarnings(Scope, int, int, boolean) and org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.finalizeProblems() are places of interest, in the latter the block of code that carries the comment // flag SuppressWarnings which had no effect (only if no (mandatory) error got detected within unit

In general a good way to find out where different things happen in ECJ is to plant a breakpoint in org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(int, String[], int, String[], int, int, int, ReferenceContext, CompilationResult)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants