Skip to content

Commit 5cca672

Browse files
committed
Remove condition on the minimal amount of lines in method
1 parent 61a598d commit 5cca672

File tree

5 files changed

+37
-2
lines changed

5 files changed

+37
-2
lines changed

checkstyle.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@
335335
</module>
336336
<module name="MissingJavadocMethod">
337337
<property name="scope" value="public"/>
338-
<property name="minLineCount" value="2"/>
339338
<property name="allowedAnnotations" value="Override, Test"/>
340339
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF,
341340
COMPACT_CTOR_DEF"/>

src/main/java/com/maxmind/db/CHMCache.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,20 @@ public class CHMCache implements NodeCache {
1616
private final ConcurrentHashMap<CacheKey, DecodedValue> cache;
1717
private boolean cacheFull = false;
1818

19+
/**
20+
* Creates a new cache with the default capacity.
21+
*/
1922
public CHMCache() {
2023
this(DEFAULT_CAPACITY);
2124
}
2225

26+
/**
27+
* Creates a new cache with the specified capacity.
28+
*
29+
* @param capacity
30+
* the maximum number of elements the cache can hold before
31+
* starting to evict them
32+
*/
2333
public CHMCache(int capacity) {
2434
this.capacity = capacity;
2535
this.cache = new ConcurrentHashMap<>(capacity);

src/main/java/com/maxmind/db/InvalidNetworkException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
* IPv6 address in an IPv4-only database.
88
*/
99
public class InvalidNetworkException extends Exception {
10+
/**
11+
* @param ip
12+
* the IP address that was used
13+
*/
1014
public InvalidNetworkException(InetAddress ip) {
1115
super("you attempted to use an IPv6 network in an IPv4-only database: " + ip.toString());
1216
}

src/main/java/com/maxmind/db/NoCache.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ private NoCache() {
1616
public DecodedValue get(CacheKey key, Loader loader) throws IOException {
1717
return loader.load(key);
1818
}
19-
19+
20+
/**
21+
* @return the singleton instance of the NoCache class
22+
*/
2023
public static NoCache getInstance() {
2124
return INSTANCE;
2225
}

src/main/java/com/maxmind/db/NodeCache.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,28 @@ public interface NodeCache {
1010
* A loader is used to load a value for a key that is not in the cache.
1111
*/
1212
interface Loader {
13+
/**
14+
* @param key
15+
* the key to load
16+
* @return the value for the key
17+
* @throws IOException
18+
* if there is an error loading the value
19+
*/
1320
DecodedValue load(CacheKey key) throws IOException;
1421
}
1522

23+
/**
24+
* This method returns the value for the key. If the key is not in the cache
25+
* then the loader is called to load the value.
26+
*
27+
* @param key
28+
* the key to look up
29+
* @param loader
30+
* the loader to use if the key is not in the cache
31+
* @return the value for the key
32+
* @throws IOException
33+
* if there is an error loading the value
34+
*/
1635
DecodedValue get(CacheKey key, Loader loader) throws IOException;
1736

1837
}

0 commit comments

Comments
 (0)