Skip to content

Commit

Permalink
Remove support for JDK 1.3 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Apr 26, 2024
1 parent 37cfc68 commit 9bc0101
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 133 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,6 @@
<version>2.4.21</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>oro</groupId>
<artifactId>oro</artifactId>
<version>2.0.8</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
Expand Down
64 changes: 0 additions & 64 deletions src/main/java/net/sf/json/regexp/Perl5RegexpMatcher.java

This file was deleted.

29 changes: 2 additions & 27 deletions src/main/java/net/sf/json/regexp/RegexpUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,18 @@
* @author Andres Almiray <a href="mailto:[email protected]">[email protected]</a>
*/
public class RegexpUtils {
private static String javaVersion = "1.3.1";

static {
javaVersion = System.getProperty("java.version");
}

/**
* Returns a RegexpMatcher that works in a specific environment.<br>
* When in a JVM 1.3.1 it will return a Perl5RegexpMatcher, if the JVM is
* younger (1.4+) it will return a JdkRegexpMatcher.
*/
public static RegexpMatcher getMatcher(String pattern) {
if (isJDK13()) {
return new Perl5RegexpMatcher(pattern);
} else {
return new JdkRegexpMatcher(pattern);
}
return new JdkRegexpMatcher(pattern);
}

/**
* Returns a RegexpMatcher that works in a specific environment.<br>
* When in a JVM 1.3.1 it will return a Perl5RegexpMatcher, if the JVM is
* younger (1.4+) it will return a JdkRegexpMatcher.
*/
public static RegexpMatcher getMatcher(String pattern, boolean multiline) {
if (isJDK13()) {
return new Perl5RegexpMatcher(pattern, true);
} else {
return new JdkRegexpMatcher(pattern, true);
}
}

/**
* Queries the environment for the supported JDK version.
*/
public static boolean isJDK13() {
return javaVersion.indexOf("1.3") != -1;
return new JdkRegexpMatcher(pattern, multiline);
}

private RegexpUtils() {}
Expand Down
1 change: 0 additions & 1 deletion src/test/java/net/sf/json/regexp/AllTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public static TestSuite suite() throws Exception {
suite.setName("regexp");

suite.addTest(new TestSuite(TestJdkRegexpMatcher.class));
suite.addTest(new TestSuite(TestPerl5RegexpMatcher.class));

return suite;
}
Expand Down
35 changes: 0 additions & 35 deletions src/test/java/net/sf/json/regexp/TestPerl5RegexpMatcher.java

This file was deleted.

0 comments on commit 9bc0101

Please sign in to comment.