Optional by Stuart Marks

Share this & earn $10
Devoxx
Published at : 10 Dec 2020
13015 views
256
6

The Optional class was introduced in Java 8 in order to solve a narrow but frequently occurring problem: what to return if you have nothing to return. It is a single class with less than 20 methods, but it turns out to have been one of the most controversial and most misunderstood APIs, having generated several "centithreads" of discussion on OpenJDK mailing lists. Indeed, Brian Goetz (Java Language and Libraries Architect) has mentioned that one aspect of Optional was his biggest mistake in Java 8. Optional is also one of the more widely misused APIs. A brief survey of OpenJDK code revealed several embarrassing examples of Optional usage, and expert Java programmers have admitted to not making the most of this API.

This session covers the history and rationale of Optional, provides recommendations and examples of proper and effective usage, shows several antipatterns and code smells and how to fix them, and finally describes some current and proposed work on Optional for Java 9.

Stuart Marks is a Principal Member of Technical Staff in the Java Platform Group at Oracle. He is currently working on a variety of JDK core libraries projects, including Collections, Lambda, and Streams, as well as improving test quality and performance. As his alter ego "Dr Deprecator" he also works on the Java SE deprecation mechanism. He has previously worked on JavaFX and Java ME at Sun Microsystems. He has over twenty years of software platform product development experience in the areas of window systems, interactive graphics, and mobile and embedded systems. Stuart holds a Master's degree in Computer Science and a Bachelor's degree in Electrical Engineering from Stanford University.
DVUS17

Issues of Human Development (Nature vs. Nurture,Continuity vs. Discontinuity & Stability vs. Change)

Issues of Human Development (Nature vs. Nurture,Continuity vs. Discontinuity & Stability vs. Change)

Chris Brown, Young Thug - City Girls (Official Video)

Chris Brown, Young Thug - City Girls (Official Video)

How to Plant Mirten Plant For Bonsai And Ornamental Plants For Beginners

How to Plant Mirten Plant For Bonsai And Ornamental Plants For Beginners

How To Get a Bigger Tax Refund

How To Get a Bigger Tax Refund

13+ Survival Gardening Crops To Grow To Live Off Your Garden

13+ Survival Gardening Crops To Grow To Live Off Your Garden

Michael Jackson is ALIVE | COMEBACK PLAN | Secret information Part 3

Michael Jackson is ALIVE | COMEBACK PLAN | Secret information Part 3

In God's Name -  Cult Part 1 of 2

In God's Name - Cult Part 1 of 2

C++ Pointers - Finally Understand Pointers

C++ Pointers - Finally Understand Pointers

Love by Chance (Eng sub) - บังเอิญรัก - Ep09

Love by Chance (Eng sub) - บังเอิญรัก - Ep09

In CS mode kill 30 opponents with smg in free fire | how to complete all free fire veteran missions

In CS mode kill 30 opponents with smg in free fire | how to complete all free fire veteran missions

Jimmy Kimmel on Angry Trump Mob Storming the Capitol

Jimmy Kimmel on Angry Trump Mob Storming the Capitol

Elephant Rifles vs Pine Board Box 💥 (SURPRISING RESULTS)

Elephant Rifles vs Pine Board Box 💥 (SURPRISING RESULTS)

"Jesus Didn't Say That: 'I'm Just One of Many Spiritual Options' " | Mike Housholder | 11.22.2020

"Jesus Didn't Say That: 'I'm Just One of Many Spiritual Options' " | Mike Housholder | 11.22.2020

It's OVER! Say Goodbye: More than 4,300 stores are closing in 2020 across the U.S (Here's the list)

It's OVER! Say Goodbye: More than 4,300 stores are closing in 2020 across the U.S (Here's the list)

Kingdom | Official Trailer [HD] | Netflix

Kingdom | Official Trailer [HD] | Netflix

Plentiful Fall Garden Harvest, Organic Backyard Gardening in a Suburban Neighborhood

Plentiful Fall Garden Harvest, Organic Backyard Gardening in a Suburban Neighborhood

Hästens is Summer

Hästens is Summer

This 15th Century Weapon of War Fired 100 Arrows at Once

This 15th Century Weapon of War Fired 100 Arrows at Once

Simon & Garfunkel - Keep The Customer Satisfied

Simon & Garfunkel - Keep The Customer Satisfied

Rapidly Expanding Universe DOCUMENTARY Quantum Mechanics That Even Einstein Struggled With

