Skip to content

Avoid deprecated org.eclipse.jdt.ui.actions.ShowInPackageViewAction#1844

Merged
ruspl-afed merged 1 commit intoeclipse-pde:masterfrom
ruspl-afed:audit_show_package
Jun 30, 2025
Merged

Avoid deprecated org.eclipse.jdt.ui.actions.ShowInPackageViewAction#1844
ruspl-afed merged 1 commit intoeclipse-pde:masterfrom
ruspl-afed:audit_show_package

Conversation

@ruspl-afed
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 29, 2025

Test Results

   765 files  ±0     765 suites  ±0   58m 56s ⏱️ + 2m 40s
 3 611 tests ±0   3 535 ✅ ±0   76 💤 ±0  0 ❌ ±0 
10 833 runs  ±0  10 602 ✅ ±0  231 💤 ±0  0 ❌ ±0 

Results for commit b3b4d95. ± Comparison against base commit 3993065.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping to get rid of deprecated code.

}
}
private void handleGoToPackage(IStructuredSelection selection) {
Optional.ofNullable(getPackageFragment(selection)).map(ShowInPackageExplorer::new).ifPresent(r -> r.run());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If one wants to use optional, I would have expected it that getPackageFragment(selection); already returns an optional here.

otherwise an early exit like

if (frag == null) {
  return;
}

seems more suitable here than wrapping in an optional ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected it that getPackageFragment(selection); already returns an optional here.

It was so in initial version, but then the fight with null spreads more and more and I reverted it to avoid loosely related changes.

Copy link
Copy Markdown
Contributor Author

@ruspl-afed ruspl-afed Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laeubi I suggest to rework nullable IPackageFragment getPackageFragment to Optional<IPackageFragment> extractPackageFragment with another PR

@ruspl-afed ruspl-afed force-pushed the audit_show_package branch 2 times, most recently from 9715bdc to b03463f Compare June 30, 2025 12:27
Copy link
Copy Markdown
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates, the code looks good to me now.

I just think we should not add generic comments to the contributors list.
But besides that I'm fine with this change.

Comment thread ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/EditorUtilities.java Outdated
@ruspl-afed ruspl-afed force-pushed the audit_show_package branch from b03463f to b3b4d95 Compare June 30, 2025 17:38
Copy link
Copy Markdown
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thank you :)

@ruspl-afed ruspl-afed merged commit a3a70c3 into eclipse-pde:master Jun 30, 2025
19 checks passed
@ruspl-afed ruspl-afed deleted the audit_show_package branch June 30, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants