rfscholte commented on a change in pull request #192: [MNG-6261] - using java 
File api to compare
URL: https://github.com/apache/maven/pull/192#discussion_r234410160
 
 

 ##########
 File path: 
maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
 ##########
 @@ -852,10 +852,11 @@ private ModelData readParent( Model childModel, 
ModelSource childSource, ModelBu
                 File pomFile = parentData.getModel().getPomFile();
                 if ( pomFile != null )
                 {
+                    FileModelSource pomFileModel = new FileModelSource( 
pomFile );
                     ModelSource expectedParentSource = getParentPomFile( 
childModel, childSource );
 
                     if ( expectedParentSource == null || ( 
expectedParentSource instanceof ModelSource2
-                        && !pomFile.toURI().equals( ( (ModelSource2) 
expectedParentSource ).getLocationURI() ) ) )
+                        && !pomFileModel.equals(  expectedParentSource ) ) )
 
 Review comment:
   At first the comparison looked weird, i.e. comparing a Model with a Source. 
The comparison is good, just need to improve the name of the variables.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to