vgritsenko 2004/02/18 18:35:28 Modified: src/java/org/apache/regexp REDebugCompiler.java REDemo.java Log: Optimize imports, access static constants through class name Revision Changes Path 1.4 +3 -3 jakarta-regexp/src/java/org/apache/regexp/REDebugCompiler.java Index: REDebugCompiler.java =================================================================== RCS file: /home/cvs/jakarta-regexp/src/java/org/apache/regexp/REDebugCompiler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- REDebugCompiler.java 17 Feb 2004 13:37:54 -0000 1.3 +++ REDebugCompiler.java 19 Feb 2004 02:35:28 -0000 1.4 @@ -16,8 +16,8 @@ package org.apache.regexp; -import java.util.*; -import java.io.*; +import java.io.PrintWriter; +import java.util.Hashtable; /** * A subclass of RECompiler which can dump a regular expression program 1.4 +19 -15 jakarta-regexp/src/java/org/apache/regexp/REDemo.java Index: REDemo.java =================================================================== RCS file: /home/cvs/jakarta-regexp/src/java/org/apache/regexp/REDemo.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- REDemo.java 17 Feb 2004 13:37:54 -0000 1.3 +++ REDemo.java 19 Feb 2004 02:35:28 -0000 1.4 @@ -16,17 +16,21 @@ package org.apache.regexp; -import java.applet.*; +import java.applet.Applet; import java.awt.*; -import java.awt.event.*; -import java.io.*; +import java.awt.event.TextEvent; +import java.awt.event.TextListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.CharArrayWriter; +import java.io.PrintWriter; /** * Interactive demonstration and testing harness for regular expressions classes. * @author <a href="mailto:[EMAIL PROTECTED]">Jonathan Locke</a> * @version $Id$ */ -public class REDemo extends Applet implements TextListener +public class REDemo extends Applet implements TextListener { /** * Matcher and compiler objects @@ -52,27 +56,27 @@ setLayout(gb); GridBagConstraints c = new GridBagConstraints(); c.insets = new Insets(5, 5, 5, 5); - c.anchor = c.EAST; + c.anchor = GridBagConstraints.EAST; gb.setConstraints(add(new Label("Regular expression:", Label.RIGHT)), c); c.gridy = 0; - c.anchor = c.WEST; + c.anchor = GridBagConstraints.WEST; gb.setConstraints(add(fieldRE = new TextField("\\[([:javastart:][:javapart:]*)\\]", 40)), c); c.gridx = 0; - c.gridy = c.RELATIVE; - c.anchor = c.EAST; + c.gridy = GridBagConstraints.RELATIVE; + c.anchor = GridBagConstraints.EAST; gb.setConstraints(add(new Label("String:", Label.RIGHT)), c); c.gridy = 1; - c.gridx = c.RELATIVE; - c.anchor = c.WEST; + c.gridx = GridBagConstraints.RELATIVE; + c.anchor = GridBagConstraints.WEST; gb.setConstraints(add(fieldMatch = new TextField("aaa([foo])aaa", 40)), c); c.gridy = 2; - c.gridx = c.RELATIVE; - c.fill = c.BOTH; + c.gridx = GridBagConstraints.RELATIVE; + c.fill = GridBagConstraints.BOTH; c.weighty = 1.0; c.weightx = 1.0; gb.setConstraints(add(outRE = new TextArea()), c); c.gridy = 2; - c.gridx = c.RELATIVE; + c.gridx = GridBagConstraints.RELATIVE; gb.setConstraints(add(outMatch = new TextArea()), c); // Listen to text changes @@ -124,7 +128,7 @@ { try { - // Compile program + // Compile program r.setProgram(compiler.compile(expr)); // Dump program into RE feedback area
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]