Skip to content

Commit 9eeeee1

Browse files
committed
Reformat code
1 parent ab2ecf7 commit 9eeeee1

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

Diff for: spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringJUnit5Check.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,18 @@ private void visitMethodDef(DetailAST ast) {
129129
}
130130

131131
private boolean containsAnnotation(DetailAST ast, List<Annotation> annotations) {
132-
List<String> annotationNames = annotations.stream().flatMap((annotation) ->
133-
Stream.of(annotation.simpleName, annotation.fullyQualifiedName())).collect(Collectors.toList());
132+
List<String> annotationNames = annotations.stream()
133+
.flatMap((annotation) -> Stream.of(annotation.simpleName, annotation.fullyQualifiedName()))
134+
.collect(Collectors.toList());
134135
try {
135136
return AnnotationUtil.containsAnnotation(ast, annotationNames);
136137
}
137138
catch (NoSuchMethodError ex) {
138139
// Checkstyle >= 10.3 (https://github.com/checkstyle/checkstyle/issues/14134)
139140
Set<String> annotationNamesSet = new HashSet<>(annotationNames);
140141
try {
141-
return (boolean) AnnotationUtil.class.getMethod("containsAnnotation", DetailAST.class, Set.class)
142-
.invoke(null, ast, annotationNamesSet);
142+
return (boolean) AnnotationUtil.class.getMethod("containsAnnotation", DetailAST.class, Set.class)
143+
.invoke(null, ast, annotationNamesSet);
143144
}
144145
catch (Exception ex2) {
145146
throw new RuntimeException("containsAnnotation failed", ex2);

Diff for: spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringTestFileNameCheck.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
2828

2929
/**
30-
* Checks that test class filenames end {@literal Tests.java} and not {@literal Test.java}.
30+
* Checks that test class filenames end {@literal Tests.java} and not
31+
* {@literal Test.java}.
3132
*
3233
* @author Phillip Webb
3334
* @author Andy Wilkinson

Diff for: spring-javaformat/spring-javaformat-checkstyle/src/test/java/io/spring/javaformat/checkstyle/SpringConfigurationLoaderTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ public void loadShouldLoadChecks() {
5757

5858
@Test
5959
public void loadWithExcludeShouldExcludeChecks() {
60-
Set<String> excludes = new HashSet<String>(Arrays.asList("com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck",
61-
"com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck"));
60+
Set<String> excludes = new HashSet<String>(
61+
Arrays.asList("com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck",
62+
"com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck"));
6263
Collection<FileSetCheck> checks = load(excludes);
6364
assertThat(checks).hasSize(5);
6465
TreeWalker treeWalker = (TreeWalker) checks.toArray()[4];

Diff for: spring-javaformat/spring-javaformat-formatter/src/main/java/io/spring/javaformat/formatter/jdk17/eclipse/JavadocLineBreakPreparator.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ public boolean visit(Javadoc node) {
9494
int commentIndex = this.tokenManager.firstIndexIn(node, TerminalTokens.TokenNameCOMMENT_JAVADOC);
9595
Token commentToken = this.tokenManager.get(commentIndex);
9696
this.commentTokenManager = (commentToken.getInternalStructure() != null)
97-
? new TokenManager(commentToken.getInternalStructure(), this.tokenManager)
98-
: null;
97+
? new TokenManager(commentToken.getInternalStructure(), this.tokenManager) : null;
9998
this.declaration = node.getParent();
10099
this.firstTagElement = true;
101100
this.hasText = false;

Diff for: spring-javaformat/spring-javaformat-formatter/src/main/java/io/spring/javaformat/formatter/jdk8/eclipse/JavadocLineBreakPreparator.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ public boolean visit(Javadoc node) {
9494
int commentIndex = this.tokenManager.firstIndexIn(node, TerminalTokens.TokenNameCOMMENT_JAVADOC);
9595
Token commentToken = this.tokenManager.get(commentIndex);
9696
this.commentTokenManager = (commentToken.getInternalStructure() != null)
97-
? new TokenManager(commentToken.getInternalStructure(), this.tokenManager)
98-
: null;
97+
? new TokenManager(commentToken.getInternalStructure(), this.tokenManager) : null;
9998
this.declaration = node.getParent();
10099
this.firstTagElement = true;
101100
this.hasText = false;

0 commit comments

Comments
 (0)