Skip to content

Commit 6804dd9

Browse files
committed
Adhere to project coding and style guidelines
1 parent 02cd2f6 commit 6804dd9

File tree

8 files changed

+49
-36
lines changed

8 files changed

+49
-36
lines changed

junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeoutPreemptively.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,17 @@ private static class ExecutionTimeoutException extends JUnitException {
143143

144144
/**
145145
* The thread factory used for preemptive timeout.
146-
* <p>
147-
* The factory creates threads with meaningful names, helpful for debugging purposes.
146+
*
147+
* <p>The factory creates threads with meaningful names, helpful for debugging
148+
* purposes.
148149
*/
149150
private static class TimeoutThreadFactory implements ThreadFactory {
150151
private static final AtomicInteger threadNumber = new AtomicInteger(1);
151152

153+
@Override
152154
public Thread newThread(Runnable r) {
153155
return new Thread(r, "junit-timeout-thread-" + threadNumber.getAndIncrement());
154156
}
155157
}
158+
156159
}

junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionFailureBuilder.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
/**
2323
* Builder for {@link AssertionFailedError AssertionFailedErrors}.
24-
* <p>
25-
* Using this builder ensures consistency in how failure message are formatted
24+
*
25+
* <p>Using this builder ensures consistency in how failure message are formatted
2626
* within JUnit Jupiter and for custom user-defined assertions.
2727
*
2828
* @since 5.9
@@ -51,8 +51,8 @@ private AssertionFailureBuilder() {
5151

5252
/**
5353
* Set the user-defined message of the assertion.
54-
* <p>
55-
* The {@code message} may be passed as a {@link Supplier} or plain
54+
*
55+
* <p>The {@code message} may be passed as a {@link Supplier} or plain
5656
* {@link String}. If any other type is passed, it is converted to
5757
* {@code String} as per {@link StringUtils#nullSafeToString(Object)}.
5858
*
@@ -202,4 +202,5 @@ private static String getClassName(Object obj) {
202202
return (obj == null ? "null"
203203
: obj instanceof Class ? getCanonicalName((Class<?>) obj) : obj.getClass().getName());
204204
}
205+
205206
}

junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestReporter.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ default void publishEntry(String value) {
8989

9090
/**
9191
* Publish the supplied file and attach it to the current test or container.
92-
* <p>
93-
* The file will be copied to the report output directory replacing any
92+
*
93+
* <p>The file will be copied to the report output directory replacing any
9494
* potentially existing file with the same name.
9595
*
9696
* @param file the file to be attached; never {@code null} or blank
@@ -108,8 +108,8 @@ default void publishFile(Path file, MediaType mediaType) {
108108
/**
109109
* Publish the supplied directory and attach it to the current test or
110110
* container.
111-
* <p>
112-
* The entire directory will be copied to the report output directory
111+
*
112+
* <p>The entire directory will be copied to the report output directory
113113
* replacing any potentially existing files with the same name.
114114
*
115115
* @param directory the file to be attached; never {@code null} or blank
@@ -142,8 +142,8 @@ default void publishDirectory(Path directory) {
142142
/**
143143
* Publish a file or directory with the supplied name and media type written
144144
* by the supplied action and attach it to the current test or container.
145-
* <p>
146-
* The {@link Path} passed to the supplied action will be relative to the
145+
*
146+
* <p>The {@link Path} passed to the supplied action will be relative to the
147147
* report output directory, but it's up to the action to write the file.
148148
*
149149
* @param name the name of the file to be attached; never {@code null} or
@@ -161,8 +161,8 @@ default void publishFile(String name, MediaType mediaType, ThrowingConsumer<Path
161161
/**
162162
* Publish a directory with the supplied name written by the supplied action
163163
* and attach it to the current test or container.
164-
* <p>
165-
* The {@link Path} passed to the supplied action will be relative to the
164+
*
165+
* <p>The {@link Path} passed to the supplied action will be relative to the
166166
* report output directory and point to an existing directory, but it's up
167167
* to the action to write files to it.
168168
*

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContext.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ default void publishReportEntry(String value) {
370370
/**
371371
* Publish a file with the supplied name written by the supplied action and
372372
* attach it to the current test or container.
373-
* <p>
374-
* The file will be resolved in the report output directory prior to
373+
*
374+
* <p>The file will be resolved in the report output directory prior to
375375
* invoking the supplied action.
376376
*
377377
* @param name the name of the file to be attached; never {@code null} or
@@ -388,8 +388,8 @@ default void publishReportEntry(String value) {
388388
/**
389389
* Publish a directory with the supplied name written by the supplied action
390390
* and attach it to the current test or container.
391-
* <p>
392-
* The directory will be resolved and created in the report output directory
391+
*
392+
* <p>The directory will be resolved and created in the report output directory
393393
* prior to invoking the supplied action.
394394
*
395395
* @param name the name of the directory to be attached; never {@code null}

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/MediaType.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ public class MediaType {
8686

8787
/**
8888
* Parse the given media type value.
89-
* <p>
90-
* Must be valid according to
89+
*
90+
* <p>Must be valid according to
9191
* <a href="https://tools.ietf.org/html/rfc2045">RFC 2045</a>.
9292
*
9393
* @param value the media type value to parse; never {@code null}
@@ -142,8 +142,9 @@ public String toString() {
142142

143143
@Override
144144
public boolean equals(Object o) {
145-
if (o == null || getClass() != o.getClass())
145+
if (o == null || getClass() != o.getClass()) {
146146
return false;
147+
}
147148
MediaType that = (MediaType) o;
148149
return Objects.equals(this.value, that.value);
149150
}
@@ -152,4 +153,5 @@ public boolean equals(Object o) {
152153
public int hashCode() {
153154
return Objects.hashCode(value);
154155
}
156+
155157
}

junit-platform-commons/src/main/java/org/junit/platform/commons/support/Resource.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import org.apiguardian.api.API;
2121

2222
/**
23-
* Represents a resource on the classpath.
23+
* {@code Resource} represents a resource on the classpath.
24+
*
2425
* @since 1.11
2526
* @see ReflectionSupport#findAllResourcesInClasspathRoot(URI, Predicate)
2627
* @see ReflectionSupport#findAllResourcesInPackage(String, Predicate)
@@ -33,29 +34,33 @@
3334
public interface Resource {
3435

3536
/**
36-
* Get the resource name.
37-
* <p>
38-
* The resource name is a {@code /}-separated path. The path is relative to
39-
* the classpath root in which the resource is located.
37+
* Get the name of this resource.
38+
*
39+
* <p>The resource name is a {@code /}-separated path. The path is relative
40+
* to the classpath root in which the resource is located.
4041
*
4142
* @return the resource name; never {@code null}
4243
*/
4344
String getName();
4445

4546
/**
46-
* Get URI to a resource.
47+
* Get the URI of this resource.
4748
*
4849
* @return the uri of the resource; never {@code null}
4950
*/
5051
URI getUri();
5152

5253
/**
53-
* Returns an input stream for reading this resource.
54+
* Get an {@link InputStream} for reading this resource.
55+
*
56+
* <p>The default implementation delegates to {@link java.net.URL#openStream()}
57+
* for this resource's {@link #getUri() URI}.
5458
*
5559
* @return an input stream for this resource; never {@code null}
5660
* @throws IOException if an I/O exception occurs
5761
*/
5862
default InputStream getInputStream() throws IOException {
5963
return getUri().toURL().openStream();
6064
}
65+
6166
}

junit-platform-commons/src/main/java/org/junit/platform/commons/support/scanning/DefaultClasspathScanner.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,10 @@ private String determineFullyQualifiedClassName(Path baseDir, String basePackage
243243

244244
/**
245245
* The fully qualified resource name is a {@code /}-separated path.
246-
* <p>
247-
* The path is relative to the classpath root in which the resource is located.
248-
246+
*
247+
* <p>The path is relative to the classpath root in which the resource is
248+
* located.
249+
*
249250
* @return the resource name; never {@code null}
250251
*/
251252
private String determineFullyQualifiedResourceName(Path baseDir, String basePackageName, Path resourceFile) {

junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@ public static Optional<String> getAttribute(Class<?> type, String name) {
9595
return Optional.ofNullable(mainAttributes.getValue(name));
9696
}
9797
}
98-
catch (Exception e) {
98+
catch (Exception ex) {
9999
return Optional.empty();
100100
}
101101
}
102102

103103
/**
104104
* Get the module or implementation version for the supplied {@code type}.
105-
* <p>
106-
* The former is only available if the type is part of a versioned module on
107-
* the module path; the latter only if the type is part of a JAR file with a
108-
* manifest that contains an {@code Implementation-Version} attribute.
105+
*
106+
* <p>The former is only available if the type is part of a versioned module
107+
* on the module path; the latter only if the type is part of a JAR file with
108+
* a manifest that contains an {@code Implementation-Version} attribute.
109109
*
110110
* @since 1.11
111111
*/
@@ -117,4 +117,5 @@ public static Optional<String> getModuleOrImplementationVersion(Class<?> type) {
117117
}
118118
return getAttribute(type, Package::getImplementationVersion);
119119
}
120+
120121
}

0 commit comments

Comments
 (0)