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
buffer.append(closingCharacter);
					document.replace(offset, length, buffer.toString());
					LinkedPositionManager manager= new LinkedPositionManager(document);
					manager.addPosition(offset + 1, 0);
					fOffset= offset;
					fLength= 2;
			
					LinkedPositionUI editor= new LinkedPositionUI(sourceViewer, manager);
					editor.setCancelListener(this);
					editor.setExitPolicy(new ExitPolicy(closingCharacter));
					editor.setFinalCaretOffset(offset + 2);
					editor.enter();
					IRegion newSelection= editor.getSelectedRegion();
					sourceViewer.setSelectedRange(newSelection.getOffset(), newSelection.getLength());
	
					event.doit= false;
				} catch (BadLocationException e) {
				}
				break;	
			}
		}
		
		/*
		 * @see org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.ExitListener#exit(boolean)
		 */
		public void exit(boolean accept) {
			if (accept)
				return;
			
			try {