Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#343 Error on DoubleCheckedLocking

5.6.1
wont-fix
nobody
None
1
2015-02-18
2012-09-29
Benson Margulies
No

Using Juno and the 5.6.0 plugin:

net.sf.eclipsecs.core.util.CheckstylePluginException: cannot initialize module TreeWalker -     Unable to instantiate DoubleCheckedLocking
at net.sf.eclipsecs.core.util.CheckstylePluginException.rethrow(CheckstylePluginException.java:66)
at net.sf.eclipsecs.core.util.CheckstylePluginException.rethrow(CheckstylePluginException.java:77)
at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:166)
at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:288)
at net.sf.eclipsecs.core.jobs.RunCheckstyleOnFilesJob.runInWorkspace(RunCheckstyleOnFilesJob.java:116)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Unable to instantiate DoubleCheckedLocking
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:178)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
at net.sf.eclipsecs.core.builder.CheckerFactory.createCheckerInternal(CheckerFactory.java:304)
at net.sf.eclipsecs.core.builder.CheckerFactory.createChecker(CheckerFactory.java:140)
at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:142)
... 4 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate DoubleCheckedLocking
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:155)
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:161)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:157)
... 8 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate DoubleCheckedLockingCheck
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:98)
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:152)
... 11 more

Discussion

  • Cory Manthei
    Cory Manthei
    2012-10-02

    Can someone shed some light on why DoubleCheckedLocking was removed? This seems like a valuable check to have.

     
  • Due to changes in Java 5 the Double Checked Locking idiom is not fundamentally broken anymore. By use of the "volatile" keyword it can be made work.
    Interesting read here: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

    If you need additional details on the decision to remove you should inquire the Checkstyle core project.

     
    • status: open --> wont-fix
    • milestone: 5.0.0 --> 5.6.1
     
  • Nevertheless the sun_checks.xml coming with checkstyle 5.6 still contains doublechecked locking

     
  • That's a bug in Checkstyle core. elipcse-cs repackages a fixed sun_checks.xml itself.