Comments (7)
I have a patch for it if it helps, it's relatively straightforward to add a few checks for not null.
from immutables-vavr.
Definitely a bug. I think part of the problem is that I didn't realize vavr
's Option
type would accept null values.
from immutables-vavr.
Just found the same bug if the member is annotated with @Value.Parameter
, there's no null check in the constructor. So:
@Value.Immutable
@VavrEncodingEnabled
public interface SomeObj {
@Value.Parameter
String someString();
@Value.Parameter
Option<String> someOptionString();
}
SomeObj o = ImmutableSomeObj.of("hello", null);
// Should throw a NullPointerException, but doesn't
Not totally sure where to fix this, looking now.
from immutables-vavr.
Found it, needs an @Encoding.Of
adding.
from immutables-vavr.
yep, by default it's just passing the parameter to a field, if any check or conversion need to be added - @Encoding.Of
is the way
from immutables-vavr.
PR coming up. Sorry I was too slow to get this into v0.6.1!
from immutables-vavr.
I think this is fixed. Thanks so much for the quick response!
from immutables-vavr.
Related Issues (20)
- Question: Why is there no VavrSetEncodingEnabled? HOT 3
- Customized with() methods HOT 1
- Builder.add with VarArgs HOT 1
- Publish as a Java 9 module HOT 1
- Modularize! HOT 2
- Failing builds HOT 3
- Options appearing wierdly in builder HOT 7
- Correct module name
- inhibit-classpath is too aggressive HOT 4
- vavr 1.0.0 is due out soon HOT 1
- Make VavrMapEncoding consistent with immutables naming HOT 1
- Make Option's "with" method behaviour consistent with builder logic HOT 1
- Migrate to Github Actions
- @Value.Default with Option-fields throws NullPointerException HOT 1
- NullPointerException in equals(), hashCode() and toString() with @Nullable Vector. HOT 3
- Multimap needs proper support HOT 4
- Upload the releases to maven central HOT 2
- Jackson encoding is broken HOT 12
- Option builder fields are not generated for Stage builders / values HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immutables-vavr.