57

I'm using eclipse checkstyle plugin with Juno Eclipse distribution. Anytime the code is checked for checkstyle error I get the following error:

cannot initialize module TreeWalker - Unable to instantiate DoubleCheckedLocking

Does anybody know how to fix this problem? Is it a plugin compatibility issue or something else?

Lii
  • 11,553
  • 8
  • 64
  • 88
Alex Objelean
  • 3,893
  • 2
  • 27
  • 36

4 Answers4

57

The DoubleCheckedLocking check has been removed in Checkstyle 5.6 and must be manually removed from your Checkstyle configuration.

See also: http://sourceforge.net/tracker/index.php?func=detail&aid=3571442&group_id=29721&atid=397078

Torsten
  • 6,184
  • 1
  • 34
  • 31
26

Open the Checkstyle preferences, create your own Check Configuration, go into your own check configuration, find the TreeWalker module, click it and then un-check the DoubleCheckedLocking. As simple as that.

enter image description here

V.Y.
  • 379
  • 3
  • 4
2

just comment or remove "DoubleCheckedLocking" from the checkstyle file and it will work

gospodin
  • 1,133
  • 4
  • 22
  • 42
0
  • Under your Eclipse Workspace Search for file internal_config__*.xml
  • Remove the following line from the file

    <module name="DoubleCheckedLocking"/>

  • Reload Workspace.

This will work for any discontinued module which produces the error message "Unable to instantiate"

Martin Spamer
  • 5,437
  • 28
  • 44