Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 212126 Details for
Bug 372128
[syntax highlighting] "Highlight enclosing brackets" has massive performance problems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch for platform text
text-performance.txt (text/plain), 22.93 KB, created by
Deepak Azad
on 2012-03-06 06:32:25 EST
(
hide
)
Description:
patch for platform text
Filename:
MIME Type:
Creator:
Deepak Azad
Created:
2012-03-06 06:32:25 EST
Size:
22.93 KB
patch
obsolete
>diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java >index e8dae52..7c9dd53 100644 >--- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java >+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java >@@ -13,9 +13,6 @@ > import junit.framework.Test; > import junit.framework.TestSuite; > >-import org.eclipse.jface.text.tests.reconciler.ReconcilerTestSuite; >-import org.eclipse.jface.text.tests.rules.RulesTestSuite; >- > > /** > * Test Suite for org.eclipse.jface.text. >@@ -26,13 +23,13 @@ > > public static Test suite() { > TestSuite suite= new TestSuite("Test Suite for org.eclipse.jface.text"); //$NON-NLS-1$ >- suite.addTest(HTML2TextReaderTest.suite()); >- suite.addTest(TextHoverPopupTest.suite()); >- suite.addTest(TextPresentationTest.suite()); >- suite.addTest(DefaultUndoManagerTest.suite()); >- suite.addTest(TextViewerUndoManagerTest.suite()); >- suite.addTest(RulesTestSuite.suite()); >- suite.addTest(ReconcilerTestSuite.suite()); >+ /* suite.addTest(HTML2TextReaderTest.suite()); >+ suite.addTest(TextHoverPopupTest.suite()); >+ suite.addTest(TextPresentationTest.suite()); >+ suite.addTest(DefaultUndoManagerTest.suite()); >+ suite.addTest(TextViewerUndoManagerTest.suite()); >+ suite.addTest(RulesTestSuite.suite()); >+ suite.addTest(ReconcilerTestSuite.suite());*/ > suite.addTest(DefaultPairMatcherTest.suite()); > suite.addTest(DefaultPairMatcherTest2.suite()); > >diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultCharacterPairMatcher.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultCharacterPairMatcher.java >index 4983562..ed8cfa7 100644 >--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultCharacterPairMatcher.java >+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultCharacterPairMatcher.java >@@ -9,9 +9,6 @@ > * Christian Plesner Hansen (plesner@quenta.org) - initial API and implementation > *******************************************************************************/ > package org.eclipse.jface.text.source; >-import java.util.HashSet; >-import java.util.Set; >- > import org.eclipse.core.runtime.Assert; > > import org.eclipse.jface.text.BadLocationException; >@@ -97,6 +94,14 @@ > this(chars, IDocumentExtension3.DEFAULT_PARTITIONING); > } > >+ /** >+ * @see org.eclipse.jface.text.source.ICharacterPairMatcherExtension#isMatchedChar(char) >+ * @since 3.8 >+ */ >+ public boolean isMatchedChar(char ch) { >+ return fPairs.contains(ch); >+ } >+ > /* @see ICharacterPairMatcher#match(IDocument, int) */ > public IRegion match(IDocument doc, int offset) { > if (doc == null || offset < 0 || offset > doc.getLength()) return null; >@@ -132,38 +137,134 @@ > if (document == null || offset < 0 || offset > document.getLength()) > return null; > >- int start; >- int end; >- if (length >= 0) { >- start= offset; >- end= offset + length; >- } else { >- end= offset; >- start= offset + length; >+ //maybe a bracket is selected >+ IRegion region= match(document, offset, length); >+ if (region != null) { >+ return region; > } > >- int sourceCaretOffset= offset + length; >- int adjustment= getOffsetAdjustment(document, sourceCaretOffset, length); >- sourceCaretOffset+= adjustment; >- >+ //bracket is not selected >+ fAnchor= ICharacterPairMatcher.LEFT; > try { >- for (int offset1= sourceCaretOffset; offset1 >= 0; offset1--) { >- char prevChar= document.getChar(Math.max(offset1 - 1, 0)); >- if (fPairs.contains(prevChar) && fPairs.isStartCharacter(prevChar)) { >- IRegion match= performMatch(document, offset1); >- if (match != null) { >- int matchOffset= match.getOffset(); >- int matchLength= match.getLength(); >- if ((matchOffset <= start) && (matchOffset + matchLength > start) && (matchOffset < end) && (matchOffset + matchLength >= end)) { >- return match; >- } >- } >- } >- } >+ final String partition1= TextUtilities.getContentType(document, fPartitioning, offset, false); >+ final DocumentPartitionAccessor partDoc= new DocumentPartitionAccessor(document, fPartitioning, partition1); >+ >+ return findEnclosing(document, partDoc, offset, length, 0, document.getLength()); >+ > } catch (BadLocationException ble) { > return null; > } >- return null; >+ } >+ >+ /** >+ * Searches <code>doc</code> for the specified end character, <code>end</code>. >+ * >+ * @param document the document >+ * @param doc the document to search >+ * @param offset the offset >+ * @param length the length >+ * @param lowerBoundary the lower boundary >+ * @param upperBoundary the upper boundary >+ * >+ * @return the index of the end character if it was found, otherwise -1 >+ * @throws BadLocationException if the document is accessed with invalid offset or line >+ */ >+ >+ private IRegion findEnclosing(IDocument document, DocumentPartitionAccessor doc, int offset, int length, int lowerBoundary, int upperBoundary) throws BadLocationException { >+ int pos1; >+ int pos2; >+ >+ if (fPairs.isStartCharacter(doc.getChar(offset))) { >+ pos1= doc.getNextPosition(offset, false); >+ pos2= offset; >+ } else { >+ pos1= offset; >+ pos2= doc.getNextPosition(offset, true); >+ } >+ >+ char[] pairs= fPairs.fPairs; >+ int[][] counts= new int[pairs.length][2]; >+ for (int i= 0; i < counts.length; i++) { >+ counts[i][0]= counts[i][1]= 0; >+ } >+ >+ boolean lowerFound= false; >+ boolean upperFound= false; >+ >+ outer1: while (pos1 >= lowerBoundary && !lowerFound) { >+ final char c= doc.getChar(pos1); >+ >+ int i= index(document, pairs, c, pos1); >+ if (i == -1) { >+// continue; >+ } else if (doc.inPartition(pos1)) { >+ if (i % 2 == 0) { >+ //start >+ counts[i / 2][0]--; >+ >+ } else { >+ //end >+ counts[i / 2][0]++; >+ } >+ >+ for (int j= 0; j < counts.length; j++) { >+ if (counts[j][0] == -1) { >+ lowerFound= true; >+ break outer1; >+ } >+ } >+ } >+ >+ pos1= doc.getNextPosition(pos1, false); >+ } >+ >+ outer2: while (pos2 < upperBoundary && !upperFound) { >+ final char c= doc.getChar(pos2); >+ >+ int i= index(document, pairs, c, pos2); >+ if (i == -1) { >+// continue; >+ } else if (doc.inPartition(pos2)) { >+ if (i % 2 == 0) { >+ //start >+ counts[i / 2][1]++; >+ >+ } else { >+ //end >+ counts[i / 2][1]--; >+ } >+ for (int j= 0; j < counts.length; j++) { >+ if (counts[j][1] == -1 && counts[j][0] == -1) { >+ upperFound= true; >+ break outer2; >+ } >+ } >+ } >+ pos2= doc.getNextPosition(pos2, true); >+ } >+ pos2++; >+ >+ if (pos1 < lowerBoundary || pos2 > upperBoundary) >+ return null; >+ return new Region(pos1, pos2 - pos1); >+ } >+ >+ /** >+ * >+ * @param document the document >+ * @param pairs the character pairs >+ * @param ch the character >+ * @param offset the offset in document >+ * @return -1 if no match, 0 if start character, 1 if end character >+ * @since 3.8 >+ */ >+ protected int index(IDocument document, char[] pairs, char ch, int offset) { >+ for (int i= 0; i < pairs.length; i++) { >+ if (pairs[i] == ch) { >+ return i; >+ } >+ } >+ return -1; > } > > /** >@@ -285,6 +386,7 @@ > private final IDocument fDocument; > private final String fPartitioning, fPartition; > private ITypedRegion fCachedPartition; >+ private int fLength; > > /** > * Creates a new partitioned document for the specified document. >@@ -298,6 +400,7 @@ > fDocument= doc; > fPartitioning= partitioning; > fPartition= partition; >+ fLength= doc.getLength(); > } > > /** >@@ -338,7 +441,7 @@ > } > > /** >- * Returns the next position to query in the search. The position >+ * Returns the next position to query in the search. The position > * is not guaranteed to be in this document's partition. > * > * @param pos an offset within the document >@@ -347,8 +450,7 @@ > */ > public int getNextPosition(int pos, boolean searchForward) { > final ITypedRegion partition= getPartition(pos); >- if (partition == null) return simpleIncrement(pos, searchForward); >- if (fPartition.equals(partition.getType())) >+ if (partition == null || fPartition.equals(partition.getType())) > return simpleIncrement(pos, searchForward); > if (searchForward) { > int end= partition.getOffset() + partition.getLength(); >@@ -376,7 +478,7 @@ > */ > private ITypedRegion getPartition(int pos) { > if (fCachedPartition == null || !contains(fCachedPartition, pos)) { >- Assert.isTrue(pos >= 0 && pos <= fDocument.getLength()); >+ Assert.isTrue(pos >= 0 && pos <= fLength); > try { > fCachedPartition= TextUtilities.getPartition(fDocument, fPartitioning, pos, false); > } catch (BadLocationException e) { >@@ -405,28 +507,18 @@ > } > > /** >- * Returns true if the specified character pair occurs in one >- * of the character pairs. >- * >+ * Returns true if the specified character occurs in one of the character pairs. >+ * > * @param c a character > * @return true exactly if the character occurs in one of the pairs > */ > public boolean contains(char c) { >- return getAllCharacters().contains(new Character(c)); >- } >- >- private Set/*<Character>*/ fCharsCache= null; >- /** >- * @return A set containing all characters occurring in character pairs. >- */ >- private Set/*<Character>*/ getAllCharacters() { >- if (fCharsCache == null) { >- Set/*<Character>*/ set= new HashSet/*<Character>*/(); >- for (int i= 0; i < fPairs.length; i++) >- set.add(new Character(fPairs[i])); >- fCharsCache= set; >+ char[] pairs= fPairs; >+ for (int i= 0, n= pairs.length; i < n; i++) { >+ if (c == pairs[i]) >+ return true; > } >- return fCharsCache; >+ return false; > } > > /** >@@ -491,4 +583,12 @@ > > } > >+ /** >+ * @return the partitioning >+ * @since 3.8 >+ */ >+ public String getPartitioning() { >+ return fPartitioning; >+ } >+ > } >diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcherExtension.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcherExtension.java >index ef87038..3469a85 100644 >--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcherExtension.java >+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcherExtension.java >@@ -49,4 +49,12 @@ > * enclosing pair > */ > IRegion findEnclosingPeerCharacters(IDocument document, int offset, int length); >+ >+ /** >+ * @param ch the character >+ * @return whether the pair matcher matches this character or not >+ */ >+ boolean isMatchedChar(char ch); >+ >+ String getPartitioning(); > } >diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java >index f32f1a0..36c384c 100644 >--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java >+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java >@@ -20,13 +20,18 @@ > import org.eclipse.swt.graphics.Rectangle; > > import org.eclipse.jface.text.BadLocationException; >+import org.eclipse.jface.text.DocumentEvent; > import org.eclipse.jface.text.IDocument; > import org.eclipse.jface.text.IPaintPositionManager; > import org.eclipse.jface.text.IPainter; > import org.eclipse.jface.text.IRegion; >+import org.eclipse.jface.text.ITextInputListener; >+import org.eclipse.jface.text.ITextListener; > import org.eclipse.jface.text.ITextViewerExtension5; > import org.eclipse.jface.text.Position; > import org.eclipse.jface.text.Region; >+import org.eclipse.jface.text.TextEvent; >+import org.eclipse.jface.text.TextUtilities; > > /** > * Highlights the peer character matching the character near the caret position. >@@ -37,7 +42,7 @@ > * > * @since 2.1 > */ >-public final class MatchingCharacterPainter implements IPainter, PaintListener { >+public final class MatchingCharacterPainter implements IPainter, PaintListener, ITextListener, ITextInputListener { > > /** Indicates whether this painter is active */ > private boolean fIsActive= false; >@@ -62,6 +67,13 @@ > /** Whether a character is present at caret location or not. */ > private boolean fCharacterPresentAtCaretLocation; > >+ private IRegion fPreviousSelection; >+ >+// private int count= 0; >+ >+ private IDocument fDocument; >+ >+ private boolean fDocumentChanged; > > /** > * Creates a new MatchingCharacterPainter for the given source viewer using the given character >@@ -75,6 +87,13 @@ > fSourceViewer= sourceViewer; > fMatcher= matcher; > fTextWidget= sourceViewer.getTextWidget(); >+ >+ fDocument= fSourceViewer.getDocument(); >+ >+ if (fMatcher instanceof ICharacterPairMatcherExtension) { >+ fSourceViewer.addTextInputListener(this); >+ fSourceViewer.addTextListener(this); >+ } > } > > /** >@@ -138,6 +157,7 @@ > * @see org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt.events.PaintEvent) > */ > public void paintControl(PaintEvent event) { >+// System.out.println("paint event - " + "fPairPosition.offset: " + fPairPosition.offset + " | fPairPosition.length: " + fPairPosition.length); > if (fTextWidget != null) > handleDrawRequest(event.gc); > } >@@ -148,7 +168,7 @@ > * @param gc the GC to draw into. > */ > private void handleDrawRequest(GC gc) { >- >+// System.out.println("drawing"); > if (fPairPosition.isDeleted) > return; > >@@ -262,7 +282,8 @@ > */ > public void paint(int reason) { > >- IDocument document= fSourceViewer.getDocument(); >+// printDebugStatements(reason, "entering the method"); >+ IDocument document= fDocument; > if (document == null) { > deactivate(false); > return; >@@ -272,12 +293,77 @@ > IRegion pair; > boolean characterPresentAtCaretLocation; > >+ if (reason != IPainter.CONFIGURATION && !fDocumentChanged && selection.equals(fPreviousSelection)) { >+// if (reason == IPainter.INTERNAL) >+// System.out.println("same as previous selection"); >+ return; >+ } >+ >+ if (reason == IPainter.TEXT_CHANGE) { >+ fPreviousSelection= selection; >+ fPairPosition.isDeleted= true; >+ return; >+ } >+ >+ fDocumentChanged= false; >+ > if (fMatcher instanceof ICharacterPairMatcherExtension) { > ICharacterPairMatcherExtension matcher= (ICharacterPairMatcherExtension)fMatcher; >+ >+ if (fHighlightEnclosingPeerCharcters && fPreviousSelection != null && reason != IPainter.INTERNAL && reason != IPainter.CONFIGURATION) { >+ int previousCaretOffset= fPreviousSelection.getOffset() + fPreviousSelection.getLength(); >+ int currentCaretOffset= selection.getOffset() + selection.getLength(); >+ >+ try { >+ //check partitions as well >+ String prevContentType= TextUtilities.getContentType(document, matcher.getPartitioning(), previousCaretOffset, false); >+ String currContentType= TextUtilities.getContentType(document, matcher.getPartitioning(), currentCaretOffset, false); >+ >+ if (prevContentType.equals(currContentType)) { >+ if (Math.abs(currentCaretOffset - previousCaretOffset) == 1) { >+ char c= currentCaretOffset > previousCaretOffset ? document.getChar(previousCaretOffset) : document.getChar(currentCaretOffset); >+ if (!matcher.isMatchedChar(c)) { >+ fPreviousSelection= selection; >+ return; >+ } >+ } >+ >+ int start; >+ int end; >+ if (currentCaretOffset > previousCaretOffset) { >+ start= previousCaretOffset; >+ end= currentCaretOffset; >+ } else { >+ start= currentCaretOffset; >+ end= previousCaretOffset; >+ } >+ boolean found= false; >+ for (int i= start; i < end; i++) { >+ if (matcher.isMatchedChar(document.getChar(i))) { >+ found= true; >+ break; >+ } >+ } >+ if (!found) { >+ fPreviousSelection= selection; >+ return; >+ } >+ } >+ } catch (BadLocationException e) { >+ //do nothing >+ } >+ } >+ >+// printDebugStatements(reason, "about to compute"); >+// count++; >+ > pair= matcher.match(document, selection.getOffset(), selection.getLength()); > characterPresentAtCaretLocation= (pair != null); > if (pair == null && fHighlightEnclosingPeerCharcters) { >+// long start= System.currentTimeMillis(); > pair= matcher.findEnclosingPeerCharacters(document, selection.getOffset(), selection.getLength()); >+// long end= System.currentTimeMillis(); >+// System.out.println("MCP: " + (end - start)); > } > } else { > if (Math.abs(selection.getLength()) > 0) { >@@ -288,6 +374,7 @@ > characterPresentAtCaretLocation= (pair != null); > } > >+ fPreviousSelection= selection; > if (pair == null) { > deactivate(true); > return; >@@ -312,6 +399,7 @@ > fPairPosition.isDeleted= false; > fPairPosition.offset= pair.getOffset(); > fPairPosition.length= pair.getLength(); >+// System.out.println("fPairPosition.offset: " + fPairPosition.offset + " | fPairPosition.length: " + fPairPosition.length); > fAnchor= fMatcher.getAnchor(); > fCharacterPresentAtCaretLocation= characterPresentAtCaretLocation; > // apply new highlighting >@@ -334,10 +422,96 @@ > } > } > >+// private void printDebugStatements(int reason, String loc) { >+//// count++; >+// String s; >+// switch (reason) { >+// case IPainter.SELECTION: >+// s= "SELECTION"; //$NON-NLS-1$ >+// break; >+// case IPainter.TEXT_CHANGE: >+// s= "TEXT_CHANGE"; //$NON-NLS-1$ >+// break; >+// case IPainter.KEY_STROKE: >+// s= "KEY_STROKE"; //$NON-NLS-1$ >+// break; >+// case IPainter.MOUSE_BUTTON: >+// s= "MOUSE_BUTTON"; //$NON-NLS-1$ >+// break; >+// case IPainter.INTERNAL: >+// s= "INTERNAL"; //$NON-NLS-1$ >+// break; >+// case IPainter.CONFIGURATION: >+// s= "CONFIGURATION"; //$NON-NLS-1$ >+// break; >+// default: >+// s= "You have got to be kidding me"; //$NON-NLS-1$ >+// break; >+// } >+// System.out.println(loc + " Reason: " + s + " count: " + count); //$NON-NLS-1$ //$NON-NLS-2$ >+// } >+ > /* > * @see org.eclipse.jface.text.IPainter#setPositionManager(org.eclipse.jface.text.IPaintPositionManager) > */ > public void setPositionManager(IPaintPositionManager manager) { > fPaintPositionManager= manager; > } >+ >+ /** >+ * @param oldInput the old input >+ * @param newInput the new input >+ * @since 3.8 >+ */ >+ public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { >+ //do nothing >+ } >+ >+ /** >+ * @param oldInput the old input >+ * @param newInput the new input >+ * @since 3.8 >+ */ >+ public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { >+ fDocument= newInput; >+ fDocumentChanged= true; >+// System.out.println("doc changed"); >+ } >+ >+ /** >+ * @param event the text event >+ * @since 3.8 >+ */ >+ public void textChanged(TextEvent event) { >+ if (!(fMatcher instanceof ICharacterPairMatcherExtension)) >+ return; >+ >+ String text= event.getText(); >+ String replacedText= event.getReplacedText(); >+// System.out.println("TextEvent: " + "|" + text + "|" + replacedText); >+ >+ boolean viewerRedrawState= event.getViewerRedrawState(); >+ DocumentEvent documentEvent= event.getDocumentEvent(); >+ if (documentEvent == null && !viewerRedrawState) >+ return; >+ >+ ICharacterPairMatcherExtension matcher= (ICharacterPairMatcherExtension)fMatcher; >+ boolean found= searchForCharacter(text, matcher) || searchForCharacter(replacedText, matcher); >+ >+ if (found || (documentEvent == null && viewerRedrawState)) { >+// System.out.println("smart painting"); >+ paint(IPainter.INTERNAL); >+ } >+ } >+ >+ private boolean searchForCharacter(String text, ICharacterPairMatcherExtension matcher) { >+ if (text == null) >+ return false; >+ for (int i= 0; i < text.length(); i++) { >+ if (matcher.isMatchedChar(text.charAt(i))) { >+ return true; >+ } >+ } >+ return false; >+ } > } >diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java >index 589aa7b..2fc930e 100644 >--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java >+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 2012 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -31,7 +31,7 @@ > super(new GapTextStore()); > } > ITextStore getStore() { >- return fTextStore; >+ return (ITextStore)new Accessor(this, CopyOnWriteTextStore.class).get("fTextStore"); > } > String get() { > return get(0, getLength()); >@@ -68,7 +68,7 @@ > // check that underlying text store is not modifiable > boolean failed= false; > try { >- fText.getStore().replace(0,0,null); >+ fText.getStore().replace(0, 0, null); > } catch (UnsupportedOperationException uoe) { > failed= true; > } >@@ -91,7 +91,7 @@ > // check that underlying text store is not modifiable > boolean failed= false; > try { >- fText.getStore().replace(0,0,null); >+ fText.getStore().replace(0, 0, null); > } catch (UnsupportedOperationException uoe) { > failed= true; > } >diff --git a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java >index a4e5095..370eb76 100644 >--- a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java >+++ b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -802,9 +802,11 @@ > * @see org.eclipse.jface.text.IDocument#getChar(int) > */ > public char getChar(int pos) throws BadLocationException { >- if ((0 > pos) || (pos >= getLength())) >+ try { >+ return fStore.get(pos); //TODO: call getStore() ? >+ } catch (IndexOutOfBoundsException e) { > throw new BadLocationException(); >- return getStore().get(pos); >+ } > } > > /* >diff --git a/org.eclipse.text/src/org/eclipse/jface/text/CopyOnWriteTextStore.java b/org.eclipse.text/src/org/eclipse/jface/text/CopyOnWriteTextStore.java >index 7bb46ee..acbe1e2 100644 >--- a/org.eclipse.text/src/org/eclipse/jface/text/CopyOnWriteTextStore.java >+++ b/org.eclipse.text/src/org/eclipse/jface/text/CopyOnWriteTextStore.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2010 IBM Corporation and others. >+ * Copyright (c) 2005, 2012 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -107,7 +107,7 @@ > } > > /** The underlying "real" text store */ >- protected ITextStore fTextStore= new StringTextStore(); >+ private ITextStore fTextStore; > > /** A modifiable <code>ITextStore</code> instance */ > private final ITextStore fModifiableTextStore;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 372128
:
211936
|
212125
|
212126
|
212208
|
212214
|
212353
|
212364
|
212429
|
212430