Mercurial > projects > dwt-addons
diff dwtx/jface/text/templates/TemplateCompletionProcessor.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | f70d9508c95c |
children |
line wrap: on
line diff
--- a/dwtx/jface/text/templates/TemplateCompletionProcessor.d Wed Aug 27 14:49:30 2008 +0200 +++ b/dwtx/jface/text/templates/TemplateCompletionProcessor.d Mon Sep 08 00:51:37 2008 +0200 @@ -67,7 +67,17 @@ } } - private static const Comparator fgProposalComparator= new ProposalComparator(); + private static Comparator fgProposalComparator_; + private static Comparator fgProposalComparator(){ + if(fgProposalComparator_ is null ) { + synchronized( TemplateCompletionProcessor.classinfo ){ + if(fgProposalComparator_ is null ) { + fgProposalComparator_ = new ProposalComparator(); + } + } + } + return fgProposalComparator_; + } /* * @see dwtx.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(dwtx.jface.text.ITextViewer, @@ -100,12 +110,12 @@ continue; } if (template_.matches(prefix, context.getContextType().getId())) - matches.add(createProposal(template_, context, cast(IRegion) region, getRelevance(template_, prefix))); + matches.add( cast(Object) createProposal(template_, context, cast(IRegion) region, getRelevance(template_, prefix))); } Collections.sort(matches, fgProposalComparator); - return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]); + return arraycast!(ICompletionProposal)( matches.toArray()); } /**