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


##########
java/java.source.base/src/org/netbeans/modules/java/source/parsing/PatchModuleFileManager.java:
##########
@@ -296,7 +296,8 @@ public FileObject getFileForOutput(Location location, 
String packageName, String
 
     private Location fixLocation(Location input) throws IOException {
         if (input == StandardLocation.CLASS_OUTPUT && overrideModuleName != 
null) {
-            return this.moduleLocations.stream().filter(pl -> 
overrideModuleName.equals(pl.getModuleName())).map(pl -> (Location) 
pl).findAny().orElse(input);
+            return moduleLocations(StandardLocation.PATCH_MODULE_PATH)
+                    .stream().filter(pl -> 
overrideModuleName.equals(pl.getModuleName())).map(pl -> (Location) 
pl).findAny().orElse(input);

Review Comment:
   this looks good to me, I actually wanted to propose the same but you were 
faster this time :)
   
   The confusing part while looking through the code however was that 
`moduleLocations(foo)` only allows foo to be the constant 
`StandardLocation.PATCH_MODULE_PATH`, everything else throws an exception. So 
it would be more intuitive to simply make that a `getModueLocations()` without 
parameter - probably also less error prone since it does what you expect it to 
do.



-- 
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