This is an automated email from the ASF dual-hosted git repository.
lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new f4b4a52 Fix NPE summary may be null
f4b4a52 is described below
commit f4b4a525b980c5465df58476f76fe227219576f2
Author: Eric Barboni <[email protected]>
AuthorDate: Fri Apr 23 12:51:48 2021 +0200
Fix NPE summary may be null
---
.../gsf/codecoverage/CoverageReportTopComponent.java | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git
a/ide/gsf.codecoverage/src/org/netbeans/modules/gsf/codecoverage/CoverageReportTopComponent.java
b/ide/gsf.codecoverage/src/org/netbeans/modules/gsf/codecoverage/CoverageReportTopComponent.java
index bdca717..6888b99 100644
---
a/ide/gsf.codecoverage/src/org/netbeans/modules/gsf/codecoverage/CoverageReportTopComponent.java
+++
b/ide/gsf.codecoverage/src/org/netbeans/modules/gsf/codecoverage/CoverageReportTopComponent.java
@@ -167,9 +167,7 @@ final class CoverageReportTopComponent extends TopComponent
{
// sorter.setComparator(i, comparableComparator);
// }
totalCoverage.setCoveragePercentage(model.getTotalCoverage());
- FileCoverageSummary summary = model.getCoverageSummary();
- totalCoverage.setStats(summary.getLineCount(),
summary.getExecutedLineCount(),
- summary.getPartialCount(), summary.getInferredCount());
+ updateStats();
}
public void resizeColumnWidth(JTable table) {
@@ -363,12 +361,18 @@ final class CoverageReportTopComponent extends
TopComponent {
model = new CoverageTableModel(results);
table.setModel(model);
totalCoverage.setCoveragePercentage(model.getTotalCoverage());
- FileCoverageSummary summary = model.getCoverageSummary();
- totalCoverage.setStats(summary.getLineCount(),
summary.getExecutedLineCount(),
- summary.getPartialCount(), summary.getInferredCount());
+ updateStats();
resizeColumnWidth(table);
}
+ private void updateStats() {
+ FileCoverageSummary summary = model.getCoverageSummary();
+ if (summary != null) {
+ totalCoverage.setStats(summary.getLineCount(),
summary.getExecutedLineCount(),
+ summary.getPartialCount(), summary.getInferredCount());
+ }
+ }
+
private static class CoverageTableModel implements TableModel {
List<FileCoverageSummary> results;
---------------------------------------------------------------------
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