Skip to content

Commit cc0d3a0

Browse files
committed
Fix warnings
1 parent ac81874 commit cc0d3a0

23 files changed

+153
-78
lines changed

src/main/java/us/bpsm/edn/Keyword.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ public final class Keyword implements Named, Comparable<Keyword> {
2323
private final Symbol sym;
2424

2525
/** {@inheritDoc} */
26-
public final String getPrefix() {
26+
@Override
27+
public final String getPrefix() {
2728
return sym.getPrefix();
2829
}
2930

3031
/** {@inheritDoc} */
31-
public final String getName() {
32+
@Override
33+
public final String getName() {
3234
return sym.getName();
3335
}
3436

@@ -79,11 +81,13 @@ private Keyword(Symbol sym) {
7981
this.sym = sym;
8082
}
8183

82-
public String toString() {
84+
@Override
85+
public String toString() {
8386
return ":" + sym.toString();
8487
}
8588

86-
public int compareTo(Keyword o) {
89+
@Override
90+
public int compareTo(Keyword o) {
8791
if (this == o) {
8892
return 0;
8993
}

src/main/java/us/bpsm/edn/Symbol.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ public final class Symbol implements Named, Comparable<Symbol> {
1818
/**
1919
* {@inheritDoc}
2020
*/
21-
public final String getPrefix() {
21+
@Override
22+
public final String getPrefix() {
2223
return prefix;
2324
}
2425

2526
/**
2627
* {@inheritDoc}
2728
*/
28-
public final String getName() {
29+
@Override
30+
public final String getName() {
2931
return name;
3032
}
3133

@@ -148,7 +150,8 @@ private static void checkName(String label, String ident) {
148150
}
149151
}
150152

151-
public int compareTo(Symbol right) {
153+
@Override
154+
public int compareTo(Symbol right) {
152155
int cmp = prefix.compareTo(right.prefix);
153156
return cmp != 0 ? cmp : name.compareTo(right.name);
154157
}

src/main/java/us/bpsm/edn/Tag.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ public final class Tag implements Named, Comparable<Tag> {
2222
private final Symbol sym;
2323

2424
/** {@inheritDoc} */
25-
public final String getPrefix() {
25+
@Override
26+
public final String getPrefix() {
2627
return sym.getPrefix();
2728
}
2829

2930
/** {@inheritDoc} */
30-
public final String getName() {
31+
@Override
32+
public final String getName() {
3133
return sym.getName();
3234
}
3335

@@ -80,7 +82,8 @@ private Tag(Symbol sym) {
8082
this.sym = sym;
8183
}
8284

83-
public String toString() {
85+
@Override
86+
public String toString() {
8487
return "#" + sym.toString();
8588
}
8689

@@ -114,7 +117,8 @@ public boolean equals(Object obj) {
114117
return true;
115118
}
116119

117-
public int compareTo(Tag o) {
120+
@Override
121+
public int compareTo(Tag o) {
118122
return sym.compareTo(o.sym);
119123
}
120124

src/main/java/us/bpsm/edn/parser/AbstractInstantHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
*/
1616
public abstract class AbstractInstantHandler implements TagHandler {
1717

18-
public final Object transform(Tag tag, Object value) {
18+
@Override
19+
public final Object transform(Tag tag, Object value) {
1920
if (!(value instanceof String)) {
2021
throw new EdnSyntaxException(tag.toString() + " expects a String.");
2122
}

src/main/java/us/bpsm/edn/parser/DefaultListFactory.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
import java.util.Collections;
66

77
final class DefaultListFactory implements CollectionBuilder.Factory {
8-
public CollectionBuilder builder() {
8+
@Override
9+
public CollectionBuilder builder() {
910
return new CollectionBuilder() {
1011
ArrayList<Object> list = new ArrayList<Object>();
11-
public void add(Object o) {
12+
@Override
13+
public void add(Object o) {
1214
list.add(o);
1315
}
14-
public Object build() {
16+
@Override
17+
public Object build() {
1518
return Collections.unmodifiableList(list);
1619
}
1720
};

src/main/java/us/bpsm/edn/parser/DefaultMapFactory.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@
66
import java.util.Map;
77

88
final class DefaultMapFactory implements CollectionBuilder.Factory {
9-
public CollectionBuilder builder() {
9+
@Override
10+
public CollectionBuilder builder() {
1011
return new CollectionBuilder() {
1112
final Object none = new Object();
1213
final Map<Object,Object> map = new HashMap<Object,Object>();
1314
Object key = none;
14-
public void add(Object o) {
15+
@Override
16+
public void add(Object o) {
1517
if (key == none) {
1618
key = o;
1719
} else {
1820
map.put(key, o);
1921
key = none;
2022
}
2123
}
22-
public Object build() {
24+
@Override
25+
public Object build() {
2326
if (key != none) {
2427
throw new IllegalStateException(
2528
"Every map must have an equal number of keys and values.");

src/main/java/us/bpsm/edn/parser/DefaultSetFactory.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
import java.util.Set;
77

88
final class DefaultSetFactory implements CollectionBuilder.Factory {
9-
public CollectionBuilder builder() {
9+
@Override
10+
public CollectionBuilder builder() {
1011
return new CollectionBuilder() {
1112
Set<Object> set = new HashSet<Object>();
12-
public void add(Object o) {
13+
@Override
14+
public void add(Object o) {
1315
set.add(o);
1416
}
15-
public Object build() {
17+
@Override
18+
public Object build() {
1619
return Collections.unmodifiableSet(set);
1720
}
1821
};

src/main/java/us/bpsm/edn/parser/DefaultVectorFactory.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
import java.util.Collections;
66

77
final class DefaultVectorFactory implements CollectionBuilder.Factory {
8-
public CollectionBuilder builder() {
8+
@Override
9+
public CollectionBuilder builder() {
910
return new CollectionBuilder() {
1011
ArrayList<Object> list = new ArrayList<Object>();
11-
public void add(Object o) {
12+
@Override
13+
public void add(Object o) {
1214
list.add(o);
1315
}
14-
public Object build() {
16+
@Override
17+
public Object build() {
1518
return Collections.unmodifiableList(list);
1619
}
1720
};

src/main/java/us/bpsm/edn/parser/InstantUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ public static String timestampToString(Timestamp ts) {
213213

214214
private static final ThreadLocal<SimpleDateFormat> TIMESTAMP_FORMAT =
215215
new ThreadLocal<SimpleDateFormat>() {
216-
protected SimpleDateFormat initialValue() {
216+
@Override
217+
protected SimpleDateFormat initialValue() {
217218
SimpleDateFormat f = new SimpleDateFormat(
218219
"yyyy-MM-dd'T'HH:mm:ss");
219220
f.setTimeZone(GMT);

src/main/java/us/bpsm/edn/parser/ParsedInstant.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ public ParsedInstant(int years, int months, int days, int hours,
8888
this.offsetMinutes = offsetMinutes;
8989
}
9090

91-
public String toString() {
91+
@Override
92+
public String toString() {
9293
return String.format("%04d-%02d-%02dT%02d:%02d:%02d.%09d%s%02d:%02d",
9394
years, months, days, hours, minutes, seconds, nanoseconds,
9495
offsetSign > 0 ? "+" : "-", offsetHours, offsetMinutes);

src/main/java/us/bpsm/edn/parser/ParserImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class ParserImpl implements Parser {
2424
this.cfg = cfg;
2525
}
2626

27-
public Object nextValue(Parseable pbr) {
27+
@Override
28+
public Object nextValue(Parseable pbr) {
2829
Object value = nextValue(pbr, false);
2930
if (value instanceof Token && value != END_OF_INPUT) {
3031
throw new EdnSyntaxException("Unexpected "+ value);

src/main/java/us/bpsm/edn/parser/Parsers.java

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public class Parsers {
6767
static final TagHandler UUID_HANDLER = new UuidHandler();
6868

6969
static final TagHandler IDENTITY = new TagHandler() {
70-
public Object transform(Tag tag, Object value) {
70+
@Override
71+
public Object transform(Tag tag, Object value) {
7172
return value;
7273
}
7374
};
@@ -114,18 +115,21 @@ public static Parseable newParseable(final CharSequence cs) {
114115
return new Parseable() {
115116
int i = 0;
116117

117-
public void close() throws IOException {
118+
@Override
119+
public void close() throws IOException {
118120
}
119121

120-
public int read() throws IOException {
122+
@Override
123+
public int read() throws IOException {
121124
try {
122125
return cs.charAt(i++);
123126
} catch (IndexOutOfBoundsException _) {
124127
return Parseable.END_OF_INPUT;
125128
}
126129
}
127130

128-
public void unread(int ch) throws IOException {
131+
@Override
132+
public void unread(int ch) throws IOException {
129133
i--;
130134
}
131135
};
@@ -145,14 +149,16 @@ public static Parseable newParseable(final Readable r) {
145149
boolean end = false;
146150
boolean closed = false;
147151

148-
public void close() throws IOException {
152+
@Override
153+
public void close() throws IOException {
149154
closed = true;
150155
if (r instanceof Closeable) {
151156
((Closeable) r).close();
152157
}
153158
}
154159

155-
public int read() throws IOException {
160+
@Override
161+
public int read() throws IOException {
156162
if (closed) {
157163
throw new IOException("Can not read from closed Parseable");
158164
}
@@ -175,7 +181,8 @@ public int read() throws IOException {
175181
}
176182
}
177183

178-
public void unread(int ch) throws IOException {
184+
@Override
185+
public void unread(int ch) throws IOException {
179186
if (unread != Integer.MIN_VALUE) {
180187
throw new IOException("Can't unread after unread.");
181188
}
@@ -198,57 +205,68 @@ public static Builder newParserConfigBuilder() {
198205
CollectionBuilder.Factory mapFactory = DEFAULT_MAP_FACTORY;
199206
Map<Tag, TagHandler> tagHandlers = defaultTagHandlers();
200207

201-
public Builder setListFactory(CollectionBuilder.Factory listFactory) {
208+
@Override
209+
public Builder setListFactory(CollectionBuilder.Factory listFactory) {
202210
checkState();
203211
this.listFactory = listFactory;
204212
return this;
205213
}
206214

207-
public Builder setVectorFactory(CollectionBuilder.Factory vectorFactory) {
215+
@Override
216+
public Builder setVectorFactory(CollectionBuilder.Factory vectorFactory) {
208217
checkState();
209218
this.vectorFactory = vectorFactory;
210219
return this;
211220
}
212221

213-
public Builder setSetFactory(CollectionBuilder.Factory setFactory) {
222+
@Override
223+
public Builder setSetFactory(CollectionBuilder.Factory setFactory) {
214224
checkState();
215225
this.setFactory = setFactory;
216226
return this;
217227
}
218228

219-
public Builder setMapFactory(CollectionBuilder.Factory mapFactory) {
229+
@Override
230+
public Builder setMapFactory(CollectionBuilder.Factory mapFactory) {
220231
checkState();
221232
this.mapFactory = mapFactory;
222233
return this;
223234
}
224235

225-
public Builder putTagHandler(Tag tag, TagHandler handler) {
236+
@Override
237+
public Builder putTagHandler(Tag tag, TagHandler handler) {
226238
checkState();
227239
this.tagHandlers.put(tag, handler);
228240
return this;
229241
}
230242

231-
public Config build() {
243+
@Override
244+
public Config build() {
232245
checkState();
233246
used = true;
234247
return new Config() {
235-
public Factory getListFactory() {
248+
@Override
249+
public Factory getListFactory() {
236250
return listFactory;
237251
}
238252

239-
public Factory getVectorFactory() {
253+
@Override
254+
public Factory getVectorFactory() {
240255
return vectorFactory;
241256
}
242257

243-
public Factory getSetFactory() {
258+
@Override
259+
public Factory getSetFactory() {
244260
return setFactory;
245261
}
246262

247-
public Factory getMapFactory() {
263+
@Override
264+
public Factory getMapFactory() {
248265
return mapFactory;
249266
}
250267

251-
public TagHandler getTagHandler(Tag tag) {
268+
@Override
269+
public TagHandler getTagHandler(Tag tag) {
252270
return tagHandlers.get(tag);
253271
}
254272
};

src/main/java/us/bpsm/edn/parser/ScannerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class ScannerImpl implements Scanner {
5656
/* (non-Javadoc)
5757
* @see us.bpsm.edn.parser.ScannerIf#nextToken(us.bpsm.edn.parser.Parseable)
5858
*/
59-
public Object nextToken(Parseable pbr) {
59+
@Override
60+
public Object nextToken(Parseable pbr) {
6061
try {
6162
return scanNextToken(pbr);
6263
} catch (IOException e) {

src/main/java/us/bpsm/edn/parser/UuidHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
class UuidHandler implements TagHandler {
1111

12-
public Object transform(Tag tag, Object value) {
12+
@Override
13+
public Object transform(Tag tag, Object value) {
1314
if (!(value instanceof String)) {
1415
throw new EdnSyntaxException(tag.toString() +
1516
" expectes a String.");

0 commit comments

Comments
 (0)