[jira] [Resolved] (FOP-3281) Update the checkstyle dependency

"Matthias Reischenbacher (Jira)" <[email protected]>
Newsgroups gmane.text.xml.fop.devel
Message-ID <[email protected]>
     [ https://issues.apache.org/jira/browse/FOP-3281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Reischenbacher resolved FOP-3281.
------------------------------------------
    Resolution: Fixed

> Update the checkstyle dependency
> --------------------------------
>
>                 Key: FOP-3281
>                 URL: https://issues.apache.org/jira/browse/FOP-3281
>             Project: FOP
>          Issue Type: Improvement
>            Reporter: Matthias Reischenbacher
>            Assignee: Matthias Reischenbacher
>            Priority: Minor
>             Fix For: main
>
>
> The main pom.xml uses version 2.14 of the maven-checkstyle-plugin, which internally uses Checkstyle version 5.8.
> I suggest to update to version 3.6.0 of the plugin, so that Checkstyle 9.3 is being used. This would improve compatibility with Checkstyle plugins for IDEs (e.g. "CheckStyle-IDEA" with IntelliJ)
> Most notable changes:
>  * The InnerAssignment check is validated much more strictly requiring to turn off the check in several Java files via
> {code:java}
> // CSOFF: InnerAssignment
> {code}
> so that code like this doesn't cause warnings (extracted from DelimitedTextRange.java):
> {code:java}
> if ((levels = UnicodeBidiAlgorithm.resolveLevels(buffer, paragraphEmbeddingLevel)) != null) {
> {code}
>  * The OneStatementPerLine check requires to move the "break;" statement inside "switch" fragments into its own line
> {code:java}
> case Constants.FO_TABLE:
>     holderName = "table";
>     break;
> {code}
>  * The ImportOrder check unfortunately works completely different now. Static imports can't be displayed together with the group of the non-static imports, when a new line should be generated between non-static and static imports. Therefore all static imports have to be defined now below the non-static imports. So a notation like 
> {code:java}
> import java.io.IOException;
> import java.io.Writer;
> import static java.lang.Character.isHighSurrogate;
> import org.apache.fop.events.EventBroadcaster;
> import org.apache.fop.render.pdf.PDFEventProducer;
> {code}
> has to be changed too
> {code:java}
> import java.io.IOException;
> import java.io.Writer;
> import static java.lang.Character.isHighSurrogate;
> import org.apache.fop.events.EventBroadcaster;
> import org.apache.fop.render.pdf.PDFEventProducer;{code}
>  * Some files had CRLF line endings (e.g. fop-core/src/main/java/org/apache/fop/render/pdf/ImageRawPNGAdapter.java). Those were changed to LF line endings (like the majority of the files)
>  * The SimplifyBooleanExpression check now forces to change a code fragment like
> {code:java}
> public String toString() {
>     return "GraphicsSetPatternSymbol(fill="
>         + (pattern == SOLID_FILL ? true : false)  + ")";
> }{code}
> to
> {code:java}
> public String toString() {
>     return "GraphicsSetPatternSymbol(fill="
>         + (pattern == SOLID_FILL)  + ")";
> } {code}
>  
>  * The opening curly brace of a method declaration (or "if" statement etc.) now must be on the same line as the method declaration:
> {code:java}
> protected GlyphSubtable(String lookupId, int sequence, int flags, int format, GlyphMappingTable mapping)
> {{code}
> has to be changed to
> {code:java}
> protected GlyphSubtable(String lookupId, int sequence, int flags, int format, GlyphMappingTable mapping) { {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.