Bug 28716 [misc] 'Goto Matching Bracket' fails when 'Show Source of Selected Element Only' is selected
When the 'Show Source of Selected Element Only' button is pressed and the editor is narrowed down to the selected method the Goto Matching Bracket action fails. It reports 'No Matching Bracket' found in the status bar. Invoking the same action on the same bracket when the editor shows the whole of the source file works as expected.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
else
					return new Region(start + 1, end - start - 1);
				
			} catch (BadLocationException x) {
				return null;
			}
		}
		IRegion getCurrentTextRegion(ISourceViewer viewer) {
			int offset= getCurrentTextOffset(viewer);				
			if (offset == -1)
				return null;
			IJavaElement input= SelectionConverter.getInput(JavaEditor.this);
			if (input == null)
				return null;
			try {
				
				IJavaElement[] elements= null;
				synchronized (input) {
					elements= ((ICodeAssist) input).codeSelect(offset, 0);
				}
				
				if (elements == null || elements.length == 0)
					return null;
					
				return selectWord(viewer.getDocument(), offset);
					
			} catch (JavaModelException e) {
				return null;	
			}
		}