From 9c9bba8c3f31f3ef1cb4f868eaac2e13e6e2c0b9 Mon Sep 17 00:00:00 2001 From: Henry Coles Date: Fri, 1 Nov 2024 15:00:54 +0000 Subject: [PATCH] remove use of reflection based toString generator The reflection based toString generator fails on some modern jvms as apache commons tries to parse out the version of Java, but fails due to outdated assumptions. Not clear why it's inmportant to have a toString method here, but replacing with an autogenerated one should solve #1358. Implementation excludes logger and sink form toString as it's unclear how they would be useful. --- pitest-entry/pom.xml | 2 +- .../report/generator/ReportGenerationContext.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pitest-entry/pom.xml b/pitest-entry/pom.xml index a7f2e2293..947301fd5 100644 --- a/pitest-entry/pom.xml +++ b/pitest-entry/pom.xml @@ -133,7 +133,7 @@ org.apache.commons commons-text - 1.10.0 + 1.12.0 diff --git a/pitest-maven/src/main/java/org/pitest/maven/report/generator/ReportGenerationContext.java b/pitest-maven/src/main/java/org/pitest/maven/report/generator/ReportGenerationContext.java index 61714455a..042547e75 100644 --- a/pitest-maven/src/main/java/org/pitest/maven/report/generator/ReportGenerationContext.java +++ b/pitest-maven/src/main/java/org/pitest/maven/report/generator/ReportGenerationContext.java @@ -18,8 +18,6 @@ import java.util.List; import java.util.Locale; -import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.commons.lang.builder.ToStringStyle; import org.apache.maven.doxia.sink.Sink; import org.apache.maven.plugin.logging.Log; @@ -97,8 +95,11 @@ public void setSourceDataFormats(List sourceDataFormats) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this, - ToStringStyle.MULTI_LINE_STYLE); + return "ReportGenerationContext{" + + "locale=" + locale + + ", reportsDataDirectory=" + reportsDataDirectory + + ", siteDirectory=" + siteDirectory + + ", sourceDataFormats=" + sourceDataFormats + + '}'; } - }