Community
Participate
Working Groups
I20090515-1143. Comparing identical value detection does not work for this, i.e. if (this == this) is not warned.
Will investigate this.
Proposed patch for bug #276740 should also fix this.
Released for 3.6M1
Srikanth, Using nightly build leads to have 101 additional warnings in org.eclipse.jdt.core.tests.model project while building my workspace... All these warnings are in ASTTest and ASTParserTest test suites, typically on following lines: assertTrue(ASTParser.K_EXPRESSION == 1); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ This sounds a valid test for me, unless I miss something? If so, then this option should be unset on this project to avoid all these noisy warnings...
> assertTrue(ASTParser.K_EXPRESSION == 1); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >This sounds a valid test for me, unless I miss something? What does the test do? Verify the value of constants? If so, it makes sense otherwise I don't see the value of such an assert.
(In reply to comment #5) > > assertTrue(ASTParser.K_EXPRESSION == 1); > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >This sounds a valid test for me, unless I miss something? > > What does the test do? Verify the value of constants? If so, it makes sense > otherwise I don't see the value of such an assert. > These are typically tests to verify that API constants value are not modified...
(In reply to comment #4) > Srikanth, > Using nightly build leads to have 101 additional warnings in > org.eclipse.jdt.core.tests.model project while building my workspace... > All these warnings are in ASTTest and ASTParserTest test suites, typically on > following lines: > assertTrue(ASTParser.K_EXPRESSION == 1); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > This sounds a valid test for me, unless I miss something? I have verified that all the 101 additional warnings are correct and intended to be produced. For the org.eclipse.jdt.core.tests.model project alone, I am changing the compiler setting so these warnings are not produced. Changed project preferences released to HEAD.
In Eclipse 3.5 it's still not fixed: java.lang.Double has a method: /** * Returns <code>true</code> if the specified number is a * Not-a-Number (NaN) value, <code>false</code> otherwise. * * @param v the value to be tested. * @return <code>true</code> if the value of the argument is NaN; * <code>false</code> otherwise. */ static public boolean isNaN(double v) { return (v != v); } The "v != v" is NOT marked! My custom code if (d != d) { //Double.isNaN() is marked for "d != d" with "Comparing identical expressions"!
(In reply to comment #8) > In Eclipse 3.5 it's still not fixed: > Yes, because this bug is targeted 3.6M1. Furthermore, it seems not to be so critical to be backported to 3.5.1 (no data loss, no exceptions), unless you give solid arguments to convince us...
This is definitely not 3.5.1 worthy.
Verified for 3.6M1 using build 20090802-2000.