Source:
<code>public static MergeSourceViewer extractMergeSourceViewer(ICompareNavigator aNavigator, boolean aIsLeftPane) { if (aNavigator instanceof CompareEditorInputNavigator) { final Object[] panes = ((CompareEditorInputNavigator) aNavigator).getPanes(); for (Object pane : panes) { if (pane instanceof CompareContentViewerSwitchingPane) { Viewer viewer = ((CompareContentViewerSwitchingPane) pane).getViewer(); if (viewer instanceof TextMergeViewer) { TextMergeViewer textViewer = (TextMergeViewer) viewer; Class textViewerClass = textViewer.getClass(); if (!textViewerClass.getName().equals(COMPARE_EDITOR_TEXT_CLASS_NAME)) { do { textViewerClass = textViewerClass.getSuperclass(); if (textViewerClass.getName().equals(DEFAULT_OBJECT_CLASS_NAME)) { break; } } while (!textViewerClass.getName().equals(COMPARE_EDITOR_TEXT_CLASS_NAME)); } try { Field field; if (aIsLeftPane) { field = textViewerClass.getDeclaredField(COMPARE_EDITOR_TEXT_FIELD_LEFT); } else { field = textViewerClass.getDeclaredField(COMPARE_EDITOR_TEXT_FIELD_RIGHT); } field.setAccessible(true); MergeSourceViewer sourceViewer = (MergeSourceViewer) field.get(textViewer); return sourceViewer; <START> } catch (SecurityException e) { <END> } catch (NoSuchFieldException e) { } catch (IllegalArgumentException e) { } catch (IllegalAccessException e) { } } } } } return null; }</code><technical_language>I prefer catch exception here. Consider logging inform user failed</technical_language>

Target:
public static MergeSourceViewer extractMergeSourceViewer(ICompareNavigator aNavigator, boolean aIsLeftPane) { if (aNavigator instanceof CompareEditorInputNavigator) { final Object[] panes = ((CompareEditorInputNavigator) aNavigator).getPanes(); for (Object pane : panes) { if (pane instanceof CompareContentViewerSwitchingPane) { Viewer viewer = ((CompareContentViewerSwitchingPane) pane).getViewer(); if (viewer instanceof TextMergeViewer) { TextMergeViewer textViewer = (TextMergeViewer) viewer; Class textViewerClass = textViewer.getClass(); if (!textViewerClass.getName().equals(COMPARE_EDITOR_TEXT_CLASS_NAME)) { do { textViewerClass = textViewerClass.getSuperclass(); if (textViewerClass.getName().equals(DEFAULT_OBJECT_CLASS_NAME)) { break; } } while (!textViewerClass.getName().equals(COMPARE_EDITOR_TEXT_CLASS_NAME)); } try { Field field; if (aIsLeftPane) { field = textViewerClass.getDeclaredField(COMPARE_EDITOR_TEXT_FIELD_LEFT); } else { field = textViewerClass.getDeclaredField(COMPARE_EDITOR_TEXT_FIELD_RIGHT); } field.setAccessible(true); MergeSourceViewer sourceViewer = (MergeSourceViewer) field.get(textViewer); return sourceViewer; } catch (SecurityException e) { StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Exception raised: " + e.toString())); } catch (NoSuchFieldException e) { StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Exception raised: " + e.toString())); } catch (IllegalArgumentException e) { StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Exception raised: " + e.toString())); } catch (IllegalAccessException e) { StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Exception raised: " + e.toString())); } } } } } return null; }