Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:59:13+00:00 2026-06-14T16:59:13+00:00

From the release notes , checkstyle removed the Double-Checked locking check. I’m having a

  • 0

From the release notes, checkstyle removed the Double-Checked locking check.

I’m having a hard time understanding why. They replied this not only in the release notes but also in the issue tracker:

Removed the DoubleCheckedLocking check, as in Java 5 (and beyond),
using the volatile keyword addresses the issue.

I’m assuming that, if checkstyle is removing this warning, it’s because it is no longer helpful. That is, either the error won’t happen anymore or another warning does the job. But

I can’t see why such error won’t happen anymore in Java 5, or how it is complemented by another warning. Could someone care to explain?

EDIT: I understand how adding the volatile keyword solves the issue. My concern is: isn’t this warning still worth it somehow? I’m thinking on the case when the programmer uses the aforementioned locking pattern, but forgets to declare the variable volatile. Shouldn’t checkstyle still warn about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:59:14+00:00Added an answer on June 14, 2026 at 4:59 pm

    The description pretty much explains the decision. As of Java 1.5 you can use volatile instance variable. It will correctly handle memory visibility issues and using double checked locking is no longer a bug.

    It doesn’t mean that using volatile is the solution. But in 1.5 Java Memory Model was redefined, making volatile sufficient.

    See also

    • The “Double-Checked Locking is Broken” Declaration
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a maven plugin that downloads the release notes from JIRA. It's
From the Transitioning to ARC Release Notes Use Lifetime Qualifiers to Avoid Strong Reference
as I understood from ASP.net MVC 4 Release notes, is that it has Content
Switching from JVM 1.4 to 1.5 has performance benefits as per release notes. http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#performance
From SDK 1.x.x Release Notes it said that Users can provide Django settings to
From Nvidia release notes: The nvcc compiler switch, --fmad (short name: -fmad), to control
The release notes of Grails 2.0 mention that it has removed Prototype in favour
From the Xcode 4.4 release notes: The compiler automatically calls @synthesize by default for
If you read the release notes from the Feb 18th release of Silverlight ,
I am looking for a solution to build release notes from svn. What I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.