Questions tagged [non-nullable]
232 questions
0
votes
3 answers
C# - Reset the value of struct on class or struct
I'm trying to code some script with Unity, and I have some issue to understand how struct works.
Start with a base of code:
public class Engine : MonoBehaviour {
public Hero selectedHero;
public List heroes;
public struct Hero {
…

Arthur
- 4,870
- 3
- 32
- 57
0
votes
1 answer
@NonNullByDefault The return type is incompatible with 'List' returned from ExecutorService.shutdownNow() (mismatching null constraints)
I have a class which derives from java.util.concurrent.AbstractExecutorService. My class overrides shutdownNow(). Everything compiles and runs fine.
I added org.eclipse.jdt.annotation.@NonNullByDefault to the class. I managed to fix all of the…

Nathan
- 8,093
- 8
- 50
- 76
0
votes
2 answers
C# Nullable vs Non-Nullable DateTime tags
This is an EPIC story about date and time.
Created is a non-nullable DateTimeOffset variable
Updated is a nullable DateTimeOffset variable
Values of both have been created properly, exist in the DB and have been passed to the view. So both of these…

A.Rowan
- 1,460
- 2
- 16
- 20
0
votes
2 answers
Class declaration with switch gives warning that code is int in if statement always returns true, but false case of code also works
When using a custom class there is a switch that takes in an int. The switch then fills out the class where some cases have a num, and some do not. The int can range virtually anywhere in the application, but some cases do not have one. When the…

Stephen Smith
- 15
- 5
0
votes
1 answer
How to convert a type from nullable to non-nullable in VB.NET?
Right now, I have nullable generic type and I can check if it is nullable or not. However, I cannot find a way to get a non-nullable type from it. Here is what I want to do:
If Nullable.GetUnderlyingType(nullableType) IsNot Nothing Then
Dim…

Pawich S.
- 375
- 6
- 20
0
votes
1 answer
Objective C to Swift Nonnull conversion
Im converting some code from Objective C.
-(nonnull NSString*) endpoint {
return @"LoginRequest";
}
The Swift converter produces
func endpoint() -> nonnull NSString {
return "LoginRequest"
}
However nonnull is not recognised by swift. This…

ThundercatChris
- 481
- 6
- 25
0
votes
1 answer
How do you get Microsoft SQL Management Studio 2014 default columns to not nullable on creation or design?
I am new to Visual Studio Management Studio 2014.
In my database the vast majority of my data is an Id, a bit, a nvarchar(x) or the odd necessary timestamp. Most of the columns are NULLABLE, except for end dates.
I am not saying there are not uses…
user5333898
0
votes
1 answer
@Nonnull fields in an init method
Is there a way to get Eclipse to realize that @Nonnull fields have been initialized in some initialization method. I'm looking for something like @EnsuresNonNull({"bar"}) in the otherwise completely unusable Checker Framework.
Example:
import…

Seppo420
- 2,041
- 2
- 18
- 37
0
votes
2 answers
SQL*Loader - Using sysdate if incoming value is blank
I am trying to create a control file for SQL*Loader script. I have a date column that is defined as NOT NULL. I need to set-up the script to use current date, if the incoming value from the file is blank. I tried a few ways - some examples below…

adbdkb
- 1,897
- 6
- 37
- 66
0
votes
4 answers
Insert statement with a NON-NULLABLE column
I have a SQL Server script that I'm using to insert some data into a database. I won't upload the whole script here just for space/time savings sake, but I will include the important bits.
So here is the problem. I have a table that has a column…

Skrubb
- 531
- 1
- 6
- 25
0
votes
0 answers
Differences Nullable values: .Value or not?
I'm kinda new to Nullable. I have a DateTime in C# that I want to be null, than assign the value in a try-catch, and after that check whether it's null or not.
Code:
DateTime? dt = null;
try
{
dt = DateTime.ParseExact(stringDate, "yyyy-MM-dd…

Kevin Cruijssen
- 9,153
- 9
- 61
- 135
0
votes
1 answer
Why is Mysql letting me insert records without the fields which have the constraint NOT NULL?
I have created a table with some attributes that have the NOT NULL constraint, then I have tried a INSERT INTO instruction, specifying values only for the fields that don't have the NOT NULL constraint, but the instruction still works. Shouldn't it…

user3603880
- 1
- 5
0
votes
1 answer
Changing Controller method parameter, having a non-nullable type error
I am new with MVC and I am trying to edit a tutorial I completed to understand how everything works. Originally, the tutorial had a search function that let you search by two string parameters, one that check the movie title and one that checks the…

Austin
- 3,010
- 23
- 62
- 97
0
votes
2 answers
Delete Data from Non-Nullable Column in SQL
Question: I have table with three column, with column names APP_NAME, APP_TYPE and VALUE_TIME.
I would like to edit VALUE_TIME for particular APP_NAME and APP_TYPE. So my query should look like below mentioned if VALUE_TIME column is Nullable. So…

Mad-D
- 4,479
- 18
- 52
- 93
0
votes
3 answers
Generic return type and non-nullable objects
I have a Sql Utility class which contains a lot of handy methods around Sql queries.
This class contains the following method:
public static T ExecuteScalar(
string query,
SqlConnection connection,
params SqlParameter[] parameters)…

hwcverwe
- 5,287
- 7
- 35
- 63