-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
…urce
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -696,7 +696,12 @@ private Model readFileModel( ModelBuildingRequest request, | |
intoCache( request.getModelCache(), modelSource, ModelCacheTag.FILE, model ); | ||
if ( modelSource instanceof FileModelSource ) | ||
{ | ||
intoCache( request.getModelCache(), getGroupId( model ), model.getArtifactId(), modelSource ); | ||
if ( request.getTransformerContextBuilder() instanceof DefaultTransformerContextBuilder ) | ||
{ | ||
DefaultTransformerContextBuilder contextBuilder = | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gnodet
Author
Owner
|
||
(DefaultTransformerContextBuilder) request.getTransformerContextBuilder(); | ||
contextBuilder.context.putSource( getGroupId( model ), model.getArtifactId(), modelSource ); | ||
} | ||
} | ||
|
||
return model; | ||
|
@@ -1543,14 +1548,6 @@ private <T> void intoCache( ModelCache modelCache, String groupId, String artifa | |
} | ||
} | ||
|
||
private <T> void intoCache( ModelCache modelCache, String groupId, String artifactId, Source source ) | ||
{ | ||
if ( modelCache != null ) | ||
{ | ||
modelCache.put( groupId, artifactId, source ); | ||
} | ||
} | ||
|
||
private <T> void intoCache( ModelCache modelCache, Source source, ModelCacheTag<T> tag, T data ) | ||
{ | ||
if ( modelCache != null ) | ||
|
@@ -1572,16 +1569,6 @@ private static <T> T fromCache( ModelCache modelCache, String groupId, String ar | |
} | ||
return null; | ||
} | ||
|
||
private static Source fromCache( ModelCache modelCache, String groupId, String artifactId ) | ||
{ | ||
if ( modelCache != null ) | ||
{ | ||
return modelCache.get( groupId, artifactId ); | ||
} | ||
return null; | ||
} | ||
|
||
|
||
private static <T> T fromCache( ModelCache modelCache, Source source, ModelCacheTag<T> tag ) | ||
{ | ||
|
@@ -1845,7 +1832,7 @@ public Model getRawModel( Path path ) | |
|
||
private Model findRawModel( String groupId, String artifactId ) | ||
{ | ||
Source source = fromCache( request.getModelCache(), groupId, artifactId ); | ||
Source source = context.getSource( groupId, artifactId ); | ||
if ( source != null ) | ||
{ | ||
try | ||
|
1 comment
on commit 497e7fe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I see some code movements, so I'm not so worried. I agree that the cache looks again more as intended.
this is something I wanted to avoid: casting to get access to certain methods. But I think I had that issue too.