Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 17233 Details for
Bug 81403
Completion improvement.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Replacement ArrayList with Vector
org.eclipse.cdt.ui.adb.completion.patch (text/plain), 2.65 KB, created by
Tomaszewski Przemek
on 2005-01-18 03:27:07 EST
(
hide
)
Description:
Replacement ArrayList with Vector
Filename:
MIME Type:
Creator:
Tomaszewski Przemek
Created:
2005-01-18 03:27:07 EST
Size:
2.65 KB
patch
obsolete
>Index: CCompletionProcessor.java >=================================================================== >RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java,v >retrieving revision 1.26 >diff -u -r1.26 CCompletionProcessor.java >--- CCompletionProcessor.java 13 Dec 2004 21:16:29 -0000 1.26 >+++ CCompletionProcessor.java 18 Jan 2005 08:19:04 -0000 >@@ -10,6 +10,7 @@ > import java.util.Iterator; > import java.util.LinkedList; > import java.util.List; >+import java.util.Vector; > > import org.eclipse.cdt.core.model.ICElement; > import org.eclipse.cdt.core.model.ITranslationUnit; >@@ -32,8 +33,8 @@ > import org.eclipse.cdt.ui.CUIPlugin; > import org.eclipse.cdt.ui.IFunctionSummary; > import org.eclipse.cdt.ui.IWorkingCopyManager; >-import org.eclipse.cdt.ui.text.ICHelpInvocationContext; > import org.eclipse.cdt.ui.text.ICCompletionProposal; >+import org.eclipse.cdt.ui.text.ICHelpInvocationContext; > import org.eclipse.core.resources.IProject; > import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.jface.text.BadLocationException; >@@ -315,7 +316,7 @@ > fCurrentSourceUnit = unit; > fTextViewer = viewer; > >- ArrayList completions = new ArrayList(); >+ final List completions = new Vector(); > > if (fCurrentSourceUnit == null) > return null; >@@ -327,12 +328,29 @@ > if (fCurrentCompletionNode != null) { > addProposalsFromSearch(fCurrentCompletionNode, completions); > addProposalsFromCompletionContributors(fCurrentCompletionNode, completions); >- addProposalsFromTemplates(viewer, fCurrentCompletionNode, completions); >+ addProposalsFromTemplates(viewer, fCurrentCompletionNode, completions); >+ removeRepeatedProposals(completions); > return order( (ICCompletionProposal[]) completions.toArray(new ICCompletionProposal[0])); > } > return null; > } >- >+ >+ /** >+ * Removes duplicated proposals. >+ * @param completions Completions to check. >+ */ >+ private void removeRepeatedProposals(List completions) { >+ final int size = completions.size(); >+ final ICompletionProposal[] proposalsToCheck = (ICCompletionProposal[]) completions.toArray(new ICCompletionProposal[0]); >+ for (int i = 0; i < size; i++) { >+ for (int j = i + 1; j < size; j++) { >+ if (proposalsToCheck[i].equals(proposalsToCheck[j])) { >+ completions.remove(proposalsToCheck[j]); >+ } >+ } >+ } >+ } >+ > private void addProposalsFromTemplates(ITextViewer viewer, IASTCompletionNode completionNode, List completions){ > if (completionNode == null) > return;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 81403
:
16695
|
16722
|
17195
| 17233