since method references can be as debug-friendly as lambda expressions, perhaps they should be?

mark.yagnatinsky at barclays.com mark.yagnatinsky at barclays.com
Mon Aug 16 18:22:17 UTC 2021


I recently saw a cool blog post by Tagir Valeev about how to make method references as debug-friendly as lambda expressions:
https://habr.com/en/post/569414/
If something like this were adopted, then Java developers could choose lambda expressions vs method references purely based on what makes the code easier to read, instead of having to make annoying trade-offs such as "a method reference is more readable in this case, but a lambda expression will give me better stack traces if something goes wrong".

Thoughts?

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________
“This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer.

For important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; https://www.investmentbank.barclays.com/disclosures/barclays-global-markets-disclosures.html regarding our standard terms for the Investment Bank of Barclays where we trade with you in principal-to-principal wholesale markets transactions; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.com.”  
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________
If you are incorporated or operating in Australia, please see https://www.home.barclays/disclosures/importantapacdisclosures.html for important disclosure.
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________
How we use personal information  see our privacy notice https://www.investmentbank.barclays.com/disclosures/personalinformationuse.html 
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________


More information about the jdk-dev mailing list