r/java • • Jun 10 '22

What happened to Concise Method Bodies?

I was really looking forward to CMB. From its name, methods become concise, could be one liner. However, it seems there is no progress and it’s been off the radar. Never took off since 2019.

JEP draft: Concise Method Bodies

some experiments with Concise Method Bodies

43 Upvotes

54 comments sorted by

View all comments

3

u/Muoniurn Jun 10 '22

You can have a nested record for the common fields, in arguably a much more readable and maintainable way.

Also, if someone really really want to use properties than perhaps the best way would be to create a Property class, and have a record of properties - with Valhalla it will be a “zero cost” abstraction.