DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • How To Approach Dependency Management in Java [Video]
  • NullPointerException in Java: Causes and Ways to Avoid It
  • The First Annual Recap From JPA Buddy
  • Visually Designing Views for Java Web Apps

Trending

  • Helm Dry Run: Guide and Best Practices
  • .NET Performance Optimization Techniques for Expert Developers
  • Breaking Down Silos: The Importance of Collaboration in Solution Architecture
  • What Technical Skills Can You Expect To Gain From a DevOps Course Syllabus?
  1. DZone
  2. Coding
  3. Java
  4. New Inspections for Java 8 in IntelliJ IDEA 2016.1

New Inspections for Java 8 in IntelliJ IDEA 2016.1

Since Java 8 has been launched almost two years ago, it has been gaining more and more traction around the community.

Andrey Cheptcov user avatar by
Andrey Cheptcov
·
Apr. 07, 16 · News
Like (5)
Save
Tweet
Share
5.89K Views

Join the DZone community and get the full member experience.

Join For Free

Since Java 8 has been launched almost two years ago, it has been gaining more and more traction around the community. Most Java frameworks and platforms have either already migrated their APIs to Java 8, or are planning to do so.

With our latest update, the whole IntelliJ Platform has migrated to Java 8, which has allowed both ourselves and plugin developers to use the new language features. Among other reasons, this motivates us to further improve our coding assistance to make it more friendly to Java 8.

Misuse of java.util.Optional

IntelliJ IDEA now helps you avoid writing unsafe code when using java.util.Optional. It warns you if you call get() without first calling isPresent() to check if the value is available.

Also, you may be warned if you use java.util.Optional<T>, java.util.OptionalDouble, java.util.OptionalInt,java.util.OptionalLong or com.google.common.base.Optional as the type for a field or parameter, or if you use java.util.Optional or com.google.common.base.Optional types with an array or collection type parameter. Note that this setting is disabled by default.

Functional Interfaces

In case a method reference points to a method of its own functional interface type, IntelliJ IDEA suggests replacing it with a qualifier.

You’ll also be warned when you’re calling a method of a functional interface, which is directly invoked on a lambda definition, method reference or anonymous class. This inspection provides a quick-fix to replace it with the implementation body for that functional interface.

Overloaded methods or constructors with similar functional interface type parameters, for which any call sites will need a cast or parameter type specified on the lambda expression to resolve ambiguity, may now be reported as well.

Guava

For those who would like to migrate their Guava code to Java 8 APIs, we’ve added a number of quick-fixes that help replace FluentIterable, Function, Optional and Predicate with their Java 8 analogues.

That’s it for today. We hope these improvements will make adopting Java 8 a more enjoyable experience for you.

As always, we appreciate questions as well as your feedback here in comments or directly in our tracker.

intellij Java (programming language)

Published at DZone with permission of Andrey Cheptcov, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How To Approach Dependency Management in Java [Video]
  • NullPointerException in Java: Causes and Ways to Avoid It
  • The First Annual Recap From JPA Buddy
  • Visually Designing Views for Java Web Apps

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: