Skip to content

Commit 0139cb1

Browse files
committed
Spotless code format
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
1 parent ddb7b37 commit 0139cb1

File tree

3 files changed

+35
-28
lines changed

3 files changed

+35
-28
lines changed

src/main/java/com/github/markusbernhardt/xmldoclet/Parser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ protected Method parseMethod(final ExecutableElement methodDoc) {
420420
}
421421

422422
for (final AnnotationMirror annotationDesc : methodDoc.getAnnotationMirrors()) {
423-
final var annotationInstance = new AnnotationParser(annotationDesc, this).parse( methodDoc.getSimpleName());
423+
final var annotationInstance = new AnnotationParser(annotationDesc, this).parse(methodDoc.getSimpleName());
424424
methodNode.getAnnotation().add(annotationInstance);
425425
}
426426

@@ -517,6 +517,7 @@ protected TypeParameter parseTypeParameter(final TypeVariable typeVariable) {
517517
/**
518518
* Gets a type parameter bound for a generic type (such as <T extends Number> or <T extends Comparable<E> & Serializable>)
519519
* and splits the name of each type into a list of strings
520+
*
520521
* @param bound the type parameter bound
521522
* @return a list of strings representing each type parameter bound
522523
*/

src/test/java/com/github/markusbernhardt/xmldoclet/AbstractTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@
1919
public abstract class AbstractTest {
2020
private final static Logger LOGGER = Logger.getLogger(AbstractTest.class.getName());
2121

22-
protected static final String[] TEST_DIR = { "./src/test/java/" };
22+
protected static final String[] TEST_DIR = {"./src/test/java/"};
2323
protected static final String SIMPLE_DATA_PACKAGE = "com.github.markusbernhardt.xmldoclet.simpledata";
2424
protected static final String SIMPLE_DATA_DIR = TEST_DIR[0] + SIMPLE_DATA_PACKAGE.replaceAll("\\.", "/");
2525

26-
protected static final String[] ARGS = { "-dryrun" };
27-
protected static final String[] SUB_PACKAGES = { "com" };
26+
protected static final String[] ARGS = {"-dryrun"};
27+
protected static final String[] SUB_PACKAGES = {"com"};
2828

2929
/**
3030
* Gets the first {@link Package} and {@link Class} from a JavaDoc {@link Root} element.
31+
*
3132
* @param sourceFileName Name of a source files inside the {@link #SIMPLE_DATA_DIR} to test.
3233
*/
33-
public JavaDocElements newJavaDocElements(final String ...sourceFileName) {
34+
public JavaDocElements newJavaDocElements(final String... sourceFileName) {
3435
final var sourceFiles = stream(sourceFileName).map(this::getFilePathFromSimpleDataDir).toArray(String[]::new);
3536
final var rootNode = new JavaDocCLI(sourceFiles, ARGS).execute();
3637

@@ -76,6 +77,7 @@ public static String join(final String glue, final List<String> strings) {
7677

7778
/**
7879
* {@return the path (separated by /) to a source file in the {@link #SIMPLE_DATA_DIR}}
80+
*
7981
* @param sourceFileName the name of the file to get its full path from the {@link #SIMPLE_DATA_DIR}
8082
*/
8183
protected String getFilePathFromSimpleDataDir(final String sourceFileName) {
@@ -86,8 +88,9 @@ protected String getFilePathFromSimpleDataDir(final String sourceFileName) {
8688
* {@return the full qualified name of a class, interface, record, enum or even some other element inside
8789
* those ones (separated by .) in the {@link #SIMPLE_DATA_PACKAGE}}
8890
* Those internal elements can be something such as fields, methods, constructors, etc.
91+
*
8992
* @param elementName the name of the element (class, interface, record, method, etc.) to get its
90-
* full qualified name from the {@link #SIMPLE_DATA_PACKAGE}
93+
* full qualified name from the {@link #SIMPLE_DATA_PACKAGE}
9194
*/
9295
protected static String getElementPathFromSimpleDataPackage(final String elementName) {
9396
return join(".", List.of(SIMPLE_DATA_PACKAGE, elementName));

src/test/java/com/github/markusbernhardt/xmldoclet/JavaDocCLI.java

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
/**
1717
* Execute the javadoc command line tool to process source code files.
18+
*
1819
* @author Manoel Campos
1920
*/
2021
public class JavaDocCLI {
@@ -40,27 +41,27 @@ public class JavaDocCLI {
4041

4142
/**
4243
*
43-
* @param extendedClassPath Any classpath information required to help along javadoc. Javadoc
44-
* will actually compile the source code you specify; so if there are any jars or classes
45-
* that are referenced by the source code to process, then including those compiled items
46-
* in the classpath will give you more complete data in the resulting XML.
47-
* @param sourcePaths Usually sourcePaths is specified in conjunction with either/both packages &
48-
* subpackages. The sourcepaths value should be the path of the source files right before
49-
* the standard package-based folder layout of projects begins. For example, if you have
50-
* code that exists in package foo.bar, and your code is physically in /MyFolder/foo/bar/,
51-
* then the sourcePaths would be /MyFolder
52-
* @param packages Use if you want to detail specific packages to process (contrast with
53-
* subpackages, which is probably the easiest/most brute force way of using xml-doclet).
54-
* If you have within your code two packages, foo.bar and bar.foo, but only wanted
55-
* foo.bar processed, then specify just 'foo.bar' for this argument.
56-
* @param sourceFiles You can specify source files individually. This usually is used instead of
57-
* sourcePaths/subPackages/packages. If you use this parameter, specify the full path of
58-
* any java file you want processed.
59-
* @param subPackages You can specify 'subPackages', which simply gives one an easy way to
60-
* specify the root package, and have javadoc recursively look through everything under
61-
* that package. So for instance, if you had foo.bar, foo.bar.bar, and bar.foo,
62-
* specifying 'foo' will process foo.bar and foo.bar.bar packages, but not bar.foo
63-
* (unless you specify 'bar' as a subpackage, too)
44+
* @param extendedClassPath Any classpath information required to help along javadoc. Javadoc
45+
* will actually compile the source code you specify; so if there are any jars or classes
46+
* that are referenced by the source code to process, then including those compiled items
47+
* in the classpath will give you more complete data in the resulting XML.
48+
* @param sourcePaths Usually sourcePaths is specified in conjunction with either/both packages &
49+
* subpackages. The sourcepaths value should be the path of the source files right before
50+
* the standard package-based folder layout of projects begins. For example, if you have
51+
* code that exists in package foo.bar, and your code is physically in /MyFolder/foo/bar/,
52+
* then the sourcePaths would be /MyFolder
53+
* @param packages Use if you want to detail specific packages to process (contrast with
54+
* subpackages, which is probably the easiest/most brute force way of using xml-doclet).
55+
* If you have within your code two packages, foo.bar and bar.foo, but only wanted
56+
* foo.bar processed, then specify just 'foo.bar' for this argument.
57+
* @param sourceFiles You can specify source files individually. This usually is used instead of
58+
* sourcePaths/subPackages/packages. If you use this parameter, specify the full path of
59+
* any java file you want processed.
60+
* @param subPackages You can specify 'subPackages', which simply gives one an easy way to
61+
* specify the root package, and have javadoc recursively look through everything under
62+
* that package. So for instance, if you had foo.bar, foo.bar.bar, and bar.foo,
63+
* specifying 'foo' will process foo.bar and foo.bar.bar packages, but not bar.foo
64+
* (unless you specify 'bar' as a subpackage, too)
6465
* @param additionalArguments Additional Arguments.
6566
*/
6667
private JavaDocCLI(
@@ -127,12 +128,14 @@ private DocumentationTool.DocumentationTask createTask(
127128

128129
/**
129130
* Actually starts the javadoc CLI.
131+
*
130132
* @param task javadoc task to run
131133
*/
132134
private static void runJavaDocTask(final DocumentationTool.DocumentationTask task) {
133135
if (task.call())
134136
System.out.println("Doclet ran successfully");
135-
else System.err.println("Doclet execution failed");
137+
else
138+
System.err.println("Doclet execution failed");
136139
}
137140

138141
/** Aggregate arguments (including package names). */

0 commit comments

Comments
 (0)