Upgrading Checkstyle to 5.7 (Java 7 grammar support and more)

84 views
Skip to first unread message

Michael Prentice

unread,
Jun 7, 2014, 4:26:24 AM6/7/14
to google-web-tool...@googlegroups.com
Today, I was able to get Eclipse building the trunk with the latest Checkstyle v5.7 from http://eclipse-cs.sourceforge.net/update

I was seeing a ton (1200-1900+) of OrderCheck and FieldCheck errors using Checkstyle 4.2 or 4.3 in Eclipse. But with 5.7, I am not seeing any errors. It does appear that Checkstyle 4.2 is still being used by Ant though.

There was some discussion about upgrading Checkstyle last year here.

Checkstyle 5.7 includes Java 7 grammar support, which is now supported (and the default) in gwt 2.6.0+.


In order to upgrade the current .xml configuration files for Checkstyle, the following appear to be needed:

PackageHtml looks like it can just be changed to JavadocPackage.
GenericIllegalRegexp looks like it can just be changed to RegexpSinglelineIt needs to be pulled out of the TreeWalker module.
TabCharacter needs to be replaced with FileTabCharacter. It needs to be pulled out of the TreeWalker module and have the following added to it: <property name="fileExtensions" value="java"/>
RegexpHeader needs to be pulled out of the TreeWalker module and have the following added to it: <property name="fileExtensions" value="java"/>
There seems to be a bug with SuppressionCommentFilter and the use of messageFormat AND checkFormat not properly working together. Removing messageFormat seems to help for now. There is an issue about this here.
There are 4 files in gwt-user that break the AvoidStarImport check which will need to be fixed.

From the checkstyle release notes:
"Removed the DoubleCheckedLocking check, as in Java 5 (and beyond), using the volatile keyword addresses the issue. See here for more details."

Can this check be removed for gwt as well?


It looks like checkstyle-5.7-all.jar is already in gwt/tools/antlib/. So this would just mean a small change to trunk/common.ant.xml in addition to the configuration mentioned above.

Roberto Lublinerman

unread,
Jun 7, 2014, 2:55:36 PM6/7/14
to google-web-tool...@googlegroups.com
We upgraded to checkstyle 5.7 in trunk (https://gwt-review.googlesource.com/#/c/6670/). If you checkout out trunk or download the nighty builds (2.7.0-SNAPSHOP) from maven all the required changes  (to ant, the style files, etc) are there.
 


--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/dc4df58a-3381-4daf-961a-3e820fea50c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Prentice

unread,
Jun 8, 2014, 7:24:07 AM6/8/14
to google-web-tool...@googlegroups.com
OK, thank you for that info. Odd that I'm not seeing those changes in my trunk. I thought that I was updated but I'm still on 973b708 which apparently is 382 changes behind, doh!
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.

Michael Prentice

unread,
Jun 8, 2014, 10:32:14 AM6/8/14
to google-web-tool...@googlegroups.com
Awesome. Looks like you got all of the changes that I had found, plus you cleaned up a ton of the code as well. This is extremely helpful!
Reply all
Reply to author
Forward
0 new messages