Skip to content

Commit dc7971a

Browse files
committed
Minor code cleanup
1 parent ed79b80 commit dc7971a

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,10 @@ Normally, one of our developers should be able to comment on them and fix.
480480
mat
481481
These are the release notes for the Java library for mapcodes.
482482

483+
### 2.4.13
484+
485+
* Minor code cleanup.
486+
483487
### 2.4.12
484488

485489
* Added unit tests to check internal data structures.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<artifactId>mapcode</artifactId>
99

1010
<packaging>jar</packaging>
11-
<version>2.4.12</version>
11+
<version>2.4.13-SNAPSHOT</version>
1212

1313
<name>Mapcode Java Library</name>
1414
<description>

src/main/java/com/mapcode/Common.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ private Common() {
9090

9191
// This method returns a divider for longitude (multiplied by 4), for a given latitude.
9292
// TODO: Need better names for minY and maxY.
93-
@SuppressWarnings("ConstantConditions")
9493
static int xDivider(final int latMin, final int latMax) {
9594
assert latMin < latMax;
9695
if (latMin >= 0) {

src/main/java/com/mapcode/DataModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private static int readLongLoHi(final int lo, final int mid1, final int mid2, fi
8686
private static final Object mutex = new Object();
8787

8888
@SuppressWarnings({"DoubleCheckedLocking", "SynchronizationOnStaticField"})
89-
public static DataModel getInstance() {
89+
static DataModel getInstance() {
9090
if (instance == null) {
9191
synchronized (mutex) {
9292
if (instance == null) {

src/main/java/com/mapcode/Encoder.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ private static String encodeAutoHeader(
338338
if (Data.getTerritoryRecordType(i) == Data.TERRITORY_RECORD_TYPE_PLUS) // plus pipe
339339
{
340340
final int goodRounder = (codexm >= 23) ? (961 * 961 * 31) : (961 * 961);
341-
product =
342-
((((storageStart + product + goodRounder) - 1) / goodRounder) * goodRounder) - storageStart;
341+
product = ((((storageStart + product + goodRounder) - 1) / goodRounder) * goodRounder) - storageStart;
343342
}
344343

345344
if (i == territoryRecord) {

src/main/java/com/mapcode/Mapcode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ public Territory getTerritory() {
249249
* provided as statics to only compile these patterns once.
250250
*/
251251
@Nonnull
252-
static final String REGEX_TERRITORY = "[\\p{L}\\p{N}]{2,3}+([-_][\\p{L}\\p{N}]{2,3}+)?";
252+
private static final String REGEX_TERRITORY = "[\\p{L}\\p{N}]{2,3}+([-_][\\p{L}\\p{N}]{2,3}+)?";
253253
@Nonnull
254-
static final String REGEX_CODE_PREFIX = "[\\p{L}\\p{N}]{2,5}+";
254+
private static final String REGEX_CODE_PREFIX = "[\\p{L}\\p{N}]{2,5}+";
255255
@Nonnull
256-
static final String REGEX_CODE_POSTFIX = "[\\p{L}\\p{N}]{2,4}+";
256+
private static final String REGEX_CODE_POSTFIX = "[\\p{L}\\p{N}]{2,4}+";
257257
@Nonnull
258-
static final String REGEX_CODE_PRECISION = "[-][\\p{L}\\p{N}&&[^zZ]]{1,8}+";
258+
private static final String REGEX_CODE_PRECISION = "[-][\\p{L}\\p{N}&&[^zZ]]{1,8}+";
259259

260260
/**
261261
* This patterns/regular expressions is used for checking mapcode format strings.

0 commit comments

Comments
 (0)