Skip to content

Commit

Permalink
chore(deps): update spring-javaformat-checkstyle.version to v0.0.35 (#…
Browse files Browse the repository at this point in the history
…2134)

* chore(deps): update spring-javaformat-checkstyle.version to v0.0.35

* fix: adapt changes in checkstyle

* fix: adapt changes in checkstyle

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Stephan Köninger <[email protected]>
  • Loading branch information
renovate[bot] and SteKoe authored Jan 22, 2023
1 parent c407547 commit 2ed3c6c
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 52 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
root=true
root = true

[*]
insert_final_newline = true
trim_trailing_whitespace= true
trim_trailing_whitespace = true

[*.java]
indent_style = tab
Expand All @@ -20,7 +20,7 @@ ij_java_blank_lines_after_class_header = 0
ij_java_doc_enable_formatting = false
ij_java_class_count_to_use_import_on_demand = 100
ij_java_names_count_to_use_import_on_demand = 100
ij_java_imports_layout = |,java.**,|,jakarta.**,|,*,|,de.codecentric.boot.admin.**,|,$*
ij_java_imports_layout = |, java.**, |, jakarta.**, *, |, de.codecentric.boot.admin.**, |, $*
ij_java_layout_static_imports_separately = true

[*.xml]
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
<maven-checkstyle-plugin.version>3.2.1</maven-checkstyle-plugin.version>
<checkstyle.version>9.3</checkstyle.version>
<spring-javaformat-checkstyle.version>0.0.29</spring-javaformat-checkstyle.version>
<spring-javaformat-checkstyle.version>0.0.35</spring-javaformat-checkstyle.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<node.version>v16.13.2</node.version>
<npm.version>8.3.2</npm.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;

import jakarta.servlet.ServletContext;

import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
Expand Down Expand Up @@ -75,7 +74,6 @@ public class SpringBootAdminClientAutoConfiguration {
@ConditionalOnMissingBean
public ApplicationRegistrator registrator(RegistrationClient registrationClient, ClientProperties client,
ApplicationFactory applicationFactory) {

return new DefaultApplicationRegistrator(applicationFactory, registrationClient, client.getAdminUrl(),
client.isRegisterOnce());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ protected String getHost(InetAddress address) {
}

switch (this.instance.getServiceHostType()) {
case IP:
return address.getHostAddress();
case HOST_NAME:
return address.getHostName();
case CANONICAL_HOST_NAME:
default:
return address.getCanonicalHostName();
case IP:
return address.getHostAddress();
case HOST_NAME:
return address.getHostName();
case CANONICAL_HOST_NAME:
default:
return address.getCanonicalHostName();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package de.codecentric.boot.admin.client.registration;

import jakarta.servlet.ServletContext;

import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.springframework.security.web.csrf.CsrfToken;
import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.web.util.WebUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.UUID;

import jakarta.servlet.DispatcherType;

import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletResponse;

import org.assertj.core.api.WithAssertions;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import jakarta.mail.MessagingException;
import jakarta.mail.internet.MimeMessage;

import org.springframework.lang.Nullable;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
Expand Down Expand Up @@ -119,30 +118,30 @@ protected String getSubject(Context ctx) {
return templateEngine.process(this.template, singleton("subject"), ctx).trim();
}

public void setTo(String[] to) {
this.to = Arrays.copyOf(to, to.length);
}

public String[] getTo() {
return Arrays.copyOf(to, to.length);
}

public void setCc(String[] cc) {
this.cc = Arrays.copyOf(cc, cc.length);
public void setTo(String[] to) {
this.to = Arrays.copyOf(to, to.length);
}

public String[] getCc() {
return Arrays.copyOf(cc, cc.length);
}

public void setFrom(String from) {
this.from = from;
public void setCc(String[] cc) {
this.cc = Arrays.copyOf(cc, cc.length);
}

public String getFrom() {
return from;
}

public void setFrom(String from) {
this.from = from;
}

public String getTemplate() {
return template;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Map;

import jakarta.annotation.Nullable;

import org.springframework.context.expression.MapAccessor;
import org.springframework.expression.Expression;
import org.springframework.expression.ParserContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,17 @@ private static Map<String, Object> convertMappingConditions(String predicate) {
// Based on conditionKey we may need to apply some transformations,
// mostly wrapping, of the input values
switch (conditionKey) {
case "consumes":
case "produces":
conditionValue = conditionValue.stream().map((v) -> singletonMap("mediaType", v))
.collect(Collectors.toList());
break;
case "headers":
case "params":
case "method":
case "patterns":
default:
break;
case "consumes":
case "produces":
conditionValue = conditionValue.stream().map((v) -> singletonMap("mediaType", v))
.collect(Collectors.toList());
break;
case "headers":
case "params":
case "method":
case "patterns":
default:
break;
}

conditionsMap.put(conditionKey, conditionValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import jakarta.servlet.AsyncContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DataBufferFactory;
import org.springframework.core.io.buffer.DataBufferUtils;
Expand Down Expand Up @@ -93,7 +92,7 @@ public void instanceProxy(@PathVariable("instanceId") String instanceId, HttpSer
// org.springframework.security.web.context.HttpSessionSecurityContextRepository.SaveToSessionRequestWrapper.startAsync()
AsyncContext asyncContext = servletRequest.startAsync();
asyncContext.setTimeout(-1); // no timeout because instanceWebProxy will handle it
// for us
// for us
try {
ServletServerHttpRequest request = new ServletServerHttpRequest(
(HttpServletRequest) asyncContext.getRequest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import jakarta.mail.Session;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeMessage;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
Expand Down Expand Up @@ -189,7 +188,7 @@ private String loadExpectedBody(String resource) throws IOException {
private String extractBody(DataHandler dataHandler) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream(4096);
dataHandler.writeTo(os);
return os.toString(StandardCharsets.UTF_8.name()).replaceAll("\\r?\\n", "\n");
return os.toString(StandardCharsets.UTF_8).replaceAll("\\r?\\n", "\n");
}

}
10 changes: 1 addition & 9 deletions src/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<property name="headerFile" value="${checkstyle.header.file}"/>
<property name="fileExtensions" value="java"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck" />
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck"/>

<!-- TreeWalker Checks -->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
Expand Down Expand Up @@ -156,14 +156,6 @@
value="Line has leading space characters; indentation should be performed with tabs only."/>
<property name="ignoreComments" value="true"/>
</module>
<!-- BDD-Style not used at the moment -->
<!-- <module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">-->
<!-- <property name="maximum" value="0"/>-->
<!-- <property name="format" value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)"/>-->
<!-- <property name="message"-->
<!-- value="Please use BDDMockito imports."/>-->
<!-- <property name="ignoreComments" value="true"/>-->
<!-- </module>-->
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="maximum" value="0"/>
<property name="format" value="org\.junit\.(Assert|jupiter\.api\.Assertions)\.assert"/>
Expand Down

0 comments on commit 2ed3c6c

Please sign in to comment.