JUnit Assert.assertNotNull(nonLiteralIntendedToBeNullChecked, "literal string that is actually null checked")
Open
migrated
Priority-Medium
Type-NewCheck
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
_[Original issue](https://code.google.com/p/error-prone/issues/detail?id=212) created by **cpovirk@google.com** on 2013-11-15 at 06:15 PM_
---
The parameters are reversed from what is intended. In both JUnit 3 and JUnit 4, the first parameter is the message, and the second is the object to be tested.
http://junit.sourceforge.net/junit3.8.1/javadoc/junit/framework/Assert.html#assertNotNull(java.lang.String, java.lang.Object)
http://junit.sourceforge.net/javadoc/org/junit/Assert.html#assertNotNull(java.lang.String, java.lang.Object)
I see about a dozen instances of this problem in Google code.
Contributor guide
Assessment
This issue has not been assessed yet.