Avoid deprecated org.eclipse.jdt.ui.actions.ShowInPackageViewAction#1844
Avoid deprecated org.eclipse.jdt.ui.actions.ShowInPackageViewAction#1844ruspl-afed merged 1 commit intoeclipse-pde:masterfrom
org.eclipse.jdt.ui.actions.ShowInPackageViewAction#1844Conversation
HannesWell
left a comment
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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 ...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@laeubi I suggest to rework nullable IPackageFragment getPackageFragment to Optional<IPackageFragment> extractPackageFragment with another PR
9715bdc to
b03463f
Compare
HannesWell
left a comment
There was a problem hiding this comment.
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.
b03463f to
b3b4d95
Compare
No description provided.