Skip to content
Closed
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
17 changes: 11 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ buildscript {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
}

dependencies {
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.5"
}

plugins {
id("com.github.spotbugs") version "6.1.9"
}

defaultTasks 'build'
Expand All @@ -27,6 +28,10 @@ configurations.configureEach {
}
}

import com.github.spotbugs.snom.Effort
import com.github.spotbugs.snom.Confidence


configure(subprojects.findAll { ['core', 'examples'].contains(it.name) }) {
apply plugin: 'java'
apply plugin: 'com.github.spotbugs'
Expand All @@ -46,10 +51,10 @@ configure(subprojects.findAll { ['core', 'examples'].contains(it.name) }) {
}

spotbugs {
toolVersion = "4.7.3" // com.github.spotbugs:spotbugs-annotations
toolVersion = "4.8.6" // com.github.spotbugs:spotbugs-annotations
reportsDir = file("$project.buildDir/reports/SpotBugsReports")
effort = "max"
reportLevel = "high"
effort = Effort.valueOf('MAX')
reportLevel = Confidence.valueOf('HIGH')
}

java {
Expand Down
17 changes: 12 additions & 5 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ configurations {

dependencies {
implementation(
'org.springframework:spring-core:5.3.39',
'org.springframework:spring-context:5.3.39',
'org.springframework:spring-web:5.3.39',
'org.springframework:spring-webmvc:5.3.39',
Expand Down Expand Up @@ -163,12 +164,18 @@ dependencies {
'org.geotools:gt-cql:33.0',
)
jasper(
'net.sf.jasperreports:jasperreports:6.21.4',
'net.sf.jasperreports:jasperreports-fonts:6.21.4',
'net.sf.jasperreports:jasperreports-functions:6.21.4',
'org.codehaus.groovy:groovy-all:3.0.23',
'ar.com.fdvs:DynamicJasper:5.3.9',
'joda-time:joda-time:2.13.1',
'com.itextpdf:itextpdf:5.5.13.4',
'joda-time:joda-time:2.14.0',
'net.sf.jasperreports:jasperreports:7.0.2',
'net.sf.jasperreports:jasperreports-excel-poi:7.0.2',
'net.sf.jasperreports:jasperreports-fonts:7.0.2',
'net.sf.jasperreports:jasperreports-functions:7.0.2',
'net.sf.jasperreports:jasperreports-json:7.0.2',
'net.sf.jasperreports:jasperreports-pdf:7.0.2',
'org.jfree:jcommon:1.0.24',
'org.apache.groovy:groovy-all:4.0.26',
'xalan:serializer:2.7.3',
)
implementation(
'org.slf4j:slf4j-api:2.0.16',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.List;
import javax.annotation.Nonnull;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.data.JsonDataSource;
import net.sf.jasperreports.json.data.JsonDataSource;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.mapfish.print.attribute.map;

import static org.mapfish.print.Constants.PDF_DPI;

import java.awt.Rectangle;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.geometry.jts.ReferencedEnvelope;
Expand Down Expand Up @@ -108,8 +106,7 @@ public Scale getNearestScale(

if (geodetic) {
newScale =
new Scale(
result.getScale(unit).getDenominator(PDF_DPI) * scaleRatio, getProjection(), dpi);
new Scale(result.getScale(unit).getDenominator(dpi) * scaleRatio, getProjection(), dpi);
} else {
newScale = result.getScale(unit);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public final Set<String> getTypeNames() {
.getBinding()
.getSimpleName();
final String styleRef = styleString != null ? styleString : geomType;

final StyleParser styleParser = AbstractFeatureSourceLayerPlugin.this.parser;
return OptionalUtils.or(
() -> template.getStyle(styleRef),
Expand All @@ -77,7 +76,11 @@ public final Set<String> getTypeNames() {
};
}

/** Sets the style parser for this feature source layer. */
/**
* Sets the style parser for this feature source layer.
*
* @param parser
*/
public final void setParser(final StyleParser parser) {
this.parser = parser;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.io.OutputStream;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.export.JRXlsExporter;
import net.sf.jasperreports.export.SimpleExporterInput;
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput;
import net.sf.jasperreports.poi.export.JRXlsExporter;

/** An PDF output format that uses Jasper reports to generate the result. */
public final class JasperReportExcelOutputFormat extends AbstractJasperReportOutputFormat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.PrintPageFormat;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.export.SimpleExporterInput;
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput;
import net.sf.jasperreports.export.SimplePdfExporterConfiguration;
import net.sf.jasperreports.export.type.PdfVersionEnum;
import net.sf.jasperreports.pdf.JRPdfExporter;
import net.sf.jasperreports.pdf.SimplePdfExporterConfiguration;
import net.sf.jasperreports.pdf.type.PdfVersionEnum;
import org.mapfish.print.config.PDFConfig;
import org.mapfish.print.processor.ExecutionStats;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import com.google.common.annotations.VisibleForTesting;
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfWriter;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfWriter;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
Expand Down Expand Up @@ -283,8 +283,9 @@ private URI createMergedGraphic(
int height = mapContext.getMapSize().height;

if ("pdf".equalsIgnoreCase(outputFormat)) {
try (com.lowagie.text.Document document =
new com.lowagie.text.Document(new com.lowagie.text.Rectangle(width, height))) {
try {
com.itextpdf.text.Document document =
new com.itextpdf.text.Document(new com.itextpdf.text.Rectangle(width, height));
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(mergedGraphic));
document.open();
PdfContentByte pdfCB = writer.getDirectContent();
Expand Down
26 changes: 26 additions & 0 deletions core/src/main/java/org/springframework/core/NestedIOException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.springframework.core;

import java.io.IOException;

public class NestedIOException extends IOException {

static {
NestedExceptionUtils.class.getName();
}

public NestedIOException(final String msg) {
super(msg);
}

public NestedIOException(final String msg, final Throwable cause) {
super(msg, cause);
}

/**
* @return something
*/
@Override
public String getMessage() {
return NestedExceptionUtils.buildMessage(super.getMessage(), getCause());
}
}
2 changes: 2 additions & 0 deletions core/src/main/java/org/springframework/core/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** Javadoc. */
package org.springframework.core;
Loading