Skip to Content
100 Java Mistakes and How to Avoid Them
book

100 Java Mistakes and How to Avoid Them

by Tagir Valeev
May 2024
Intermediate to advanced
352 pages
10h 45m
English
Manning Publications

Overview

Dodge the common mistakes that even senior developers make, take full advantage of static analysis tools, and deliver robust and error-free Java code.

Whenever you make a mistake writing Java, it’s almost guaranteed that someone else has made it before! In 100 Java Mistakes and How To Avoid Them you’ll learn about the common and the not-so-common antipatterns, errors, and tricky bits that trip up almost every Java developer.

Inside 100 Java Mistakes and How To Avoid Them you will learn how to:

  • Write better Java programs
  • Recognize common mistakes during programming
  • Create fewer bugs and save time for debugging and testing
  • Get help from static analyzers during programming
  • Configure static analysis tools to reduce the number of false reports
  • Extend static analysis tools with custom plugins

Each Java mistake in this handy guide comes with an illustrative code sample, an explanation of why the mistake occurs, and an actionable “ways to avoid this” section to help you dodge the error. Plus, you’ll benefit from useful static analysis sidebars that let you know when mistakes will—and won’t—be spotted by static analysis tools.

About the Technology
Minor bugs in development can become major problems in production. It’s much better to spot and fix your mistakes before they get that far! This one-of-a-kind book shines a light on the most common Java slip-ups and shows you exactly how to avoid making them in the first place.

About the Book
100 Java Mistakes and How To Avoid Them highlights 100 Java coding errors—from beginner missteps to mistakes even Java experts don’t know they’re making. Each case includes clear examples to show you what to look for and concrete troubleshooting advice. You’ll learn to use static analysis tools like IntelliJ IDEA and SonarLint to ensure you’re consistently delivering exceptional Java, discover how unit tests and defensive coding can keep your code clean, and even learn to write your own bug-busting plugins.

What's Inside
  • Recognize bugs and antipatterns during programming
  • Highly-effective debugging and testing
  • Get help from static analyzers


About the Reader
For Java developers of all skill levels.

About the Author
Tagir Valeev is a technical lead in JetBrains and a Java Champion. He designed and developed many code inspections for IntelliJ IDEA built-in static analyzer.

The technical editor on this book was Jean-François Morin.

Quotes
A wonderful book! No matter how much you know about the topic, it will teach you something new.
- Joshua Bloch, Carnegie Mellon University, author of Effective Java

I love this book! It should be on your bookshelf right next to Effective Java and Thinking in Java.
- Josh Long, Spring Developer Advocate

There’s so much to learn from this book! Read a couple of the mistakes each day.
- Trisha Gee, Java Champion

Contains the most comprehensive treatment of Iterators that I’m aware of.
- Stuart W. Marks, JDK Core Libraries Project Lead

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java SE 17 Developer (1Z0-829)

Java SE 17 Developer (1Z0-829)

Simon Roberts
Java Coding Problems

Java Coding Problems

Anghel Leonard
Java Concurrency in Practice

Java Concurrency in Practice

Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, Doug Lea

Publisher Resources

ISBN: 9781633437968Publisher SupportPublisher WebsiteErrata Page