Skip to content

Commit

Permalink
Update all third-party Jars, junit passes (but build.xmls are broken)
Browse files Browse the repository at this point in the history
Remove xml-api, jakarta-regex, xalan - instead rely on Java built-ins.
Update ant, junit, xerces, jaxen
Question - isorelax in contrib?
  • Loading branch information
rolfl committed Aug 2, 2011
1 parent 2ce8a11 commit dd9d2ce
Show file tree
Hide file tree
Showing 37 changed files with 861 additions and 545 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file removed contrib/lib/jakarta-regexp-1.1.jar
Binary file not shown.
66 changes: 0 additions & 66 deletions contrib/lib/jakarta-regexp.readme

This file was deleted.

33 changes: 18 additions & 15 deletions contrib/src/java/org/jdom2/contrib/beans/DateUtils.java
Expand Up @@ -59,7 +59,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
package org.jdom2.contrib.beans;

import java.util.*;
import org.apache.regexp.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import java.text.*;
import java.io.PrintStream;

Expand Down Expand Up @@ -165,20 +167,21 @@ public static ISO8601 parseISO8601(String s) {
// e.g. 1997-07-16T19:20:30.45+01:00
// additions: "T" can be a space, TZ can be a three-char code, TZ can be missing
try {
RE re = new RE(reISO8601);
if (re.match(s)) {
Pattern pat = Pattern.compile(reISO8601);
Matcher re = pat.matcher(s);
if (re.matches()) {
if (debug)
showParens(re);

ISO8601 iso = new ISO8601();
iso.year = toInt(re.getParen(1));
iso.month = toInt(re.getParen(3));
iso.day = toInt(re.getParen(5));
iso.hour = toInt(re.getParen(7));
iso.min = toInt(re.getParen(8));
iso.sec = toInt(re.getParen(11));
iso.frac = toInt(re.getParen(13));
iso.tz = re.getParen(14);
iso.year = toInt(re.group(1));
iso.month = toInt(re.group(3));
iso.day = toInt(re.group(5));
iso.hour = toInt(re.group(7));
iso.min = toInt(re.group(8));
iso.sec = toInt(re.group(11));
iso.frac = toInt(re.group(13));
iso.tz = re.group(14);

if (debug) {
System.out.println("year='" + iso.year + "'");
Expand All @@ -194,7 +197,7 @@ public static ISO8601 parseISO8601(String s) {
return iso;
}
} // try
catch (RESyntaxException ree) {
catch (PatternSyntaxException ree) {
ree.printStackTrace();
}
return null;
Expand All @@ -214,13 +217,13 @@ public static int toInt(String x) {
* Dump parenthesized subexpressions found by a regular expression matcher object
* @param r Matcher object with results to show
*/
static void showParens(RE r)
static void showParens(Matcher r)
{
// Loop through each paren
for (int i = 0; i < r.getParenCount(); i++)
for (int i = 0; i < r.groupCount(); i++)
{
// Show paren register
System.out.println("$" + i + " = " + r.getParen(i));
System.out.println("$" + i + " = " + r.group(i));
}
}

Expand Down
Expand Up @@ -57,22 +57,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
package org.jdom2.contrib.input.scanner;


import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.xpath.XPath;

import org.xml.sax.Attributes;

import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;


/* package */ class JakartaRegExpXPathMatcher extends XPathMatcher {

/**
* The compiled regular expression this matcher matches.
*/
private final RE re;
private final Pattern re;

private final XPath test;

Expand All @@ -94,7 +94,7 @@ public JakartaRegExpXPathMatcher(
try {
String pathPattern = getPathPatternAsRE(expression);

this.re = new RE(pathPattern);
this.re = Pattern.compile(pathPattern);

String testPattern = getTestPattern(expression);
if (testPattern != null) {
Expand All @@ -114,7 +114,7 @@ public JakartaRegExpXPathMatcher(
" -> XPath = " + testPattern);
}
}
catch (RESyntaxException ex1) {
catch (PatternSyntaxException ex1) {
throw (new JDOMException(
"Illegal XPath expression: " + expression, ex1));
}
Expand All @@ -137,7 +137,7 @@ public JakartaRegExpXPathMatcher(
* expression, <code>false</code> otherwise.
*/
public boolean match(String path, Attributes attrs) {
return (this.re.match(path));
return (this.re.matcher(path).matches());
}

/**
Expand Down
53 changes: 0 additions & 53 deletions core/lib/README

This file was deleted.

Binary file removed core/lib/ant.jar
Binary file not shown.
54 changes: 0 additions & 54 deletions core/lib/ant.readme

This file was deleted.

13 changes: 0 additions & 13 deletions core/lib/bin/antRun

This file was deleted.

Binary file removed core/lib/jaxen.jar
Binary file not shown.
3 changes: 0 additions & 3 deletions core/lib/jaxen.readme

This file was deleted.

Binary file removed core/lib/xalan.jar
Binary file not shown.
55 changes: 0 additions & 55 deletions core/lib/xalan.license

This file was deleted.

2 changes: 0 additions & 2 deletions core/lib/xalan.readme

This file was deleted.

Binary file removed core/lib/xerces.jar
Binary file not shown.

0 comments on commit dd9d2ce

Please sign in to comment.