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

Key: IDEADEV-14496
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Maxim Shafirov
Reporter: Martin Schmid
Votes: 0
Watchers: 0
Operations

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

NotNull Nullable conflict not detected

Created: 13 Feb 07 20:51   Updated: 06 Nov 08 23:24
Component/s: Code Analysis. Inspection
Fix Version/s: Undefined

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment:
Windows
JDK 1.5_0_10

Build: 6,148


 Description  « Hide
The getBla method in the following code is marked as NotNull. An attempt to directly return null (Problem 1) or returning a field marked as Nullable (Problem2) is not detected.
public class NullReturnTest
{

    @Nullable
    private String bla;


    public NullReturnTest(@Nullable String bla)
    {
        this.bla = bla;
    }


    @NotNull
    public String getBla()
    {
        try
        {
            Integer.parseInt("abc");
            return null;//Problem 1
        }
        catch (NumberFormatException e)
        {
            System.out.println("can be expected");
        }
        return bla;//Problem 2
    }
}


 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.