Skip to content

Commit 6da96ff

Browse files
committed
Comply with checkstyle
1 parent 6f798b7 commit 6da96ff

32 files changed

+1613
-1480
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ public void start(String[] args) throws IOException, InterruptedException {
7070
project.open(new File(projectPath));
7171
}
7272

73-
// Open a project from a .grip file specified on the command line
74-
project.open(new File(projectPath));
75-
7673
pipelineRunner.startAsync();
7774

7875
// This is done in order to indicate to the user using the deployment UI that this is running
@@ -99,4 +96,4 @@ public final void onExceptionClearedEvent(ExceptionClearedEvent event) {
9996
+ "Event");
10097
}
10198

102-
}
99+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package edu.wpi.grip.core.events;
22

33
/**
4-
* An event fired when the pipeline starts running. This is guaranteed to be followed by a corresponding
5-
* {@link RunStoppedEvent}.
4+
* An event fired when the pipeline starts running. This is guaranteed to be followed by a
5+
* corresponding {@link RunStoppedEvent}.
66
*/
77
public class RunStartedEvent {
88
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package edu.wpi.grip.core.events;
22

33
/**
4-
* An event fired when the pipeline stops running. This is guaranteed to follow a corresponding {@link RunStartedEvent}.
5-
* This is different from {@link RenderEvent} in that it will <i>always</i> be fired when the pipeline runs.
4+
* An event fired when the pipeline stops running. This is guaranteed to follow a corresponding
5+
* {@link RunStartedEvent}.
6+
*
7+
* <p>This is different from {@link RenderEvent} in that it will <i>always</i> be fired when the
8+
* pipeline runs.
69
*/
710
public class RunStoppedEvent {
811
}

core/src/main/java/edu/wpi/grip/core/exception/GripException.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
*/
99
public abstract class GripException extends RuntimeException {
1010

11-
public GripException(String message) {
12-
super(message);
13-
}
11+
public GripException(String message) {
12+
super(message);
13+
}
1414

15-
public GripException(String message, Throwable cause) {
16-
super(message, cause);
17-
}
15+
public GripException(String message, Throwable cause) {
16+
super(message, cause);
17+
}
1818

1919
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
package edu.wpi.grip.core.exception;
22

33
/**
4-
* An exception thrown when something goes wrong in the {@link edu.wpi.grip.core.http.GripServer GripServer}.
4+
* An exception thrown when something goes wrong in the
5+
* {@link edu.wpi.grip.core.http.GripServer GripServer}.
56
*/
67
public class GripServerException extends GripException {
78

8-
public GripServerException(String message) {
9-
super(message);
10-
}
9+
public GripServerException(String message) {
10+
super(message);
11+
}
1112

12-
public GripServerException(String message, Throwable cause) {
13-
super(message, cause);
14-
}
13+
public GripServerException(String message, Throwable cause) {
14+
super(message, cause);
15+
}
1516
}

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

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import com.google.inject.Singleton;
44

5-
import javax.annotation.Nullable;
65
import java.util.HashSet;
76
import java.util.Set;
87

8+
import javax.annotation.Nonnull;
9+
import javax.annotation.Nullable;
10+
911
import static com.google.common.base.Preconditions.checkNotNull;
1012

1113
/**
@@ -14,42 +16,43 @@
1416
@Singleton
1517
public class ContextStore {
1618

17-
private final Set<String> store = new HashSet<>();
18-
19-
/**
20-
* Records the given context.
21-
*
22-
* @param context the context to record. This cannot be null.
23-
* @throws IllegalArgumentException if the given context has already been claimed
24-
*/
25-
public void record(String context) throws IllegalArgumentException {
26-
checkNotNull(context);
27-
if (!store.add(context)) {
28-
throw new IllegalArgumentException("Context is already claimed: " + context);
29-
}
30-
}
31-
32-
/**
33-
* Erases the given context from this store, if it's present. If {@code context} is {@code null}, this will
34-
* do nothing and return {@code false}.
35-
*
36-
* @param context the context to erase
37-
* @return true if the context was erased, false if it wasn't erased or if it wasn't present to begin with.
38-
*/
39-
public boolean erase(@Nullable String context) {
40-
return store.remove(context);
41-
}
42-
43-
/**
44-
* Checks if the given context has been recorded in this store. If {@code context} is {@code null}, this will
45-
* return {@code false}.
46-
*
47-
* @param context the context to check
48-
* @return true if the given context has been recorded in this store
49-
*/
50-
public boolean contains(@Nullable String context) {
51-
return store.contains(context);
19+
private final Set<String> store = new HashSet<>();
20+
21+
/**
22+
* Records the given context.
23+
*
24+
* @param context the context to record. This cannot be null.
25+
* @throws IllegalArgumentException if the given context has already been claimed
26+
*/
27+
public void record(@Nonnull String context) throws IllegalArgumentException {
28+
checkNotNull(context);
29+
if (!store.add(context)) {
30+
throw new IllegalArgumentException("Context is already claimed: " + context);
5231
}
32+
}
33+
34+
/**
35+
* Erases the given context from this store, if it's present. If {@code context} is {@code null},
36+
* this will do nothing and return {@code false}.
37+
*
38+
* @param context the context to erase
39+
* @return true if the context was erased, false if it wasn't erased
40+
* or if it wasn't present to begin with.
41+
*/
42+
public boolean erase(@Nullable String context) {
43+
return store.remove(context);
44+
}
45+
46+
/**
47+
* Checks if the given context has been recorded in this store.
48+
* If {@code context} is {@code null}, this will return {@code false}.
49+
*
50+
* @param context the context to check
51+
* @return true if the given context has been recorded in this store
52+
*/
53+
public boolean contains(@Nullable String context) {
54+
return store.contains(context);
55+
}
5356

5457

5558
}

0 commit comments

Comments
 (0)