From a2d52b943e3064b8ca86a8a59b8970898b373a34 Mon Sep 17 00:00:00 2001 From: jestin Date: Fri, 22 Jul 2011 16:53:52 +0000 Subject: --- tests/TestNetSwing.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'tests/TestNetSwing.java') diff --git a/tests/TestNetSwing.java b/tests/TestNetSwing.java index f2dc0eb..7aed6e2 100644 --- a/tests/TestNetSwing.java +++ b/tests/TestNetSwing.java @@ -15,7 +15,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; import fr.dgac.ivy.*; -import org.apache.regexp.*; +import java.util.regex.*; import gnu.getopt.*; class TestNetSwing implements Runnable { @@ -183,19 +183,20 @@ class TestNetSwing implements Runnable { int sep_index = net.lastIndexOf( ":" ); if ( sep_index != -1 ) { net = net.substring(0,sep_index); } try { - RE numbersPoint = new RE("([0-9]|\\.)+"); - if (!numbersPoint.match(net)) { + Pattern numbersPoint = Pattern.compile("([0-9]|\\.)+"); + if (!numbersPoint.matcher(net).matches()) { // traceDebug("should only have numbers and point ? I won't add anything... " + net); return net; } net += ".255.255.255"; - RE exp = new RE( "^(\\d+\\.\\d+\\.\\d+\\.\\d+).*"); - if (!exp.match(net)) { + Pattern exp = Pattern.compile( "^(\\d+\\.\\d+\\.\\d+\\.\\d+).*"); + Matcher m = exp.matcher(net); + if (!m.matches()) { System.out.println("Bad broascat addr " + net); throw new IvyException("bad broadcast addr"); } - net=exp.getParen(1); - } catch ( RESyntaxException e ){ + net=m.group(1); + } catch ( PatternSyntaxException e ){ System.out.println(e); System.exit(0); } -- cgit v1.1