use of com.google.security.zynamics.binnavi.Exceptions.MaybeNullException in project binnavi by google.
the class CCrossReferencesPanel method processRemovedNode.
/**
* Processes a removed node and updates the references list accordingly.
*
* @param node The node to remove.
*
* @return True, if the removed node was the last node with its parent function in the graph.
*/
private boolean processRemovedNode(final INaviViewNode node) {
if (node instanceof INaviCodeNode) {
final INaviCodeNode cnode = (INaviCodeNode) node;
try {
final INaviFunction targetFunction = cnode.getParentFunction();
if (m_nodeCounter.containsKey(targetFunction)) {
final int newCounter = m_nodeCounter.get(targetFunction) - 1;
if (newCounter == 0) {
m_nodeCounter.remove(targetFunction);
final Set<CCrossReference> toDelete = new HashSet<CCrossReference>();
for (final CCrossReference reference : m_crossReferences) {
if (reference.getCalledFunction() == targetFunction) {
toDelete.add(reference);
}
}
m_crossReferences.removeAll(toDelete);
return true;
} else {
m_nodeCounter.put(targetFunction, newCounter);
}
}
// else
// {
// TODO: How is this even possible?
// }
} catch (final MaybeNullException exception) {
// Code nodes that do not have a parent function can obviously not be called.
}
}
return false;
}
use of com.google.security.zynamics.binnavi.Exceptions.MaybeNullException in project binnavi by google.
the class CCodeNodeUpdater method removeListeners.
/**
* Removes all listeners this class has attached.
*/
private void removeListeners() {
try {
codeNode.getParentFunction().removeListener(functionUpdater);
codeNode.getParentFunction().getModule().removeListener(moduleUpdater);
} catch (final MaybeNullException exception) {
// The code nodes does not have a parent function, therefore the information
// about the parent function is not shown in the code and does not have to
// be processed when updating.
}
codeNode.removeListener(codeNodeListener);
for (final INaviInstruction instruction : codeNode.getInstructions()) {
instruction.removeListener(instructionUpdater);
}
final Iterator<CTag> it = codeNode.getTagsIterator();
while (it.hasNext()) {
it.next().removeListener(tagUpdater);
}
for (final IDebugger debugger : provider.getDebuggers()) {
debugger.getProcessManager().removeListener(debuggerUpdater);
}
provider.removeListener(debuggerProviderListener);
graph.getSettings().getDisplaySettings().removeListener(settingsUpdater);
}
Aggregations