Source:
<code>public void getMemoryBlockAddressInfo(Object selection, final IMemoryBlock memBlock, final IGetMemoryBlockAddressInfoReq request) { IDMContext memBlockContext = null; if (memBlock instanceof DsfMemoryBlock) { memBlockContext = ((DsfMemoryBlock) memBlock).getContext(); if (selection instanceof IDMVMContext) { IDMContext context = ((IDMVMContext) selection).getDMContext(); final IFrameDMContext frameCtx = DMContexts.getAncestorOfType(context, IFrameDMContext.class); if (frameCtx != null) { IContainerDMContext selectedContainerCtx = DMContexts.getAncestorOfType(frameCtx, IContainerDMContext.class); IContainerDMContext memoryContainerCtx = DMContexts.getAncestorOfType(memBlockContext, IContainerDMContext.class); <START> if (memoryContainerCtx.equals(selectedContainerCtx)) { <END> fSession.getExecutor().execute(new DsfRunnable() { @Override public void run() { final IMemoryAddressInfo service = resolveService(IMemoryAddressInfo.class); IGdbMemoryAddressInfoTypeRetrieval[] infoTypeProviders = service .getMemoryAddressInfoProviders(); if (infoTypeProviders == null || infoTypeProviders.length == 0) { request.done(); return; } final CountingRequestMonitor crm = new CountingRequestMonitor(fSession.getExecutor(), null) { @Override protected void handleCompleted() { request.done(); }; }; for (final IGdbMemoryAddressInfoTypeRetrieval infoProvider : infoTypeProviders) { infoProvider.itemsRequest(frameCtx, memBlock, new DataRequestMonitor<IMemoryBlockAddressInfoItem[]>( fSession.getExecutor(), crm) { @Override protected void handleCompleted() { if (isSuccess()) { request.setAddressInfoItems(infoProvider.getInfoType(), getData()); } else { request.setStatus(getStatus()); } crm.done(); } }); } crm.setDoneCount(infoTypeProviders.length); } }); } } else { request.done(); } } } }</code><technical_language>safe, check memoryContainerCtx is null</technical_language>

Target:
public void getMemoryBlockAddressInfo(Object selection, final IMemoryBlock memBlock, final IGetMemoryBlockAddressInfoReq request) { IDMContext memBlockContext = null; if (memBlock instanceof DsfMemoryBlock) { memBlockContext = ((DsfMemoryBlock) memBlock).getContext(); if (selection instanceof IDMVMContext) { IDMContext context = ((IDMVMContext) selection).getDMContext(); final IFrameDMContext frameCtx = DMContexts.getAncestorOfType(context, IFrameDMContext.class); if (frameCtx != null) { IContainerDMContext selectedContainerCtx = DMContexts.getAncestorOfType(frameCtx, IContainerDMContext.class); IContainerDMContext memoryContainerCtx = DMContexts.getAncestorOfType(memBlockContext, IContainerDMContext.class); if (memoryContainerCtx.equals(selectedContainerCtx)) { fSession.getExecutor().execute(new DsfRunnable() { @Override public void run() { IGdbMemoryAddressInfoTypeRetrieval[] infoTypeProviders = resolveMemoryAddressInfoProviders(); if (infoTypeProviders == null || infoTypeProviders.length == 0) { request.done(); return; } final CountingRequestMonitor crm = new CountingRequestMonitor(fSession.getExecutor(), null) { @Override protected void handleCompleted() { request.done(); }; }; for (final IGdbMemoryAddressInfoTypeRetrieval infoProvider : infoTypeProviders) { infoProvider.itemsRequest(frameCtx, memBlock, new DataRequestMonitor<IMemoryBlockAddressInfoItem[]>( fSession.getExecutor(), crm) { @Override protected void handleCompleted() { if (isSuccess()) { request.setAddressInfoItems(infoProvider.getInfoType(), getData()); } else { request.setStatus(getStatus()); } crm.done(); } }); } crm.setDoneCount(infoTypeProviders.length); } }); } } else { request.done(); } } } }