diff --git a/.gitignore b/.gitignore
index 19ba0e5..bd7e011 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ target/
out/
*.versionsBackup
+.gitnexus
diff --git a/README.md b/README.md
index 874bc7f..04fb346 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,11 @@
# Mapcode Library for Java
-[](https://www.codacy.com/app/rijnb/mapcode-java?utm_source=github.com&utm_medium=referral&utm_content=mapcode-foundation/mapcode-java&utm_campaign=Badge_Grade)
-[](https://travis-ci.org/mapcode-foundation/mapcode-java)
[](https://coveralls.io/github/mapcode-foundation/mapcode-java?branch=master)
[]()
[](https://github.com/mapcode-foundation/mapcode-java/releases)
[](https://maven-badges.herokuapp.com/maven-central/com.mapcode/mapcode)
-**Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)**
+**Copyright (C) 2014-2026, Stichting Mapcode Foundation (http://www.mapcode.com)**
This Java project contains a library to encode latitude/longitude pairs to mapcodes
and to decode mapcodes back to latitude/longitude pairs.
@@ -477,9 +475,34 @@ Normally, one of our developers should be able to comment on them and fix.
# Release Notes
-mat
+
These are the release notes for the Java library for mapcodes.
+### 2.4.19
+
+* Added synonyms for territories Maco CN-MO and Mexico MX-CMX.
+* Updated dependencies.
+
+### 2.4.16-2.4.18
+
+* Updated `log4j` and `gson` dependencies.
+
+### 2.4.15
+
+* Removed country code ANT (not used for mapcodes) after JDK 1.8. Fixed unit test for that.
+
+* Updated Maven dependencies for security vulnerabilities.
+
+* Updated copyrights.
+
+### 2.4.14
+
+* Updated dependencies for security vulnerabilities.
+
+### 2.4.13
+
+* Minor code cleanup.
+
### 2.4.12
* Added unit tests to check internal data structures.
diff --git a/pom.xml b/pom.xml
index 2b251d1..a2b93fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,3 +1,19 @@
+
+
= 0) {
diff --git a/src/main/java/com/mapcode/Data.java b/src/main/java/com/mapcode/Data.java
index c3cf9b3..2eb7e37 100644
--- a/src/main/java/com/mapcode/Data.java
+++ b/src/main/java/com/mapcode/Data.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/com/mapcode/DataModel.java b/src/main/java/com/mapcode/DataModel.java
index e1107d2..72a8543 100644
--- a/src/main/java/com/mapcode/DataModel.java
+++ b/src/main/java/com/mapcode/DataModel.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -86,7 +86,7 @@ private static int readLongLoHi(final int lo, final int mid1, final int mid2, fi
private static final Object mutex = new Object();
@SuppressWarnings({"DoubleCheckedLocking", "SynchronizationOnStaticField"})
- public static DataModel getInstance() {
+ static DataModel getInstance() {
if (instance == null) {
synchronized (mutex) {
if (instance == null) {
diff --git a/src/main/java/com/mapcode/Decoder.java b/src/main/java/com/mapcode/Decoder.java
index ea03317..195ad2e 100644
--- a/src/main/java/com/mapcode/Decoder.java
+++ b/src/main/java/com/mapcode/Decoder.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -678,6 +678,7 @@ private static String aeuUnpack(@Nonnull final String argStr) {
for (int v = 0; v <= lastpos; v++) {
if (v != dotpos) {
+ //noinspection RedundantCast
final int i = (int) str.charAt(v);
if (DECODE_CHARS[i] < 0) {
return ""; // bad char!
@@ -839,7 +840,9 @@ private static MapcodeZone decodeExtension(
final int extremeLatMicroDeg,
final int maxLonMicroDeg) {
final MapcodeZone mapcodeZone = new MapcodeZone();
+ //noinspection RedundantCast
double dividerx4 = (double) dividerx0;
+ //noinspection RedundantCast
double dividery = (double) dividery0;
double processor = 1;
int lon32 = 0;
@@ -849,6 +852,7 @@ private static MapcodeZone decodeExtension(
// decode up to 8 characters
final int len = (extrapostfix.length() > 8) ? 8 : extrapostfix.length();
while (idx < len) {
+ //noinspection RedundantCast
int c1 = (int) extrapostfix.charAt(idx);
idx++;
c1 = DECODE_CHARS[c1];
@@ -861,6 +865,7 @@ private static MapcodeZone decodeExtension(
final int y2;
final int x2;
if (idx < len) {
+ //noinspection RedundantCast
int c2 = (int) extrapostfix.charAt(idx);
idx++;
c2 = DECODE_CHARS[c2];
@@ -915,6 +920,7 @@ private static MapcodeZone decodeExtension(
private static boolean isAbjadScript(@Nonnull final String argStr) {
for (final char ch : argStr.toCharArray()) {
+ //noinspection RedundantCast
final int c = (int) ch;
if ((c >= 0x0628) && (c <= 0x0649)) {
return true; // Arabic
diff --git a/src/main/java/com/mapcode/Encoder.java b/src/main/java/com/mapcode/Encoder.java
index becff65..8f2f459 100644
--- a/src/main/java/com/mapcode/Encoder.java
+++ b/src/main/java/com/mapcode/Encoder.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -338,8 +338,7 @@ private static String encodeAutoHeader(
if (Data.getTerritoryRecordType(i) == Data.TERRITORY_RECORD_TYPE_PLUS) // plus pipe
{
final int goodRounder = (codexm >= 23) ? (961 * 961 * 31) : (961 * 961);
- product =
- ((((storageStart + product + goodRounder) - 1) / goodRounder) * goodRounder) - storageStart;
+ product = ((((storageStart + product + goodRounder) - 1) / goodRounder) * goodRounder) - storageStart;
}
if (i == territoryRecord) {
diff --git a/src/main/java/com/mapcode/IncorrectDataModelException.java b/src/main/java/com/mapcode/IncorrectDataModelException.java
index f543139..dd7f410 100644
--- a/src/main/java/com/mapcode/IncorrectDataModelException.java
+++ b/src/main/java/com/mapcode/IncorrectDataModelException.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/com/mapcode/Mapcode.java b/src/main/java/com/mapcode/Mapcode.java
index 1e83a1b..e32a310 100644
--- a/src/main/java/com/mapcode/Mapcode.java
+++ b/src/main/java/com/mapcode/Mapcode.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -249,13 +249,13 @@ public Territory getTerritory() {
* provided as statics to only compile these patterns once.
*/
@Nonnull
- static final String REGEX_TERRITORY = "[\\p{L}\\p{N}]{2,3}+([-_][\\p{L}\\p{N}]{2,3}+)?";
+ private static final String REGEX_TERRITORY = "[\\p{L}\\p{N}]{2,3}+([-_][\\p{L}\\p{N}]{2,3}+)?";
@Nonnull
- static final String REGEX_CODE_PREFIX = "[\\p{L}\\p{N}]{2,5}+";
+ private static final String REGEX_CODE_PREFIX = "[\\p{L}\\p{N}]{2,5}+";
@Nonnull
- static final String REGEX_CODE_POSTFIX = "[\\p{L}\\p{N}]{2,4}+";
+ private static final String REGEX_CODE_POSTFIX = "[\\p{L}\\p{N}]{2,4}+";
@Nonnull
- static final String REGEX_CODE_PRECISION = "[-][\\p{L}\\p{N}&&[^zZ]]{1,8}+";
+ private static final String REGEX_CODE_PRECISION = "[-][\\p{L}\\p{N}&&[^zZ]]{1,8}+";
/**
* This patterns/regular expressions is used for checking mapcode format strings.
diff --git a/src/main/java/com/mapcode/MapcodeCodec.java b/src/main/java/com/mapcode/MapcodeCodec.java
index ba306d8..b0e3405 100644
--- a/src/main/java/com/mapcode/MapcodeCodec.java
+++ b/src/main/java/com/mapcode/MapcodeCodec.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -416,6 +416,7 @@ public static boolean isNearMultipleBorders(@Nonnull final Point point, @Nonnull
return false;
}
+ @SuppressWarnings("OverlyBroadThrowsClause")
@Nonnull
private static MapcodeZone decodeToMapcodeZone(@Nonnull final String mapcode, @Nullable final Territory defaultTerritoryContext)
throws UnknownMapcodeException, IllegalArgumentException {
diff --git a/src/main/java/com/mapcode/MapcodeZone.java b/src/main/java/com/mapcode/MapcodeZone.java
index a3d9ae4..29300c4 100644
--- a/src/main/java/com/mapcode/MapcodeZone.java
+++ b/src/main/java/com/mapcode/MapcodeZone.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/com/mapcode/Point.java b/src/main/java/com/mapcode/Point.java
index a3a1153..7544446 100644
--- a/src/main/java/com/mapcode/Point.java
+++ b/src/main/java/com/mapcode/Point.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,9 +36,13 @@
public final class Point {
// Latitude and longitude ranges.
+ @SuppressWarnings("unused")
public static final double LON_DEG_MIN = -180.0;
+ @SuppressWarnings("unused")
public static final double LON_DEG_MAX = 180.0;
+ @SuppressWarnings("unused")
public static final double LAT_DEG_MIN = -90.0;
+ @SuppressWarnings("unused")
public static final double LAT_DEG_MAX = 90.0;
// Conversion constants.
diff --git a/src/main/java/com/mapcode/Rectangle.java b/src/main/java/com/mapcode/Rectangle.java
index 0d3a2d0..4eebac9 100644
--- a/src/main/java/com/mapcode/Rectangle.java
+++ b/src/main/java/com/mapcode/Rectangle.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/com/mapcode/Territory.java b/src/main/java/com/mapcode/Territory.java
index a8b04e3..5f4879f 100644
--- a/src/main/java/com/mapcode/Territory.java
+++ b/src/main/java/com/mapcode/Territory.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -48,7 +48,7 @@ public enum Territory {
BLM(5, "Saint-Barthelemy"),
NRU(6, "Nauru"),
TUV(7, "Tuvalu"),
- MAC(8, "Macau", new Alphabet[]{Alphabet.CHINESE, Alphabet.ROMAN}, null, new String[]{"CN-92", "CHN-92", "CN-MC", "CHN-MC"}, new String[]{"Aomen"}),
+ MAC(8, "Macau", new Alphabet[]{Alphabet.CHINESE, Alphabet.ROMAN}, null, new String[]{"CN-92", "CHN-92", "CN-MC", "CHN-MC", "CN-MO", "CHN-MO"}, new String[]{"Aomen"}),
SXM(9, "Sint Maarten"),
MAF(10, "Saint-Martin"),
NFK(11, "Norfolk and Philip Island", null, null, new String[]{"AU-NF", "AUS-NF"},
@@ -277,7 +277,7 @@ public enum Territory {
LBY(230, "Libya", new Alphabet[]{Alphabet.ARABIC, Alphabet.ROMAN, Alphabet.TIFINAGH}),
SDN(231, "Sudan", new Alphabet[]{Alphabet.ARABIC, Alphabet.ROMAN}),
IDN(232, "Indonesia"),
- MX_DIF(233, "Federal District", null, MEX, new String[]{"MX-DF"}),
+ MX_DIF(233, "Federal District", null, MEX, new String[]{"MX-DF", "MX-CMX"}),
MX_TLA(234, "Tlaxcala", null, MEX, new String[]{"MX-TL"}),
MX_MOR(235, "Morelos", null, MEX, new String[]{"MX-MO"}),
MX_AGU(236, "Aguascalientes", null, MEX, new String[]{"MX-AG"}),
@@ -960,14 +960,15 @@ public boolean hasSubdivisions() {
// Add Clipperton Island (not recognized by Java).
MAP_ISO3_TO_ISO2.put("CPT", "CP");
+ // Remove Antilles (present in Java 1.8, removed later).
+ MAP_ISO3_TO_ISO2.remove("ANT");
+
// Create fixed sets of the keys and values.
COUNTRY_ISO2_CODES = new HashSet(MAP_ISO3_TO_ISO2.values());
COUNTRY_ISO3_CODES = new HashSet(MAP_ISO3_TO_ISO2.keySet());
}
- /**
- * Static checking of the static data structures.
- */
+ // Static checking of the static data structures.
static {
final String errorPrefix = "Initializing error: ";
CODE_LIST = new ArrayList();
@@ -978,11 +979,11 @@ public boolean hasSubdivisions() {
final Set territoryNumbers = new HashSet();
final Set namesSet = new HashSet();
- for (final Territory territory : Territory.values()) {
+ for (final Territory territory : values()) {
final int territoryNumber = territory.getNumber();
// Check if territory code is within range.
- if ((territoryNumber < 0) || (territoryNumber >= Territory.values().length)) {
+ if ((territoryNumber < 0) || (territoryNumber >= values().length)) {
throw new ExceptionInInitializerError(errorPrefix + "territory number out of range: " + territoryNumber);
}
@@ -1036,12 +1037,12 @@ public boolean hasSubdivisions() {
max = Math.max(max, territory.number);
assert territory.alphabets.length > 0;
}
- assert territoryNumbers.size() == Territory.values().length;
+ assert territoryNumbers.size() == values().length;
// Check that territory has at least one alphabet.
// Check for missing codes; minimum code must be 0, maximum code must be last code of enum.
- if (!((min == 0) && (max == (Territory.values().length - 1)))) {
+ if (!((min == 0) && (max == (values().length - 1)))) {
throw new ExceptionInInitializerError(errorPrefix + "incorrect min/max territory number: " + min + '/' + max);
}
}
diff --git a/src/main/java/com/mapcode/UnknownAlphabetException.java b/src/main/java/com/mapcode/UnknownAlphabetException.java
index c37bd86..0519e78 100644
--- a/src/main/java/com/mapcode/UnknownAlphabetException.java
+++ b/src/main/java/com/mapcode/UnknownAlphabetException.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/com/mapcode/UnknownDecodeException.java b/src/main/java/com/mapcode/UnknownDecodeException.java
index 1c7bb7d..ef38c63 100644
--- a/src/main/java/com/mapcode/UnknownDecodeException.java
+++ b/src/main/java/com/mapcode/UnknownDecodeException.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/com/mapcode/UnknownMapcodeException.java b/src/main/java/com/mapcode/UnknownMapcodeException.java
index 59fcc78..2bd7a24 100644
--- a/src/main/java/com/mapcode/UnknownMapcodeException.java
+++ b/src/main/java/com/mapcode/UnknownMapcodeException.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/com/mapcode/UnknownPrecisionFormatException.java b/src/main/java/com/mapcode/UnknownPrecisionFormatException.java
index 4f339ea..732610e 100644
--- a/src/main/java/com/mapcode/UnknownPrecisionFormatException.java
+++ b/src/main/java/com/mapcode/UnknownPrecisionFormatException.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/main/java/com/mapcode/UnknownTerritoryException.java b/src/main/java/com/mapcode/UnknownTerritoryException.java
index 2f23223..d2d38b8 100644
--- a/src/main/java/com/mapcode/UnknownTerritoryException.java
+++ b/src/main/java/com/mapcode/UnknownTerritoryException.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/com/mapcode/AlphabetTest.java b/src/test/java/com/mapcode/AlphabetTest.java
index 19fb8af..47b4c98 100644
--- a/src/test/java/com/mapcode/AlphabetTest.java
+++ b/src/test/java/com/mapcode/AlphabetTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -103,9 +103,7 @@ public void testConvertToAlphabet() throws Exception {
final String codeGreek = Mapcode.convertStringToAlphabet(code, Alphabet.GREEK);
LOG.debug("testConvertToAlphabet: code={}, codeGreek={}", code, codeGreek);
final String expect = CODE_TEST_PAIRS[i + 1];
- if (!expect.isEmpty()) {
- assertEquals(codeGreek, expect);
- }
+ assertEquals(codeGreek, expect);
final String codeAscii = Mapcode.convertStringToPlainAscii(codeGreek);
LOG.debug("testConvertToAlphabet: code={}, codeGreek={}, codeAscii={}", code, codeGreek, codeAscii);
assertEquals(code, codeAscii);
diff --git a/src/test/java/com/mapcode/CheckArgsTest.java b/src/test/java/com/mapcode/CheckArgsTest.java
index 5a4dd6f..eb42f78 100644
--- a/src/test/java/com/mapcode/CheckArgsTest.java
+++ b/src/test/java/com/mapcode/CheckArgsTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/com/mapcode/DataModelTest.java b/src/test/java/com/mapcode/DataModelTest.java
index 2a35c24..358e166 100644
--- a/src/test/java/com/mapcode/DataModelTest.java
+++ b/src/test/java/com/mapcode/DataModelTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/com/mapcode/DecoderTest.java b/src/test/java/com/mapcode/DecoderTest.java
index 0fc0e08..213ad00 100644
--- a/src/test/java/com/mapcode/DecoderTest.java
+++ b/src/test/java/com/mapcode/DecoderTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,7 +38,7 @@ public void tableAscii2Language() {
LOG.info("tableAscii2Language");
assertEquals(Decoder.ASCII2LANGUAGE.length, Decoder.UNICODE2ASCII.length - 10 /* Digits */ - 3 /* Lowercase */);
int i = 1;
- for (char[] chars : Decoder.ASCII2LANGUAGE) {
+ for (final char[] chars : Decoder.ASCII2LANGUAGE) {
assertEquals("At row " + i + ", length: " + chars.length, 36, chars.length);
++i;
}
@@ -47,7 +47,7 @@ public void tableAscii2Language() {
@Test
public void tableUnicodeToAscii() {
LOG.info("tableUnicodeToAscii");
- for (Unicode2Ascii unicode2Ascii : Decoder.UNICODE2ASCII) {
+ for (final Unicode2Ascii unicode2Ascii : Decoder.UNICODE2ASCII) {
assertEquals("Error at: u" + Integer.toHexString(unicode2Ascii.min),
(int) unicode2Ascii.max - (int) unicode2Ascii.min, unicode2Ascii.convert.length() - 1);
}
diff --git a/src/test/java/com/mapcode/EncodeDecodeTest.java b/src/test/java/com/mapcode/EncodeDecodeTest.java
index aef1ba6..a0e4f1a 100644
--- a/src/test/java/com/mapcode/EncodeDecodeTest.java
+++ b/src/test/java/com/mapcode/EncodeDecodeTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/com/mapcode/EncoderTest.java b/src/test/java/com/mapcode/EncoderTest.java
index 3316c94..e1ac239 100644
--- a/src/test/java/com/mapcode/EncoderTest.java
+++ b/src/test/java/com/mapcode/EncoderTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/com/mapcode/MapcodeTest.java b/src/test/java/com/mapcode/MapcodeTest.java
index c4c4661..c8b0db2 100644
--- a/src/test/java/com/mapcode/MapcodeTest.java
+++ b/src/test/java/com/mapcode/MapcodeTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/com/mapcode/PointTest.java b/src/test/java/com/mapcode/PointTest.java
index f986dcf..1ca5d6c 100644
--- a/src/test/java/com/mapcode/PointTest.java
+++ b/src/test/java/com/mapcode/PointTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/com/mapcode/ReferenceFileTest.java b/src/test/java/com/mapcode/ReferenceFileTest.java
index 3834dcb..0d9a8dc 100644
--- a/src/test/java/com/mapcode/ReferenceFileTest.java
+++ b/src/test/java/com/mapcode/ReferenceFileTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/com/mapcode/TerritoryTest.java b/src/test/java/com/mapcode/TerritoryTest.java
index 409a24c..b0c23fc 100644
--- a/src/test/java/com/mapcode/TerritoryTest.java
+++ b/src/test/java/com/mapcode/TerritoryTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright (C) 2014-2019, Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -307,7 +307,7 @@ public void testGetCountryISO2Codes() {
LOG.info("testGetCountryISO2Codes");
final Set countryISO2Codes = Territory.allCountryISO2Codes();
LOG.info("set={}", countryISO2Codes);
- assertEquals(251, countryISO2Codes.size());
+ assertEquals(250, countryISO2Codes.size());
assertEquals(2, countryISO2Codes.iterator().next().length());
}
@@ -316,7 +316,7 @@ public void testGetCountryISO3Codes() {
LOG.info("testGetCountryISO3Codes");
final Set countryISO3Codes = Territory.allCountryISO3Codes();
LOG.info("set={}", countryISO3Codes);
- assertEquals(251, countryISO3Codes.size());
+ assertEquals(250, countryISO3Codes.size());
assertEquals(3, countryISO3Codes.iterator().next().length());
}
}
diff --git a/src/test/resources/log4j.xml b/src/test/resources/log4j.xml
index ff649e1..26da1c8 100644
--- a/src/test/resources/log4j.xml
+++ b/src/test/resources/log4j.xml
@@ -1,19 +1,19 @@
+ ~ Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
diff --git a/src/test/resources/show3d/sketch.properties b/src/test/resources/show3d/sketch.properties
index 8630fa2..bf88b4f 100644
--- a/src/test/resources/show3d/sketch.properties
+++ b/src/test/resources/show3d/sketch.properties
@@ -1,2 +1,18 @@
+#
+# Copyright (C) 2016-2021, Stichting Mapcode Foundation (http://www.mapcode.com)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
mode.id=processing.mode.java.JavaMode
mode=Java