SmartIntroduce bug

SmartIntroduce allows to select an illegal expression when used with array literals. This can produce code which does not compile. See the attached screen shot for an example.



Attachment(s):
smart_introduce.png
0
5 comments
Avatar
Permanently deleted user


Bas Leijdekkers wrote:

SmartIntroduce allows to select an illegal expression when used with array literals.
This can produce code which does not compile. See the attached screen shot for an example.


Yep, you are right. I'll have a look at it and will try to prevent to offer the selection of array
initializers in these situations. Thanks for reporting it.

However, it also shows a bug in IDEA because IDEA actually allows this selection to be turned
into a variable (and fails in doing so). I'll file an SCR for that if you don't mind.


Sascha


0
Avatar
Permanently deleted user

On 2004/01/15 12:24, Sascha Weinreuter wrote:

Bas Leijdekkers wrote:

>> SmartIntroduce allows to select an illegal expression when used
>> with array literals. This can produce code which does not compile.
>> See the attached screen shot for an example.


Yep, you are right. I'll have a look at it and will try to prevent to
offer the selection of array initializers in these situations. Thanks
for reporting it.


No problem. I would try to fix it myself if recent sources were
available, are they?

However, it also shows a bug in IDEA because IDEA actually allows
this selection to be turned into a variable (and fails in doing so).
I'll file an SCR for that if you don't mind.


Yes, please do.
Strangely enough in some cases IDEA can't turn a similar selection into
a variable when it should be able to do so. See:
http://www.intellij.net/tracker/idea/viewSCR?publicId=10412

Bas

0
Avatar
Permanently deleted user

Bas Leijdekkers wrote:

On 2004/01/15 12:24, Sascha Weinreuter wrote:

>

Bas Leijdekkers wrote:

>> SmartIntroduce allows to select an illegal expression when used
>> with array literals. This can produce code which does not compile.
>> See the attached screen shot for an example.
>

Yep, you are right. I'll have a look at it and will try to prevent to
offer the selection of array initializers in these situations. Thanks
for reporting it.

>

No problem. I would try to fix it myself if recent sources were
available, are they?


Hehe, you got me. Unfortunately they are not right now. Not even right here on
my machine because I forgot to check them into CVS when doing the last version(s)
on my home PC :o
I will put them on the Wiki the next days.

However, it also shows a bug in IDEA because IDEA actually allows
this selection to be turned into a variable (and fails in doing so).
I'll file an SCR for that if you don't mind.

>

Yes, please do.

http://www.intellij.net/tracker/idea/viewSCR?publicId=26625

Strangely enough in some cases IDEA can't turn a similar selection into
a variable when it should be able to do so. See:
http://www.intellij.net/tracker/idea/viewSCR?publicId=10412


Yes, I found this one as well. This is caused by IDEA constructing a different parse
tree in this case. The PsiViewer shows this example as a simple PsiCodeBlock
whereas "true" array initalizers are PsiArrayInitializer objects. PsiCodeBlock is no
expression, which explains that IDEA doesn't like it to be turned into a variable.


Sascha


0
Avatar
Permanently deleted user


Bas Leijdekkers wrote:

On 2004/01/15 12:24, Sascha Weinreuter wrote:

>

Bas Leijdekkers wrote:

>> SmartIntroduce allows to select an illegal expression when used
>> with array literals. This can produce code which does not compile.
>> See the attached screen shot for an example.
>

Yep, you are right. I'll have a look at it and will try to prevent to
offer the selection of array initializers in these situations. Thanks
for reporting it.


Fixed in 1.0.3 available on the Wiki and via the Plugin Manager.

No problem. I would try to fix it myself if recent sources were
available, are they?


Yes, the latest sources are on the Wiki now.

Sascha


0
Avatar
Permanently deleted user

On 2004/01/20 20:08, Sascha Weinreuter wrote:

Bas Leijdekkers wrote:

>> On 2004/01/15 12:24, Sascha Weinreuter wrote:
>>
>> > Bas Leijdekkers wrote:
>> >> SmartIntroduce allows to select an illegal expression when used
>> >> with array literals. This can produce code which does not compile.
>> >> See the attached screen shot for an example.
>> >
>> > Yep, you are right. I'll have a look at it and will try to prevent to
>> > offer the selection of array initializers in these situations. Thanks
>> > for reporting it.


Fixed in 1.0.3 available on the Wiki and via the Plugin Manager.


Thanks, just tested it and works great!

>> No problem. I would try to fix it myself if recent sources were
>> available, are they?


Yes, the latest sources are on the Wiki now.


Thanks again. Another excellent learning opportunity for me:-)

Bas

0

Please sign in to leave a comment.