Skip to content

Commit af205f4

Browse files
authored
Fixing problem that when there are references the reference Aspect Model will not load (#46)
1 parent 4d2e71b commit af205f4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/org/eclipse/esmf/ame/model/validation/ViolationError.java

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

1414
package org.eclipse.esmf.ame.model.validation;
1515

16+
import java.util.ArrayList;
1617
import java.util.List;
1718

1819
import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn;
@@ -37,7 +38,7 @@ public class ViolationError {
3738

3839
@JsonInclude( JsonInclude.Include.NON_NULL )
3940
@JsonProperty( "fix" )
40-
private List<String> fix;
41+
private List<String> fix = new ArrayList<>();
4142

4243
@JsonInclude( JsonInclude.Include.NON_NULL )
4344
@JsonProperty( "errorCode" )

src/main/java/org/eclipse/esmf/ame/resolver/strategy/InMemoryStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ protected Try<Model> getModelFromFileSystem( final AspectModelUrn aspectModelUrn
4949
final Path file = fileSystem.getPath( filePath );
5050

5151
if ( Files.exists( file ) ) {
52-
return loadTurtleFromFile( new File( Files.readString( file ) ) );
52+
return Try.of( () -> loadTurtleFromString( Files.readString( file ) ) );
5353
}
5454

5555
LOG.warn( "Looking for {}, but no {}.ttl was found. Inspecting files in {}", aspectModelUrn.getName(),
5656
aspectModelUrn.getName(), filePath );
5757

5858
Optional<Try<Model>> modelWithDefinition = pathStream
5959
.filter( Files::isRegularFile )
60-
.map( Path::getFileName )
60+
.map( Path::toAbsolutePath )
6161
.map( Path::toString )
6262
.map( fileSystem::getPath )
6363
.map( aspectModelPath -> Try.of( () -> loadTurtleFromString( Files.readString( aspectModelPath ) ) ) )

0 commit comments

Comments
 (0)