Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BRMO-386] Upgrade itextpdf.version van 8.0.5 naar 9.0.0 #2311

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
Expand Down Expand Up @@ -53,7 +52,7 @@
}

public void check() {
afgiftes.forEach((afgifte) -> check(afgifte));
afgiftes.forEach(this::check);

Check warning on line 55 in brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgifteChecker.java

View check run for this annotation

Codecov / codecov/patch

brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgifteChecker.java#L55

Added line #L55 was not covered by tests
}

/**
Expand Down Expand Up @@ -85,22 +84,21 @@
List<Bericht> berichten = staging.getBerichtByLaadProces(lp);
Map<Bericht.STATUS, Integer> counts = afgifte.getStatussen();
berichten.stream()
.map(
.peek(

Check warning on line 87 in brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgifteChecker.java

View check run for this annotation

Codecov / codecov/patch

brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgifteChecker.java#L87

Added line #L87 was not covered by tests
(bericht) -> {
if (!counts.containsKey(bericht.getStatus())) {
counts.put(bericht.getStatus(), 0);
}
return bericht;
})
.forEachOrdered(
(bericht) -> counts.put(bericht.getStatus(), counts.get(bericht.getStatus()) + 1));
}

public File getResults(String input, String f) throws FileNotFoundException {
public File getResults(String input, String f) throws IOException {
return getResults(input, new File(f));
}

public File getResults(String input, File f) throws FileNotFoundException {
public File getResults(String input, File f) throws IOException {
AfgiftelijstReport reporter = new AfgiftelijstReport();

reporter.createReport(afgiftes, input, f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

import com.itextpdf.io.font.constants.StandardFonts;
import com.itextpdf.kernel.colors.DeviceRgb;
import com.itextpdf.kernel.events.Event;
import com.itextpdf.kernel.events.IEventHandler;
import com.itextpdf.kernel.events.PdfDocumentEvent;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.font.PdfFontFactory;
import com.itextpdf.kernel.geom.PageSize;
Expand All @@ -29,6 +26,9 @@
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEvent;
import com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEventHandler;
import com.itextpdf.kernel.pdf.event.PdfDocumentEvent;
import com.itextpdf.kernel.pdf.xobject.PdfFormXObject;
import com.itextpdf.layout.Canvas;
import com.itextpdf.layout.Document;
Expand All @@ -41,7 +41,6 @@
import com.itextpdf.layout.element.Table;
import com.itextpdf.layout.properties.TextAlignment;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
Expand All @@ -64,7 +63,7 @@
private String datum;

public void createReport(List<Afgifte> afgiftes, String inputFileName, File output)
throws FileNotFoundException {
throws IOException {
datum = sdf.format(new Date());
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(output));

Expand Down Expand Up @@ -151,21 +150,21 @@
}

private String getStatusString(Afgifte afgifte) {
String res = "";
StringBuilder res = new StringBuilder();

Check warning on line 153 in brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java

View check run for this annotation

Codecov / codecov/patch

brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java#L153

Added line #L153 was not covered by tests
Map<STATUS, Integer> stati = afgifte.getStatussen();
for (STATUS status : stati.keySet()) {
if (!res.isEmpty()) {
res += "\n";
res.append("\n");

Check warning on line 157 in brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java

View check run for this annotation

Codecov / codecov/patch

brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java#L157

Added line #L157 was not covered by tests
}
res += status.name() + ":" + stati.get(status);
res.append(status.name()).append(":").append(stati.get(status));

Check warning on line 159 in brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java

View check run for this annotation

Codecov / codecov/patch

brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java#L159

Added line #L159 was not covered by tests
}
if (res.isEmpty()) {
res = "-";
res = new StringBuilder("-");

Check warning on line 162 in brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java

View check run for this annotation

Codecov / codecov/patch

brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java#L162

Added line #L162 was not covered by tests
}
return res;
return res.toString();

Check warning on line 164 in brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java

View check run for this annotation

Codecov / codecov/patch

brmo-loader/src/main/java/nl/b3p/brmo/loader/checks/AfgiftelijstReport.java#L164

Added line #L164 was not covered by tests
}

protected class Footer implements IEventHandler {
protected class Footer extends AbstractPdfDocumentEventHandler {

protected PdfFormXObject placeholder;
protected float side = 20;
Expand All @@ -179,7 +178,7 @@
}

@Override
public void handleEvent(Event event) {
public void onAcceptedEvent(AbstractPdfDocumentEvent event) {
PdfDocumentEvent docEvent = (PdfDocumentEvent) event;
PdfDocument pdf = docEvent.getDocument();
PdfPage page = docEvent.getPage();
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<geotools.version>32.1</geotools.version>
<jdbc-util.version>18.1</jdbc-util.version>
<jts.version>1.20.0</jts.version>
<itextpdf.version>8.0.5</itextpdf.version>
<itextpdf.version>9.0.0</itextpdf.version>
<postgresql.jdbc.version>42.7.4</postgresql.jdbc.version>
<postgresql.postgis-jdbc.version>2024.1.0</postgresql.postgis-jdbc.version>
<oracle.jdbc.version>23.6.0.24.10</oracle.jdbc.version>
Expand Down
Loading