Hi,
yesterday we updated our SonarQube (Enterprise, on-Premise) from 10.4 to 10.7 and at the same time updated the Checkstyle plugin from 10.12.5 to 10.17.0.
Since this update we face an exception which didn’t occur before. This is a problem, as the analysis of the whole project is now aborted and not available on Sonar.
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project cpq-veterans-aggregator: Can not execute Checkstyle: Exception was thrown while processing C:\censoredPath\AbstractPipelineComparator.java: IllegalStateException occurred while parsing file C:\censoredPath\AbstractPipelineComparator.java. 28:39: mismatched input ‘(’ expecting ‘;’: InputMismatchException
The whole content of the file is:
/*
* AbstractPipelineComparator.java
*
* Created on 16. Juni 2004, 14:15
*/
package com.censored.util.sort.comparator;
/**
*
* @author anonymus
*/
public abstract class AbstractPipelineComparator implements java.util.Comparator {
public abstract int compare(Object o1, Object o2);
/*
* Ersetzt in einem String (falls vorhanden)
* alle Umlaute (ä,ö,ü) durch (a,o,u),
* 'ß' durch s und alle Zeichen in Kleinbuchstaben.
* Dies ermöglicht eine genaue Sortierung eines
* Strings.
*
* @param Object o
* @return ersetzter String
*/
protected String prepairForCompare(Object o) {
String prepair = String.valueOf(o);
prepair = prepair.toLowerCase();
prepair = prepair.replace('ä','a');
prepair = prepair.replace('ö','o');
prepair = prepair.replace('ü','u');
prepair = prepair.replace('ß','s');
return prepair;
}
}
It contains several German umlauts, but is encoded in UTF-8 and hasn’t caused any problems until now.
Is this a bug in Checkstyle or SonarQube?
Is there a workaround to mitigate this problem?
Thanks!
Regards,
Carsten