Let me correct you Dan,

> String someString;
> ...
> someString = "some value";
> ...
> cannotInline( someString );

This indeed won't work now, but probably we'll make some changes to to the
inline functionaty in Ariadna, so that this will work for some cases. We
already have a request for this from Thomas Singer. However this is minor
thing imho.

> and neither will this:
>
> String someString = "some value";
> ...
> someString = "another value";
> ...
> stillCannotInline( someString );

This will work. Actually it will inline all usages of someString before it
is reassigned to "another value". The assignment itself will be replaced
with the declaration of someString:

// inlined usages of someString

String someString = "another value";
 ...
 stillCannotInline( someString );

The inline is not automatically performed in case when in order to re-assign
the vatiale we need to know the previous value of the variable (for example
++ or += operators) or when the re-assignmet is conditional and after the
re-assignment we cannot say (using static analysis) whether the value of the
variable has changed. This won't work:

String someString = "some value";
 ...
someString += "another value";
...
stillCannotInline( someString );


----- Original Message -----
From: "North D" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 23 December, 2001 12:28 PM
Subject: RE: [Eap-list] inline : here and not there


> Hi Alain.
>
> Inlining only works for variables which are assigned to in their
definition
> and not reassigned.  This won't work:
>
> String someString;
> ...
> someString = "some value";
> ...
> cannotInline( someString );
>
> and neither will this:
>
> String someString = "some value";
> ...
> someString = "another value";
> ...
> stillCannotInline( someString );
>
> I guess it would be possible to inline the first case (but obviously not
the
> second case) but IDEA doesn't do this yet.
>
> Cheers,
> Dan
>
>
> > -----Original Message-----
> > From: Alain Ravet [mailto:[EMAIL PROTECTED]]
> > Sent: 22 December 2001 19:33
> > To: [EMAIL PROTECTED]
> > Subject: [Eap-list] inline : here and not there
> >
> >
> > I can inline "_name" in the 2nd line
> >
> > here :
> >         String _name = "klkl";
> >         return _name ;
> >
> > but not here :
> >         _name = "klkl";
> >         return _name ;
> >
> > Why ?
> >
> >
> > --Alain Ravet
> >
> > _______________________________________________
> > Eap-list mailing list
> > [EMAIL PROTECTED]
> > http://www.intellij.com/mailman/listinfo/eap-list
> >
>
>
>
****************************************************************************
***********
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify
[EMAIL PROTECTED] immediately.
>
> This footnote also confirms that this email message has been swept for the
> presence of computer viruses.
>
****************************************************************************
***********
>
> _______________________________________________
> Eap-list mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-list


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to