mbien commented on code in PR #7158:
URL: https://github.com/apache/netbeans/pull/7158#discussion_r1525810870


##########
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/ParentVersionError.java:
##########
@@ -107,7 +108,17 @@ public List<ErrorDescription> 
getErrorsForDocument(POMModel model, Project prj)
                     if (parentPrj != null) {
                         NbMavenProject nbprj = 
parentPrj.getLookup().lookup(NbMavenProject.class);
                         if (nbprj != null) { //do we have some non-maven 
project maybe?
-                            MavenProject mav = nbprj.getMavenProject();
+                            MavenProject mav = nbprj.getMavenProject();  
+                            
if(PomModelUtils.isPropertyExpression(declaredVersion)){
+                                String key = 
PomModelUtils.getPropertyName(declaredVersion);
+                                String propVal = 
PomModelUtils.getProperty(model, declaredVersion);
+                                if(propVal != null){
+                                    declaredVersion = propVal;
+                                }
+                                else {
+                                    declaredVersion = 
mav.getProperties().getProperty(key, declaredVersion);
+                                }
+                            }

Review Comment:
   ```java
                               MavenProject mav = nbprj.getMavenProject();
                               if 
(PomModelUtils.isPropertyExpression(declaredVersion)) {
                                   String propVal = 
PomModelUtils.getProperty(model, declaredVersion);
                                   if (propVal != null) {
                                       declaredVersion = propVal;
                                   } else {
                                       String key = 
PomModelUtils.getPropertyName(declaredVersion);
                                       declaredVersion = 
mav.getProperties().getProperty(key, declaredVersion);
                                   }
                               }
   ```
   I think you are right, I did only format it and moved the key into the else 
branch. I am not 100% sure if the order is correct, e.g if it should check the 
parent first and the current pom second or if this is correct - but it makes 
sense.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to