Merge pull request #454 from lionsoul2014/fr_java_config_builder_assert

assert the builder data source args to avoid errors like reported on…
This commit is contained in:
Leon / 狮子的魂 2026-02-28 15:24:24 +08:00 committed by GitHub
commit 3d21a8247c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -4,7 +4,7 @@
<groupId>org.lionsoul</groupId> <groupId>org.lionsoul</groupId>
<artifactId>ip2region</artifactId> <artifactId>ip2region</artifactId>
<version>3.3.4</version> <version>3.3.5</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>ip2region</name> <name>ip2region</name>

View File

@ -49,16 +49,19 @@ public class ConfigBuilder {
} }
public ConfigBuilder setXdbPath(String xdbPath) { public ConfigBuilder setXdbPath(String xdbPath) {
assert xdbPath != null && xdbPath.length() > 0;
this.xdbPath = xdbPath; this.xdbPath = xdbPath;
return this; return this;
} }
public ConfigBuilder setXdbFile(File xdbFile) { public ConfigBuilder setXdbFile(File xdbFile) {
assert xdbFile != null;
this.xdbFile = xdbFile; this.xdbFile = xdbFile;
return this; return this;
} }
public ConfigBuilder setXdbInputStream(InputStream xdbInputStream) { public ConfigBuilder setXdbInputStream(InputStream xdbInputStream) {
assert xdbInputStream != null;
this.xdbInputStream = xdbInputStream; this.xdbInputStream = xdbInputStream;
return this; return this;
} }