[jira] [Commented] (NETBEANS-3002) NullPointerExceptions during PHPStan inspection
[ https://issues.apache.org/jira/browse/NETBEANS-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16959482#comment-16959482 ] Junichi Yamamoto commented on NETBEANS-3002: [~czukowski] I see, Thank you! > NullPointerExceptions during PHPStan inspection > --- > > Key: NETBEANS-3002 > URL: https://issues.apache.org/jira/browse/NETBEANS-3002 > Project: NetBeans > Issue Type: Bug > Components: php - Code Analysis >Affects Versions: 11.0, 11.1 > Environment: Windows 10 >Reporter: Czukowski >Assignee: Junichi Yamamoto >Priority: Major > Labels: pull-request-available > Attachments: PHPStanException.zip > > Time Spent: 10m > Remaining Estimate: 0h > > PHPStan code analysis support reports NullPointerExceptions at some > occasions. When the exception occurs, the Inspect dialog window is not closed > on its own. > I've been able to reproduce it using the uploaded sample project. Run > {{composer install}}, then configure NetBeans to use PHPStan from > {{vendor/bin}} and the configuration from {{phpstan.neon}} file in the > project root. > The configuration file contains {{ignoreErrors}} section with a pattern to > ignore known errors. The exception seems to depend on whether this pattern is > there or not (to disable, comment the line with {{#}}). > To reproduce, select the {{app}} folder and run PHPStan inspection with the > scope: Current folder (app). > With the setup above I've encountered two types of the stack traces: > *Without ignore pattern (commented line)* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at org.netbeans.modules.php.analysis.util.Mappers.map(Mappers.java:54) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.doAnalyze(PHPStanAnalyzerImpl.java:140) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.analyze(PHPStanAnalyzerImpl.java:92) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.doRunAnalyzer(RunAnalysis.java:186) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.run(RunAnalysis.java:142) > at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [catch] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > {code} > *With ignore pattern* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.sanitizeFileName(PHPStanReportParser.java:199) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.getCurrentFile(PHPStanReportParser.java:180) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.processFileStart(PHPStanReportParser.java:133) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.startElement(PHPStanReportParser.java:114) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1397) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) > at > j
[jira] [Commented] (NETBEANS-3002) NullPointerExceptions during PHPStan inspection
[ https://issues.apache.org/jira/browse/NETBEANS-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16959475#comment-16959475 ] Czukowski commented on NETBEANS-3002: - [~junichi11] yes, I checked in NetBeans, mingw (git bash console) and cmd, and in all three cases I got windows-style directory separators. > NullPointerExceptions during PHPStan inspection > --- > > Key: NETBEANS-3002 > URL: https://issues.apache.org/jira/browse/NETBEANS-3002 > Project: NetBeans > Issue Type: Bug > Components: php - Code Analysis >Affects Versions: 11.0, 11.1 > Environment: Windows 10 >Reporter: Czukowski >Assignee: Junichi Yamamoto >Priority: Major > Labels: pull-request-available > Attachments: PHPStanException.zip > > Time Spent: 10m > Remaining Estimate: 0h > > PHPStan code analysis support reports NullPointerExceptions at some > occasions. When the exception occurs, the Inspect dialog window is not closed > on its own. > I've been able to reproduce it using the uploaded sample project. Run > {{composer install}}, then configure NetBeans to use PHPStan from > {{vendor/bin}} and the configuration from {{phpstan.neon}} file in the > project root. > The configuration file contains {{ignoreErrors}} section with a pattern to > ignore known errors. The exception seems to depend on whether this pattern is > there or not (to disable, comment the line with {{#}}). > To reproduce, select the {{app}} folder and run PHPStan inspection with the > scope: Current folder (app). > With the setup above I've encountered two types of the stack traces: > *Without ignore pattern (commented line)* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at org.netbeans.modules.php.analysis.util.Mappers.map(Mappers.java:54) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.doAnalyze(PHPStanAnalyzerImpl.java:140) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.analyze(PHPStanAnalyzerImpl.java:92) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.doRunAnalyzer(RunAnalysis.java:186) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.run(RunAnalysis.java:142) > at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [catch] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > {code} > *With ignore pattern* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.sanitizeFileName(PHPStanReportParser.java:199) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.getCurrentFile(PHPStanReportParser.java:180) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.processFileStart(PHPStanReportParser.java:133) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.startElement(PHPStanReportParser.java:114) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1397) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) > at > java.xm
[jira] [Commented] (NETBEANS-3002) NullPointerExceptions during PHPStan inspection
[ https://issues.apache.org/jira/browse/NETBEANS-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16959014#comment-16959014 ] Junichi Yamamoto commented on NETBEANS-3002: [~czukowski] I have a question. In windows, you get not "" but ""? (I mean the directory separator.) > NullPointerExceptions during PHPStan inspection > --- > > Key: NETBEANS-3002 > URL: https://issues.apache.org/jira/browse/NETBEANS-3002 > Project: NetBeans > Issue Type: Bug > Components: php - Code Analysis >Affects Versions: 11.0, 11.1 > Environment: Windows 10 >Reporter: Czukowski >Assignee: Junichi Yamamoto >Priority: Major > Attachments: PHPStanException.zip > > > PHPStan code analysis support reports NullPointerExceptions at some > occasions. When the exception occurs, the Inspect dialog window is not closed > on its own. > I've been able to reproduce it using the uploaded sample project. Run > {{composer install}}, then configure NetBeans to use PHPStan from > {{vendor/bin}} and the configuration from {{phpstan.neon}} file in the > project root. > The configuration file contains {{ignoreErrors}} section with a pattern to > ignore known errors. The exception seems to depend on whether this pattern is > there or not (to disable, comment the line with {{#}}). > To reproduce, select the {{app}} folder and run PHPStan inspection with the > scope: Current folder (app). > With the setup above I've encountered two types of the stack traces: > *Without ignore pattern (commented line)* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at org.netbeans.modules.php.analysis.util.Mappers.map(Mappers.java:54) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.doAnalyze(PHPStanAnalyzerImpl.java:140) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.analyze(PHPStanAnalyzerImpl.java:92) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.doRunAnalyzer(RunAnalysis.java:186) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.run(RunAnalysis.java:142) > at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [catch] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > {code} > *With ignore pattern* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.sanitizeFileName(PHPStanReportParser.java:199) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.getCurrentFile(PHPStanReportParser.java:180) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.processFileStart(PHPStanReportParser.java:133) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.startElement(PHPStanReportParser.java:114) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1397) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) > at > java.xml/com.sun.org.apache.
[jira] [Commented] (NETBEANS-3002) NullPointerExceptions during PHPStan inspection
[ https://issues.apache.org/jira/browse/NETBEANS-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16958571#comment-16958571 ] Czukowski commented on NETBEANS-3002: - Yes, I think it warns about an unused ignore pattern in the configuration file, which is not an error in any of the inspected sources, but rather in the configuration itself, so there's no file name or error lines and column numbers. > NullPointerExceptions during PHPStan inspection > --- > > Key: NETBEANS-3002 > URL: https://issues.apache.org/jira/browse/NETBEANS-3002 > Project: NetBeans > Issue Type: Bug > Components: php - Code Analysis >Affects Versions: 11.0, 11.1 > Environment: Windows 10 >Reporter: Czukowski >Assignee: Junichi Yamamoto >Priority: Major > Attachments: PHPStanException.zip > > > PHPStan code analysis support reports NullPointerExceptions at some > occasions. When the exception occurs, the Inspect dialog window is not closed > on its own. > I've been able to reproduce it using the uploaded sample project. Run > {{composer install}}, then configure NetBeans to use PHPStan from > {{vendor/bin}} and the configuration from {{phpstan.neon}} file in the > project root. > The configuration file contains {{ignoreErrors}} section with a pattern to > ignore known errors. The exception seems to depend on whether this pattern is > there or not (to disable, comment the line with {{#}}). > To reproduce, select the {{app}} folder and run PHPStan inspection with the > scope: Current folder (app). > With the setup above I've encountered two types of the stack traces: > *Without ignore pattern (commented line)* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at org.netbeans.modules.php.analysis.util.Mappers.map(Mappers.java:54) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.doAnalyze(PHPStanAnalyzerImpl.java:140) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.analyze(PHPStanAnalyzerImpl.java:92) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.doRunAnalyzer(RunAnalysis.java:186) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.run(RunAnalysis.java:142) > at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [catch] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > {code} > *With ignore pattern* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.sanitizeFileName(PHPStanReportParser.java:199) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.getCurrentFile(PHPStanReportParser.java:180) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.processFileStart(PHPStanReportParser.java:133) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.startElement(PHPStanReportParser.java:114) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1397) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) > at > java.xml/co
[jira] [Commented] (NETBEANS-3002) NullPointerExceptions during PHPStan inspection
[ https://issues.apache.org/jira/browse/NETBEANS-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16958552#comment-16958552 ] Junichi Yamamoto commented on NETBEANS-3002: It seems that the values of name attributes are changed. old version (0.10.5): {code:xml} "/usr/bin/php" "/home/junichi11/phars/phpstan.phar" "analyse" "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" "--level=7" "/home/junichi11/Downloads/PHPStanException/app" {code} > NullPointerExceptions during PHPStan inspection > --- > > Key: NETBEANS-3002 > URL: https://issues.apache.org/jira/browse/NETBEANS-3002 > Project: NetBeans > Issue Type: Bug > Components: php - Code Analysis >Affects Versions: 11.0, 11.1 > Environment: Windows 10 >Reporter: Czukowski >Assignee: Junichi Yamamoto >Priority: Major > Attachments: PHPStanException.zip > > > PHPStan code analysis support reports NullPointerExceptions at some > occasions. When the exception occurs, the Inspect dialog window is not closed > on its own. > I've been able to reproduce it using the uploaded sample project. Run > {{composer install}}, then configure NetBeans to use PHPStan from > {{vendor/bin}} and the configuration from {{phpstan.neon}} file in the > project root. > The configuration file contains {{ignoreErrors}} section with a pattern to > ignore known errors. The exception seems to depend on whether this pattern is > there or not (to disable, comment the line with {{#}}). > To reproduce, select the {{app}} folder and run PHPStan inspection with the > scope: Current folder (app). > With the setup above I've encountered two types of the stack traces: > *Without ignore pattern (commented line)* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at org.netbeans.modules.php.analysis.util.Mappers.map(Mappers.java:54) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.doAnalyze(PHPStanAnalyzerImpl.java:140) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.analyze(PHPStanAnalyzerImpl.java:92) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.doRunAnalyzer(RunAnalysis.java:186) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.run(RunAnalysis.java:142) > at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [catch] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > {code} > *With ignore pattern* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.sanitizeFileName(PHPStanReportParser.java:199) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.getCurrentFile(PHPStanReportParser.java:180) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.processFileStart(PHPStanReportParser.java:133) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.startElement(PHPStanReportParser.java:114) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1397) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) > at > java.xml/com.sun.org.apache.xerces.int
[jira] [Commented] (NETBEANS-3002) NullPointerExceptions during PHPStan inspection
[ https://issues.apache.org/jira/browse/NETBEANS-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957578#comment-16957578 ] Junichi Yamamoto commented on NETBEANS-3002: Reproducible. Thanks for reporting it. > NullPointerExceptions during PHPStan inspection > --- > > Key: NETBEANS-3002 > URL: https://issues.apache.org/jira/browse/NETBEANS-3002 > Project: NetBeans > Issue Type: Bug > Components: php - Code Analysis >Affects Versions: 11.0, 11.1 > Environment: Windows 10 >Reporter: Czukowski >Assignee: Junichi Yamamoto >Priority: Major > Attachments: PHPStanException.zip > > > PHPStan code analysis support reports NullPointerExceptions at some > occasions. When the exception occurs, the Inspect dialog window is not closed > on its own. > I've been able to reproduce it using the uploaded sample project. Run > {{composer install}}, then configure NetBeans to use PHPStan from > {{vendor/bin}} and the configuration from {{phpstan.neon}} file in the > project root. > The configuration file contains {{ignoreErrors}} section with a pattern to > ignore known errors. The exception seems to depend on whether this pattern is > there or not (to disable, comment the line with {{#}}). > To reproduce, select the {{app}} folder and run PHPStan inspection with the > scope: Current folder (app). > With the setup above I've encountered two types of the stack traces: > *Without ignore pattern (commented line)* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at org.netbeans.modules.php.analysis.util.Mappers.map(Mappers.java:54) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.doAnalyze(PHPStanAnalyzerImpl.java:140) > at > org.netbeans.modules.php.analysis.PHPStanAnalyzerImpl.analyze(PHPStanAnalyzerImpl.java:92) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.doRunAnalyzer(RunAnalysis.java:186) > at > org.netbeans.modules.analysis.RunAnalysis$1$1.run(RunAnalysis.java:142) > at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [catch] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > {code} > *With ignore pattern* > Output: > {code} > "C:\Workspace\Test\PHPStanException\vendor\bin\phpstan.bat" "analyse" > "--no-ansi" "--no-progress" "--no-interaction" "--error-format=checkstyle" > "--level=5" "--configuration=C:\Workspace\Test\PHPStanException\phpstan.neon" > "C:\Workspace\Test\PHPStanException\app" > > > > > > > > > > > > > > Done. > {code} > Stack trace: > {code} > java.lang.NullPointerException > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.sanitizeFileName(PHPStanReportParser.java:199) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.getCurrentFile(PHPStanReportParser.java:180) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.processFileStart(PHPStanReportParser.java:133) > at > org.netbeans.modules.php.analysis.parsers.PHPStanReportParser.startElement(PHPStanReportParser.java:114) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1397) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) > at > java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) > at > java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParse