Incorrect Intention for 'for each'. Also throws exception

Hi,
Idea 6 shows an (incorrect) intention to convert this loop into a for each loop -

StringBuilder pathStr = new StringBuilder();

for (int i = 0; i < (path.size()); i++)
{
pathStr.append(path.get(i));
pathStr.append(separatorChar);
}


Of course when i actually try to use the intention, an exception is thrown.
This looks like a bug.

0
2 comments
Avatar
Permanently deleted user

Hello Prashant,

PD> Idea 6 shows an (incorrect) intention to convert this loop into a
PD> for each loop -
PD> StringBuilder pathStr = new StringBuilder();
PD>
PD> for (int i = 0; i < (path.size()); i++)
PD> {
PD> pathStr.append(path.get(i));
PD> pathStr.append(separatorChar);
PD> }
PD> Of course when i actually try to use the intention, an exception is
PD> thrown. This looks like a bug.

Without seeing the declaration of the "path" variable, it's impossible to
tell whether the intention is correct or not.

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Avatar
Permanently deleted user

Hello Prashant,

Hi,
Idea 6 shows an (incorrect) intention to convert this loop into a for
each loop -
StringBuilder pathStr = new StringBuilder();

for (int i = 0; i < (path.size()); i++)
{
pathStr.append(path.get(i));
pathStr.append(separatorChar);
}
Of course when i actually try to use the intention, an exception is
thrown. This looks like a bug.


Thanks.
Double checked it and had to confirm exception appearance.

Mike Gedzberg
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure"


0

Please sign in to leave a comment.