Skip to content

Commit 11bfded

Browse files
authored
Cleanup javadoc, force UTF-8 encoding in Javadoc tasks (#938)
Make `check` depend on javadoc task to enforce proper javadocs
1 parent d4d5d5e commit 11bfded

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

annotation/src/main/java/edu/wpi/grip/annotation/operation/Description.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,40 @@
1919

2020
/**
2121
* The name of the operation being described.
22+
*
23+
* @return the name of the operation
2224
*/
2325
String name();
2426

2527
/**
2628
* A brief summary of the operation. In-depth descriptions, usage guides, and examples
2729
* should be on the wiki, not here.
30+
*
31+
* @return a summary of the operation
2832
*/
2933
String summary();
3034

3135
/**
3236
* The category the operation belongs to. Defaults to
3337
* {@link OperationCategory#MISCELLANEOUS MISCELLANEOUS}.
38+
*
39+
* @return the category to which the operation belongs
3440
*/
3541
OperationCategory category() default MISCELLANEOUS;
3642

3743
/**
3844
* All known aliases of the operation. If the name of the operation changes, the previous name
3945
* should be here. Defaults to an empty array.
46+
*
47+
* @return known aliases
4048
*/
4149
String[] aliases() default {};
4250

4351
/**
4452
* The name of the icon to use to display the operation. If empty ({@code ""}), no icon will be
4553
* shown. The icon should be located in {@code /edu/wpi/grip/ui/icons/}.
54+
*
55+
* @return the name of the icon
4656
*/
4757
String iconName() default "";
4858

build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ javaSubprojects {
149149

150150
tasks.withType<Javadoc> {
151151
source(tasks.named<JavaCompile>("compileJava").map { it.source })
152+
options.encoding = "UTF-8"
153+
}
154+
155+
tasks.named("check").configure {
156+
dependsOn("javadoc")
152157
}
153158

154159
tasks.withType<JavaCompile>().configureEach {

core/src/main/java/edu/wpi/grip/core/Source.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected Source(ExceptionWitness.Factory exceptionWitnessFactory) {
4646
/**
4747
* Get the sockets for this source.
4848
*
49-
* @return @return An array of {@link OutputSocket}s for the outputs that the source produces.
49+
* @return An array of {@link OutputSocket}s for the outputs that the source produces.
5050
*/
5151
public final ImmutableList<OutputSocket> getOutputSockets() {
5252
final List<OutputSocket> outputSockets = createOutputSockets();
@@ -83,6 +83,8 @@ protected ExceptionWitness getExceptionWitness() {
8383
* Initializes the source. This should not try to handle initialization exceptions. Instead, the
8484
* {@link #initializeSafely()} should report the problem with initializing to the exception
8585
* witness.
86+
*
87+
* @throws IOException if the source could not be initialized
8688
*/
8789
public abstract void initialize() throws IOException;
8890

core/src/main/java/edu/wpi/grip/core/http/PedanticHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public final void handle(String target,
6666
* @param baseRequest the base HTTP request
6767
* @param request the request after being wrapped or filtered by other handlers
6868
* @param response the HTTP response to send to the client
69+
* @throws IOException if an I/O error occurred while handling the request
70+
* @throws ServletException if the request could not be handled
6971
* @see AbstractHandler#handle(String, Request, HttpServletRequest, HttpServletResponse)
7072
*/
7173
protected abstract void handleIfPassed(String target,

core/src/main/java/edu/wpi/grip/core/serialization/Project.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public void setFile(Optional<File> file) {
8383

8484
/**
8585
* Load the project from a file.
86+
*
87+
* @throws IOException if the project file could not be read
8688
*/
8789
public void open(File file) throws IOException {
8890
try (InputStreamReader reader = new InputStreamReader(new FileInputStream(file),
@@ -138,6 +140,8 @@ public boolean trySave(File file) {
138140

139141
/**
140142
* Save the project to a file.
143+
*
144+
* @throws IOException if the file could not written
141145
*/
142146
public void save(File file) throws IOException {
143147
try (Writer writer = new OutputStreamWriter(new FileOutputStream(file),

0 commit comments

Comments
 (0)