Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downgrade to java 7 #833

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ subprojects {
}
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {

Expand Down
4 changes: 2 additions & 2 deletions samples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'java'
apply plugin: 'de.fuerstenau.buildconfig'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
implementation project(":services-geocoding")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public void testToFromJson1() {
"heavy",
"heavy");

List<LegStep> legSteps = new ArrayList<>();

LegAnnotation annotation = LegAnnotation.builder()
.congestion(new ArrayList<String>())
.distance(distanceList)
Expand All @@ -84,7 +86,7 @@ public void testToFromJson1() {
.distance(53.4)
//.weight(14.3)
.duration(14.3)
.steps(new ArrayList<>())
.steps(legSteps)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes seem unrelated but no biggy to keep them around

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason it was giving me compilation error under java 7.
Casting was not possible for some reason.

.summary("")
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @since 1.0.0
*/
@AutoValue
public abstract class CarmenFeature implements GeoJson, Serializable {
public abstract class CarmenFeature extends GeoJson implements Serializable {

private static final String TYPE = "Feature";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @param <T> a generic allowing varying dimensions for each GeoJson geometry
* @since 3.0.0
*/
public interface CoordinateContainer<T> extends Geometry {
public abstract class CoordinateContainer<T> extends Geometry {

/**
* the coordinates which define the geometry. Typically a list of points but for some geometry
Expand All @@ -17,5 +17,5 @@ public interface CoordinateContainer<T> extends Geometry {
* @return the {@link Point}s which make up the coordinates defining the geometry
* @since 3.0.0
*/
T coordinates();
public abstract T coordinates();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the previous method was package private, can we retain that with this setup?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was part of an interface so when implemented it would have to be public

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @since 1.0.0
*/
@AutoValue
public abstract class Feature implements GeoJson {
public abstract class Feature extends GeoJson {

private static final String TYPE = "Feature";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @since 1.0.0
*/
@AutoValue
public abstract class FeatureCollection implements GeoJson {
public abstract class FeatureCollection extends GeoJson {

private static final String TYPE = "FeatureCollection";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @since 1.0.0
*/
public interface GeoJson {
public abstract class GeoJson {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geojson itself is public and changing it from an interface to an abstract class would be a breaking change as users using it will need to change implements to extends + if they are already extending an object, they won't be able to make this change due to java only supporting single inheritance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobrun Good point. I will create another PR then with the method just removed.


/**
* This describes the type of GeoJson geometry, Feature, or FeatureCollection this object is.
Expand All @@ -18,7 +18,7 @@ public interface GeoJson {
* {@code Feature}
* @since 1.0.0
*/
String type();
public abstract String type();

/**
* This takes the currently defined values found inside the GeoJson instance and converts it to a
Expand All @@ -27,7 +27,7 @@ public interface GeoJson {
* @return a JSON string which represents this Feature
* @since 1.0.0
*/
String toJson();
public abstract String toJson();

/**
* A GeoJson object MAY have a member named "bbox" to include information on the coordinate range
Expand All @@ -40,5 +40,5 @@ public interface GeoJson {
* the contained geometries
* @since 3.0.0
*/
BoundingBox bbox();
public abstract BoundingBox bbox();
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @since 1.0.0
*/
public interface Geometry extends GeoJson {
public abstract class Geometry extends GeoJson {

/**
* Create a new instance of this class by passing in a formatted valid JSON String.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
* @since 1.0.0
*/
@AutoValue
public abstract class GeometryCollection implements Geometry, Serializable {
public abstract class GeometryCollection extends Geometry implements Serializable {

private static final String TYPE = "GeometryCollection";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
* @since 1.0.0
*/
@AutoValue
public abstract class LineString implements CoordinateContainer<List<Point>>, Serializable {
public abstract class LineString extends CoordinateContainer<List<Point>>
implements Serializable {

private static final String TYPE = "LineString";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
* @since 1.0.0
*/
@AutoValue
public abstract class MultiLineString
implements CoordinateContainer<List<List<Point>>>, Serializable {
public abstract class MultiLineString extends CoordinateContainer<List<List<Point>>>
implements Serializable {

private static final String TYPE = "MultiLineString";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
* @since 1.0.0
*/
@AutoValue
public abstract class MultiPoint implements CoordinateContainer<List<Point>>, Serializable {
public abstract class MultiPoint extends CoordinateContainer<List<Point>>
implements Serializable {

private static final String TYPE = "MultiPoint";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
* @since 1.0.0
*/
@AutoValue
public abstract class MultiPolygon
implements CoordinateContainer<List<List<List<Point>>>>, Serializable {
public abstract class MultiPolygon extends CoordinateContainer<List<List<List<Point>>>>
implements Serializable {

private static final String TYPE = "MultiPolygon";

Expand Down
3 changes: 2 additions & 1 deletion services-geojson/src/main/java/com/mapbox/geojson/Point.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
* @since 1.0.0
*/
@AutoValue
public abstract class Point implements CoordinateContainer<List<Double>>, Serializable {
public abstract class Point extends CoordinateContainer<List<Double>>
implements Serializable {

private static final String TYPE = "Point";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
* @since 1.0.0
*/
@AutoValue
public abstract class Polygon implements CoordinateContainer<List<List<Point>>>, Serializable {
public abstract class Polygon extends CoordinateContainer<List<List<Point>>>
implements Serializable {

private static final String TYPE = "Polygon";

Expand Down