Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ant-dev] Temp vars in PlantyCompletionProcessor

> The PlantyCompletionProcessor has got some code that I don't understand.
>
> The code basically looks like this:
> public class PlantyCompletionProcessor {
>   protected static DTD dtd;
>
>   protected ICompletionProposal[] getAttributeProposals(String aTaskName,
>            String aPrefix) {
>     DTD tempDtd = dtd;
>     DTDElement tempElement = (DTDElement)tempDtd.elements.get(aTaskName);
>     <more code that does not reference tempDtd>
>   }
> }
>
> Code like this exists in a few places in this class. Is it just a remnant
from
> a refactoring that was never cleaned up?

Yes, you right. This is some left over from a former refactoring. You may
just clean it up.
The static variable 'dtd' is the one to be used at all places. It will be
set only once when the
first completion processor is instantiated and then among all instances.

Alf



Back to the top