This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | NullPointerException during java compilation when asserting a typed List | ||
---|---|---|---|
Product: | java | Reporter: | peterwlynch <peterwlynch> |
Component: | Source | Assignee: | Jan Lahoda <jlahoda> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
peterwlynch
2011-02-04 15:46:37 UTC
Hopefully this helps. When I cut this code from the java file, problem goes away. When I add it back, NPE everytime I try to save the file. proj.getProfiles(); asertThat(proj.getProfiles(), contains(items)); assertThat(proj.getProfiles(), equalTo(BuildResultDTO.SUCCESS)); Things of note: * spelling mistakes (asert*) * items refers to a type that is not the same as what getProfiles() returns * BuldResultDTO.SUCCESS is an enum * SUCCESS is not the same as the type returned by getProfiles() * above code uses hamcrest assertions Even more: Adding this code to a junit test that uses Hamcrest assertions creates the NPE everytime. assertThat(profiles, contains(null)) profiles is a List of a specific type. List<MyType> *** This bug has been marked as a duplicate of bug 193862 *** |