Skip to content

Commit

Permalink
Merge pull request #6135 from stweil/maven-checkstyle-plugin
Browse files Browse the repository at this point in the history
Fix coding style issues and update maven-checkstyle-plugin and its dependencies
  • Loading branch information
solth authored Aug 26, 2024
2 parents 6eafc70 + 3242737 commit 7b08356
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ private Collection<MetadataEntry> simpleValues(Collection<Metadata> values) {
* Returns the only metadata entry or null. Throws an IllegalStateException
* if the value is ambiguous or cannot be cast.
*
* @param <T>
*
* @param values
* values obtained
* @return the only entry or null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ public Integer getMandatoryInteger(String key) throws JMSException {
* type String.
*/
public Map<String, String> getMapOfStringToString(String key) {
Map<String, String> mapOfStringToString = new HashMap<>();

Object mapObject = null;
try {
mapObject = ticket.getObject(key);
Expand All @@ -224,6 +222,8 @@ public Map<String, String> getMapOfStringToString(String key) {
throw new IllegalArgumentException(
"Incompatible types: \"" + key + WRONG_TYPE + "Map<?, ?>.");
}

Map<String, String> mapOfStringToString = new HashMap<>();
for (Object keyObject : ((Map<?, ?>) mapObject).keySet()) {
Object valueObject = ((Map<?, ?>) mapObject).get(keyObject);
if (!(keyObject instanceof String)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ public static TaskService getInstance() {
*/
private BoolQueryBuilder createUserTaskQuery(String filter, boolean onlyOwnTasks, boolean hideCorrectionTasks,
boolean showAutomaticTasks, List<TaskStatus> taskStatusRestrictions) {
User user = ServiceManager.getUserService().getAuthenticatedUser();

BoolQueryBuilder query = new BoolQueryBuilder();
query.must(getQueryForTemplate(0));
if (Objects.isNull(filter)) {
Expand All @@ -133,6 +131,8 @@ private BoolQueryBuilder createUserTaskQuery(String filter, boolean onlyOwnTasks
query.must(getQueryForProcessingStatuses(taskStatusRestrictions.stream()
.map(TaskStatus::getValue).collect(Collectors.toSet())));

User user = ServiceManager.getUserService().getAuthenticatedUser();

if (onlyOwnTasks) {
query.must(getQueryForProcessingUser(user.getId()));
} else {
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<checkstyle.config.location>config/checkstyle.xml</checkstyle.config.location>
<main.basedir>${project.basedir}</main.basedir>
<phase.prop>none</phase.prop>
<!-- https://maven.apache.org/plugins/maven-checkstyle-plugin/check-mojo.html -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
Expand Down Expand Up @@ -909,20 +910,19 @@ from system library in Java 11+ -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<version>3.4.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.3.2</version>
<version>10.17.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>checkstyle-check</id>
<phase>validate</phase>
<configuration>
<encoding>UTF-8</encoding>
<failOnViolation>true</failOnViolation>
<failsOnError>false</failsOnError>
<logViolationsToConsole>true</logViolationsToConsole>
Expand Down

0 comments on commit 7b08356

Please sign in to comment.