Project: JDT
Bug 209505 [implementation] Incorrect pair-match determination of searchable partition
Reported: 2007-11-12 10:32:34 | Status: resolved fixed

Build ID: M20071023-1652 Steps To Reproduce: For a document where the closing element of a matchable pair is the last character in a partition, DefaultCharacterPairMatcher will fail to search the correct partition type -- it will search based on the type of the immediately following partition. More information: In DefaultCharacterPairMatcher#performMatch, the partition to search is determined by: final int adjustedOffset= isForward ? offset - 1 : offset; final String partition= TextUtilities.getContentType(doc, fPartitioning, adjustedOffset, false); where "offset" is the document offset representing the caret position, which will be one after the character offset of the end of the "right" partition to search. The correction is to change the computation of "adjustedOffset" to: final int adjustedOffset = offset - 1;

Files changed in fix:
org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/JavaPairMatcherTest.java