Skip to content

Commit

Permalink
Automatically reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Dec 9, 2022
1 parent dc479c5 commit 6e59bd2
Show file tree
Hide file tree
Showing 19 changed files with 508 additions and 476 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ CHANGELOG
------------------

* Messages for `DeserializationException` have been improved, and the cause
is included, if any. Moreover, the message provides detail about the involved
types, if the exception is caused by an `IllegalArgumentException`.
is included, if any. Moreover, the message provides detail about the involved
types, if the exception is caused by an `IllegalArgumentException`.

2.0.0 (2020-10-13)
------------------
Expand Down Expand Up @@ -107,7 +107,6 @@ CHANGELOG
* Several optimizations have been made to reduce allocations when decoding a
record. Pull requests by Viktor Szathmáry. GitHub #16 & #17.


1.0.0 (2014-09-29)
------------------

Expand Down
12 changes: 6 additions & 6 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
<module name="SuppressionFilter">
<property name="file" value="${org.checkstyle.google.suppressionfilter.config}"
default="checkstyle-suppressions.xml" />
default="checkstyle-suppressions.xml"/>
<property name="optional" value="true"/>
</module>

Expand Down Expand Up @@ -362,14 +362,14 @@
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
<module name="SuppressionXpathFilter">
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
default="checkstyle-xpath-suppressions.xml" />
default="checkstyle-xpath-suppressions.xml"/>
<property name="optional" value="true"/>
</module>
<module name="SuppressWarningsHolder" />
<module name="SuppressWarningsHolder"/>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)" />
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)" />
<property name="checkFormat" value="$1" />
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE.SUPPRESS\: ([\w\|]+)"/>
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/maxmind/db/BufferHolder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.maxmind.db;

import com.maxmind.db.Reader.FileMode;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
Expand All @@ -9,23 +10,21 @@
import java.nio.channels.FileChannel;
import java.nio.channels.FileChannel.MapMode;

import com.maxmind.db.Reader.FileMode;

final class BufferHolder {
// DO NOT PASS OUTSIDE THIS CLASS. Doing so will remove thread safety.
private final ByteBuffer buffer;

BufferHolder(File database, FileMode mode) throws IOException {
try (
final RandomAccessFile file = new RandomAccessFile(database, "r");
final FileChannel channel = file.getChannel()
final RandomAccessFile file = new RandomAccessFile(database, "r");
final FileChannel channel = file.getChannel()
) {
if (mode == FileMode.MEMORY) {
final ByteBuffer buf = ByteBuffer.wrap(new byte[(int) channel.size()]);
if (channel.read(buf) != buf.capacity()) {
throw new IOException("Unable to read "
+ database.getName()
+ " into memory. Unexpected end of stream.");
+ database.getName()
+ " into memory. Unexpected end of stream.");
}
this.buffer = buf.asReadOnlyBuffer();
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/maxmind/db/CachedConstructor.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ final class CachedConstructor<T> {
private final Map<String, Integer> parameterIndexes;

CachedConstructor(
Constructor<T> constructor,
Class<?>[] parameterTypes,
java.lang.reflect.Type[] parameterGenericTypes,
Map<String, Integer> parameterIndexes
Constructor<T> constructor,
Class<?>[] parameterTypes,
java.lang.reflect.Type[] parameterGenericTypes,
Map<String, Integer> parameterIndexes
) {
this.constructor = constructor;
this.parameterTypes = parameterTypes;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/maxmind/db/DecodedValue.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.maxmind.db;

public final class DecodedValue {
final Object value;
final Object value;

DecodedValue(Object value) {
this.value = value;
Expand Down
Loading

0 comments on commit 6e59bd2

Please sign in to comment.