Skip to content

Commit faba815

Browse files
committed
Update to match checkstyle
2 parents 6f798b7 + 5f0e511 commit faba815

33 files changed

+1650
-1523
lines changed

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

Lines changed: 0 additions & 3 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
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: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
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.Nullable;
9+
910
import static com.google.common.base.Preconditions.checkNotNull;
1011

1112
/**
@@ -14,42 +15,43 @@
1415
@Singleton
1516
public class ContextStore {
1617

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

5456

5557
}

0 commit comments

Comments
 (0)