You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Matthias Reischenbacher (Jira)" <ji...@apache.org> on 2025/11/03 11:35:00 UTC

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

     [ https://issues.apache.org/jira/browse/FOP-3281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Reischenbacher reopened FOP-3281:
------------------------------------------

[~ssteiner]: The CI build failed after the merge with the following error message:
{code:java}
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0:check (default-cli) on project fop-parent: The plugin org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0 requires Maven version 3.6.3 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0:check (default-cli) on project fop-parent: The plugin org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0 requires Maven version 3.6.3
{code}
See also [https://ci-builds.apache.org/job/XMLGraphics/job/xmlgraphics-fop/574/]

Is that something you can fix? Or do I need to revert the changes?

> 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)