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
Please sign in to leave a comment.
Bas Leijdekkers wrote:
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
On 2004/01/15 12:24, Sascha Weinreuter 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.
No problem. I would try to fix it myself if recent sources were
available, are they?
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
Bas Leijdekkers wrote:
>
>
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.
>
http://www.intellij.net/tracker/idea/viewSCR?publicId=26625
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
Bas Leijdekkers wrote:
>
Fixed in 1.0.3 available on the Wiki and via the Plugin Manager.
Yes, the latest sources are on the Wiki now.
Sascha
On 2004/01/20 20:08, Sascha Weinreuter 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.
Thanks, just tested it and works great!
>> No problem. I would try to fix it myself if recent sources were
>> available, are they?
Thanks again. Another excellent learning opportunity for me:-)
Bas