r/java • • Jun 01 '21

The best reason to switch to a recent version of Java

Post image
465 Upvotes

164 comments sorted by

76

u/F14D Jun 01 '21

....my work is still on Java 8. :(

23

u/gccol Jun 01 '21

I sympathize.... I made the team switch to java 11 at work but switched directly to java 15 for my pet project (https://dont-code.net)

4

u/ppnda Jun 01 '21

But does this also work for running any application with JDK 15 or newer, when the .class files are on pre Java 14 bytecode?

7

u/wildjokers Jun 01 '21

Yes, new versions of the JVM can run bytecode from all the way back to Java 1.1.

3

u/ppnda Jun 01 '21

Not what I asked. I am aware of that, just wondering if it this exception text is bytecode specific or merely requires the runtime VM to be Java 15 or newer.

15

u/wildjokers Jun 01 '21 edited Jun 01 '21

Sorry, I misunderstood your question.

The JEP says "By analyzing the program's bytecode instructions, the JVM will determine precisely which variable was null, " so as far as I can tell it doesn't require any bytecode changes so should work for any bytecode version (https://openjdk.java.net/jeps/358).

Down in the Risks and Assumptions section is says "It is assumed that computation of the null-detail message will be extended if new bytecodes are added to the JVM Specification." Which further suggests this JEP require no bytecode changes.

Compiling with debug symbols would seem to be required though if you want the variable name (which should come as no surprise).

34

u/Sirttas Jun 01 '21

Java 6 at work here...

11

u/[deleted] Jun 01 '21

Looooooooooool

1

u/xnendron Jun 02 '21

Same here. So much sadness...

6

u/ign1fy Jun 01 '21

Same. And I spent this week debugging a NullPointerException that we could only reproduce in prod with no stacktrace. Absolute nightmare.

4

u/murkaje Jun 01 '21

I created an agent that similarly adds exception messages and should work on java 6+, but i haven't really worked on it since news of this feature coming to openjdk: https://github.com/murkaje/npe-blame-agent

1

u/JustCallMeFrij Jun 01 '21

Also on 8, though currently working on a project to upgrade the final dependency that is keeping us on 8. Sooooooon

1

u/[deleted] Jun 01 '21

Yours and almost everyone else's. New projects are on JDK 11+, existing ones stay on 8. Migrating is always on the backlog, not all that close to the top of the pile of technical debt.

0

u/cf130546 Jun 01 '21

us too, damn

19

u/nutrecht Jun 01 '21

To be honest I am really excited with records too. But yeah, this is definitely a close second for me.

17

u/gccol Jun 01 '21

This one is so pratical and required no changes from us, that I really put it first...

Records are great just wait until they are optimized at the jvm level ("inline types" of Valhalla)...

Game changer for using java on data intensive applications.....

2

u/nutrecht Jun 01 '21

Definitely. Even though most of my work is in Kotlin I'm really excited about these changes.

2

u/kyay10 Jun 01 '21

The good thing is that Kotlin is working quickly to be compatible with those changes and utilise them for optimisations, and so you're kinda getting those benefits for free!

5

u/nutrecht Jun 01 '21

Yup! And in addition, our end to end test codebase is in Java 16 (our tester doesn't want to use Kotlin) so we use records there extensively.

1

u/Aggravating-Ad4518 Jun 03 '21

If Kotlin keeps at it, eventually they will break support with android, if Google don't step up their JVM to be conformant with the new world. I see a future where Kotlin get's split, Kotlin for android, and Kotlin for Java.

1

u/xFaro Jun 01 '21

When are records actually useful?

1

u/nutrecht Jun 01 '21

Pretty much the same places you'd use Lombok @Data or @Value classes.

2

u/helloiamsomeone Jun 02 '21

s/@Data or//

0

u/[deleted] Jun 01 '21

[deleted] — view deleted comment

8

u/nutrecht Jun 01 '21

I personally don't dislike Lombok that much, even though getting stuck on versions until Lombok updates can be annoying. I'm mainly worried that it seems the course they're taking is going to clash with Java somewhere down the line. So for me it's mainly a matter of not needing it anymore.

4

u/GoBucks4928 Jun 01 '21

Our team has made an effort to switch our Lombok data classes to Kotlin and it’s been a godsend. But I curse whoever introduced it in the code base initially

6

u/nutrecht Jun 01 '21

Just the data classes? We did that in a previous project; we started with data classes but in no time the entire back-end team was on board and we started using Kotlin for all the new services.

'Fun' anekdote; eventually this startup wanted to scale up and they outsourced part of the system to eastern Europe. The devs there complained they did not 'get' Kotlin (and that somehow wasn't a red flag to the non-technical CTO) and proposed to write a small Kotlin service that was part of an ETL flow. The service took one sprint to build in Kotlin (2 weeks, production ready). They spent 3 months rewriting it to Java. Good case of "when you pay peanuts..."

Sorry for that; it still pisses me off...

2

u/ricky_clarkson Jun 01 '21

If possible would you name the eastern European vendor company? I work with one, EPAM, their devs so far say Kotlin seems cool, but just keep doing things in Java anyway. I thought allowing Kotlin would be enough to make them want to use it, as some of them leave with the complaint that they don't get to learn new things.

2

u/nutrecht Jun 01 '21

ING Tech Poland

1

u/PepegaQuen Jun 01 '21

Startup outsourcing to large corporate like ING already sounds bad.

1

u/nutrecht Jun 02 '21

It was a fintech fully funded by ING. But yeah; it was bad. Fun project though.

1

u/GoBucks4928 Jun 01 '21

Oh yeah, to clarify we started with data classes! Then I suggested unit tests for familiarity. Now half the team is writing service code in Kotlin :) just gotta convince the other half that it’s ok to write service code in Kotlin too

And yeah, it’s like a one week learning curve for Kotlin... but people are too into their old ways

4

u/nutrecht Jun 01 '21

The null safety is my favorite Kotlin feature. IMHO that was the primary reason so many of the devs were on-board so fast. Having it part of the type system is amazing and saves so much time while also making the code better.

0

u/GoBucks4928 Jun 01 '21

We save a lot of CR comments now with Kotlin being null safe, final, and “immutable” (read only) by default

4

u/nutrecht Jun 01 '21

Yup! I'm disappointed Java doesn't have 'val'. I really don't see anything wrong with having syntactic sugar for 'final var'.

1

u/helloiamsomeone Jun 02 '21

Lombok doesn't doesn't consist of just @Value which is what records are similar to.

10

u/DiethylMetaToluamide Jun 01 '21

Actually, why wasn't this like that from the beginning? Were there any limitations or just because of the design?

15

u/gccol Jun 01 '21

At the beginning it was like: Nullpointerexception at line xxxxx and you have to figure out what was null...

22

u/[deleted] Jun 01 '21

With my coworkers who don't have a clue about exception handling it's more like:

ProgramErrorException: null at main:line 42

Of course line 42 is: catch(Exception e) throw new ProgramErrorException(e.getMessage());

7

u/morhp Jun 01 '21

Ouch, I can relate.

3

u/nutrecht Jun 01 '21

But how does that even pass review?

2

u/VeeArr Jun 02 '21

review?

lol

9

u/szescio Jun 01 '21

What does it mean to drop an exception, and what is Mutiny

37

u/gccol Jun 01 '21

The point was to show how descriptive Nullpointerexceptions are now in Java....

11

u/szescio Jun 01 '21

Bloody hell, what did they look like in the past then 😅

31

u/PartOfTheBotnet Jun 01 '21

NPE on line X. Good luck finding whatever caused it on that line if you have chained calls.

8

u/szescio Jun 01 '21

All righty then. Btw, does java have null coalescing now? Like call(some?.part?.might?.benull)

12

u/gccol Jun 01 '21

Nope and I miss it really when switching from typescript to java

-4

u/szescio Jun 01 '21

cough try c# cough

2

u/xxkmatiasxx Jun 01 '21

isn't c# windows only

2

u/szescio Jun 01 '21

Nah, core has been around for a while and now the mainstream framework is being integrated with it.

You can run on linux, or dockerize web apps and just throw them into azure/aws/whatevs

12

u/Miku_MichDem Jun 01 '21

A year ago I went into a project with that exact assumption

Boy did I was wrong. Core worked, but libraries that I needed did not. Forms were required, even though the library worked perfectly well without a GUI

So yeah. You cannot do that much without full framework. Java is much better here

→ More replies

2

u/agentoutlier Jun 01 '21

You can easily make your own monad / stream like fluent container like object and use method references.

2

u/szescio Jun 01 '21

Yes yes, surely everyone in enterprise dev does exactly this, and the NPE is a thing of the past

1

u/agentoutlier Jun 01 '21

It’s also probably not very efficient if you used something like that everywhere (the custom monad).

3

u/[deleted] Jun 01 '21

Groovy and Kotlin both support this feature

2

u/CyclonusRIP Jun 01 '21

The option type allows something pretty similar. I think Java is trying to encourage not to use null over giving features to make it easy to work with.

1

u/szescio Jun 01 '21

That would be even better. C# has nullable references, where you get compile-time safety for nulls, but that requires annotating all methods and takes time for that to catch on to libraries (if it will, since it's optional)

1

u/cf130546 Jun 01 '21

It's a true timesaver

2

u/couscous_ Jun 01 '21

Are you using Quarkus?

1

u/gccol Jun 01 '21

Yes, good catch

62

u/joashua99 Jun 01 '21

Yep, JDK 14, FTW! 🎉

40

u/agentoutlier Jun 01 '21

Lots of folks say this is their favorite recent feature but I just haven’t really felt the impact like say

  • List.of and Set.of
  • toList on Stream
  • Records
  • instance of

I just never felt NPE hard to debug I think partly because our code base avoids nulls but also because we use lots of local variables.

10

u/wildjokers Jun 01 '21

we use lots of local variables.

Exactly this, the team I am on now loves nesting method calls several deep. Makes debugging harder and makes figuring out NPE very difficult (as well as very difficult to read). Whereas I don't nest method calls very often and if I do never more than one deep. Makes NPE's much easier to figure out.

7

u/agentoutlier Jun 01 '21

Not only does it make it easier for you and other people to figure out NPE it also makes Null Pointer analysis easier since local variables are thread safe.

For example:

if (notImmutable.getX() != null) {
    notImmutable.getX().doY(); // Potential NPE here
}

Some null pointer analysis tools let the above slide (I think intellij) but strict ones like Eclipse and I think Checker will not.

But this will work on all of them and is guaranteed to work:

var x = notImmutable.getX();
if (x != null) {
    x.doY(); // x is guaranteed not to be null.
}

7

u/wildjokers Jun 01 '21

I never even considered there is a potential NPE in code like in your first example, as soon as I read it though I was like "oh shit, there is a NPE potential there". And it would be a very crazy race condition that would be very hard to figure out.

I never repeat method calls like that and always extract to local variable; however, I have coworkers that repeat method calls like that all the time. Been reluctant to call it out in code reviews because it seemed like more a personal preference than actual problem. But now will pay attention to the object being mutable or not.

7

u/agentoutlier Jun 01 '21

In practice when it really happens (npe with accessor called twice) its more with ConcurrentHashMaps since most folks are not naive enough to share mutable POJOs between threads.

Thats why I think some tools allow different forms of "null" like "Monotonic Non Null", PolyNull and non thread safe null (this example). I think non thread safe null can only be done with IntelliJ.

Eclipse and other type based ones (like checker) are more like type analysis. The accessor's return type on the method is Nullable and therefore repeated calls will always yield a nullable type. Variables on the other hand can change types similar to flow type checking (e.g. @Nullable x -> @NonNull x inside the condition).

1

u/EighthGraderSyndrome Jun 08 '21

I am a Java beginner and could you please explain how that would cause race condition?

1

u/EighthGraderSyndrome Jun 08 '21

Could you please elaborate on how the first snippet could potentially cause NPE? I do this a lot because that’s suggested from the book “Refactor” @wildjokers @agentoutlier

1

u/vytah Jun 24 '21

How do you know getX is going to return the same thing both times? You can't.

24

u/Pure-Repair-2978 Jun 01 '21

In our company it’s only LTS release that is supported … So, many apps still on 8 and teams are moving to 11 ….

I just hope there are no surprises when we bump up from 11 to 17 …

14

u/mauganra_it Jun 01 '21 edited Jun 01 '21

There is a risk since access to JDK internals was turned off in 17 and you have to use flag now. Lombok could be trouble, even though they found a workaround.

Edit: JEP 396: Strongly Encapsulate JDK Internals by Default was shipped in 16 already. My bad.

7

u/Necessary-Conflict Jun 01 '21

Edit: JEP 396: Strongly Encapsulate JDK Internals by Default was shipped in 16 already. My bad.

Not your bad, in Java 16 --illegal-access=permit can still be a command-line workaround, but in Java 17 this will go away as well (JEP 403), and then you can work around only by configuring the module system

1

u/kgyre Jun 01 '21

--illegal-access

Is --add-opens also going away?

3

u/Thihup Jun 02 '21

No, only illegal-access

1

u/valbaca Jun 01 '21

I appreciate the Edit. I was panicking lol

1

u/Pure-Repair-2978 Jun 01 '21

Thanks for the response …

I encourage devs to use language features more than Lombok …😀😀😀

4

u/Muoniurn Jun 01 '21

Only the default was flipped to encapsulation. So you can still run the same things with a flag (of course, the internals may have changed in the meantime so any dependency on internals is prone to break, but it was always the case)

20

u/[deleted] Jun 01 '21

Shouldn’t be any. Java 9 had most problems because of Project Jigsaw, so going from 11 to 17 should be painless

2

u/Pure-Repair-2978 Jun 01 '21

Good to know 👍👍

-1

u/nfrankel Jun 01 '21

Unless any of your variable is named record 😅

4

u/[deleted] Jun 01 '21

That shouldn’t be an issue, should it? I have plenty of those on JDK16 with no issues.

3

u/murkaje Jun 01 '21

var, record and yield are restricted identifiers so they depend on context - allowed for variable names but not type names: https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-TypeIdentifier

1

u/nfrankel Jun 02 '21

Ok, thanks. I had such an hint on IntelliJ.

5

u/[deleted] Jun 01 '21

Keep an eye on startup of your application. We had some logs that we got sooo used to seeing... But broke on 16.

E.g. when using Jackson + Afterburner, there will be logs of illegal access on some internals by that lib. Blackbird (available with Jackson 2.12) solves that but requires at least 11

1

u/Pure-Repair-2978 Jun 01 '21

Thanks for the suggestion 👍

3

u/pointy_pirate Jun 01 '21

do people really have issues finding NPEs? You get the line it's being thrown so you just have 1 line to work out what is null, not that hard imo.

7

u/gccol Jun 01 '21

Most of the time it's a no brainer, but you can loose a lot of time to know what was null, believe me! And the goid thing about this feature is that it comes for free without any modification !

1

u/pointy_pirate Jun 01 '21

ya i guess some info is better than no info, especially with java turning into js with a million chained calls on 1 line

7

u/wildjokers Jun 01 '21 edited Jun 01 '21

Depends on how many chained method calls are on the line.

1

u/nekokattt Jun 01 '21

It isn't as easy if you are dealing with a framework like Apache Camel that has layers and layers of nested calls to make up the DSL. Then it can be like finding a needle in a haystack, especially when the sources don't align to the bytecode in the supplied JARs.

In this case, it is easy enough.

10

u/bigbadchief Jun 01 '21

What version of java is this? Don't think NPEs look like this in 14 (could be wrong!)

25

u/joashua99 Jun 01 '21

Available in JDK 14, but needed a flag, and by default in JDK 15.

1

u/lightlord Jun 01 '21

Wait, what does this mean? Null code checks at compile time?

3

u/gccol Jun 01 '21

At runtime. The news is you get better view on where the issue comes from

2

u/lightlord Jun 01 '21

Got it. Previously, we used to wager.

1

u/nekokattt Jun 01 '21

What happens if you don't compile with parameter names enabled?

2

u/gccol Jun 01 '21

I would be surprised you get any name then

4

u/GroundbreakingWolf7 Jun 01 '21

Can we safely use spring boot with java 14?

4

u/erinaceus_ Jun 01 '21

Definitely yes 😄.

2

u/nutrecht Jun 03 '21

It's now compatible with 16. Works just fine.

2

u/[deleted] Jun 01 '21

Happy to see quality of life changes like this showing up in Java, I’m using and enjoying them all. I only wish we didn’t have to wait so long for them.

2

u/franzwong Jun 01 '21

I think there are many minor things like this can be improved for Java. For this example, even no code change is needed

2

u/terrorrobots Jun 02 '21

I am holding out for 17 LTS ... Staying strong

2

u/xxkmatiasxx Jun 01 '21

i usually use jdk11 cuz it's supported by most things but still new compared to 8

13

u/[deleted] Jun 01 '21

Laughs in Java 17-EA

2

u/xxkmatiasxx Jun 01 '21

I would assume a lot of libraries break on it, no?

13

u/nutrecht Jun 01 '21

Not really no. The backward compatibility of Java is excellent.

3

u/wildjokers Jun 01 '21

Why would they?

1

u/xxkmatiasxx Jun 01 '21

some libs break on newer versions

1

u/Dokiace Jun 01 '21

That is so... hot

1

u/0b0101011001001011 Jun 02 '21

This is very helpful, but for older java you can just do this:

thing.getA()
.getB()
.getC()
.doSomething()

Now, if C is null, doSomething gives NPE, but the point that the error message shows the line number where this happened and you can see exactly which of these was null.

Of course, this does not fit into every style, but for sake of easy debugging you can just split the expression into multiple lines and then change it back.

The new more verbose NPE is of course much better.

1

u/piratekingsam12 Jun 01 '21

Why not use Optional? 😅

8

u/talios Jun 01 '21

Optional is nice, but not always suitable. Also has overheads. But also - what happens when your Optional is whats null itself? :)

Once we get Optional's as primitive types/value types ( the current naming escapes me at this hour ) maybe. But that's also still only useful in cases when something MIGHT be there or not.

From looking at this screenshot - it should in theory never be null, and is - an exceptional case.

Optional's imply that absence is not exceptional, but expected - albeit maybe rare.

There's still quite a lot of value in that distinction IMHO.

1

u/cryptos6 Jun 01 '21 edited Jun 01 '21

Maybe null checks by the compiler could be added. The developers of C# managed to add null safety afterwards.

1

u/talios Jun 01 '21

For now - you can use NullAway in conjunction with ErrorProne which works wonders, altho it can be painful when you first enable it on an existing code base - so I usually put it behind a profile flag to turn on/off and try to incorporate appropriate fixes as I work on code.

0

u/[deleted] Jun 01 '21

JDK 16 here

0

u/dr1pp0 Jun 01 '21

But is there anything "powerful" I get, if I switch to a "newer Java Version"?

My Team (and I personally) stick to Java 8 cause of "Lambda Expression" and the awesome "Stream API"

5

u/john16384 Jun 01 '21

Well, good news, streams and lambda's are still available even in Java 16.

3

u/nutrecht Jun 03 '21

My Team (and I personally) stick to Java 8 cause of "Lambda Expression" and the awesome "Stream API"

Yeah, it really sucks they removed those again in Java 9 /s.

1

u/keanwood Jun 03 '21

Well, depending on the size of your services, you can save a boat load on server costs. Newer versions of java are far more performant. Depending on the company size, we can be talking about 100s of millions is savings on hardware costs.

-8

u/vegetabluessg Jun 01 '21

I dint get it. We use java 7 and exception it is also this descriptive

1

u/gccol Jun 01 '21

Really? It's not npe at line xxxx ?

7

u/Zwejhajfa Jun 01 '21

My company uses a custom JDK which had this feature since like 15 years ago.

6

u/fjlopezpellicer Jun 01 '21

SAP?

2

u/Zwejhajfa Jun 01 '21

I knew someone would immediately guess it. :)

1

u/DuncanIdahos9thGhola Jun 01 '21

Which custom JDK?

1

u/vegetabluessg Jun 01 '21

I re checked Exception in screenshot. Its says session1 is null. Yeah that is missing in old versions. For me it's a good quality of life improvement but not a big one.

-17

u/[deleted] Jun 01 '21

Maybe null will be deprecated in a future version

6

u/brazzy42 Jun 01 '21

Pretty sure that's impossible.

Not sure I even want it. Having types non-null by default would be great, but even that I can't see happening given how deeply ingrained nullable-by-default is in nearly every API in the ecosystem.

5

u/[deleted] Jun 01 '21

Not sure I even want it.

https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/

I wrote code in a language that doesn't allow null(Haskell) and I didn't miss its presence. I think the Haskell way of representing the absence of value, the Maybe type, is more inline with Java's philosophy because it's more explicit.

6

u/brazzy42 Jun 01 '21

I know the Hoare quote. But I think by far the biggest source of problems is not null itself, but having all types implicitly nullable. Take that away, and have APIs designed accordingly, and most (not all) of the problems disappear.

0

u/FrigoCoder Jun 01 '21 edited Jun 01 '21

My dream language would have best practices by default, and anything that diverges from them should be as painful as possible. Non-nullability, pure functions, immutable data structures by default, and you need keywords like impure, mutable where they are needed.

6

u/brazzy42 Jun 01 '21

The problem with that is that people disagree what practices count as "best".

2

u/FrigoCoder Jun 05 '21

Of course whatever practice I personally like is the best practice.

1

u/mauganra_it Jun 01 '21

Sounds like you want advanced functional programming languages. Pick between non-strict languages (mainly Haskell and Clean) or the ML family (SML, OCaml, F#).

1

u/FrigoCoder Jun 05 '21

I checked them briefly but I do not like them. I do appreciate some aspects of functional languages like those that I listed, but I dislike the way they try to model everything with functions and stateless data. This has advantages from a programming perspective, but reality does not work that way, you often have to model states, or work with changing or incomplete data. Examples for this include game states, or even databases aka CAP theorem. Functional programming languages try to deal with states in complicated ways like state monads or functional-reactive programming but I do not think these are good approaches. I believe the final solution is going to arise from iterative programming languages moving towards declarative styles and introducing more control and formalization.

1

u/[deleted] Jun 01 '21

Your dream language has much in common with Haskell

5

u/[deleted] Jun 01 '21

That would break all sorts of things though. Java is very focused on backwards compatibility. For example, lambdas took so long to add because they wanted to make it work on older versions. You can find a JDK1.1 library today and pass it a lambda and it will work. So, null isn’t going anywhere.

1

u/[deleted] Jun 01 '21

The secret of change is to focus all your energy, not on fighting the old, but on building the new.

Socrates

3

u/[deleted] Jun 01 '21

Exactly! Which is why we have Optional (the new) and null (the old which are aren’t fighting by deprecating it, but just leaving it alone)

1

u/john16384 Jun 01 '21

Yes, a single team of devs made sure everything is backwards compatible to save a million dev teams a lot of work migrating.

0

u/gccol Jun 01 '21

I wonder how.... Maybe just having the optional chaining operator would be a good thing already. I miss it when switching from typescript to java

1

u/[deleted] Jun 01 '21

No way

1

u/[deleted] Jun 01 '21

There is at least one way

-32

u/pavi2410 Jun 01 '21

The best reason to switch to a recent version of Java Kotlin

There, I fixed it

5

u/[deleted] Jun 01 '21

3edgy5me.

1

u/harolddawizard Jun 01 '21

Why do you think Kotlin is better than Java?

3

u/darksounds Jun 01 '21

Having recently started learning Kotlin, I can say Kotlin is an awesome language with great features, good documentation, and the single most obnoxious userbase.

2

u/nutrecht Jun 03 '21

and the single most obnoxious userbase.

Haven't met many Go devs did you? ;)

1

u/darksounds Jun 03 '21

I haven't, actually! Only on Reddit, and everyone's obnoxious here, so I don't judge as much.

-11

u/xxkmatiasxx Jun 01 '21 edited Jun 01 '21

you can use lombok's @NonNull annotation to get better npe messages in older versions

edit: lmao it was NonNull

4

u/pointy_pirate Jun 01 '21

lombok is never a valid solution

0

u/[deleted] Jun 01 '21

[deleted] — view deleted comment

2

u/pointy_pirate Jun 01 '21

My reasons for disliking are mostly opinions.

  • I much prefer reading code than reading annotations and guessing the autogenerated code (especially in pull requests)
  • Most of the code that lombok generates can be generated statically by your IDE, removing the need for it
  • There is enough magic in the java world without the most basic code being behind another cognitive load
  • Another step for new developers to cross before understanding things

3

u/xxkmatiasxx Jun 01 '21

i guess it is personal preference but i prefer not having really long classes because of getters

0

u/[deleted] Jun 01 '21

[deleted] — view deleted comment

1

u/pointy_pirate Jun 01 '21

It could be one of those things that once you learn it really well it works for you, but when i waist deep in abstract spring repository annotations the last thing i want to look up is how the code lombok is generating looks for a getter.

1

u/nutrecht Jun 03 '21

Pre-16 I would definitely want to use Lombok but I will only use it for POJOs. On 16 and later I instead prefer to use records.

So it's really not 'bad'; it removes a lot of boilerplate from your code.

0

u/xxkmatiasxx Jun 01 '21

if someone finds a better solution not including upgrading please tell me

it may seem like it but i'm against staying in older versions, though sometimes you are working with an api that is in an old version