Le Wang <[EMAIL PROTECTED]> writes:

> Hi,
>
> I'm trying to adhere to a fill-column standard of 78 characters.
Fine. You should do this for mails as well ;-)

> But for some code I have to write, there are very long string
> constants, so I end up chaining together method calls like the
> following:
>
> <code>
>
> public class Test
> {
>   public Test ()
>   {
>   }
>   public String CONSTANT=new StringBuffer ("a").append("b")
>     .app
> }
>
> </code>
>
> Completion (jde-compete) fails if I place the cursor after ".app".
> The construct itself is syntatically correct, so this should be
> considered a bug in the completion mechanism, right?

I can confirm that completion does not work after method calls...,
sometimes.

Sometimes it does not find the return type of methods defined in base
classes or interfaces of the current class. Perhaps this has something
to do with the mysterious access$nnn functions. Like in this
completion buffer:

Click <mouse-2> on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
DefaultScheduler()
access$000(DefaultScheduler) : AlarmManager
access$100(DefaultScheduler) : Context
access$200(DefaultScheduler) : Logger
access$300(DefaultScheduler) : Logger
addTask(SchedulerTask) : Scheduler$Task
cancel(boolean) : void             class$(String) : Class
clone() : Object                   compose(ComponentManager) : void
configure(Configuration) : void    contextualize(Context) : void
dispose() : void                   enableLogging(Logger) : void
equals(Object) : boolean           finalize() : void
getClass() : Class                 getImplementationVersion() : Version
getInterfaceVersion() : Version    getLogger() : Logger
getPersistenceBroker() : PersistenceBroker
getTasks() : List                  getUnmarshaller() : Unmarshaller
hashCode() : int                   initTasks() : void
initialize() : void                notify() : void
notifyAll() : void                 recontextualize(Context) : void
reinitTasks() : void               removeTask(Scheduler$Task) : void
setupLogger(Object, String) : void
toString() : String                wait(long, int) : void

access$?00(DefaultScheduler) : Logger should be a function called
public Logger getLogger(), defined in a base class.

And of cause, as you showed, it has problems with return types of
complex expressions. Does (new Stringbuffer()) qualifies as complex
expression :-) ?

But btw, why do you use Stringbuffer#append for String constants?
Just concat them with `+' and the compiler will make one long string
from the parts. This will happen at compile time.
With your method the compiler will emit seperate string constants
and then build the long strings at instanciation time, or, in case of
static constants, at class-loading time.

Ole
-- 
Ole Arndt                     http://www.sugarshark.com
-------------------------------------------------------
Lie, n.:
        A very poor substitute for the truth, but the only one
discovered to date.

Reply via email to