Earlier quoted context omitted.
There are locks around those - for example, writeLock
I mean race conditions between the operations, e.g. an update followed by a delete: 1. update x in memory 2. delete x in memory 3. update fn checks for file on disk 4. delete x from disk 5. update x on disk Is this not possible and you end up with different state in memory and on disk.
Show HN: Minum – A minimal Java web framework
111–113 of 113 posts
Re: Show HN: Minum – A minimal Java web framework
#112Earlier quoted context omitted.
> The real nice thing about Java is everything is statically typed Optional and generics would like a word... Edit: OK, since this got a downvote, let me be clearer, with some help from the parent: You just use Optional , and if you're lucky some of your dependencies BUT NOT ALL OF THEIR TRANSITIVE DEPENDENCIES also use Optional correctly and don't return null, and before you know it you've lost the nice safety and i…
I have never ever ever seen a null inside an Optional -- the most common constructor actually Optional::ofNullable makes the correct decision, so you can't even fck it up, and if you deliberately try to, I'm sure intellij would scream your head off.
private Optional(T value) { this.value = Objects.requireNonNull(value); }
Re: Show HN: Minum – A minimal Java web framework
#113Earlier quoted context omitted.
I mean race conditions between the operations, e.g. an update followed by a delete: 1. update x in memory 2. delete x in memory 3. update fn checks for file on disk 4. delete x from disk 5. update x on disk Is this not possible and you end up with different state in memory and on disk.
great find. i’ve got some adjustments in mind, mainly carefully placed locks. i’d like to give you credit for the call out in the docs/acknowledgment file. is there some better way to reference you than jabradoodle? the code i’m considering is in the branch under_consideration.