Skip to content

Commit

Permalink
Fix code cleanliness
Browse files Browse the repository at this point in the history
  • Loading branch information
LizzMre committed Aug 18, 2023
1 parent 79db048 commit c28e14a
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,19 @@ public Object[] getElements(Object inputElement) {
public void selectionChanged(final SelectionChangedEvent event) {
IMemoryRenderingContainer containers[] = ((IMemorySearchQuery) fQuery).getMemoryView()
.getMemoryRenderingContainers();
if (containers == null || containers.length == 0) return;
if (containers == null || containers.length == 0)
return;

if (event.getSelection() instanceof StructuredSelection && ((StructuredSelection) event.getSelection())
.getFirstElement() instanceof MemoryMatch match) {

if (match == null) return;
if (match == null)
return;

for (int i = 0; i < containers.length; i++) {
IMemoryRendering rendering = containers[i].getActiveRendering();
if (!(rendering instanceof IRepositionableMemoryRendering repositionable)) continue;
if (!(rendering instanceof IRepositionableMemoryRendering repositionable))
continue;

try {
repositionable.goToAddress(match.getStartAddress());
Expand Down Expand Up @@ -224,7 +227,8 @@ public void doubleClick(DoubleClickEvent event) {
if (event.getSelection() instanceof StructuredSelection
&& ((StructuredSelection) event.getSelection()).getFirstElement() instanceof MemoryMatch) {
IWorkbenchPart wb = ((IMemorySearchQuery) fQuery).getMemoryView().getSite().getPart();
if (wb == null) return;
if (wb == null)
return;
getSite().getPage().activate(wb);
}
}
Expand Down

0 comments on commit c28e14a

Please sign in to comment.