Skip to content

Commit 9d91a14

Browse files
committed
Fixed arabic stuff
1 parent 35a9bdd commit 9d91a14

16 files changed

+26
-48
lines changed

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.2.5-SNAPSHOT</version>
11+
<version>2.3.0</version>
1212

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

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,9 @@ public static DataModel getInstance() {
170170
i += 4;
171171
}
172172
} finally {
173-
//noinspection ThrowFromFinallyBlock
174173
outputStream.close();
175174
}
176175
} finally {
177-
//noinspection ThrowFromFinallyBlock
178176
inputStream.close();
179177
}
180178
} catch (final IOException e) {

src/main/java/com/mapcode/Decoder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ private static String convertFromAbjad(final String mapcode) {
925925
return prefix + Encoder.aeuPack(newstr, false) + postfix;
926926
}
927927

928+
@SuppressWarnings("NumericCastThatLosesPrecision")
928929
private static String convertToAbjad(final String mapcode) {
929930
String str;
930931
final String rest;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ static List<Mapcode> encode(
5757
private final static char[] ENCODE_CHARS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'B', 'C', 'D', 'F',
5858
'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z', 'A', 'E', 'U'};
5959

60-
@SuppressWarnings("ConstantConditions")
6160
@Nonnull
6261
private static List<Mapcode> encode(final double argLatDeg, final double argLonDeg,
6362
@Nullable final Territory territory, final boolean limitToOneResult,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,14 @@ public int hashCode() {
421421
}
422422

423423
@Override
424-
public boolean equals(@Nullable final Object o) {
425-
if (this == o) {
424+
public boolean equals(@Nullable final Object obj) {
425+
if (this == obj) {
426426
return true;
427427
}
428-
if (!(o instanceof Mapcode)) {
428+
if (!(obj instanceof Mapcode)) {
429429
return false;
430430
}
431-
final Mapcode that = (Mapcode) o;
431+
final Mapcode that = (Mapcode) obj;
432432
return this.territory.equals(that.territory) &&
433433
this.codePrecision8.equals(that.codePrecision8);
434434
}

src/main/java/com/mapcode/Point.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ public int hashCode() {
225225

226226
@SuppressWarnings("NonFinalFieldReferenceInEquals")
227227
@Override
228-
public boolean equals(final Object o) {
229-
if (this == o) {
228+
public boolean equals(final Object obj) {
229+
if (this == obj) {
230230
return true;
231231
}
232-
if (!(o instanceof Point)) {
232+
if (!(obj instanceof Point)) {
233233
return false;
234234
}
235-
final Point that = (Point) o;
235+
final Point that = (Point) obj;
236236
return (this.latMicroDeg == that.latMicroDeg) &&
237237
(this.lonMicroDeg == that.lonMicroDeg) &&
238238
(this.latFractionOnlyDeg == that.latFractionOnlyDeg) &&

src/main/java/com/mapcode/Territory.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,6 @@ private Territory(
912912
* @return Territory.
913913
* @throws UnknownTerritoryException Thrown if the territory is not found.
914914
*/
915-
@SuppressWarnings("TailRecursion")
916915
@Nonnull
917916
private static Territory createFromString(
918917
@Nonnull final String alphaCode,

src/main/java/com/mapcode/UnknownAlphabetException.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@
2525
public final class UnknownAlphabetException extends IllegalArgumentException {
2626
private static final long serialVersionUID = 1L;
2727

28-
private final Integer code;
29-
3028
public UnknownAlphabetException(@Nonnull final String message) {
3129
super(message);
3230
assert message != null;
33-
this.code = null;
3431
}
3532
}

src/main/java/com/mapcode/UnknownPrecisionFormatException.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@
2525
public final class UnknownPrecisionFormatException extends IllegalArgumentException {
2626
private static final long serialVersionUID = 1L;
2727

28-
private final Integer precision;
29-
3028
public UnknownPrecisionFormatException(@Nonnull final String message) {
3129
super(message);
3230
assert message != null;
33-
this.precision = null;
3431
}
3532
}

src/test/java/com/mapcode/DataModelTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,45 +21,40 @@
2121
import org.slf4j.Logger;
2222
import org.slf4j.LoggerFactory;
2323

24-
import javax.annotation.Nonnull;
25-
26-
import static org.junit.Assert.assertEquals;
27-
28-
@SuppressWarnings({"OverlyBroadThrowsClause", "ProhibitedExceptionDeclared"})
2924
public class DataModelTest {
3025
private static final Logger LOG = LoggerFactory.getLogger(DataModelTest.class);
3126

3227
public void testFileOK() {
3328
LOG.info("testFileOK");
3429
final DataModel dataModel = new DataModel("/com/mapcode/mminfo_ok.dat");
35-
Assert.assertTrue(dataModel != null);
30+
Assert.assertNotNull(dataModel);
3631
}
3732

3833
@Test(expected = IncorrectDataModelException.class)
3934
public void testFileTooShort() {
4035
LOG.info("testFileTooShort");
4136
final DataModel dataModel = new DataModel("/com/mapcode/mminfo_too_short.dat");
42-
Assert.assertTrue(false);
37+
Assert.assertNull(dataModel);
4338
}
4439

4540
@Test(expected = IncorrectDataModelException.class)
4641
public void testFileEndsEarly() {
4742
LOG.info("testFileEndsEarly");
4843
final DataModel dataModel = new DataModel("/com/mapcode/mminfo_ends_early.dat");
49-
Assert.assertTrue(false);
44+
Assert.assertNull(dataModel);
5045
}
5146

5247
@Test(expected = IncorrectDataModelException.class)
5348
public void testFileNoHeader() {
5449
LOG.info("testFileNoHeader");
5550
final DataModel dataModel = new DataModel("/com/mapcode/mminfo_no_header.dat");
56-
Assert.assertTrue(false);
51+
Assert.assertNull(dataModel);
5752
}
5853

5954
@Test(expected = IncorrectDataModelException.class)
6055
public void testFileWrongversion() {
6156
LOG.info("testFileWrongversion");
6257
final DataModel dataModel = new DataModel("/com/mapcode/mminfo_wrong_version.dat");
63-
Assert.assertTrue(false);
58+
Assert.assertNull(dataModel);
6459
}
6560
}

0 commit comments

Comments
 (0)