Rapidly Expanding Universe DOCUMENTARY Quantum Mechanics That Even Einstein Struggled With

Most appropriate center and variation Assignment

Most appropriate center and variation Assignment

My First Custom iPad...

My First Custom iPad...

Continuous variables - interaction term interpretation

Continuous variables - interaction term interpretation

Dyson V11 Review After 7 Months - The Good The Bad and the Ugly

Dyson V11 Review After 7 Months - The Good The Bad and the Ugly

The Chain Rule... How? When? (NancyPi)

The Chain Rule... How? When? (NancyPi)

Bravo borrowed a certain amount from Amina at 20% annual | 7769 | Experts' Global GMAT Prep

Bravo borrowed a certain amount from Amina at 20% annual | 7769 | Experts' Global GMAT Prep

TROOPERS - RESPEKTLOS, SCHEIßE UND JUNG - HARDCORE WORLDWIDE (OFFICIAL VERSION HCWW)

TROOPERS - RESPEKTLOS, SCHEIßE UND JUNG - HARDCORE WORLDWIDE (OFFICIAL VERSION HCWW)

What is Infertility? - Factors that define and cause infertility

What is Infertility? - Factors that define and cause infertility

Viral Songs 2020 (You Probably Don't Know The Name)

Viral Songs 2020 (You Probably Don't Know The Name)

Hits Of Ravi B Karma Me Crazy Mix By Dj Wazim

Hits Of Ravi B Karma Me Crazy Mix By Dj Wazim

Ranking the BEST & WORST Skin Care Brands

Ranking the BEST & WORST Skin Care Brands

Inspite of all the Church is Marching on - Pastor Chris

Inspite of all the Church is Marching on - Pastor Chris

Top 10 Ear Pops!  Ear Blackheads, Pimples, Zits and Acne Popping!  Popaholics

Top 10 Ear Pops! Ear Blackheads, Pimples, Zits and Acne Popping! Popaholics

Twisted Turban Hat Sewing Pattern - Turban Hat DIY

Twisted Turban Hat Sewing Pattern - Turban Hat DIY

We Dropped The WORLD’S LARGEST WATER BALLOON From A 200ft Crane!

We Dropped The WORLD’S LARGEST WATER BALLOON From A 200ft Crane!

Vanishing COIN TRICK - TUTORIAL | TheRussianGenius

Vanishing COIN TRICK - TUTORIAL | TheRussianGenius

Dan Lebowitz - Casey Don’t You Fret

Dan Lebowitz - Casey Don’t You Fret

Sufficient Meaning

Sufficient Meaning

Plant Life Cycle - Learning Life Cycle - Videos For Kids And Toddlers

Plant Life Cycle - Learning Life Cycle - Videos For Kids And Toddlers

Why Modern Warfare and Warzone Were So Successful

Why Modern Warfare and Warzone Were So Successful

An IMPORTANT MESSAGE  from Archangel Raphael *timeless*

An IMPORTANT MESSAGE from Archangel Raphael *timeless*

Global View with โอ๊ต เฉลิมพล ฤทธิชัย: ซีรีย์เกาหลีที่ช่วงนี้ต้องห้ามพลาด

Global View with โอ๊ต เฉลิมพล ฤทธิชัย: ซีรีย์เกาหลีที่ช่วงนี้ต้องห้ามพลาด

[SmartBiz Accelerators] DREAM BEAN, a food company that specializes in producing tofu

[SmartBiz Accelerators] DREAM BEAN, a food company that specializes in producing tofu

Shoreline Mafia - Disgusting [Official Audio]

Shoreline Mafia - Disgusting [Official Audio]

One Thing Remains - Jesus Culture (lyric video)

One Thing Remains - Jesus Culture (lyric video)

Inside The NBA Best Moments | 2020 NBA Bubble Version

Inside The NBA Best Moments | 2020 NBA Bubble Version

Let's accept Game of Thrones the way it is. माझं मत.

Let's accept Game of Thrones the way it is. माझं मत.

“We Are Animals” aka “Modern Ape’s Futile Yet Valiant Attempt to Make Sense of Modern Ape Society”

“We Are Animals” aka “Modern Ape’s Futile Yet Valiant Attempt to Make Sense of Modern Ape Society”

How to Make Solo 401k Contributions (Webinar Replay)

How to Make Solo 401k Contributions (Webinar Replay)