pydev-cvs Mailing List for PyDev for Eclipse (Page 15)
Brought to you by:
fabioz
You can subscribe to this list here.
2004 |
Jan
|
Feb
(4) |
Mar
(48) |
Apr
(56) |
May
(64) |
Jun
(27) |
Jul
(66) |
Aug
(81) |
Sep
(148) |
Oct
(194) |
Nov
(78) |
Dec
(46) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(125) |
Feb
(126) |
Mar
(163) |
Apr
(133) |
May
(115) |
Jun
(307) |
Jul
(387) |
Aug
(417) |
Sep
(283) |
Oct
(148) |
Nov
(45) |
Dec
(53) |
2006 |
Jan
(240) |
Feb
(200) |
Mar
(267) |
Apr
(231) |
May
(245) |
Jun
(361) |
Jul
(142) |
Aug
(12) |
Sep
(210) |
Oct
(99) |
Nov
(7) |
Dec
(30) |
2007 |
Jan
(161) |
Feb
(511) |
Mar
(265) |
Apr
(74) |
May
(147) |
Jun
(151) |
Jul
(94) |
Aug
(68) |
Sep
(98) |
Oct
(144) |
Nov
(26) |
Dec
(36) |
2008 |
Jan
(98) |
Feb
(107) |
Mar
(199) |
Apr
(113) |
May
(119) |
Jun
(112) |
Jul
(92) |
Aug
(71) |
Sep
(101) |
Oct
(16) |
Nov
|
Dec
|
From: Fabio Z. <fa...@us...> - 2008-06-14 23:35:53
|
Update of /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/env In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25506/src_console/org/python/pydev/debug/newconsole/env Modified Files: IProcessFactory.java Log Message: Fixed problem while creating jython shell. Index: IProcessFactory.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/env/IProcessFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IProcessFactory.java 21 May 2008 01:38:14 -0000 1.6 --- IProcessFactory.java 14 Jun 2008 23:36:00 -0000 1.7 *************** *** 96,100 **** if(interpreterManager.isPython()){ commandLine = SimplePythonRunner.makeExecutableCommandStr(scriptWithinPySrc.getAbsolutePath(), ! new String[]{""+port, ""+clientPort}); }else if(interpreterManager.isJython()){ --- 96,100 ---- if(interpreterManager.isPython()){ commandLine = SimplePythonRunner.makeExecutableCommandStr(scriptWithinPySrc.getAbsolutePath(), ! new String[]{String.valueOf(port), String.valueOf(clientPort)}); }else if(interpreterManager.isJython()){ *************** *** 103,107 **** commandLine = SimpleJythonRunner.makeExecutableCommandStrWithVMArgs(scriptWithinPySrc.getAbsolutePath(), ! pythonpathEnv, vmArgs, new String[]{""+port, ""+clientPort}); }else{ --- 103,107 ---- commandLine = SimpleJythonRunner.makeExecutableCommandStrWithVMArgs(scriptWithinPySrc.getAbsolutePath(), ! pythonpathEnv, vmArgs, new String[]{String.valueOf(port), String.valueOf(clientPort)}); }else{ |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:15:19
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin/nature In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/plugin/nature Modified Files: PythonNatureStore.java PythonPathNature.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PythonPathNature.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin/nature/PythonPathNature.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PythonPathNature.java 9 May 2008 00:42:32 -0000 1.26 --- PythonPathNature.java 14 Jun 2008 22:14:55 -0000 1.27 *************** *** 25,28 **** --- 25,29 ---- import org.python.pydev.core.IPythonPathNature; import org.python.pydev.core.REF; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.plugin.PydevPlugin; import org.python.pydev.ui.filetypes.FileTypesPreferencesPage; *************** *** 116,120 **** //relative to the project location String[] strings = source.split("\\|"); ! StringBuffer buf = new StringBuffer(); for (int i = 0; i < strings.length; i++) { if(strings[i].trim().length()>0){ --- 117,121 ---- //relative to the project location String[] strings = source.split("\\|"); ! FastStringBuffer buf = new FastStringBuffer(); for (int i = 0; i < strings.length; i++) { if(strings[i].trim().length()>0){ *************** *** 157,161 **** external = ""; } ! return buf.toString()+"|"+external; } --- 158,162 ---- external = ""; } ! return buf.append("|").append(external).toString(); } Index: PythonNatureStore.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin/nature/PythonNatureStore.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PythonNatureStore.java 13 Aug 2007 01:16:30 -0000 1.18 --- PythonNatureStore.java 14 Jun 2008 22:14:55 -0000 1.19 *************** *** 38,41 **** --- 38,42 ---- import org.eclipse.core.runtime.jobs.Job; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager; import org.python.pydev.plugin.PydevPlugin; *************** *** 134,139 **** private volatile boolean inInit; ! private void traceFunc(String func){ if(TRACE_PYTHON_NATURE_STORE){ if(!func.startsWith("END ")){ System.out.println(indent+func); --- 135,145 ---- private volatile boolean inInit; ! private void traceFunc(String func, Object ... args){ if(TRACE_PYTHON_NATURE_STORE){ + FastStringBuffer buf = new FastStringBuffer(func, 128); + for(Object o:args){ + buf.appendObject(o); + } + func = buf.toString(); if(!func.startsWith("END ")){ System.out.println(indent+func); *************** *** 165,169 **** }else{ ! traceFunc("setProject - "+project.getName()); try{ this.project = project; --- 171,175 ---- }else{ ! traceFunc("setProject - ", project.getName()); try{ this.project = project; *************** *** 180,184 **** loaded = true; } ! traceFunc("END setProject - "+project.getName()); } } --- 186,190 ---- loaded = true; } ! traceFunc("END setProject - ", project.getName()); } } *************** *** 205,213 **** return ""; } ! traceFunc("getPathProperty - "+key); synchronized (this) { checkLoad("getPathProperty"); String ret = getPathStringFromArray(getPathPropertyFromXml(key)); ! traceFunc("END getPathProperty - "+ret); return ret; } --- 211,219 ---- return ""; } ! traceFunc("getPathProperty - ", key); synchronized (this) { checkLoad("getPathProperty"); String ret = getPathStringFromArray(getPathPropertyFromXml(key)); ! traceFunc("END getPathProperty - ", ret); return ret; } *************** *** 336,340 **** } ! traceFunc("END getRootNodeInXml -- "+ret); if(ret != null){ return ret; --- 342,346 ---- } ! traceFunc("END getRootNodeInXml -- ", ret); if(ret != null){ return ret; *************** *** 382,386 **** String name = attrs.getNamedItem(PYDEV_NATURE_PROPERTY_NAME).getNodeValue(); if (name != null && name.equals(keyString)) { ! traceFunc("END findPropertyNodeInXml - "+child); return child; } --- 388,392 ---- String name = attrs.getNamedItem(PYDEV_NATURE_PROPERTY_NAME).getNodeValue(); if (name != null && name.equals(keyString)) { ! traceFunc("END findPropertyNodeInXml - ", child); return child; } *************** *** 454,458 **** synchronized (this) { if (pathArray != null) { ! StringBuffer s = new StringBuffer(""); for (int i = 0; i < pathArray.length; i++) { if (i > 0) { --- 460,464 ---- synchronized (this) { if (pathArray != null) { ! FastStringBuffer s = new FastStringBuffer(); for (int i = 0; i < pathArray.length; i++) { if (i > 0) { *************** *** 495,499 **** } ! traceFunc("getPropertyFromXml - "+key); synchronized (this) { checkLoad("getPropertyFromXml"); --- 501,505 ---- } ! traceFunc("getPropertyFromXml - ", key); synchronized (this) { checkLoad("getPropertyFromXml"); *************** *** 503,507 **** if (propertyNode != null) { String ret = getTextContent(propertyNode); ! traceFunc("END getPropertyFromXml -- "+ret); return ret; } --- 509,513 ---- if (propertyNode != null) { String ret = getTextContent(propertyNode); ! traceFunc("END getPropertyFromXml -- ", ret); return ret; } *************** *** 582,586 **** traceFunc("getTextContent"); synchronized (this) { ! StringBuffer fBufferStr = new StringBuffer(); Node child = self.getFirstChild(); if (child != null) { --- 588,592 ---- traceFunc("getTextContent"); synchronized (this) { ! FastStringBuffer fBufferStr = new FastStringBuffer(); Node child = self.getFirstChild(); if (child != null) { *************** *** 590,594 **** String nodeValue = child.getNodeValue(); if(nodeValue != null){ ! traceFunc("END getTextContent - "+nodeValue); return nodeValue; } --- 596,600 ---- String nodeValue = child.getNodeValue(); if(nodeValue != null){ ! traceFunc("END getTextContent - ", nodeValue); return nodeValue; } *************** *** 597,608 **** return ""; } ! if (fBufferStr == null){ ! fBufferStr = new StringBuffer(); ! } ! else { ! fBufferStr.setLength(0); ! } getTextContent(fBufferStr, self); ! traceFunc("END getTextContent - "+fBufferStr); return fBufferStr.toString(); } --- 603,609 ---- return ""; } ! fBufferStr.clear(); getTextContent(fBufferStr, self); ! traceFunc("END getTextContent - ", fBufferStr); return fBufferStr.toString(); } *************** *** 614,618 **** // internal method taking a StringBuffer in parameter ! private synchronized void getTextContent(StringBuffer buf, Node self) throws DOMException { traceFunc("getTextContent"); synchronized (this) { --- 615,619 ---- // internal method taking a StringBuffer in parameter ! private synchronized void getTextContent(FastStringBuffer buf, Node self) throws DOMException { traceFunc("getTextContent"); synchronized (this) { *************** *** 634,638 **** boolean ret = child.getNodeType() != Node.COMMENT_NODE && child.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE; ! traceFunc("END hasTextContent "+ret); return ret; } --- 635,639 ---- boolean ret = child.getNodeType() != Node.COMMENT_NODE && child.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE; ! traceFunc("END hasTextContent ", ret); return ret; } *************** *** 758,762 **** return; } ! traceFunc("resourceChanged -- "+project.getName()); if(inInit){ traceFunc("END resourceChanged (inInit)"); --- 759,763 ---- return; } ! traceFunc("resourceChanged -- ", project.getName()); if(inInit){ traceFunc("END resourceChanged (inInit)"); *************** *** 808,812 **** } } ! traceFunc("END resourceChanged -- rebuilt:"+doRebuild); } --- 809,813 ---- } } ! traceFunc("END resourceChanged -- rebuilt:", doRebuild); } |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:15:19
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/editor/actions Modified Files: PyConvertSpaceToTab.java PyUncomment.java PyAddBlockComment.java OfflineActionTarget.java PyOrganizeImports.java PyAction.java PyAddSingleBlockComment.java PyComment.java PyConvertTabToSpace.java PyRemoveBlockComment.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyRemoveBlockComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyRemoveBlockComment.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyRemoveBlockComment.java 10 Feb 2007 11:55:57 -0000 1.6 --- PyRemoveBlockComment.java 14 Jun 2008 22:14:55 -0000 1.7 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.jface.action.IAction; import org.python.pydev.core.docutils.PySelection; + import org.python.pydev.core.structure.FastStringBuffer; /** *************** *** 53,57 **** public int perform(PySelection ps) { // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer(); --- 54,58 ---- public int perform(PySelection ps) { // What we'll be replacing the selected text with ! FastStringBuffer strbuf = new FastStringBuffer(); Index: PyComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyComment.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyComment.java 22 Aug 2006 22:07:08 -0000 1.9 --- PyComment.java 14 Jun 2008 22:14:55 -0000 1.10 *************** *** 15,18 **** --- 15,19 ---- import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; /** *************** *** 49,53 **** public Tuple<Integer, Integer> perform(PySelection ps) throws BadLocationException { // What we'll be replacing the selected text with - StringBuffer strbuf = new StringBuffer(); // If they selected a partial line, count it as a full one --- 50,53 ---- *************** *** 57,60 **** --- 57,61 ---- List<String> ret = StringUtils.splitInLines(selectedText); + FastStringBuffer strbuf = new FastStringBuffer(selectedText.length()+ret.size()+2); for(String line: ret){ strbuf.append('#'); Index: OfflineActionTarget.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/OfflineActionTarget.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OfflineActionTarget.java 20 Oct 2007 19:30:36 -0000 1.6 --- OfflineActionTarget.java 14 Jun 2008 22:14:55 -0000 1.7 *************** *** 24,27 **** --- 24,28 ---- import org.eclipse.ui.texteditor.IStatusField; import org.eclipse.ui.texteditor.IStatusFieldExtension; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.PyEdit; *************** *** 391,395 **** */ private String escapeTabs(String string) { ! StringBuffer buffer= new StringBuffer(); int begin= 0; --- 392,396 ---- */ private String escapeTabs(String string) { ! FastStringBuffer buffer= new FastStringBuffer(); int begin= 0; Index: PyUncomment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyUncomment.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyUncomment.java 22 Aug 2006 22:07:08 -0000 1.8 --- PyUncomment.java 14 Jun 2008 22:14:55 -0000 1.9 *************** *** 10,13 **** --- 10,14 ---- import org.python.pydev.core.Tuple; import org.python.pydev.core.docutils.PySelection; + import org.python.pydev.core.structure.FastStringBuffer; /** *************** *** 28,32 **** public Tuple<Integer, Integer> perform(PySelection ps) throws BadLocationException { // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer(); // If they selected a partial line, count it as a full one --- 29,33 ---- public Tuple<Integer, Integer> perform(PySelection ps) throws BadLocationException { // What we'll be replacing the selected text with ! FastStringBuffer strbuf = new FastStringBuffer(); // If they selected a partial line, count it as a full one Index: PyAddBlockComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyAddBlockComment.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PyAddBlockComment.java 4 Aug 2007 16:01:11 -0000 1.17 --- PyAddBlockComment.java 14 Jun 2008 22:14:55 -0000 1.18 *************** *** 10,13 **** --- 10,14 ---- import org.python.pydev.core.Tuple; import org.python.pydev.core.docutils.PySelection; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.commentblocks.CommentBlocksPreferences; import org.python.pydev.plugin.PydevPlugin; *************** *** 74,78 **** public int perform(PySelection ps) { // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer(); // If they selected a partial line, count it as a full one --- 75,80 ---- public int perform(PySelection ps) { // What we'll be replacing the selected text with ! FastStringBuffer strbuf = new FastStringBuffer(); ! FastStringBuffer tempBuffer = new FastStringBuffer(); // If they selected a partial line, count it as a full one *************** *** 118,122 **** } ! fullCommentLine = getFullCommentLine(classIndex); String spacesBefore; if(classIndex > 0){ --- 120,124 ---- } ! fullCommentLine = getFullCommentLine(classIndex, tempBuffer); String spacesBefore; if(classIndex > 0){ *************** *** 126,133 **** } ! strbuf.append(spacesBefore+"#" + fullCommentLine + endLineDelim); String initialLine = line; line = line.substring(classIndex+tokLen); ! StringBuffer className = new StringBuffer(); for(int i=0;i<line.length();i++){ char cN = line.charAt(i); --- 128,135 ---- } ! strbuf.append(spacesBefore+"#").append(fullCommentLine).append(endLineDelim); String initialLine = line; line = line.substring(classIndex+tokLen); ! FastStringBuffer className = new FastStringBuffer(); for(int i=0;i<line.length();i++){ char cN = line.charAt(i); *************** *** 145,149 **** strbuf.append(spacesBefore); ! strbuf.append("#" + fullCommentLine); strbuf.append(endLineDelim); strbuf.append(initialLine); --- 147,151 ---- strbuf.append(spacesBefore); ! strbuf.append("#").append(fullCommentLine); strbuf.append(endLineDelim); strbuf.append(initialLine); *************** *** 151,156 **** }else{ ! fullCommentLine = getFullCommentLine(0); ! strbuf.append("#" + fullCommentLine + endLineDelim); // For each line, comment them out for (int i = startLineIndex; i <= endLineIndex; i++) { --- 153,158 ---- }else{ ! fullCommentLine = getFullCommentLine(0, tempBuffer); ! strbuf.append("#").append(fullCommentLine).append(endLineDelim); // For each line, comment them out for (int i = startLineIndex; i <= endLineIndex; i++) { *************** *** 164,168 **** } // End of block ! strbuf.append("#" + fullCommentLine); } --- 166,170 ---- } // End of block ! strbuf.append("#").append(fullCommentLine); } *************** *** 191,200 **** * @return Comment line string, or a default one if Preferences are null */ ! protected String getFullCommentLine(int subtract) { Tuple<Integer,Character> colsAndChar = getColsAndChar(); int cols = colsAndChar.o1-subtract; char c = colsAndChar.o2; ! StringBuffer buffer = new StringBuffer(cols); for (int i = 0; i < cols-1; i++) { buffer.append(c); --- 193,202 ---- * @return Comment line string, or a default one if Preferences are null */ ! protected String getFullCommentLine(int subtract, FastStringBuffer buffer) { Tuple<Integer,Character> colsAndChar = getColsAndChar(); int cols = colsAndChar.o1-subtract; char c = colsAndChar.o2; ! buffer.clear(); for (int i = 0; i < cols-1; i++) { buffer.append(c); Index: PyAddSingleBlockComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyAddSingleBlockComment.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyAddSingleBlockComment.java 18 Jun 2007 16:33:22 -0000 1.7 --- PyAddSingleBlockComment.java 14 Jun 2008 22:14:55 -0000 1.8 *************** *** 10,13 **** --- 10,14 ---- import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.commentblocks.CommentBlocksPreferences; import org.python.pydev.plugin.PydevPlugin; *************** *** 34,38 **** public int perform(PySelection ps) { // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer(); // If they selected a partial line, count it as a full one --- 35,39 ---- public int perform(PySelection ps) { // What we'll be replacing the selected text with ! FastStringBuffer strbuf = new FastStringBuffer(); // If they selected a partial line, count it as a full one *************** *** 55,59 **** char c = colsAndChar.o2; ! StringBuffer buffer = makeBufferToIndent(line, cols); buffer.append("# "); buffer.append(line.trim()); --- 56,60 ---- char c = colsAndChar.o2; ! FastStringBuffer buffer = makeBufferToIndent(line, cols); buffer.append("# "); buffer.append(line.trim()); *************** *** 109,113 **** char c = colsAndChar.o2; ! StringBuffer buffer = makeBufferToIndent(line, cols); buffer.append("#"); --- 110,114 ---- char c = colsAndChar.o2; ! FastStringBuffer buffer = makeBufferToIndent(line, cols); buffer.append("#"); *************** *** 119,124 **** } ! private StringBuffer makeBufferToIndent(String line, int cols) { ! StringBuffer buffer = new StringBuffer(cols); for (int i = 0; i < line.length(); i++) { char ch = line.charAt(i); --- 120,126 ---- } ! ! private FastStringBuffer makeBufferToIndent(String line, int cols) { ! FastStringBuffer buffer = new FastStringBuffer(cols); for (int i = 0; i < line.length(); i++) { char ch = line.charAt(i); Index: PyOrganizeImports.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyOrganizeImports.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PyOrganizeImports.java 11 Jun 2008 00:00:00 -0000 1.16 --- PyOrganizeImports.java 14 Jun 2008 22:14:55 -0000 1.17 *************** *** 30,33 **** --- 30,34 ---- import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.ImportHandle.ImportHandleInfo; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.PyEdit; import org.python.pydev.plugin.PydevPlugin; *************** *** 161,165 **** //now, re-add the imports ! StringBuffer all = new StringBuffer(); --- 162,166 ---- //now, re-add the imports ! FastStringBuffer all = new FastStringBuffer(); *************** *** 188,191 **** --- 189,195 ---- Set<Entry<String, List<ImportHandleInfo>>> entrySet = importsWithFrom.entrySet(); + FastStringBuffer lastFromXXXImportWritten = new FastStringBuffer(); + FastStringBuffer line = new FastStringBuffer(); + for (Entry<String, List<ImportHandleInfo>> entry : entrySet) { *************** *** 199,204 **** //ok, it's all filled, let's start rewriting it! boolean firstInLine = true; ! StringBuffer line = new StringBuffer(); ! StringBuffer lastFromXXXImportWritten = null; boolean addedParenForLine = false; --- 203,207 ---- //ok, it's all filled, let's start rewriting it! boolean firstInLine = true; ! line.clear(); boolean addedParenForLine = false; *************** *** 211,215 **** if(firstInLine){ ! lastFromXXXImportWritten = new StringBuffer(); lastFromXXXImportWritten.append("from "); lastFromXXXImportWritten.append(entry.getKey()); --- 214,218 ---- if(firstInLine){ ! lastFromXXXImportWritten.clear(); lastFromXXXImportWritten.append("from "); lastFromXXXImportWritten.append(entry.getKey()); *************** *** 236,240 **** } all.append(line); ! line = new StringBuffer(); } } --- 239,243 ---- } all.append(line); ! line.clear(); } } *************** *** 242,246 **** line.append(tuple.o1); ! if(addedParenForLine && i == importsAndComments.size()){ addedParenForLine = false; line.append(")"); --- 245,249 ---- line.append(tuple.o1); ! if(addedParenForLine && i == importsAndNoComments.size()){ addedParenForLine = false; line.append(")"); *************** *** 258,262 **** line.append(endLineDelim); all.append(line); ! line = new StringBuffer(); firstInLine = true; } --- 261,265 ---- line.append(endLineDelim); all.append(line); ! line.clear(); firstInLine = true; } *************** *** 271,275 **** line.append(endLineDelim); all.append(line); ! line = new StringBuffer(); } } --- 274,278 ---- line.append(endLineDelim); all.append(line); ! line.clear(); } } *************** *** 287,291 **** * Write the imports that don't have a 'from' in the beggining (regular imports) */ ! private static void writeImportsWithoutFrom(String endLineDelim, StringBuffer all, List<ImportHandleInfo> importsWithoutFrom) { //now, write the regular imports (no wrapping or tabbing here) --- 290,294 ---- * Write the imports that don't have a 'from' in the beggining (regular imports) */ ! private static void writeImportsWithoutFrom(String endLineDelim, FastStringBuffer all, List<ImportHandleInfo> importsWithoutFrom) { //now, write the regular imports (no wrapping or tabbing here) Index: PyConvertSpaceToTab.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyConvertSpaceToTab.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyConvertSpaceToTab.java 20 Jun 2007 01:17:29 -0000 1.7 --- PyConvertSpaceToTab.java 14 Jun 2008 22:14:55 -0000 1.8 *************** *** 8,12 **** --- 8,15 ---- import org.eclipse.jface.action.IAction; + import org.eclipse.jface.text.IDocument; + import org.eclipse.jface.text.IRegion; import org.python.pydev.core.docutils.PySelection; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.autoedit.DefaultIndentPrefs; *************** *** 47,51 **** public static boolean perform(PySelection ps) { // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer(); // If they selected a partial line, count it as a full one --- 50,54 ---- public static boolean perform(PySelection ps) { // What we'll be replacing the selected text with ! FastStringBuffer strbuf = new FastStringBuffer(); // If they selected a partial line, count it as a full one *************** *** 56,69 **** try { // For each line, strip their whitespace ! for (i = ps.getStartLineIndex(); i <= ps.getEndLineIndex(); i++) { ! String line = ps.getDoc().get(ps.getDoc().getLineInformation(i).getOffset(), ps.getDoc().getLineInformation(i).getLength()); ! strbuf.append(line.replaceAll(getTabSpace(), "\t") + (i < ps.getEndLineIndex() ? ps.getEndLineDelim() : "")); } // If all goes well, replace the text with the modified information ! if (strbuf.toString() != null) { ! ps.getDoc().replace(ps.getStartLine().getOffset(), ps.getSelLength(), strbuf.toString()); ! return true; ! } } catch (Exception e) { beep(e); --- 59,76 ---- try { // For each line, strip their whitespace ! String tabSpace = getTabSpace(); ! IDocument doc = ps.getDoc(); ! int endLineIndex = ps.getEndLineIndex(); ! String endLineDelim = ps.getEndLineDelim(); ! ! for (i = ps.getStartLineIndex(); i <= endLineIndex; i++) { ! IRegion lineInformation = doc.getLineInformation(i); ! String line = doc.get(lineInformation.getOffset(), lineInformation.getLength()); ! strbuf.append(line.replaceAll(tabSpace, "\t")).append((i < endLineIndex ? endLineDelim : "")); } // If all goes well, replace the text with the modified information ! doc.replace(ps.getStartLine().getOffset(), ps.getSelLength(), strbuf.toString()); ! return true; } catch (Exception e) { beep(e); Index: PyConvertTabToSpace.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyConvertTabToSpace.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyConvertTabToSpace.java 25 Feb 2006 00:14:23 -0000 1.5 --- PyConvertTabToSpace.java 14 Jun 2008 22:14:55 -0000 1.6 *************** *** 8,13 **** import org.eclipse.jface.action.IAction; import org.python.pydev.core.docutils.PySelection; ! /** --- 8,15 ---- import org.eclipse.jface.action.IAction; + import org.eclipse.jface.text.IDocument; + import org.eclipse.jface.text.IRegion; import org.python.pydev.core.docutils.PySelection; ! import org.python.pydev.core.structure.FastStringBuffer; /** *************** *** 17,99 **** * @author Parhaum Toofanian */ ! public class PyConvertTabToSpace extends PyConvertSpaceToTab ! { ! /* Selection element */ ! private static PySelection ps; ! /** ! * Grabs the selection information and performs the action. ! */ ! public void run ( IAction action ) ! { ! try ! { ! // Select from text editor ! ps = new PySelection ( getTextEditor ( )); ! ps.selectAll(false); ! // Perform the action ! perform ( ); ! // Put cursor at the first area of the selection ! getTextEditor ( ).selectAndReveal ( ps.getLineOffset ( ), 0 ); ! } ! catch ( Exception e ) ! { ! beep ( e ); ! } ! } ! /** ! * Performs the action with the class' PySelection. ! * ! * @return boolean The success or failure of the action ! */ ! public static boolean perform ( ) ! { ! return perform ( ps ); ! } ! /** ! * Performs the action with a given PySelection ! * ! * @param ps Given PySelection ! * @return boolean The success or failure of the action ! */ ! public static boolean perform ( PySelection ps ) ! { ! // What we'll be replacing the selected text with ! StringBuffer strbuf = new StringBuffer ( ); ! ! // If they selected a partial line, count it as a full one ! ps.selectCompleteLine ( ); ! ! int i; ! ! try ! { ! // For each line, strip their whitespace ! for ( i = ps.getStartLineIndex(); i <= ps.getEndLineIndex(); i++ ) ! { ! String line = ps.getDoc().get ( ps.getDoc().getLineInformation ( i ).getOffset ( ), ps.getDoc().getLineInformation ( i ).getLength ( ) ); ! strbuf.append ( line.replaceAll ( "\t", getTabSpace ( ) ) + ( i < ps.getEndLineIndex() ? ps.getEndLineDelim() : "" ) ); ! } ! // If all goes well, replace the text with the modified information ! if ( strbuf.toString ( ) != null ) ! { ! ps.getDoc().replace ( ps.getStartLine().getOffset ( ), ps.getSelLength(), strbuf.toString ( ) ); ! return true; ! } ! } ! catch ( Exception e ) ! { ! beep( e ); ! } ! ! // In event of problems, return false ! return false; ! } } --- 19,89 ---- * @author Parhaum Toofanian */ ! public class PyConvertTabToSpace extends PyConvertSpaceToTab { ! /* Selection element */ ! private static PySelection ps; + /** + * Grabs the selection information and performs the action. + */ + public void run(IAction action) { + try { + // Select from text editor + ps = new PySelection(getTextEditor()); + ps.selectAll(false); + // Perform the action + perform(); ! // Put cursor at the first area of the selection ! getTextEditor().selectAndReveal(ps.getLineOffset(), 0); ! } catch (Exception e) { ! beep(e); ! } ! } ! /** ! * Performs the action with the class' PySelection. ! * ! * @return boolean The success or failure of the action ! */ ! public static boolean perform() { ! return perform(ps); ! } + /** + * Performs the action with a given PySelection + * + * @param ps Given PySelection + * @return boolean The success or failure of the action + */ + public static boolean perform(PySelection ps) { + // What we'll be replacing the selected text with + FastStringBuffer strbuf = new FastStringBuffer(); ! // If they selected a partial line, count it as a full one ! ps.selectCompleteLine(); + int i; ! try { ! // For each line, strip their whitespace ! IDocument doc = ps.getDoc(); ! String tabSpace = getTabSpace(); ! int endLineIndex = ps.getEndLineIndex(); ! String endLineDelim = ps.getEndLineDelim(); ! for (i = ps.getStartLineIndex(); i <= endLineIndex; i++) { ! IRegion lineInformation = doc.getLineInformation(i); ! String line = doc.get(lineInformation.getOffset(), lineInformation.getLength()); ! strbuf.append(line.replaceAll("\t", tabSpace) + (i < endLineIndex ? endLineDelim : "")); ! } ! // If all goes well, replace the text with the modified information ! doc.replace(ps.getStartLine().getOffset(), ps.getSelLength(), strbuf.toString()); ! return true; ! } catch (Exception e) { ! beep(e); ! } ! ! // In event of problems, return false ! return false; ! } } Index: PyAction.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyAction.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** PyAction.java 28 Feb 2007 19:29:37 -0000 1.35 --- PyAction.java 14 Jun 2008 22:14:55 -0000 1.36 *************** *** 21,24 **** --- 21,25 ---- import org.eclipse.ui.texteditor.ITextEditor; import org.python.pydev.core.docutils.PySelection; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.autoedit.DefaultIndentPrefs; *************** *** 340,346 **** private static String createStaticSpaceString(int tabWidth) { ! StringBuffer b = new StringBuffer(tabWidth); ! while (tabWidth-- > 0) b.append(" "); return b.toString(); } --- 341,348 ---- private static String createStaticSpaceString(int tabWidth) { ! FastStringBuffer b = new FastStringBuffer(tabWidth); ! while (tabWidth-- > 0){ b.append(" "); + } return b.toString(); } |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:55
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/utils Modified Files: PyFileListing.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyFileListing.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/utils/PyFileListing.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyFileListing.java 1 Nov 2007 12:38:03 -0000 1.2 --- PyFileListing.java 14 Jun 2008 22:14:57 -0000 1.3 *************** *** 15,18 **** --- 15,19 ---- import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.PythonPathHelper; *************** *** 85,89 **** if (file.isDirectory()) { if(level != 0){ ! StringBuffer newModuleRep = new StringBuffer(currModuleRep); if(newModuleRep.length() != 0){ newModuleRep.append("."); --- 86,90 ---- if (file.isDirectory()) { if(level != 0){ ! FastStringBuffer newModuleRep = new FastStringBuffer(currModuleRep, 128); if(newModuleRep.length() != 0){ newModuleRep.append("."); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:55
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940 Modified Files: Changes.txt Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.393 retrieving revision 1.394 diff -C2 -d -r1.393 -r1.394 *** Changes.txt 1 Jun 2008 20:44:41 -0000 1.393 --- Changes.txt 14 Jun 2008 22:14:57 -0000 1.394 *************** *** 6,9 **** --- 6,11 ---- <li><strong>Auto-import</strong>: Groups imports when possible.</li> <li><strong>Auto-import</strong>: Doesn't bring imports for completions already in the document even if a parse is not successful.</li> + <li><strong>Organize Imports (ctrl+shift+O)</strong>: Suggests imports to the undefined tokens in the editor.</li> + <li><strong>Import quick-fix</strong>: Icons correspondent to the element being imported.</li> </ul> |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:54
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/visitors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src_completions/org/python/pydev/editor/codecompletion/revisited/visitors Modified Files: Definition.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: Definition.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/visitors/Definition.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Definition.java 8 Jul 2007 21:14:54 -0000 1.3 --- Definition.java 14 Jun 2008 22:14:56 -0000 1.4 *************** *** 10,13 **** --- 10,14 ---- import org.python.pydev.core.ILocalScope; import org.python.pydev.core.IModule; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.modules.SourceToken; import org.python.pydev.parser.jython.SimpleNode; *************** *** 107,111 **** */ public String toString() { ! StringBuffer buffer = new StringBuffer("Definition="); buffer.append(value); buffer.append(" line="); --- 108,112 ---- */ public String toString() { ! FastStringBuffer buffer = new FastStringBuffer("Definition=", 30+value.length()); buffer.append(value); buffer.append(" line="); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:53
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/docstrings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/editor/correctionassist/docstrings Modified Files: AssistDocString.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: AssistDocString.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/docstrings/AssistDocString.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AssistDocString.java 1 Mar 2007 02:34:56 -0000 1.5 --- AssistDocString.java 14 Jun 2008 22:14:56 -0000 1.6 *************** *** 17,20 **** --- 17,21 ---- import org.python.pydev.core.bundle.ImageCache; import org.python.pydev.core.docutils.PySelection; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.actions.PyAction; *************** *** 45,49 **** String inAndIndent = delimiter + initial + indentation; ! StringBuffer buf = new StringBuffer(); String docStringMarker = DocstringsPrefPage.getDocstringMarker(); buf.append(inAndIndent + docStringMarker); --- 46,50 ---- String inAndIndent = delimiter + initial + indentation; ! FastStringBuffer buf = new FastStringBuffer(); String docStringMarker = DocstringsPrefPage.getDocstringMarker(); buf.append(inAndIndent + docStringMarker); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:53
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/editor/correctionassist/heuristics Modified Files: AssistAssign.java AssistOverride.java AssistSurroundWith.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: AssistAssign.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics/AssistAssign.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AssistAssign.java 9 Apr 2008 00:43:47 -0000 1.17 --- AssistAssign.java 14 Jun 2008 22:14:56 -0000 1.18 *************** *** 19,22 **** --- 19,23 ---- import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.actions.PyAction; *************** *** 148,152 **** private String changeToCodingStd(String callName) { if(!this.std.localsAndAttrsCamelcase()){ ! StringBuffer ret = new StringBuffer(); char[] cs = callName.toCharArray(); --- 149,153 ---- private String changeToCodingStd(String callName) { if(!this.std.localsAndAttrsCamelcase()){ ! FastStringBuffer ret = new FastStringBuffer(); char[] cs = callName.toCharArray(); Index: AssistOverride.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics/AssistOverride.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AssistOverride.java 25 Feb 2007 12:07:35 -0000 1.20 --- AssistOverride.java 14 Jun 2008 22:14:56 -0000 1.21 *************** *** 17,20 **** --- 17,21 ---- import org.python.pydev.core.bundle.ImageCache; import org.python.pydev.core.docutils.PySelection; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.actions.PyAction; *************** *** 57,64 **** for (IToken token:selfCompletions) { String rep = token.getRepresentation(); if(rep.startsWith(tok)){ ! StringBuffer buffer = new StringBuffer( start ); buffer.append(rep); --- 58,67 ---- + FastStringBuffer buffer = new FastStringBuffer(); for (IToken token:selfCompletions) { String rep = token.getRepresentation(); if(rep.startsWith(tok)){ ! buffer.clear(); ! buffer.append(start); buffer.append(rep); Index: AssistSurroundWith.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics/AssistSurroundWith.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AssistSurroundWith.java 1 May 2008 14:26:00 -0000 1.1 --- AssistSurroundWith.java 14 Jun 2008 22:14:56 -0000 1.2 *************** *** 22,25 **** --- 22,26 ---- import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.actions.PyAction; *************** *** 52,56 **** //get the 1st char (determines indent) int firstCharPosition = PySelection.getFirstCharRelativePosition(ps.getDoc(), start); ! StringBuffer startIndentBuffer = new StringBuffer(); int i = 0; while(i < firstCharPosition){ --- 53,57 ---- //get the 1st char (determines indent) int firstCharPosition = PySelection.getFirstCharRelativePosition(ps.getDoc(), start); ! FastStringBuffer startIndentBuffer = new FastStringBuffer(firstCharPosition+1); int i = 0; while(i < firstCharPosition){ |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:53
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/autoedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/editor/autoedit Modified Files: AbstractIndentPrefs.java PyAutoIndentStrategy.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyAutoIndentStrategy.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/autoedit/PyAutoIndentStrategy.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** PyAutoIndentStrategy.java 6 Apr 2008 19:51:34 -0000 1.67 --- PyAutoIndentStrategy.java 14 Jun 2008 22:14:57 -0000 1.68 *************** *** 21,24 **** --- 21,25 ---- import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.actions.PyAction; *************** *** 239,243 **** int end= findEndOfWhiteSpace(d, start, offset); ! StringBuffer buf= new StringBuffer(text); if (end > start) { // append to input --- 240,244 ---- int end= findEndOfWhiteSpace(d, start, offset); ! FastStringBuffer buf= new FastStringBuffer(text, end-start+1); if (end > start) { // append to input Index: AbstractIndentPrefs.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/autoedit/AbstractIndentPrefs.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractIndentPrefs.java 14 Sep 2005 16:32:12 -0000 1.4 --- AbstractIndentPrefs.java 14 Jun 2008 22:14:57 -0000 1.5 *************** *** 10,13 **** --- 10,14 ---- import org.eclipse.jface.text.IDocument; import org.python.pydev.core.docutils.DocUtils; + import org.python.pydev.core.structure.FastStringBuffer; /** *************** *** 80,84 **** // contains a char (pasted text) byte[] byteLine = text.getBytes(); ! StringBuffer newText = new StringBuffer(); for (int count = 0; count < byteLine.length; count++) { if (byteLine[count] == '\t'){ --- 81,85 ---- // contains a char (pasted text) byte[] byteLine = text.getBytes(); ! FastStringBuffer newText = new FastStringBuffer(); for (int count = 0; count < byteLine.length; count++) { if (byteLine[count] == '\t'){ |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:52
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/editors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/ui/editors Modified Files: TreeWithAddRemove.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: TreeWithAddRemove.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/editors/TreeWithAddRemove.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TreeWithAddRemove.java 27 Oct 2007 11:07:57 -0000 1.8 --- TreeWithAddRemove.java 14 Jun 2008 22:14:56 -0000 1.9 *************** *** 22,25 **** --- 22,26 ---- import org.eclipse.ui.dialogs.ResourceSelectionDialog; import org.eclipse.ui.dialogs.SelectionDialog; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.plugin.PydevPlugin; import org.python.pydev.plugin.nature.PythonNature; *************** *** 265,269 **** public String getTreeItemsAsStr(){ ! StringBuffer ret = new StringBuffer(); TreeItem[] items = tree.getItems(); for (int i = 0; i < items.length; i++) { --- 266,270 ---- public String getTreeItemsAsStr(){ ! FastStringBuffer ret = new FastStringBuffer(); TreeItem[] items = tree.getItems(); for (int i = 0; i < items.length; i++) { |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:50
|
Update of /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/tests/org/python/pydev/editor/actions Modified Files: PyOrganizeImportsTest.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyOrganizeImportsTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/editor/actions/PyOrganizeImportsTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyOrganizeImportsTest.java 11 Jun 2008 00:00:00 -0000 1.7 --- PyOrganizeImportsTest.java 14 Jun 2008 22:14:56 -0000 1.8 *************** *** 20,24 **** PyOrganizeImportsTest test = new PyOrganizeImportsTest(); test.setUp(); ! test.testPerformWithGroupingWithAs(); test.tearDown(); junit.textui.TestRunner.run(PyOrganizeImportsTest.class); --- 20,24 ---- PyOrganizeImportsTest test = new PyOrganizeImportsTest(); test.setUp(); ! test.testPerformGroupingWithWrapsLong(); test.tearDown(); junit.textui.TestRunner.run(PyOrganizeImportsTest.class); *************** *** 161,164 **** --- 161,185 ---- + + + public void testPerformGroupingWithWrapsLong() { + ImportsPreferencesPage.groupImportsForTests = true; + String d = ""+ + "from cccccccccccccccccccccccccccccccccccccccccccccccccc import eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\n"+ + "from cccccccccccccccccccccccccccccccccccccccccccccccccc import ffffffffffffffffffffffffffffffffffffffffffffffffff"; + + Document doc = new Document(d); + PyOrganizeImports.performArrangeImports(doc, "\n", " "); + + String result = ""+ + "from cccccccccccccccccccccccccccccccccccccccccccccccccc import (\n" + + " eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, \n"+ + " ffffffffffffffffffffffffffffffffffffffffffffffffff)\n"; + + // System.out.println(">>"+doc.get()+"<<"); + assertEquals(result, doc.get()); + } + + public void testPerformGroupingWithWraps3() { ImportsPreferencesPage.groupImportsForTests = true; |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:50
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/ui/pythonpathconf Modified Files: InterpreterInfo.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: InterpreterInfo.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/InterpreterInfo.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** InterpreterInfo.java 2 Nov 2007 13:26:29 -0000 1.52 --- InterpreterInfo.java 14 Jun 2008 22:14:56 -0000 1.53 *************** *** 28,31 **** --- 28,32 ---- import org.python.pydev.core.REF; import org.python.pydev.core.Tuple; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.core.uiutils.RunInUiThread; import org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager; *************** *** 351,355 **** */ public String toString() { ! StringBuffer buffer = new StringBuffer(); buffer.append("Version"); buffer.append(version); --- 352,356 ---- */ public String toString() { ! FastStringBuffer buffer = new FastStringBuffer(); buffer.append("Version"); buffer.append(version); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:50
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src_completions/org/python/pydev/editor/codecompletion/revisited Modified Files: CompletionStateWrapper.java PythonPathHelper.java AbstractToken.java ModulesFoundStructure.java SystemModulesManager.java ModulesManager.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: SystemModulesManager.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/SystemModulesManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SystemModulesManager.java 5 May 2008 01:31:22 -0000 1.9 --- SystemModulesManager.java 14 Jun 2008 22:14:55 -0000 1.10 *************** *** 20,23 **** --- 20,24 ---- import org.python.pydev.core.Tuple; import org.python.pydev.core.cache.LRUCache; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.modules.AbstractModule; import org.python.pydev.editor.codecompletion.revisited.modules.CompiledModule; *************** *** 170,173 **** --- 171,176 ---- boolean foundStartingWithBuiltin = false; + FastStringBuffer buffer = null; + for (int i = 0; i < builtins.length; i++) { String forcedBuiltin = builtins[i]; *************** *** 180,184 **** if(n == null && dontSearchInit == false){ ! keyForCacheAccess.name = new StringBuffer(name).append(".__init__").toString(); n = cache.getObj(keyForCacheAccess, this); } --- 183,192 ---- if(n == null && dontSearchInit == false){ ! if(buffer == null){ ! buffer = new FastStringBuffer(); ! }else{ ! buffer.clear(); ! } ! keyForCacheAccess.name = buffer.append(name).append(".__init__").toString(); n = cache.getObj(keyForCacheAccess, this); } Index: ModulesFoundStructure.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/ModulesFoundStructure.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ModulesFoundStructure.java 30 Sep 2007 01:30:51 -0000 1.3 --- ModulesFoundStructure.java 14 Jun 2008 22:14:55 -0000 1.4 *************** *** 13,16 **** --- 13,17 ---- import org.eclipse.core.runtime.IProgressMonitor; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; /** *************** *** 85,88 **** --- 86,90 ---- public void consolidatePythonpathInfo(IProgressMonitor monitor) { int i=0; + FastStringBuffer buffer = new FastStringBuffer(); for (Map.Entry<String, String> entry : pyFilesLowerToRegular.entrySet()) { if(i % 15==0){ *************** *** 95,99 **** } ! StringBuffer buffer = new StringBuffer(StringUtils.stripFromLastSlash(entry.getKey())); boolean add = true; if(zipContentsType == ZIP_CONTENTS_TYPE_PY_ZIP){ --- 97,102 ---- } ! buffer.clear(); ! buffer.append(StringUtils.stripFromLastSlash(entry.getKey())); boolean add = true; if(zipContentsType == ZIP_CONTENTS_TYPE_PY_ZIP){ Index: ModulesManager.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/ModulesManager.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ModulesManager.java 5 May 2008 01:31:21 -0000 1.22 --- ModulesManager.java 14 Jun 2008 22:14:55 -0000 1.23 *************** *** 32,35 **** --- 32,36 ---- import org.python.pydev.core.REF; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.ModulesFoundStructure.ZipContents; import org.python.pydev.editor.codecompletion.revisited.ModulesKeyTreeMap.Entry; *************** *** 228,231 **** --- 229,233 ---- int j = 0; + FastStringBuffer buffer = new FastStringBuffer(); //now, create in memory modules for all the loaded files (empty modules). for (Iterator<Map.Entry<File, String>> iterator = modulesFound.regularModules.entrySet().iterator(); iterator.hasNext() *************** *** 237,241 **** if (j % 15 == 0) { //no need to report all the time (that's pretty fast now) ! monitor.setTaskName(new StringBuffer("Module resolved: ").append(m).toString()); monitor.worked(1); } --- 239,244 ---- if (j % 15 == 0) { //no need to report all the time (that's pretty fast now) ! buffer.clear(); ! monitor.setTaskName(buffer.append("Module resolved: ").append(m).toString()); monitor.worked(1); } Index: CompletionStateWrapper.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/CompletionStateWrapper.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CompletionStateWrapper.java 4 May 2008 16:48:46 -0000 1.7 --- CompletionStateWrapper.java 14 Jun 2008 22:14:55 -0000 1.8 *************** *** 9,12 **** --- 9,13 ---- import org.python.pydev.core.IToken; import org.python.pydev.core.structure.CompletionRecursionException; + import org.python.pydev.core.structure.FastStringBuffer; public class CompletionStateWrapper implements ICompletionState { *************** *** 167,171 **** @Override public String toString() { ! StringBuffer buf = new StringBuffer(); buf.append("CompletionStateWrapper[ "); buf.append(this.activationToken); --- 168,172 ---- @Override public String toString() { ! FastStringBuffer buf = new FastStringBuffer(); buf.append("CompletionStateWrapper[ "); buf.append(this.activationToken); Index: PythonPathHelper.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/PythonPathHelper.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PythonPathHelper.java 18 May 2008 20:02:16 -0000 1.10 --- PythonPathHelper.java 14 Jun 2008 22:14:55 -0000 1.11 *************** *** 22,25 **** --- 22,26 ---- import org.python.pydev.core.REF; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.ModulesFoundStructure.ZipContents; import org.python.pydev.plugin.PydevPlugin; *************** *** 112,115 **** --- 113,117 ---- int i=0; + FastStringBuffer buffer = new FastStringBuffer(); //ok, now that we have the zip entries, let's map them to modules while (entries.hasMoreElements()) { *************** *** 128,132 **** return null; } ! monitor.setTaskName(new StringBuffer("Found in ").append(zipFileName).append(" module ").append(name).toString()); monitor.worked(1); } --- 130,135 ---- return null; } ! buffer.clear(); ! monitor.setTaskName(buffer.append("Found in ").append(zipFileName).append(" module ").append(name).toString()); monitor.worked(1); } Index: AbstractToken.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/AbstractToken.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractToken.java 21 Oct 2007 18:34:44 -0000 1.4 --- AbstractToken.java 14 Jun 2008 22:14:55 -0000 1.5 *************** *** 9,12 **** --- 9,13 ---- import org.python.pydev.core.FullRepIterable; import org.python.pydev.core.IToken; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.PyCodeCompletionImages; import org.python.pydev.editor.codecompletion.revisited.modules.SourceToken; *************** *** 187,191 **** if(getParentPackage() != null && getParentPackage().length() > 0){ ! return new StringBuffer(getRepresentation()).append(" - ").append(getParentPackage()).toString(); }else{ return getRepresentation(); --- 188,192 ---- if(getParentPackage() != null && getParentPackage().length() > 0){ ! return new FastStringBuffer(getRepresentation(), 64).append(" - ").append(getParentPackage()).toString(); }else{ return getRepresentation(); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:50
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/plugin Modified Files: PyFileLabelProvider.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyFileLabelProvider.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin/PyFileLabelProvider.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyFileLabelProvider.java 20 May 2006 00:21:34 -0000 1.1 --- PyFileLabelProvider.java 14 Jun 2008 22:14:56 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- import org.eclipse.swt.graphics.Image; import org.eclipse.ui.model.WorkbenchLabelProvider; + import org.python.pydev.core.structure.FastStringBuffer; public class PyFileLabelProvider implements ILabelProvider { *************** *** 25,32 **** if(element instanceof IFile){ IFile f = (IFile) element; ! StringBuffer buffer = new StringBuffer(); buffer.append(f.getName()); buffer.append(" ("); ! buffer.append(f.getFullPath().removeFileExtension().removeLastSegments(1)); buffer.append(")"); return buffer.toString(); --- 26,33 ---- if(element instanceof IFile){ IFile f = (IFile) element; ! FastStringBuffer buffer = new FastStringBuffer(); buffer.append(f.getName()); buffer.append(" ("); ! buffer.append(f.getFullPath().removeFileExtension().removeLastSegments(1).toString()); buffer.append(")"); return buffer.toString(); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:49
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/runners In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/runners Modified Files: SimpleJythonRunner.java ThreadStreamReader.java SimpleRunner.java ThreadStreamReaderPrinter.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: ThreadStreamReader.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/runners/ThreadStreamReader.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ThreadStreamReader.java 30 Mar 2008 21:45:12 -0000 1.8 --- ThreadStreamReader.java 14 Jun 2008 22:14:55 -0000 1.9 *************** *** 7,18 **** import java.io.InputStreamReader; public class ThreadStreamReader extends Thread { InputStream is; ! public StringBuffer contents; public ThreadStreamReader(InputStream is) { this.setName("ThreadStreamReader"); this.setDaemon(true); ! contents = new StringBuffer(); this.is = is; } --- 7,20 ---- import java.io.InputStreamReader; + import org.python.pydev.core.structure.FastStringBuffer; + public class ThreadStreamReader extends Thread { InputStream is; ! public FastStringBuffer contents; public ThreadStreamReader(InputStream is) { this.setName("ThreadStreamReader"); this.setDaemon(true); ! contents = new FastStringBuffer(); this.is = is; } *************** *** 36,41 **** */ public String getAndClearContents() { ! StringBuffer oldContents = contents; ! contents = new StringBuffer(); return oldContents.toString(); } --- 38,43 ---- */ public String getAndClearContents() { ! FastStringBuffer oldContents = contents; ! contents = new FastStringBuffer(); return oldContents.toString(); } Index: SimpleRunner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/runners/SimpleRunner.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** SimpleRunner.java 21 May 2008 01:38:08 -0000 1.25 --- SimpleRunner.java 14 Jun 2008 22:14:55 -0000 1.26 *************** *** 28,31 **** --- 28,32 ---- import org.python.pydev.core.docutils.StringUtils; import org.python.pydev.core.log.Log; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.plugin.PydevPlugin; import org.python.pydev.plugin.nature.PythonNature; *************** *** 153,157 **** if (commandLine.length < 1) return ""; //$NON-NLS-1$ ! StringBuffer buf= new StringBuffer(); for (int i= 0; i < commandLine.length; i++) { if(commandLine[i] == null){ --- 154,159 ---- if (commandLine.length < 1) return ""; //$NON-NLS-1$ ! FastStringBuffer buf= new FastStringBuffer(); ! FastStringBuffer command= new FastStringBuffer(); for (int i= 0; i < commandLine.length; i++) { if(commandLine[i] == null){ *************** *** 161,165 **** buf.append(' '); char[] characters= commandLine[i].toCharArray(); ! StringBuffer command= new StringBuffer(); boolean containsSpace= false; for (int j = 0; j < characters.length; j++) { --- 163,167 ---- buf.append(' '); char[] characters= commandLine[i].toCharArray(); ! command.clear(); boolean containsSpace= false; for (int j = 0; j < characters.length; j++) { Index: ThreadStreamReaderPrinter.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/runners/ThreadStreamReaderPrinter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ThreadStreamReaderPrinter.java 7 Jun 2006 21:54:33 -0000 1.2 --- ThreadStreamReaderPrinter.java 14 Jun 2008 22:14:55 -0000 1.3 *************** *** 9,20 **** import java.io.InputStreamReader; public class ThreadStreamReaderPrinter extends Thread { private static final boolean DEBUG = false; InputStream is; ! StringBuffer contents; public ThreadStreamReaderPrinter(InputStream is) { ! contents = new StringBuffer(); setName("ThreadStreamReaderPrinter"); this.is = is; --- 9,22 ---- import java.io.InputStreamReader; + import org.python.pydev.core.structure.FastStringBuffer; + public class ThreadStreamReaderPrinter extends Thread { private static final boolean DEBUG = false; InputStream is; ! FastStringBuffer contents; public ThreadStreamReaderPrinter(InputStream is) { ! contents = new FastStringBuffer(); setName("ThreadStreamReaderPrinter"); this.is = is; *************** *** 33,37 **** if(DEBUG){ System.out.print(contents); ! contents = new StringBuffer(); } } catch (IOException ioe) { --- 35,39 ---- if(DEBUG){ System.out.print(contents); ! contents = new FastStringBuffer(); } } catch (IOException ioe) { Index: SimpleJythonRunner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/runners/SimpleJythonRunner.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** SimpleJythonRunner.java 21 May 2008 01:38:08 -0000 1.26 --- SimpleJythonRunner.java 14 Jun 2008 22:14:55 -0000 1.27 *************** *** 18,21 **** --- 18,22 ---- import org.python.pydev.core.Tuple; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.plugin.PydevPlugin; import org.python.pydev.ui.pythonpathconf.InterpreterInfo; *************** *** 101,105 **** //pythonpath is: base path + libs path. String libs = SimpleRunner.makePythonPathEnvFromPaths(info.libs); ! StringBuffer jythonPath = new StringBuffer(basePythonPath); String pathSeparator = SimpleRunner.getPythonPathSeparator(); if(jythonPath.length() != 0){ --- 102,106 ---- //pythonpath is: base path + libs path. String libs = SimpleRunner.makePythonPathEnvFromPaths(info.libs); ! FastStringBuffer jythonPath = new FastStringBuffer(basePythonPath, 128); String pathSeparator = SimpleRunner.getPythonPathSeparator(); if(jythonPath.length() != 0){ |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:49
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/outline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/outline Modified Files: ParsedItem.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: ParsedItem.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/outline/ParsedItem.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ParsedItem.java 18 May 2008 20:02:17 -0000 1.23 --- ParsedItem.java 14 Jun 2008 22:14:56 -0000 1.24 *************** *** 12,15 **** --- 12,16 ---- import org.python.pydev.core.bundle.ImageCache; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.ErrorDescription; import org.python.pydev.parser.jython.SimpleNode; *************** *** 289,293 **** } else if (astThis.node instanceof Import) { aliasType[] imports = ((Import)astThis.node).names; ! StringBuffer retVal = new StringBuffer(); for (int i=0; i<imports.length; i++) { aliasType aliasType = imports[i]; --- 290,294 ---- } else if (astThis.node instanceof Import) { aliasType[] imports = ((Import)astThis.node).names; ! FastStringBuffer retVal = new FastStringBuffer(); for (int i=0; i<imports.length; i++) { aliasType aliasType = imports[i]; *************** *** 302,306 **** retVal.append(", "); } ! retVal.delete(retVal.length() - 2, retVal.length()); return retVal.toString(); --- 303,309 ---- retVal.append(", "); } ! //delete the last 2 chars ! retVal.deleteLast(); ! retVal.deleteLast(); return retVal.toString(); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:49
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src_completions/org/python/pydev/editor/codecompletion/templates Modified Files: PyDocumentTemplateContext.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyDocumentTemplateContext.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/templates/PyDocumentTemplateContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyDocumentTemplateContext.java 4 Aug 2007 16:01:11 -0000 1.1 --- PyDocumentTemplateContext.java 14 Jun 2008 22:14:56 -0000 1.2 *************** *** 17,20 **** --- 17,21 ---- import org.python.pydev.core.docutils.DocUtils; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.autoedit.DefaultIndentPrefs; *************** *** 79,83 **** }else{ if(pattern.indexOf(spacesIndentString) != -1){ ! StringBuffer newPattern = new StringBuffer(); for(int i=0; i<splitted.size();i++){ --- 80,85 ---- }else{ if(pattern.indexOf(spacesIndentString) != -1){ ! FastStringBuffer newPattern = new FastStringBuffer(); ! FastStringBuffer newTabsIndent = new FastStringBuffer(); for(int i=0; i<splitted.size();i++){ *************** *** 96,100 **** tabsToAdd += 1; } ! StringBuffer newTabsIndent = new StringBuffer(); for(int j = 0; j< tabsToAdd; j++){ newTabsIndent.append("\t"); --- 98,102 ---- tabsToAdd += 1; } ! newTabsIndent.clear(); for(int j = 0; j< tabsToAdd; j++){ newTabsIndent.append("\t"); *************** *** 116,120 **** if(splitted.size() > 1 && indentTo != null && indentTo.length() > 0){ ! StringBuffer buffer = new StringBuffer(splitted.get(0)); for (int i=1; i<splitted.size();i++) { //we don't want to get the first line buffer.append(indentTo); --- 118,122 ---- if(splitted.size() > 1 && indentTo != null && indentTo.length() > 0){ ! FastStringBuffer buffer = new FastStringBuffer(splitted.get(0), 128); for (int i=1; i<splitted.size();i++) { //we don't want to get the first line buffer.append(indentTo); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:49
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src_completions/org/python/pydev/editor/codecompletion Modified Files: AbstractPyCodeCompletion.java CompletionRequest.java PyLinkedModeCompletionProposal.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: CompletionRequest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/CompletionRequest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CompletionRequest.java 24 Mar 2008 01:53:22 -0000 1.3 --- CompletionRequest.java 14 Jun 2008 22:14:55 -0000 1.4 *************** *** 7,11 **** import java.io.File; - import java.util.List; import org.eclipse.jface.text.IDocument; --- 7,10 ---- *************** *** 14,17 **** --- 13,17 ---- import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.PySelection.ActivationTokenAndQual; + import org.python.pydev.core.structure.FastStringBuffer; /** *************** *** 147,154 **** @Override public String toString() { ! StringBuffer buffer = new StringBuffer(); buffer.append("CompletionRequest["); buffer.append(" editorFile:"); ! buffer.append(editorFile); buffer.append(" activationToken:"); buffer.append(activationToken); --- 147,154 ---- @Override public String toString() { ! FastStringBuffer buffer = new FastStringBuffer(); buffer.append("CompletionRequest["); buffer.append(" editorFile:"); ! buffer.appendObject(editorFile); buffer.append(" activationToken:"); buffer.append(activationToken); Index: PyLinkedModeCompletionProposal.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyLinkedModeCompletionProposal.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyLinkedModeCompletionProposal.java 3 Apr 2008 17:48:19 -0000 1.5 --- PyLinkedModeCompletionProposal.java 14 Jun 2008 22:14:55 -0000 1.6 *************** *** 23,26 **** --- 23,27 ---- import org.eclipse.ui.texteditor.link.EditorLinkedModeUI; import org.python.pydev.core.IToken; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.core.uiutils.RunInUiThread; import org.python.pydev.plugin.PydevPlugin; *************** *** 240,244 **** List<Integer> offsetsAndLens = new ArrayList<Integer>(); ! StringBuffer buffer = new StringBuffer(); for (int i = 0; i < newStr.length(); i++) { char c = newStr.charAt(i); --- 241,245 ---- List<Integer> offsetsAndLens = new ArrayList<Integer>(); ! FastStringBuffer buffer = new FastStringBuffer(); for (int i = 0; i < newStr.length(); i++) { char c = newStr.charAt(i); *************** *** 254,258 **** if(buffer.length() > 0){ offsetsAndLens.add(buffer.length()); ! buffer = new StringBuffer(); } } --- 255,259 ---- if(buffer.length() > 0){ offsetsAndLens.add(buffer.length()); ! buffer.clear(); } } Index: AbstractPyCodeCompletion.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/AbstractPyCodeCompletion.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AbstractPyCodeCompletion.java 1 May 2008 14:26:00 -0000 1.10 --- AbstractPyCodeCompletion.java 14 Jun 2008 22:14:55 -0000 1.11 *************** *** 12,15 **** --- 12,16 ---- import org.python.pydev.core.ICodeCompletionASTManager.ImportInfo; import org.python.pydev.core.docutils.ImportsSelection; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.AbstractToken; *************** *** 154,158 **** lookingFor==ICompletionState.LOOKING_FOR_ASSIGN; if(argsReceived.trim().length() > 0){ ! StringBuffer buffer = new StringBuffer("("); StringTokenizer strTok = new StringTokenizer(argsReceived, "( ,)"); --- 155,159 ---- lookingFor==ICompletionState.LOOKING_FOR_ASSIGN; if(argsReceived.trim().length() > 0){ ! FastStringBuffer buffer = new FastStringBuffer("(", 128); StringTokenizer strTok = new StringTokenizer(argsReceived, "( ,)"); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:49
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/editor/codefolding Modified Files: FoldingEntry.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: FoldingEntry.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding/FoldingEntry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FoldingEntry.java 31 Oct 2007 00:54:45 -0000 1.2 --- FoldingEntry.java 14 Jun 2008 22:14:55 -0000 1.3 *************** *** 4,7 **** --- 4,8 ---- package org.python.pydev.editor.codefolding; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.parser.visitors.scope.ASTEntry; *************** *** 61,65 **** @Override public String toString() { ! StringBuffer buf = new StringBuffer(); buf.append("FoldingEntry<"); buf.append("type:"); --- 62,66 ---- @Override public String toString() { ! FastStringBuffer buf = new FastStringBuffer(); buf.append("FoldingEntry<"); buf.append("type:"); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:49
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/hover In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/editor/hover Modified Files: PyAnnotationHover.java PyTextHover.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyTextHover.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/hover/PyTextHover.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyTextHover.java 24 Mar 2007 20:44:02 -0000 1.3 --- PyTextHover.java 14 Jun 2008 22:14:55 -0000 1.4 *************** *** 15,24 **** import org.eclipse.jface.text.source.ISourceViewer; import org.python.pydev.core.IPythonPartitions; import org.python.pydev.editor.codefolding.PySourceViewer; - import org.python.pydev.plugin.PydevPlugin; public class PyTextHover implements ITextHover{ private boolean pythonCommentOrMultiline; public PyTextHover(ISourceViewer sourceViewer, String contentType) { --- 15,25 ---- import org.eclipse.jface.text.source.ISourceViewer; import org.python.pydev.core.IPythonPartitions; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codefolding.PySourceViewer; public class PyTextHover implements ITextHover{ private boolean pythonCommentOrMultiline; + private FastStringBuffer buf = new FastStringBuffer(); public PyTextHover(ISourceViewer sourceViewer, String contentType) { *************** *** 32,37 **** } ! public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { ! StringBuffer buf = new StringBuffer(); if(!pythonCommentOrMultiline){ if(textViewer instanceof PySourceViewer){ --- 33,41 ---- } ! /** ! * Synchronized because of buffer access. ! */ ! public synchronized String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { ! buf.clear(); if(!pythonCommentOrMultiline){ if(textViewer instanceof PySourceViewer){ *************** *** 48,52 **** buf.append("\n"); } ! buf.append(marker.getAttribute(IMarker.MESSAGE)); } } --- 52,56 ---- buf.append("\n"); } ! buf.appendObject(marker.getAttribute(IMarker.MESSAGE)); } } Index: PyAnnotationHover.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/hover/PyAnnotationHover.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyAnnotationHover.java 2 Aug 2005 17:24:19 -0000 1.1 --- PyAnnotationHover.java 14 Jun 2008 22:14:55 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codefolding.PySourceViewer; import org.python.pydev.plugin.PydevPlugin; *************** *** 20,24 **** public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { ! StringBuffer buf = new StringBuffer(); if(sourceViewer instanceof PySourceViewer){ --- 21,25 ---- public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { ! FastStringBuffer buf = new FastStringBuffer(); if(sourceViewer instanceof PySourceViewer){ *************** *** 32,36 **** buf.append("\n"); } ! buf.append(marker.getAttribute(IMarker.MESSAGE)); } } --- 33,37 ---- buf.append("\n"); } ! buf.appendObject(marker.getAttribute(IMarker.MESSAGE)); } } |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:49
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/interpreters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/ui/interpreters Modified Files: AbstractInterpreterManager.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: AbstractInterpreterManager.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/interpreters/AbstractInterpreterManager.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** AbstractInterpreterManager.java 5 Jan 2008 17:09:31 -0000 1.38 --- AbstractInterpreterManager.java 14 Jun 2008 22:14:55 -0000 1.39 *************** *** 30,33 **** --- 30,34 ---- import org.python.pydev.core.IToken; import org.python.pydev.core.Tuple; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.plugin.PydevPlugin; import org.python.pydev.plugin.nature.PythonNature; *************** *** 376,380 **** */ public String getStringToPersist(String[] executables) { ! StringBuffer buf = new StringBuffer(); for (String exe : executables) { InterpreterInfo info = this.exeToInfo.get(exe); --- 377,381 ---- */ public String getStringToPersist(String[] executables) { ! FastStringBuffer buf = new FastStringBuffer(); for (String exe : executables) { InterpreterInfo info = this.exeToInfo.get(exe); |
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/builder Modified Files: PyDevBuilder.java PydevMarkerUtils.java PydevGrouperVisitor.java PydevInternalResourceDeltaVisitor.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PydevGrouperVisitor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/builder/PydevGrouperVisitor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PydevGrouperVisitor.java 8 Mar 2007 20:03:39 -0000 1.12 --- PydevGrouperVisitor.java 14 Jun 2008 22:14:55 -0000 1.13 *************** *** 14,17 **** --- 14,18 ---- import org.python.pydev.core.REF; import org.python.pydev.core.log.Log; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.plugin.nature.PythonNature; *************** *** 49,52 **** --- 50,56 ---- return; } + + FastStringBuffer bufferToCreateString = new FastStringBuffer(); + try{ if(!nature.isResourceInPythonpath(resource)){ *************** *** 61,66 **** visitor.memo = memo; //setting the memo must be the first thing. try { ! //communicate progress for each visitor ! PyDevBuilder.communicateProgress(monitor, totalResources, currentResourcesVisited, resource, visitor); REF.invoke(visitor, name, resource, document, monitor); --- 65,70 ---- visitor.memo = memo; //setting the memo must be the first thing. try { ! //communicate progress for each visitor ! PyDevBuilder.communicateProgress(monitor, totalResources, currentResourcesVisited, resource, visitor, bufferToCreateString); REF.invoke(visitor, name, resource, document, monitor); Index: PydevInternalResourceDeltaVisitor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/builder/PydevInternalResourceDeltaVisitor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PydevInternalResourceDeltaVisitor.java 30 May 2006 01:31:59 -0000 1.5 --- PydevInternalResourceDeltaVisitor.java 14 Jun 2008 22:14:55 -0000 1.6 *************** *** 13,16 **** --- 13,17 ---- import org.python.pydev.core.REF; import org.python.pydev.core.log.Log; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.PythonPathHelper; import org.python.pydev.plugin.nature.PythonNature; *************** *** 104,108 **** //communicate the progress currentResourcesVisited++; ! PyDevBuilder.communicateProgress(monitor, totalResources, currentResourcesVisited, resource, this); } }else if(ext.equals("pyc")){ --- 105,110 ---- //communicate the progress currentResourcesVisited++; ! FastStringBuffer bufferToCreateString = new FastStringBuffer(); ! PyDevBuilder.communicateProgress(monitor, totalResources, currentResourcesVisited, resource, this, bufferToCreateString); } }else if(ext.equals("pyc")){ Index: PyDevBuilder.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/builder/PyDevBuilder.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** PyDevBuilder.java 15 Sep 2007 18:48:50 -0000 1.52 --- PyDevBuilder.java 14 Jun 2008 22:14:55 -0000 1.53 *************** *** 29,32 **** --- 29,33 ---- import org.python.pydev.core.IPythonPathNature; import org.python.pydev.core.REF; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.PyCodeCompletionVisitor; import org.python.pydev.editor.codecompletion.revisited.PythonPathHelper; *************** *** 231,234 **** --- 232,237 ---- int totalResources = resourcesToParse.size(); int i = 0; + + FastStringBuffer bufferToCreateString = new FastStringBuffer(); for (Iterator<IFile> iter = resourcesToParse.iterator(); iter.hasNext() && monitor.isCanceled() == false;) { *************** *** 258,262 **** visitor.memo = memo; //setting the memo must be the first thing. ! communicateProgress(monitor, totalResources, i, r, visitor); //on a full build, all visits are as some add... --- 261,265 ---- visitor.memo = memo; //setting the memo must be the first thing. ! communicateProgress(monitor, totalResources, i, r, visitor, bufferToCreateString); //on a full build, all visits are as some add... *************** *** 277,294 **** /** * Used so that we can communicate the progress to the user */ ! public static void communicateProgress(IProgressMonitor monitor, int totalResources, int i, IResource r, PyDevBuilderVisitor visitor) { if(monitor != null){ ! StringBuffer msgBuf = new StringBuffer(); ! msgBuf.append("Pydev: Analyzing "); ! msgBuf.append(i); ! msgBuf.append(" of "); ! msgBuf.append(totalResources); ! msgBuf.append(" ("); ! msgBuf.append(r.getName()); ! msgBuf.append(")"); //in this case the visitor does not have the progress and therefore does not communicate the progress ! String name = msgBuf.toString(); monitor.subTask(name); } --- 280,301 ---- /** * Used so that we can communicate the progress to the user + * + * @param bufferToCreateString: this is a buffer that's emptied and used to create the string to be shown to the + * user with the progress. */ ! public static void communicateProgress(IProgressMonitor monitor, int totalResources, int i, IResource r, ! PyDevBuilderVisitor visitor, FastStringBuffer bufferToCreateString) { if(monitor != null){ ! bufferToCreateString.clear(); ! bufferToCreateString.append("Pydev: Analyzing "); ! bufferToCreateString.append(i); ! bufferToCreateString.append(" of "); ! bufferToCreateString.append(totalResources); ! bufferToCreateString.append(" ("); ! bufferToCreateString.append(r.getName()); ! bufferToCreateString.append(")"); //in this case the visitor does not have the progress and therefore does not communicate the progress ! String name = bufferToCreateString.toString(); monitor.subTask(name); } Index: PydevMarkerUtils.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/builder/PydevMarkerUtils.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PydevMarkerUtils.java 21 May 2008 01:38:09 -0000 1.12 --- PydevMarkerUtils.java 14 Jun 2008 22:14:55 -0000 1.13 *************** *** 15,18 **** --- 15,19 ---- import org.eclipse.jface.text.IRegion; import org.eclipse.ui.texteditor.MarkerUtilities; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.plugin.PydevPlugin; *************** *** 110,121 **** String line = doc.get(start.getOffset(), start.getLength()); int i; ! StringBuffer buffer; if ((i = line.indexOf('#')) != -1) { ! buffer = new StringBuffer(line.substring(0, i)); } else { ! buffer = new StringBuffer(line); } while (buffer.length() > 0 && Character.isWhitespace(buffer.charAt(buffer.length() - 1))) { ! buffer.deleteCharAt(buffer.length() - 1); } absoluteEnd = start.getOffset() + buffer.length(); --- 111,122 ---- String line = doc.get(start.getOffset(), start.getLength()); int i; ! FastStringBuffer buffer; if ((i = line.indexOf('#')) != -1) { ! buffer = new FastStringBuffer(line.substring(0, i), 0); } else { ! buffer = new FastStringBuffer(line, 0); } while (buffer.length() > 0 && Character.isWhitespace(buffer.charAt(buffer.length() - 1))) { ! buffer.deleteLast(); } absoluteEnd = start.getOffset() + buffer.length(); |
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration Modified Files: AbstractJavaClassModule.java JavaProjectModulesManager.java JavaElementToken.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: AbstractJavaClassModule.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration/AbstractJavaClassModule.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractJavaClassModule.java 18 May 2008 20:02:16 -0000 1.6 --- AbstractJavaClassModule.java 14 Jun 2008 22:14:55 -0000 1.7 *************** *** 24,27 **** --- 24,28 ---- import org.python.pydev.core.Tuple; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.actions.PyAction; import org.python.pydev.editor.codecompletion.revisited.modules.AbstractModule; *************** *** 106,114 **** List<Tuple<IJavaElement, CompletionProposal>> elementsFound = getJavaCompletionProposals(packagePlusactTok, null); for (Tuple<IJavaElement, CompletionProposal> element : elementsFound) { IJavaElement javaElement = element.o1; String args = ""; if (javaElement instanceof IMethod) { ! StringBuffer tempArgs = new StringBuffer("()"); IMethod method = (IMethod) javaElement; for (String param : method.getParameterTypes()) { --- 107,117 ---- List<Tuple<IJavaElement, CompletionProposal>> elementsFound = getJavaCompletionProposals(packagePlusactTok, null); + FastStringBuffer tempArgs = new FastStringBuffer(128); for (Tuple<IJavaElement, CompletionProposal> element : elementsFound) { IJavaElement javaElement = element.o1; String args = ""; if (javaElement instanceof IMethod) { ! tempArgs.clear(); ! tempArgs.append("()"); IMethod method = (IMethod) javaElement; for (String param : method.getParameterTypes()) { *************** *** 264,268 **** //we actually have a java class. String[] splitted = StringUtils.dotSplit(state.getActivationToken()); ! StringBuffer modNameBuf = new StringBuffer(this.getName()); IModule validModule = null; IModule module = null; --- 267,271 ---- //we actually have a java class. String[] splitted = StringUtils.dotSplit(state.getActivationToken()); ! FastStringBuffer modNameBuf = new FastStringBuffer(this.getName(), 128); IModule validModule = null; IModule module = null; *************** *** 280,287 **** } ! StringBuffer pathInJavaClass = new StringBuffer(); if (validModule == null) { validModule = this; ! pathInJavaClass = new StringBuffer(state.getActivationToken()); } else { //After having found a valid java class, we must also check which was the resulting token within that class --- 283,292 ---- } ! modNameBuf.clear(); ! FastStringBuffer pathInJavaClass = modNameBuf; //get it cleared if (validModule == null) { validModule = this; ! pathInJavaClass.clear(); ! pathInJavaClass.append(state.getActivationToken()); } else { //After having found a valid java class, we must also check which was the resulting token within that class Index: JavaProjectModulesManager.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration/JavaProjectModulesManager.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JavaProjectModulesManager.java 18 May 2008 20:02:16 -0000 1.11 --- JavaProjectModulesManager.java 14 Jun 2008 22:14:55 -0000 1.12 *************** *** 31,34 **** --- 31,35 ---- import org.python.pydev.core.Tuple; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; /** *************** *** 166,169 **** --- 167,171 ---- try { rawClasspath = this.javaProject.getRawClasspath(); + FastStringBuffer buffer = new FastStringBuffer(); for(IClasspathEntry entry:rawClasspath){ int entryKind = entry.getEntryKind(); *************** *** 184,188 **** //and if the java package is 'accepted' if(filter.accept(elementName, root, childPackage)){ ! StringBuffer buffer = new StringBuffer(elementName); int packageNameLen = buffer.length(); if(packageNameLen > 0){ --- 186,191 ---- //and if the java package is 'accepted' if(filter.accept(elementName, root, childPackage)){ ! buffer.clear(); ! buffer.append(elementName); int packageNameLen = buffer.length(); if(packageNameLen > 0){ *************** *** 195,199 **** buffer.append(FullRepIterable.getFirstPart(class_.getElementName())); filter.accept(buffer.toString(), root, class_); ! buffer.delete(packageNameLen, Integer.MAX_VALUE); //to the end of the string } } --- 198,202 ---- buffer.append(FullRepIterable.getFirstPart(class_.getElementName())); filter.accept(buffer.toString(), root, class_); ! buffer.setCount(packageNameLen); //leave only the package part for the next append } } Index: JavaElementToken.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration/JavaElementToken.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JavaElementToken.java 6 Jan 2008 13:31:46 -0000 1.2 --- JavaElementToken.java 14 Jun 2008 22:14:55 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- import org.eclipse.swt.graphics.Image; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codecompletion.revisited.modules.CompiledToken; import org.python.pydev.plugin.PydevPlugin; *************** *** 128,132 **** */ private static String getString(Reader reader) { ! StringBuffer buf = new StringBuffer(); char[] buffer = new char[1024]; int count; --- 129,133 ---- */ private static String getString(Reader reader) { ! FastStringBuffer buf = new FastStringBuffer(); char[] buffer = new char[1024]; int count; |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:48
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/editor Modified Files: PyWordRule.java PyCodeScanner.java PyEditConfiguration.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyWordRule.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyWordRule.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyWordRule.java 20 Oct 2007 19:30:36 -0000 1.3 --- PyWordRule.java 14 Jun 2008 22:14:55 -0000 1.4 *************** *** 13,16 **** --- 13,17 ---- import org.eclipse.jface.text.rules.IWordDetector; import org.eclipse.jface.text.rules.Token; + import org.python.pydev.core.structure.FastStringBuffer; *************** *** 40,44 **** protected Map fWords= new HashMap(); /** Buffer used for pattern detection */ ! private StringBuffer fBuffer= new StringBuffer(); private IToken classNameToken; --- 41,45 ---- protected Map fWords= new HashMap(); /** Buffer used for pattern detection */ ! private FastStringBuffer fBuffer= new FastStringBuffer(); private IToken classNameToken; *************** *** 104,108 **** if (fColumn == UNDEFINED || (fColumn == scanner.getColumn() - 1)) { ! fBuffer.setLength(0); do { fBuffer.append((char) c); --- 105,109 ---- if (fColumn == UNDEFINED || (fColumn == scanner.getColumn() - 1)) { ! fBuffer.clear(); do { fBuffer.append((char) c); Index: PyEditConfiguration.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEditConfiguration.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** PyEditConfiguration.java 12 Apr 2008 13:04:08 -0000 1.57 --- PyEditConfiguration.java 14 Jun 2008 22:14:55 -0000 1.58 *************** *** 37,40 **** --- 37,41 ---- import org.eclipse.ui.texteditor.spelling.SpellingService; import org.python.pydev.core.IPythonPartitions; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.autoedit.DefaultIndentPrefs; import org.python.pydev.editor.autoedit.PyAutoIndentStrategy; *************** *** 172,176 **** Preferences prefs = PydevPlugin.getDefault().getPluginPreferences(); int tabWidth = DefaultIndentPrefs.getStaticTabWidth(); ! StringBuffer spaces = new StringBuffer(8); for (int i = 0; i < tabWidth; i++) { --- 173,177 ---- Preferences prefs = PydevPlugin.getDefault().getPluginPreferences(); int tabWidth = DefaultIndentPrefs.getStaticTabWidth(); ! FastStringBuffer spaces = new FastStringBuffer(8); for (int i = 0; i < tabWidth; i++) { Index: PyCodeScanner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyCodeScanner.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyCodeScanner.java 14 Sep 2006 01:15:46 -0000 1.9 --- PyCodeScanner.java 14 Jun 2008 22:14:55 -0000 1.10 *************** *** 21,24 **** --- 21,25 ---- import org.eclipse.jface.text.rules.WhitespaceRule; import org.eclipse.jface.text.rules.WordRule; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.plugin.PydevPlugin; import org.python.pydev.plugin.PydevPrefs; *************** *** 106,110 **** * Used to keep the state of the token */ ! private StringBuffer buffer; /** --- 107,111 ---- * Used to keep the state of the token */ ! private FastStringBuffer buffer = new FastStringBuffer(); /** *************** *** 118,122 **** public boolean isWordStart(char c) { isInHexa = false; ! buffer = new StringBuffer(); buffer.append(c); return Character.isDigit(c); --- 119,123 ---- public boolean isWordStart(char c) { isInHexa = false; ! buffer.clear(); buffer.append(c); return Character.isDigit(c); |
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:27
|
Update of /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/core/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27905/src/org/python/pydev/refactoring/core/edit Modified Files: AbstractTextEdit.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: AbstractTextEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/core/edit/AbstractTextEdit.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractTextEdit.java 20 Oct 2007 19:31:04 -0000 1.5 --- AbstractTextEdit.java 14 Jun 2008 22:14:34 -0000 1.6 *************** *** 10,13 **** --- 10,14 ---- import org.eclipse.text.edits.TextEdit; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.parser.jython.SimpleNode; import org.python.pydev.refactoring.ast.adapters.IASTNodeAdapter; *************** *** 66,70 **** protected String getIndentation(int indent) { ! StringBuffer buf = new StringBuffer(); while (indent > 1) { buf.append(WHITESPACE); --- 67,71 ---- protected String getIndentation(int indent) { ! FastStringBuffer buf = new FastStringBuffer(); while (indent > 1) { buf.append(WHITESPACE); |