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

QuickFixTest1d8.testRemoveRedundantNonNull fails since I20230202-1800 #423

Closed
iloveeclipse opened this issue Feb 6, 2023 · 6 comments · Fixed by eclipse-jdt/eclipse.jdt.core#707
Assignees
Labels
bug Something isn't working regression Regression defect
Milestone

Comments

@iloveeclipse
Copy link
Member

QuickFixTest1d8.testRemoveRedundantNonNull fails since I20230202-1800.

Wrong number of problems, is: 2, expected: 1 Pb(922) The nullness annotation is redundant with a default that applies to this location[91 ,105] Pb(922) The nullness annotation is redundant with a default that applies to this location[91 ,105]

java.lang.AssertionError: Wrong number of problems, is: 2, expected: 1
Pb(922) The nullness annotation is redundant with a default that applies to this location[91 ,105]
Pb(922) The nullness annotation is redundant with a default that applies to this location[91 ,105]

at org.junit.Assert.fail(Assert.java:89)
at org.eclipse.jdt.ui.tests.quickfix.QuickFixTest.assertNumberOfProblems(QuickFixTest.java:254)
at org.eclipse.jdt.ui.tests.quickfix.QuickFixTest.collectCorrections(QuickFixTest.java:229)
at org.eclipse.jdt.ui.tests.quickfix.QuickFixTest.collectCorrections(QuickFixTest.java:224)
at org.eclipse.jdt.ui.tests.quickfix.QuickFixTest1d8.testRemoveRedundantNonNull(QuickFixTest1d8.java:1743)

Regression from eclipse-jdt/eclipse.jdt.core#683

@iloveeclipse
Copy link
Member Author

@stephan-herrmann : could you please check if the original change eclipse-jdt/eclipse.jdt.core#683 produces expected results?

In debugger I see that the test fails because two identical compiler problems are reported now for the code below (which is tested in QuickFixTest1d8.testRemoveRedundantNonNull)

package test;
import org.eclipse.jdt.annotation.*;
@NonNullByDefault public class E {
  @NonNull Object f=new Object();
}

image

I can quickly fix the test (just adopt the assertion), but I assume it is not expected that compiler generates two identical problems for same line of code.

@iloveeclipse
Copy link
Member Author

@stephan-herrmann : I've pushed #425 in case it would take longer to fix JDT core problem, so that JDT UI builds can succeed in Jenkins (right now they all fail due the broken test).

Just give a hint if that should be merged or not, I will wait with merging for now, especially ECA doesn't work anymore today: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/2635

@stephan-herrmann
Copy link
Contributor

Thanks for the heads-up. Of course no warning should be reported twice.

I'll look into it later today. If you need to fix JDT/UI right now, feel free to merge #425 - I'd revert that when the issue in JDT/Core is fixed.

@iloveeclipse
Copy link
Member Author

@stephan-herrmann : I will wait, no one can merge anyway now.
In best case you will have a fix in near future and we can close #425 without merging.

@stephan-herrmann
Copy link
Contributor

@iloveeclipse if you see eclipse-jdt/eclipse.jdt.core#707 succeed, before I get online again, feel free to merge it (although it stirred up some more dust, which I'll clean up later).

@iloveeclipse
Copy link
Member Author

Thanks @stephan-herrmann !

@iloveeclipse iloveeclipse added bug Something isn't working regression Regression defect labels Feb 7, 2023
@iloveeclipse iloveeclipse added this to the 4.27 M3 milestone Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Regression defect
Projects
None yet
2 participants