From a NetBeans user (test-case is also reproducible with JDB):
If you step through the following code, the debugger will step through both if
and else statement blocks.
If aString was defined outside of the while loop, the debugger behaves normally.
regards,
Norman.
==========================
public class aBUG {
public static void main(String a[]) {
boolean aContinue = true;
int aCount = 1;
//String aString[] = {"1", "2", "3"};
String aProcess[] = {"", "", ""};
String aMessage[] = {"1", "A message"};
while (aContinue) {
System.out.println(aCount);
try {
if (aMessage[1].length() > 0) {
String aString[] = {"1", "2", "3"};
if (! aProcess[2].equalsIgnoreCase("123")){
aCount++;
} else {
aCount++;
}
} else {
aContinue = false;
}
} catch (NullPointerException e) {
aContinue = false;
}
}
}
If you step through the following code, the debugger will step through both if
and else statement blocks.
If aString was defined outside of the while loop, the debugger behaves normally.
regards,
Norman.
==========================
public class aBUG {
public static void main(String a[]) {
boolean aContinue = true;
int aCount = 1;
//String aString[] = {"1", "2", "3"};
String aProcess[] = {"", "", ""};
String aMessage[] = {"1", "A message"};
while (aContinue) {
System.out.println(aCount);
try {
if (aMessage[1].length() > 0) {
String aString[] = {"1", "2", "3"};
if (! aProcess[2].equalsIgnoreCase("123")){
aCount++;
} else {
aCount++;
}
} else {
aContinue = false;
}
} catch (NullPointerException e) {
aContinue = false;
}
}
}
- duplicates
-
JDK-4952629 REGRESSION: javac generates a spurious line number entry on } else {
- Resolved
- relates to
-
JDK-4870514 Bad mapping between bytecode and line number.
- Resolved