Skip to content

Commit 61d93b1

Browse files
authored
feat: change mom10 lib to java11 (#563)
* feat: change mom10 lib to java11 Signed-off-by: Bartosz Czyż <czyzbartosz3@gmail.com> * chore: change version Signed-off-by: Bartosz Czyż <czyzbartosz3@gmail.com> --------- Signed-off-by: Bartosz Czyż <czyzbartosz3@gmail.com>
1 parent c22cfd9 commit 61d93b1

File tree

11 files changed

+63
-22
lines changed

11 files changed

+63
-22
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Naksha_2.2.19
2+
- Changed from Java 17 to Java 11 for naksha-lib-mm-util project.
3+
14
## Naksha_2.2.18
25
- Fix snakeyaml conflicting versions.
36

build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,12 @@ project(":here-naksha-app-service") {
547547

548548
project(":here-naksha-lib-mm-util"){
549549
description = "Naksha Namespace Util library"
550+
java {
551+
sourceCompatibility = JavaVersion.VERSION_11
552+
targetCompatibility = JavaVersion.VERSION_11
553+
withJavadocJar()
554+
withSourcesJar()
555+
}
550556
dependencies {
551557
implementation(project(":here-naksha-lib-core"))
552558

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ mavenPassword=YourPassword
1111
# - here-naksha-lib-core/src/main/com/here/naksha/lib/core/NakshaVersion (static property: latest)
1212
# - here-naksha-app-service/src/main/resources/swagger/openapi.yaml (info.version property)
1313
# - CHANGELOG.md
14-
version=2.2.18
14+
version=2.2.19
1515

here-naksha-app-service/src/main/resources/swagger/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ servers:
1212
info:
1313
title: "Naksha Hub-API"
1414
description: "Naksha Hub-API is a REST API to provide simple access to geo data."
15-
version: "2.2.18"
15+
version: "2.2.19"
1616

1717
security:
1818
- AccessToken: [ ]

here-naksha-lib-core/src/main/java/com/here/naksha/lib/core/NakshaVersion.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ public class NakshaVersion implements Comparable<NakshaVersion> {
7676
public static final String v2_2_16 = "2.2.16";
7777
public static final String v2_2_17 = "2.2.17";
7878
public static final String v2_2_18 = "2.2.18";
79+
public static final String v2_2_19 = "2.2.19";
7980

8081
/**
8182
* The latest version of the naksha-extension stored in the resources.
8283
*/
8384
@AvailableSince(v2_0_5)
84-
public static final NakshaVersion latest = of(v2_2_17);
85+
public static final NakshaVersion latest = of(v2_2_19);
8586

8687
private final int major;
8788
private final int minor;

here-naksha-lib-mm-util/src/main/java/com/here/naksha/mom10/DeltaProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package com.here.naksha.mom10;
2020

2121
class DeltaProperties {
22+
2223
private DeltaProperties() {}
2324

2425
/*

here-naksha-lib-mm-util/src/main/java/com/here/naksha/mom10/Mom10Verification.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public static boolean isMom10OrGreater(JsonObject rawFeature) {
3636
Map properties = nestedMapOrNull(rawFeature, XyzFeature.PROPERTIES);
3737
if (properties != null) {
3838
Map meta = nestedMapOrNull(properties, MetaProperties.META);
39-
if (meta != null && meta.get(MetaProperties.MODEL_VERSION) instanceof String modelVersion) {
39+
if (meta != null && meta.get(MetaProperties.MODEL_VERSION) instanceof String) {
40+
String modelVersion = (String) meta.get(MetaProperties.MODEL_VERSION);
4041
return specifiesAtLeastMom10(modelVersion);
4142
}
4243
}
@@ -62,8 +63,8 @@ private static boolean specifiesAtLeastMom10(@NotNull String modelVersion) {
6263

6364
private static @Nullable Map<String, Object> nestedMapOrNull(Map rawFeature, String propertyName) {
6465
Object property = rawFeature.get(propertyName);
65-
if (property instanceof Map nested) {
66-
return nested;
66+
if (property instanceof Map) {
67+
return (Map) property;
6768
}
6869
return null;
6970
}

here-naksha-lib-mm-util/src/test/java/com/here/naksha/mom10/Mom10VerificationTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@
1313

1414
class Mom10VerificationTest {
1515

16-
record VerificationCase(JsonObject rawFeature, boolean isAtLeastMom10) {}
16+
private static class VerificationCase {
17+
18+
private final JsonObject rawFeature;
19+
private final boolean isAtLeastMom10;
20+
21+
public VerificationCase(JsonObject rawFeature, boolean isAtLeastMom10) {
22+
this.rawFeature = rawFeature;
23+
this.isAtLeastMom10 = isAtLeastMom10;
24+
}
25+
}
1726

1827
@ParameterizedTest
1928
@MethodSource

here-naksha-lib-mm-util/src/test/java/com/here/naksha/mom10/TransformationSamples.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,25 @@ public class TransformationSamples {
1818
private TransformationSamples() {
1919
}
2020

21-
public record TransformationSample(
22-
String sourceDir,
23-
XyzFeature mom10,
24-
XyzFeature nakshaInternal
25-
) {
21+
public static final class TransformationSample {
22+
23+
private final String sourceDir;
24+
private final XyzFeature mom10;
25+
private final XyzFeature nakshaInternal;
26+
27+
public TransformationSample(String sourceDir, XyzFeature mom10, XyzFeature nakshaInternal) {
28+
this.sourceDir = sourceDir;
29+
this.mom10 = mom10;
30+
this.nakshaInternal = nakshaInternal;
31+
}
32+
33+
public XyzFeature getMom10() {
34+
return mom10;
35+
}
36+
37+
public XyzFeature getNakshaInternal() {
38+
return nakshaInternal;
39+
}
2640

2741
@Override
2842
public String toString() {
@@ -59,6 +73,7 @@ private static class SamplesLoader {
5973

6074
// initialization on demand
6175
private static final List<TransformationSample> LOADED_SAMPLES;
76+
6277
static {
6378
List<Path> dirs = samplesDirs();
6479
LOADED_SAMPLES = new ArrayList<>(dirs.size());

here-naksha-lib-mm-util/src/test/java/com/here/naksha/mom10/transform/Mom10TransformationTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ class Mom10TransformationTest {
1313
@MethodSource("com.here.naksha.mom10.TransformationSamples#streamSamples")
1414
void shouldPopulatePreMom10Namespaces(TransformationSample versionedFeatures) {
1515
// When
16-
Mom10Transformation.populatePreMom10Namespaces(versionedFeatures.mom10());
16+
Mom10Transformation.populatePreMom10Namespaces(versionedFeatures.getMom10());
1717

1818
// Then:
1919
assertFeaturesEqual(
20-
versionedFeatures.nakshaInternal(), // expected - untouched
21-
versionedFeatures.mom10() // actual - transformed
20+
versionedFeatures.getNakshaInternal(), // expected - untouched
21+
versionedFeatures.getMom10() // actual - transformed
2222
);
2323
}
2424

2525
@ParameterizedTest
2626
@MethodSource("com.here.naksha.mom10.TransformationSamples#streamSamples")
2727
void shouldDropPreMom10Namespaces(TransformationSample versionedFeatures) {
2828
// When
29-
Mom10Transformation.dropPreMom10Namespaces(versionedFeatures.nakshaInternal());
29+
Mom10Transformation.dropPreMom10Namespaces(versionedFeatures.getNakshaInternal());
3030

3131
// Then:
32-
assertFeaturesEqual(versionedFeatures.mom10(), versionedFeatures.nakshaInternal());
32+
assertFeaturesEqual(versionedFeatures.getMom10(), versionedFeatures.getNakshaInternal());
3333
}
3434
}

0 commit comments

Comments
 (0)