Bug 16879 Double click after { does not always select the right block of code.
Past the following code in a java text editor public void foo() { String aString = "AAAAAAAAAAAAAAAAA"; String s1[] = new String[]{aString}; String s2[] = new String[]{"aaaa"}; Object o1[] = new Object[][]{{aString},{aString}}; } 1) Doubleclick after { in the line "String s1[]". It will select the code between { and }. Good. 2) Now doubleclick after the first { in the line "String s2[]". It will select aaaa without including the ". It should select everything between { and }. 3) Now doubleclick after the first { in the line "Object o1[]". It will select the contents of the second { instead of the first one.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaPairMatcher.java
fEndPos= -1;
		
		try {
			char prevChar= fDocument.getChar(Math.max(fOffset - 1, 0));
			char nextChar= fDocument.getChar(fOffset);
			
			for (i= 0; i < fPairs.length; i= i + 2) {
				if (nextChar == fPairs[i]) {
					fStartPos= fOffset;
					pairIndex1= i;
				} else if (prevChar == fPairs[i]) {
					fStartPos= fOffset - 1;
					pairIndex1= i;
				}
			}
			
			
			for (i= 1; i < fPairs.length; i= i + 2) {
				if (prevChar == fPairs[i]) {
					fEndPos= fOffset - 1;
					pairIndex2= i;
				} else if (nextChar == fPairs[i]) {
					fEndPos= fOffset;
					pairIndex2= i;
				}
			}
			if (fEndPos > -1) {
				fAnchor= RIGHT;
				fStartPos= searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument);
				if (fStartPos > -1)