Skip to main content
added 475 characters in body
Source Link
Michael
  • 44.5k
  • 12
  • 97
  • 143

Eclipse uses its own compiler, distinct from javac, and this error appears to be the manifestation of a difference in compiler implementation.

This is the ticket raised on their issue tracker. https://bugs.eclipse.org/bugs/show_bug.cgi?id=513766

Eclipse compiler devs seem to consider it a bug in javac, rather than the other way around. So perhaps the question should be "why does javac accept it"? They raisedThis ticket exists for the JDK https://bugs.openjdk.org/browse/JDK-8179483 but there, and was raised by Dan Smith who is no acceptancea language designer at Oracle. He states that "javac should reject this is a JDK bugprogram".

That said, I'd be quite surprised if they remove this "feature". Oracle are not in the habit of making backwards-incompatible changes, which this would be for people like you. A more likely solution seems an adjustment to the spec to allow for it, but I'd bet it's more complex than it seems on the surface, or they might have addressed it by now.

I think effectively this behaviour is ambiguously defined, and you should ideally avoid relying on it. I'd change your code to

if(Boolean.TRUE.equals(row.getValue())) 

Eclipse uses its own compiler, distinct from javac, and this error appears to be the manifestation of a difference in compiler implementation.

This is the ticket raised on their issue tracker. https://bugs.eclipse.org/bugs/show_bug.cgi?id=513766

Eclipse compiler devs seem to consider it a bug in javac, rather than the other way around. So perhaps the question should be "why does javac accept it"? They raised https://bugs.openjdk.org/browse/JDK-8179483 but there is no acceptance that this is a JDK bug.

I think effectively this behaviour is ambiguously defined, and you should ideally avoid relying on it. I'd change your code to

if(Boolean.TRUE.equals(row.getValue())) 

Eclipse uses its own compiler, distinct from javac, and this error appears to be the manifestation of a difference in compiler implementation.

This is the ticket raised on their issue tracker. https://bugs.eclipse.org/bugs/show_bug.cgi?id=513766

Eclipse compiler devs seem to consider it a bug in javac, rather than the other way around. So perhaps the question should be "why does javac accept it"? This ticket exists for the JDK https://bugs.openjdk.org/browse/JDK-8179483, and was raised by Dan Smith who is a language designer at Oracle. He states that "javac should reject this program".

That said, I'd be quite surprised if they remove this "feature". Oracle are not in the habit of making backwards-incompatible changes, which this would be for people like you. A more likely solution seems an adjustment to the spec to allow for it, but I'd bet it's more complex than it seems on the surface, or they might have addressed it by now.

I think effectively this behaviour is ambiguously defined, and you should ideally avoid relying on it. I'd change your code to

if(Boolean.TRUE.equals(row.getValue())) 
Source Link
Michael
  • 44.5k
  • 12
  • 97
  • 143

Eclipse uses its own compiler, distinct from javac, and this error appears to be the manifestation of a difference in compiler implementation.

This is the ticket raised on their issue tracker. https://bugs.eclipse.org/bugs/show_bug.cgi?id=513766

Eclipse compiler devs seem to consider it a bug in javac, rather than the other way around. So perhaps the question should be "why does javac accept it"? They raised https://bugs.openjdk.org/browse/JDK-8179483 but there is no acceptance that this is a JDK bug.

I think effectively this behaviour is ambiguously defined, and you should ideally avoid relying on it. I'd change your code to

if(Boolean.TRUE.equals(row.getValue()))