You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/10/27 14:22:37 UTC

[GitHub] [netbeans] tmysik commented on a change in pull request #1592: [NETBEANS-3002] NullPointerExceptions during PHPStan inspection

tmysik commented on a change in pull request #1592: [NETBEANS-3002] NullPointerExceptions during PHPStan inspection
URL: https://github.com/apache/netbeans/pull/1592#discussion_r339345374
 
 

 ##########
 File path: php/php.code.analysis/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParser.java
 ##########
 @@ -184,6 +192,15 @@ private String getCurrentFile(String fileName) {
         }
         if (rootDirectory.isFolder()) {
             FileObject current = rootDirectory.getFileObject(sanitizedFileName);
+            if (current == null) {
+                // NETBANS-3022 try checking relative file path from working directory
+                if (workDir != null) {
+                    rootDirectory = FileUtil.toFileObject(workDir);
 
 Review comment:
   Nitpick: Although cached, this is quite a time-consuming operation. Consider adding a class field
   
   ```java
   @Nullable
   private final FileObject workDir;
   ```
   
   But this is really just a note, not a problem at all, of course.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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