History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-3683
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Maxim Shafirov
Reporter: Jonas Kvarnstrom
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Nullability not checked in initializer for static field

Created: 02 Nov 05 13:26   Updated: 06 Nov 08 23:34
Component/s: Code Analysis. Inspection
Fix Version/s: Undefined

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 3,536
Severity: Medium


 Description  « Hide
Nullability is apparently not checked in initializers for static fields. See the two occurrences of "new TestConstantConditions(null)" below – only one of them generates a warning.

package test;

import org.jetbrains.annotations.NotNull;

public class TestConstantConditions
{
static Object obj = new TestConstantConditions(null); // No warning
TestConstantConditions(@NotNull Object obj) { }
void test() { new TestConstantConditions(null); } // Warning
}



 All   Comments   Work Log   Change History      Sort Order:
Jonas Kvarnstrom - 16 Oct 06 13:38
Still present in 6041. Though I obviously don't know the internals of the code it seems to me that this should be reasonably easy to fix (but please correct me if I'm wrong), and it would be nice to close this hole in the nullability checker.