Add Java‑8 lambda quick‑fix tests for supported JDT correction scenarios#2895
Merged
noopur2507 merged 1 commit intoeclipse-jdt:masterfrom Apr 10, 2026
Merged
Add Java‑8 lambda quick‑fix tests for supported JDT correction scenarios#2895noopur2507 merged 1 commit intoeclipse-jdt:masterfrom
noopur2507 merged 1 commit intoeclipse-jdt:masterfrom
Conversation
Contributor
Author
|
hi @noopur2507 |
jjohnstn
requested changes
Apr 1, 2026
Contributor
|
@RagiGeorge You also need to add the test to one of the testsuites. |
noopur2507
requested changes
Apr 2, 2026
Member
noopur2507
left a comment
There was a problem hiding this comment.
In addition to what Jeff mentioned i.e. apply the proposal and compare the result with expected output:
-
Use existing test classes to add tests and reuse methods like
QuickFixTest#assertProposalExistswhere applicable. -
The content in
testUnhandledExceptionInLambdaandtestUnhandledExceptionInExpressionLambdais identical. -
tearDown()method should be present.
c8012b4 to
72e0f3d
Compare
- Added 5 lambda quick-fix tests to LocalCorrectionsQuickFixTest1d8 - testUnhandledExceptionInLambda: Tests 'Surround with try/catch' for unhandled exceptions in lambda - testMissingReturnInConditionalLambda: Tests 'Add return statement' for missing return in if statement - testMissingReturnInMultipleBranches: Tests 'Add return statement' for missing return in if-else branches - testMissingReturnAfterLoop: Tests 'Add return statement' for missing return after loop - testMissingReturnInTryCatch: Tests 'Add return statement' for missing return in try-catch block - All tests use assertProposalPreviewEquals to verify the complete fix output - Tests are already included in QuickFixTestSuite via LocalCorrectionsQuickFixTest1d8.class
Contributor
Author
|
@noopur2507/ @jjohnstn |
jjohnstn
approved these changes
Apr 9, 2026
Contributor
jjohnstn
left a comment
There was a problem hiding this comment.
Looks fine. In the future, don't reformat the whole file, just the area where your changes are.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new test class LambdaQuickFixTest1d8 that adds meaningful, Java‑8‑specific lambda quick‑fix coverage to the JDT UI test suite.
What it does
The tests intentionally focus only on lambda scenarios for which Eclipse JDT UI currently provides correction proposals, and avoid cases where quick‑fixes are intentionally not offered.
How to test