Skip to content

Commit

Permalink
Replace packages incompatible with Java >8 (#475)
Browse files Browse the repository at this point in the history
As Java 8 is officially unsopported since January, we have to upgrade to
a newer version as soon as possible. This commit replaces packages which
are not supported with Java 9/10 by packages that are still compatible
with Java 8.

Fixes #474.
  • Loading branch information
sfendrich authored and Adam Rousell committed Mar 26, 2019
1 parent fab5463 commit c2f0aa5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Enable > 2 waypoints when geometry_simplify=true (#457)
### Changed
- Updated pom to always build ors.war (Issue #432)
- Replace usage of packages incompatible with Java >8 (#474)
### Deprecated
-

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

package heigit.ors.api.requests.routing;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jdk.nashorn.internal.ir.annotations.Ignore;

@ApiModel(value = "Profile Weightings", parent = RequestProfileParams.class, description = "Describe additional weightings to be applied to edges on the routing.")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
Expand All @@ -32,21 +32,21 @@ public class RequestProfileParamsWeightings {
"\n level: 0 = Novice, 1 = Moderate, 2 = Amateur, 3 = Pro. The prefered gradient increases with level. CUSTOM_KEYS:{'validWhen':{'ref':'profile','value':['cycling-*']}}", example = "2")
@JsonProperty(PARAM_STEEPNESS_DIFFICULTY)
private Integer steepnessDifficulty;
@Ignore
@JsonIgnore
private boolean hasSteepnessDifficulty = false;

@ApiModelProperty(name = PARAM_GREEN_INDEX, value = "Specifies the Green factor for `foot-*` profiles.\n" +
"\nfactor: Values range from 0 to 1. 0 equals normal routing. 1 will prefer ways through green areas over a shorter route. CUSTOM_KEYS:{'validWhen':{'ref':'profile','value':['foot-*']}}", example = "0.4")
@JsonProperty(PARAM_GREEN_INDEX)
private Float greenIndex;
@Ignore
@JsonIgnore
private boolean hasGreenIndex = false;

@ApiModelProperty(name = PARAM_QUIETNESS, value = "Specifies the Quiet factor for foot-* profiles.\n" +
"\nfactor: Values range from 0 to 1. 0 equals normal routing. 1 will prefer quiet ways over a shorter route. CUSTOM_KEYS:{'validWhen':{'ref':'profile','value':['foot-*']}}", example = "0.8")
@JsonProperty(PARAM_QUIETNESS)
private Float quietIndex;
@Ignore
@JsonIgnore
private boolean hasQuietIndex = false;

public Integer getSteepnessDifficulty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@

package heigit.ors.globalResponseProcessor.gpx.beans;

import com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import javax.xml.bind.JAXBException;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;

Expand All @@ -42,9 +43,9 @@ public class XMLBuilderTest {
* This class initializes the dummy Gpx.class object
*/
@BeforeClass
public static void setUp() {
public static void setUp() throws DatatypeConfigurationException {
// Time Element
XMLGregorianCalendar cal = new XMLGregorianCalendarImpl();
XMLGregorianCalendar cal = DatatypeFactory.newInstance().newXMLGregorianCalendar();
cal.setTime(0, 0, 0, 0);
// template value
BigDecimal bigDecimal = BigDecimal.valueOf(0.0);
Expand Down Expand Up @@ -239,4 +240,4 @@ public void testBuild() throws JAXBException {
" </extensions>\n" +
"</gpx>\n", result);
}
}
}

0 comments on commit c2f0aa5

Please sign in to comment.