D
Dimitri Maziuk
David Wahler sez:
Are you sure about that? -- you're compiling the *caller* and checking
that it does not pass a null to
public foo( @NotNull x )
declared elsewhere.
....
Really? I happen to know that column i in my table is declared NOT NULL,
so null reference from ResultSet.getX( i ) "should never happen". Would
that be one of "those cases" where I declare
public foo( @NotNull x )
for use with
foo( ResultSet.getX( i ) )
so as to "enforce this constraint statically"? Or is this the case
where x "obviously needs to be a nullable variable"?
Dima
I'm not sure I'm following you. Only the variables that are declared as
non-nullable would need to be checked.
Are you sure about that? -- you're compiling the *caller* and checking
that it does not pass a null to
public foo( @NotNull x )
declared elsewhere.
....
If the database table may contain nulls, the result would obviously
need to be stored in a nullable variable. But there are many situations
in which a null reference should never happen, and in those cases it
makes sense to enforce this constraint statically
Really? I happen to know that column i in my table is declared NOT NULL,
so null reference from ResultSet.getX( i ) "should never happen". Would
that be one of "those cases" where I declare
public foo( @NotNull x )
for use with
foo( ResultSet.getX( i ) )
so as to "enforce this constraint statically"? Or is this the case
where x "obviously needs to be a nullable variable"?
Dima