You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "David Welsh (Jira)" <ji...@apache.org> on 2020/10/08 23:52:00 UTC

[jira] [Commented] (MCHECKSTYLE-387) Deprecate method setUpCheckstyleClassloader in 3.1.2

    [ https://issues.apache.org/jira/browse/MCHECKSTYLE-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17210529#comment-17210529 ] 

David Welsh commented on MCHECKSTYLE-387:
-----------------------------------------

[~bmarwell] are there any plans to upgrade checkstyle to 8.36+?

If you are using the new switch statements released in [JEP-361|https://openjdk.java.net/jeps/361] which is now included by default in [JDK 14|https://openjdk.java.net/projects/jdk/14/] it will cause an error.

This can be view through checkstyle [issue 661.|https://github.com/checkstyle/checkstyle/issues/6615]

My current work around is to include a {{BeforeExecutionExclusionFileFilter}} to exclude files with those switches but then I miss scanning it for everything else or to just avoid them.

> Deprecate method setUpCheckstyleClassloader in 3.1.2
> ----------------------------------------------------
>
>                 Key: MCHECKSTYLE-387
>                 URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-387
>             Project: Maven Checkstyle Plugin
>          Issue Type: Task
>    Affects Versions: 3.1.1
>            Reporter: Benjamin Marwell
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> h2. Current situation
> In 3.1.1, the PR [https://github.com/apache/maven-checkstyle-plugin/pull/18] added a {{try-catch}}-block to the to-be-removed method call {{Checker::setClassLoader}}.
> Since users should be encuraged to upgrade and maven-plugin-developers should know that this method should be removed some time, a warning is to be issued if the method call was successful (i.e. when not entering the catch block).
> h2. Caveat and drawbacks
>  * Users will have to update their {{checkstyle.xml}} file because of incompatible changes introduced in {{8.24}}. 
>  * Otherwise the warning might confuse users.
>  * Once the method call to {{Checker::setClassLoader}} is removed, {{checkstyle}} versions prior to 8.26 (Source: [https://checkstyle.org/releasenotes.html#Release_8.26]) cannot be used anymore (Source: [https://github.com/checkstyle/checkstyle/commit/145160f5e21b80c27dc93a1904fe33b9afd4f212] and [https://github.com/checkstyle/checkstyle/issues/3773]). But this issue is not about removing this method call any time soon.
> => it will probably work fine for any 8.x version because this method existed for a deprecated check only.
> h2. Related issues
>  * [MCHECKSTYLE-381|[https://issues.apache.org/jira/projects/MCHECKSTYLE/issues/MCHECKSTYLE-381]] The mentioned previous commit.
>  * [MCHECKSTYLE-384|[https://issues.apache.org/jira/projects/MCHECKSTYLE/issues/MCHECKSTYLE-384]]: Once this maven-checkstyle-plugin updates to checkstyle > 8.24, the default installation for users will break existing installations unless users use this method of downgrading their checkstyle version: [https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/upgrading-checkstyle.html.] 
>  * Also track [https://github.com/checkstyle/checkstyle/issues/7190.] This will tell when the checkstyle team removes that method.
> h2. Documentation
>  * maven-checkstyle-plugin is compatible with all checkstyle versions by functionality.
>  * maven-checkstyle-plugin >= 3.1.2 will complain if checkstyle < 8.29 is being used, which is the default (since it requires checkstyle 8.19).
>  * If we are ever going to remove the method {{Checker::setClassLoader}}, this means that earlier versions than checkstyle 8.26 are not supported. They will probably work just fine, but the method call became a 'real' no-op in 8.26. Might be worth documentation.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)