I'm going through some existing (and working) code and came across a line like this:
if (someObject.getStatus() == SomeEnum.VALUE1.VALUE2) { ... }
Where SomeEnum is a simple enum that looks like this:
public enum SomeEnum {
VALUE1,
VALUE2,
VALUE3,
...
}
private SomeEnum() {}
Now, what does that comparison above do? More precisely, what does the combination of two enum values in there do? I was astonished to not see any warnings or errors because of that line as I assumed this was simply wrong. However, it compiles and runs just fine. Can someone enlighten me on what this would do?