Questions tagged [notnull]

This tag refers to an object or type that is not null (none).

Use this tag for questions related to not-null types or objects (i.e. detecting them, handling them, etc.).

295 questions
3
votes
1 answer

@NotNull annotation not working - Doesn't throw an exception when null is passed

The below code outputs "Inside Method" even though I'm passing null to the function. It should throw an exception instead. What's wrong with the below code? Why isn't it throwing an exception when a null parameter is being passed. import…
Shashi Tunga
  • 496
  • 1
  • 6
  • 24
3
votes
2 answers

`INSERT INTO SELECT` converts values depending on the client which runs the query

I am running a very basical query I expect to correctly fail, and it does as expected when ran through any MySQL client. But when run inside a PHP script with mysqli, it does a strange data conversion. Query is next: INSERT INTO gk_process_log…
Áxel Costas Pena
  • 5,886
  • 6
  • 28
  • 59
3
votes
2 answers

Lombok's @NonNull interfering with javax.validation.constraints.NotNull during validation

Lombok's @NonNull annotation interferes with javax.validation.constraints.NotNull annotation during validation in a spring boot app. I am using Lombok in my JPA entities to drastically shorten the code in them (eliminate getters and setters,…
Martin
  • 1,977
  • 5
  • 30
  • 67
3
votes
0 answers

IntegrityError / NOT NULL constraint failed

Where is the variable called by 'approve_comment'? I try 'python manage.py makemigrations'. But command-line : 'No changes detected'. How can I this problem? Help me please... from django.db import models from django.urls import reverse from…
Mux
  • 45
  • 4
3
votes
3 answers

how to coalesce timestamp with not null constraint postgres

insert into employee(eid,dojo) SELECT 14,coalesce(to_char(dojo,'dd-mm-yyyy'),'') from employee; I have to insert into table by selecting it from table,my column dojo has not null constraint and timestamp doesn't allow '' to insert…
TheDragonWarrior
  • 75
  • 1
  • 1
  • 7
3
votes
2 answers

Does @NotNull work at runtime

I have recently decided to start using null checksum annotations (@NotNull), I use Intellij Idea's annotations library to get access these. I am trying to figure out whether or not these annotations will work at runtime to check if values are null…
vandench
  • 1,973
  • 3
  • 19
  • 28
3
votes
1 answer

Intellij build error: Execution failed for task ':classes' @NotNull instrumentation failed

I use Intellij IDEA 2016.2.4 for developing a plugin. When execute the gradle task ("build" for example), I'm having the next error: gradlew build --debug --stacktrace [ERROR] [org.gradle.BuildExceptionReporter] Caused by: : @NotNull instrumentation…
Alan Teals
  • 451
  • 4
  • 8
3
votes
2 answers

Find row index of pandas dataframe that don't have finite values

I have a large dataframe that I want to split when all columns are nan or don't have a finite value. I am looking for something similar to the post Drop rows of pandas dataframe that don't have finite values in certain variable(s) but rather than…
dlwlrma
  • 99
  • 2
  • 13
3
votes
1 answer

Intellij - 15 NotNull Instrumentation errors for code that has been inspected when nothing suspicious is found

I have a little app I started putting together under Intellij-14. It compiled and ran there. When I updated to 15, I started getting NotNull Instrumentation errors for all of the classes. The error message simply states that the class failed --…
GEM
  • 31
  • 4
3
votes
1 answer

java @Nonnull annotation in a method that returns null

I have a method that gets something from a hashmap, a simplified example (that doesn't make much sense but is good enough for now) is: private Map map = new HashMap(); public String get(String key) { return…
sakis kaliakoudas
  • 2,039
  • 4
  • 31
  • 51
3
votes
1 answer

Getting NotNull Right

I've changed Adam D Ruppes module notnull.d a bit to only allow assignment of a NotNull inherited class instances to a NotNull base class instances using the constructor /** Assignment from $(D NotNull) Inherited Class $(D rhs) to $(D NotNull) Base …
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
2
votes
1 answer

Why can't I assign default to my notnull generic type?

Consider this class public sealed record IdValuePair { public IdValuePair(TId id, TValue value) { EnsureArg.HasValue(value, nameof(value)); Id = id; Value = value; } public IdValuePair(TValue…
Bassie
  • 9,529
  • 8
  • 68
  • 159
2
votes
1 answer

Why does df.where() not replace all null values?

I have a dataframe with very mixed columns. I am trying to set all occurrences of None or NaN to None. I am trying the answer to this question: Use None instead of np.nan for null values in pandas DataFrame But the accepted answer does not catch all…
KingOtto
  • 840
  • 5
  • 18
2
votes
2 answers

Query to pull only columns which are relevant or have data for specific where condition

I am trying to write a SQL query (preferably not a stored procedure) to pull specific columns that have data relevant to where condition. As mentioned in the picture, if I have a where condition on Report column = 'ABC', then the query should…
Nikita
  • 31
  • 4
2
votes
3 answers

Java Method Chaining Optionally based on arguments

If a 3rd party requests an argument attachments in a method, how may I avoid using an if and break method chaining, knowing that my argument may be null? The method has the following definition. // import…
Jerry
  • 940
  • 2
  • 12
  • 26