Bug 26314 Goto Matching Bracket bug with selection
20021113 1. In this code action.setChecked(elements[i].equals(fHierarchyView.getInputElement())); select the last bracket with a selection of length 1. 2. press ctrl + shift + P 3. wrong bracket is matched
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
final ISourceViewer sourceViewer= getSourceViewer();
				IDocument document= sourceViewer.getDocument();
				document.replace(fOffset, fLength, null);
			} catch (BadLocationException e) {
			}
		}
	}
	
	protected AnnotationType getAnnotationType(String preferenceKey) {
		Iterator e= ANNOTATION_MAP.keySet().iterator();
		while (e.hasNext()) {
			AnnotationType type= (AnnotationType) e.next();
			AnnotationInfo info= (AnnotationInfo) ANNOTATION_MAP.get(type);
			if (info != null) {
				if (preferenceKey.equals(info.fColorPreference) || preferenceKey.equals(info.fEditorPreference) || preferenceKey.equals(info.fOverviewRulerPreference)) 
					return type;
			}
		}
		return null;
	}
	
	/*
	 * @see AbstractTextEditor#handlePreferenceStoreChanged(PropertyChangeEvent)
	 */
	protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
		
		try {
			
			AdaptedSourceViewer asv= (AdaptedSourceViewer) getSourceViewer();
			if (asv != null) {