Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
5a4d0a74
Commit
5a4d0a74
authored
Aug 13, 2024
by
Riegel
Browse files
Extracted method. Ref
#69
parent
59e8a24d
Pipeline
#10055
passed with stage
in 1 minute and 11 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfStreamReporter.java
View file @
5a4d0a74
...
...
@@ -393,21 +393,7 @@ public class PdfStreamReporter implements StreamReporter {
@Override
public
void
finishReport
()
throws
CheckReportWriteException
{
if
(
buildings
!=
null
)
{
for
(
Section
s
:
buildings
.
getSubSections
())
{
if
(!
s
.
hasErrors
())
{
numOkBuildings
++;
// building has no errors, no table
continue
;
}
numErrorBuildings
++;
Table
t
=
new
Table
(
2
);
t
.
setTableColumnWidth
(
75
,
25
);
t
.
setTitle
(
"Error"
,
"Count"
);
for
(
Entry
<
String
,
AtomicInteger
>
e
:
s
.
getStats
().
getErrorCounts
().
entrySet
())
{
t
.
addRow
(
e
.
getKey
(),
e
.
getValue
().
toString
());
}
s
.
addTable
(
1
,
t
);
}
countFinishedReportBuildings
();
}
int
numBuildings
=
numErrorBuildings
+
numOkBuildings
;
if
(
numBuildings
>
0
)
{
...
...
@@ -446,6 +432,24 @@ public class PdfStreamReporter implements StreamReporter {
report
.
save
(
outFile
);
}
private
void
countFinishedReportBuildings
()
{
for
(
Section
s
:
buildings
.
getSubSections
())
{
if
(!
s
.
hasErrors
())
{
numOkBuildings
++;
// building has no errors, no table
continue
;
}
numErrorBuildings
++;
Table
t
=
new
Table
(
2
);
t
.
setTableColumnWidth
(
75
,
25
);
t
.
setTitle
(
"Error"
,
"Count"
);
for
(
Entry
<
String
,
AtomicInteger
>
e
:
s
.
getStats
().
getErrorCounts
().
entrySet
())
{
t
.
addRow
(
e
.
getKey
(),
e
.
getValue
().
toString
());
}
s
.
addTable
(
1
,
t
);
}
}
@Override
public
void
reportGlobalError
(
CheckError
err
)
{
AtomicInteger
errorCount
=
errorStatistics
.
computeIfAbsent
(
err
.
getErrorId
(),
k
->
new
AtomicInteger
(
0
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment