Skip to content

Commit

Permalink
Merge pull request #256 from Fraunhofer-AISEC/hotfix/location-converter
Browse files Browse the repository at this point in the history
Hotfix: Do not use URI in LocationConverter
  • Loading branch information
konradweiss authored Oct 16, 2020
2 parents 0d674b6 + 9749b6b commit b752d4a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class LocationConverter implements CompositeAttributeConverter<PhysicalLo
public Map<String, ?> toGraphProperties(PhysicalLocation value) {
Map<String, Object> properties = new HashMap<>();
if (value != null) {
properties.put("artifact", value.getArtifactLocation().getUri());
properties.put("artifact", value.getArtifactLocation().getUri().toString());
properties.put("startLine", value.getRegion().getStartLine());
properties.put("endLine", value.getRegion().getEndLine());
properties.put("startColumn", value.getRegion().getStartColumn());
Expand All @@ -57,7 +57,7 @@ public PhysicalLocation toEntityAttribute(Map<String, ?> value) {
int endLine = toIntExact((Integer) value.get("endLine"));
int startColumn = toIntExact((Integer) value.get("startColumn"));
int endColumn = toIntExact((Integer) value.get("endColumn"));
URI uri = (URI) value.get("artifact");
URI uri = URI.create((String) value.get("artifact"));

return new PhysicalLocation(uri, new Region(startLine, startColumn, endLine, endColumn));
} catch (NullPointerException e) {
Expand Down

0 comments on commit b752d4a

Please sign in to comment.