Incorrect Value displays while debugging
Hi there. I'm having a weird problem with the information displayed during debugging.
The debugger displays the second comparison to be true even though it is false, and the XOR as false even though it is true.
Im using Intellij Ultimate 2020.3 and tested this with JDK 13.0.5(Azul) and JDK15.0.1 (Open JDK)
Whats weird about this is that I updated to 2020.3 because of this bug and happened to run the program directly after doing so once, where it would not display the information right of the if statement but would correctly show the XOR to be true. As soon as Intellij got done indexing the JDK (whatever that means) it started displaying the (erronous) information in the next runs again.
Code in Question (String omitted for clarity as it is very long, available here https://adventofcode.com/2020/day/2/input )
public class Day2 {
public static void main(String[] args) {
String input = ...;
String[] inputs = input.split("\\n");
int valid = 0;
int lower;
int higher;
char character;
String temp;
for(String s : inputs){
String[] temps = s.split("-| |:");
lower = Integer.parseInt(temps[0]);
higher = Integer.parseInt(temps[1]);
character = temps[2].charAt(0);
temp = temps[4];
char one = temp.charAt(lower-1);
char two = temp.charAt(higher-1);
if( one == character ^ two == character){
valid++;
}
}
System.out.println(valid);
}
}
Please sign in to leave a comment.
Hello,
Thank you for taking the time to report this.
I was able to reproduce it and created a new bug report for this on our issue tracker: IDEA-257493.
The developers will look into it shortly.
Feel free to leave additional comments and follow the issue for further updates from the dev team.
See this article if you are not familiar with YouTrack.