This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git
The following commit(s) were added to refs/heads/master by this push:
new f91530c433 [GH-2321] Remove unnecessary commons-lang dependency (#2322)
f91530c433 is described below
commit f91530c43326fb5c4c34e209bc35175138d489d2
Author: Jia Yu <[email protected]>
AuthorDate: Fri Aug 29 13:13:01 2025 -0700
[GH-2321] Remove unnecessary commons-lang dependency (#2322)
---
pom.xml | 5 -----
spark-shaded/pom.xml | 1 -
spark/common/pom.xml | 4 ----
.../src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java | 5 ++---
.../java/org/apache/sedona/core/spatialRDD/SpatialRDDWriterTest.java | 5 ++---
5 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/pom.xml b/pom.xml
index 8d0b697951..3687c1b6a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -328,11 +328,6 @@
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
diff --git a/spark-shaded/pom.xml b/spark-shaded/pom.xml
index 119a335a6e..b4c287d675 100644
--- a/spark-shaded/pom.xml
+++ b/spark-shaded/pom.xml
@@ -236,7 +236,6 @@
<exclude>org.scala-lang:scala-library</exclude>
<exclude>org.apache.commons:commons-*</exclude>
<exclude>commons-pool:commons-pool</exclude>
-
<exclude>commons-lang:commons-lang</exclude>
<exclude>commons-io:commons-io</exclude>
<exclude>commons-logging:commons-logging</exclude>
</excludes>
diff --git a/spark/common/pom.xml b/spark/common/pom.xml
index 4f8265be5c..9d12005319 100644
--- a/spark/common/pom.xml
+++ b/spark/common/pom.xml
@@ -130,10 +130,6 @@
<groupId>edu.ucar</groupId>
<artifactId>cdm-core</artifactId>
</dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
diff --git
a/spark/common/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
b/spark/common/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
index 2cfc661a64..5d77e14766 100644
---
a/spark/common/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
+++
b/spark/common/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
@@ -25,7 +25,6 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.lang.NullArgumentException;
import org.apache.log4j.Logger;
import org.apache.sedona.common.FunctionsGeoTools;
import org.apache.sedona.common.jts2geojson.GeoJSONWriter;
@@ -542,7 +541,7 @@ public class SpatialRDD<T extends Geometry> implements
Serializable {
*/
public void saveAsWKB(String outputLocation) {
if (this.rawSpatialRDD == null) {
- throw new NullArgumentException("save as WKB cannot operate on null
RDD");
+ throw new IllegalArgumentException("save as WKB cannot operate on null
RDD");
}
this.rawSpatialRDD
.mapPartitions(
@@ -571,7 +570,7 @@ public class SpatialRDD<T extends Geometry> implements
Serializable {
/** Save as WKT */
public void saveAsWKT(String outputLocation) {
if (this.rawSpatialRDD == null) {
- throw new NullArgumentException("save as WKT cannot operate on null
RDD");
+ throw new IllegalArgumentException("save as WKT cannot operate on null
RDD");
}
this.rawSpatialRDD
.mapPartitions(
diff --git
a/spark/common/src/test/java/org/apache/sedona/core/spatialRDD/SpatialRDDWriterTest.java
b/spark/common/src/test/java/org/apache/sedona/core/spatialRDD/SpatialRDDWriterTest.java
index 997d3d43ce..cea2ba9fd6 100644
---
a/spark/common/src/test/java/org/apache/sedona/core/spatialRDD/SpatialRDDWriterTest.java
+++
b/spark/common/src/test/java/org/apache/sedona/core/spatialRDD/SpatialRDDWriterTest.java
@@ -25,7 +25,6 @@ import java.io.File;
import java.io.IOException;
import java.util.List;
import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.NullArgumentException;
import org.apache.sedona.common.enums.FileDataSplitter;
import org.apache.sedona.common.utils.GeomUtils;
import org.junit.AfterClass;
@@ -137,8 +136,8 @@ public class SpatialRDDWriterTest extends
SpatialRDDTestBase {
verifyResult(resultWKT.rawSpatialRDD.takeOrdered(5),
spatialRDD.rawSpatialRDD.takeOrdered(5));
}
- /** Test throws NullArgumentException when Spatial RDD is null. */
- @Test(expected = NullArgumentException.class)
+ /** Test throws IllegalArgumentException when Spatial RDD is null. */
+ @Test(expected = IllegalArgumentException.class)
public void testSaveAsEmptyWKB() {
PointRDD emptySpatialRDD = new PointRDD();