[Pydev-cvs] org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/javai
Brought to you by:
fabioz
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; |