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 15:16:19 UTC

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

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

 ##########
 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:
   Does it mean that we should change the following to it?
   https://github.com/apache/netbeans/blob/1ee4fdb02036bd3d626a1484181a9b9a7bc785e1/php/php.code.analysis/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParser.java#L59
   
   e.g.
   ```java
       @Nullable
       private final FileObject workDir;
       private PHPStanReportParser(FileObject root, File workDir) throws SAXException {
           this.xmlReader = FileUtils.createXmlReader();
           this.root = root;
           this.workDir = FileUtil.toFileObject(workDir);
       }
   ```

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