Once withers land, I think you could approximate this by letting your record class have a zero argument constructor which sets every field to some blank value, and then fill the fields using `with`.
var x = new Car() with { make = "Volvo"; year = "2023"; };
If you want the Car constructor to enforce constraints, you could use this pattern in a separate Builder record:
record Car(String make, String year) {
Car {
Objects.requireNonNull(make);
Objects.requireNonNull(year);
}
record Builder(String make, String year) {
Builder() {
this(null, null);
}
Car build() {
return new Car(make, year);
}
}
}
var x = new Car.Builder() with { make = "Volvo"; year = "2023"; }.build();
So much syntax to enable something that other languages have had for 10+ years. That's why I can't take the "Java is as good as Kotlin now" arguments seriously.
It probably means simply that the paths to the jar files cannot change between the training run and the actual run. So any valid path/location is ok as long as it stays the same.
> You can't just run Java code. The JVM has a lot of tricks you have to customize for based on your workload.
This sounds like something you would hear 10 years ago in relation to the CMS garbage collector. Since Java 9, G1 has been the default gc for multi core workloads and is self-tuning. The CMS gc was removed 4 years ago. If you do need to tune G1, the primary knob is target pause time. While other knobs exist, you should think carefully before using them.
We run all of our workloads with vanilla settings.
Not sure what type of complexity you're referring to, but it handles many file formats, though some better than others. For example, it supports using variables for the version number in Maven but not in GitLab CI. It handles private package repositories, and updates package-lock.json.
My best guess is that they are thinking of CSRF. With cookies, requests automatically carry the token, whereas with local storage you need to explicitly add the token. However, CORS does a lot to improve this situation. I note that CORS allows posting form data without pre-flight, but it is not immediately clear to me if posting a form cross domain will send cookies.
For example, when I found a table top RPG podcast with 7 years of history, I set it up with:
Archive mode (start from the beginning of the RSS)
Automatic download
In my global settings, I have it set to keep at most 5 episodes per podcast. The result being that when I was done with one episode, it would automatically download the next, and I had a buffer of 5 episodes for trains and flights.
I can't find anything in the linked eg-draft that would indicate that the error would "occur later". In fact, it explicitly says:
Note too that if the canonical constructor checks invariants, then a with expression will check them too. For example:
record Rational(int num, int denom) {
Rational {
if (denom == 0)
throw new IllegalArgumentException("denom must not be zero");
}
}
If we have a rational, and say
r with { denom = 0; }
we will get the same exception, since what this will do is unpack the numerator and denominator into mutable locals, mutate the denominator to zero, and then feed them back to the canonical constructor -- who will throw.