commonjava-developer Mailing List for CommonJava Open Component Project
Brought to you by:
johnqueso
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(10) |
Feb
(114) |
Mar
(169) |
Apr
(25) |
May
|
Jun
(5) |
Jul
(17) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John C. <joh...@co...> - 2004-07-09 21:56:31
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19788 Modified Files: .classpath Added Files: .cvsignore Log Message: cleaned up a little. --- NEW FILE: .cvsignore --- target maven.log Index: .classpath =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/.classpath,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- .classpath 9 Jul 2004 21:54:26 -0000 1.4 +++ .classpath 9 Jul 2004 21:56:19 -0000 1.5 @@ -6,5 +6,6 @@ <classpathentry kind="var" path="JRE_LIB"/> <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.3.jar"/> <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-console-2.0-2.jar"/> <classpathentry kind="output" path="target/classes"/> </classpath> |
From: John C. <joh...@co...> - 2004-07-09 21:56:28
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19788/cli Added Files: .cvsignore Log Message: cleaned up a little. --- NEW FILE: .cvsignore --- target |
From: John C. <joh...@co...> - 2004-07-09 21:55:50
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19679/cli/src/test Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/test added to the repository |
From: John C. <joh...@co...> - 2004-07-09 21:54:35
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava/diff/cli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19475/cli/src/java/org/commonjava/diff/cli Modified Files: Main.java Log Message: fixed version number in main project.xml, fixed dependencies in main project.xml, fixed imports in Main.java(cli) Index: Main.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava/diff/cli/Main.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Main.java 9 Jul 2004 21:43:12 -0000 1.1 +++ Main.java 9 Jul 2004 21:54:26 -0000 1.2 @@ -16,6 +16,8 @@ import org.commonjava.console.option.OptionFormat; import org.commonjava.console.option.SingleArgOptionalOption; import org.commonjava.console.option.SingleArgRequiredOption; +import org.commonjava.diff.DiffEngine; +import org.commonjava.diff.DiffOperation; /** * @author jdcasey @@ -116,10 +118,10 @@ DiffOperation[] ops = null; try { if (maxLen == null) { - ops = DiffEngine.getInstance().compute(oldMap, newMap); + ops = new DiffEngine().compute(oldMap, newMap); } else { - ops = DiffEngine.getInstance().compute(oldMap, newMap, maxLen.intValue()); + ops = new DiffEngine().compute(oldMap, newMap, maxLen.intValue()); } } catch (IOException e) { @@ -128,6 +130,8 @@ return CODE_ERROR_COMPUTING_DIFF; } + System.out.println("SHOULDN'T WE DO SOMETHING WITH THE OPERATIONS RESULTING FROM THIS?!"); + return CODE_OK; } |
From: John C. <joh...@co...> - 2004-07-09 21:54:35
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19475 Modified Files: project.xml .classpath Log Message: fixed version number in main project.xml, fixed dependencies in main project.xml, fixed imports in Main.java(cli) Index: .classpath =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/.classpath,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .classpath 9 Jul 2004 21:43:11 -0000 1.3 +++ .classpath 9 Jul 2004 21:54:26 -0000 1.4 @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src/java"/> + <classpathentry kind="src" path="cli/src/java"/> <classpathentry kind="src" path="src/test"/> <classpathentry kind="var" path="JRE_LIB"/> <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.3.jar"/> Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/project.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- project.xml 20 Feb 2004 21:14:08 -0000 1.6 +++ project.xml 9 Jul 2004 21:54:26 -0000 1.7 @@ -5,7 +5,7 @@ <id>commonjava-diff</id> <name>Binary Diff</name> <groupId>commonjava</groupId> - <currentVersion>2.0-2</currentVersion> + <currentVersion>2.1</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> @@ -27,30 +27,6 @@ <dependencies> <dependency> - <groupId>commonjava</groupId> - <artifactId>commonjava-lang</artifactId> - <version>2.0-1</version> - </dependency> - - <dependency> - <groupId>commonjava</groupId> - <artifactId>commonjava-console</artifactId> - <version>2.0</version> - </dependency> - - <dependency> - <groupId>commonjava</groupId> - <artifactId>commonjava-math</artifactId> - <version>2.0</version> - </dependency> - - <dependency> - <groupId>commonjava</groupId> - <artifactId>commonjava-util</artifactId> - <version>2.0-3</version> - </dependency> - - <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.0.3</version> |
From: John C. <joh...@co...> - 2004-07-09 21:43:22
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/src/java/org/commonjava/diff In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17552/src/java/org/commonjava/diff Modified Files: ByteMapping.java DiffEngine.java Added Files: DescriptiveStats.java Removed Files: Main.java Log Message: o Separated Main into subproject called 'cli' to remove requirement for commonjava-console in main diff engine project, o Removed dependency on FileSizeConstants, and hence commonjava-util o Copied DescriptiveStats from commonjava-math to . (commonjava-diff) to remove dependency on that lib. o Re-tested engine, and all's well. Index: DiffEngine.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/src/java/org/commonjava/diff/DiffEngine.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DiffEngine.java 17 Jan 2004 04:12:47 -0000 1.1 +++ DiffEngine.java 9 Jul 2004 21:43:11 -0000 1.2 @@ -26,7 +26,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.commonjava.util.FileSizeConstants; /** Engine that is used to compute a set of operations that will turn * one binary data set into another one, effectively computing the difference @@ -40,8 +39,6 @@ private static final Log LOG = LogFactory.getLog(DiffEngine.class); - private static final DiffEngine INSTANCE = new DiffEngine(); - private static final byte[] ZERO_LEN_BYTE_ARRAY = new byte[0]; private static final DiffEngine.OffsetFirstOpComparator OFFSET_FIRST = @@ -50,19 +47,10 @@ private static final DiffEngine.TypeFirstOpComparator TYPE_FIRST = new DiffEngine.TypeFirstOpComparator(); - private static final int DEFAULT_LINE_MAX = FileSizeConstants.ONE_KILOBYTE; - private static final int DEFAULT_LINE_MIN = 100; - - /** Denies creation of a new instance of Diff */ - private DiffEngine() { - } + private static final int DEFAULT_LINE_MAX = 1024; // 1K + private static final int DEFAULT_LINE_MIN = 10; - /** Returns the singleton instance of this engine. - * - * @return the singleton - */ - public static DiffEngine getInstance(){ - return INSTANCE; + public DiffEngine() { } /** Read the contents of the old file, apply the operations to --- Main.java DELETED --- Index: ByteMapping.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/src/java/org/commonjava/diff/ByteMapping.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ByteMapping.java 17 Jan 2004 04:12:47 -0000 1.1 +++ ByteMapping.java 9 Jul 2004 21:43:11 -0000 1.2 @@ -19,7 +19,7 @@ import java.util.Iterator; import java.util.List; -import org.commonjava.math.DescriptiveStats; +import org.commonjava.diff.DescriptiveStats; /** Stores a count of a byte in a file, for the purpose * of calculating line breaks for binary files. --- NEW FILE: DescriptiveStats.java --- /* Copyright (c) 2002 John Casey. All rights reserved. SEE licenses/cj-license.txt FOR MORE INFORMATION. */ /* * DescriptiveStats.java * * Created on November 2, 2002, 3:27 PM */ package org.commonjava.diff; /** Utility class providing access to some basic descriptive statistics operations. * * @author John Casey */ public final class DescriptiveStats { /** Creates a new instance of DescriptiveStats */ private DescriptiveStats() { } /** Calculates the standard deviation for an array of data points. * @param points The data points. * @return the standard deviation. */ public static double stdDev(double[] points){ double stdDev = Math.sqrt(variance(points)); return stdDev; } /** Calculates the variance for an array of data points. * @param points The data points. * @return the variance. */ public static double variance(double[] points){ double sigma = 0; double sigmaSq = 0; for(int i=0, len=points.length; i<len; i++){ sigma += points[i]; sigmaSq += Math.pow(points[i], 2); } double sigmaOp1 = Math.pow(sigma, 2)/points.length; double sSq = (sigmaSq + sigmaOp1) / (points.length -1); return sSq; } } |
From: John C. <joh...@co...> - 2004-07-09 21:43:22
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/src/test/org/commonjava/diff In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17552/src/test/org/commonjava/diff Modified Files: DiffEngineTest.java Log Message: o Separated Main into subproject called 'cli' to remove requirement for commonjava-console in main diff engine project, o Removed dependency on FileSizeConstants, and hence commonjava-util o Copied DescriptiveStats from commonjava-math to . (commonjava-diff) to remove dependency on that lib. o Re-tested engine, and all's well. Index: DiffEngineTest.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/src/test/org/commonjava/diff/DiffEngineTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DiffEngineTest.java 20 Feb 2004 21:14:08 -0000 1.2 +++ DiffEngineTest.java 9 Jul 2004 21:43:11 -0000 1.3 @@ -23,7 +23,7 @@ { System.out.println("test for DiffOperation[] compute(ReadableByteChannel, ReadableByteChannel)"); - DiffOperation[] ops = DiffEngine.getInstance().compute( + DiffOperation[] ops = new DiffEngine().compute( ByteBuffer.wrap(OLD_FILE.getBytes()), ByteBuffer.wrap(NEW_FILE.getBytes()) ); System.out.println("Found " + ops.length + " diff operations."); @@ -31,6 +31,8 @@ for (int i = 0; i < ops.length; i++) { System.out.println(ops[i]); } + + assertEquals(4, ops.length); } /* @@ -41,10 +43,12 @@ { System.out.println("test for DiffOperation[] compute(ReadableByteChannel, ReadableByteChannel, int)"); - DiffOperation[] ops = DiffEngine.getInstance().compute( + DiffOperation[] ops = new DiffEngine().compute( ByteBuffer.wrap(OLD_FILE.getBytes()), ByteBuffer.wrap(NEW_FILE.getBytes()), 5 ); System.out.println("Found " + ops.length + " diff operations."); + + assertEquals(4, ops.length); } public void testApply() throws IOException { @@ -58,7 +62,7 @@ ByteBuffer newBuffer = ByteBuffer.wrap(NEW_FILE.getBytes()); ByteBuffer testBuffer = ByteBuffer.wrap(OLD_FILE.getBytes()); - ByteBuffer result = DiffEngine.getInstance().apply(ops, newBuffer); + ByteBuffer result = new DiffEngine().apply(ops, newBuffer); testBuffer.rewind(); result.rewind(); @@ -86,13 +90,13 @@ FileChannel inChannel2 = in2.getChannel(); MappedByteBuffer map2 = inChannel2.map(FileChannel.MapMode.READ_ONLY, 0, inChannel2.size()); - DiffOperation[] ops = DiffEngine.getInstance().compute(map1, map2); + DiffOperation[] ops = new DiffEngine().compute(map1, map2); System.out.println("Found " + ops.length + " diff operations."); map1.rewind(); map2.rewind(); - ByteBuffer result = DiffEngine.getInstance().apply(ops, map2); + ByteBuffer result = new DiffEngine().apply(ops, map2); assertEquals("Re-merged result must equal original file.", map1, result); } @@ -113,16 +117,16 @@ FileChannel inChannel2 = in2.getChannel(); MappedByteBuffer map2 = inChannel2.map(FileChannel.MapMode.READ_ONLY, 0, inChannel2.size()); - DiffOperation[] ops = DiffEngine.getInstance().compute(map1, map2); + DiffOperation[] ops = new DiffEngine().compute(map1, map2); System.out.println("Found " + ops.length + " diff operations."); map1.rewind(); map2.rewind(); - ByteBuffer result = DiffEngine.getInstance().apply(ops, map2); + ByteBuffer result = new DiffEngine().apply(ops, map2); result.rewind(); - DiffOperation[] checkOps = DiffEngine.getInstance().compute(map1, result); + DiffOperation[] checkOps = new DiffEngine().compute(map1, result); System.out.println("found " + checkOps.length + " diffs."); for (int i = 0; i < checkOps.length; i++) { |
From: John C. <joh...@co...> - 2004-07-09 21:43:22
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17552 Modified Files: .classpath Log Message: o Separated Main into subproject called 'cli' to remove requirement for commonjava-console in main diff engine project, o Removed dependency on FileSizeConstants, and hence commonjava-util o Copied DescriptiveStats from commonjava-math to . (commonjava-diff) to remove dependency on that lib. o Re-tested engine, and all's well. Index: .classpath =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .classpath 20 Feb 2004 21:14:08 -0000 1.2 +++ .classpath 9 Jul 2004 21:43:11 -0000 1.3 @@ -1,24 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> - <classpath> - <classpathentry kind="src" path="src\java"> - </classpathentry> - <classpathentry output="target\test-classes" kind="src" path="src\test"> - </classpathentry> - <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"> - </classpathentry> - <classpathentry kind="var" rootpath="JRE_SRCROOT" path="JRE_LIB" sourcepath="JRE_SRC"> - </classpathentry> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-lang-2.0-1.jar"> - </classpathentry> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-console-2.0.jar"> - </classpathentry> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-math-2.0.jar"> - </classpathentry> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-util-2.0-3.jar"> - </classpathentry> - <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.3.jar"> - </classpathentry> - <classpathentry kind="output" path="target\classes"> - </classpathentry> -</classpath> \ No newline at end of file + <classpathentry kind="src" path="src/java"/> + <classpathentry kind="src" path="src/test"/> + <classpathentry kind="var" path="JRE_LIB"/> + <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.3.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> |
From: John C. <joh...@co...> - 2004-07-09 21:43:22
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17552/cli Added Files: project.xml Log Message: o Separated Main into subproject called 'cli' to remove requirement for commonjava-console in main diff engine project, o Removed dependency on FileSizeConstants, and hence commonjava-util o Copied DescriptiveStats from commonjava-math to . (commonjava-diff) to remove dependency on that lib. o Re-tested engine, and all's well. --- NEW FILE: project.xml --- <?xml version="1.0" encoding="UTF-8"?> <project> <pomVersion>3</pomVersion> <id>commonjava-diff-cli</id> <name>Binary Diff Command-line Interface</name> <groupId>commonjava</groupId> <currentVersion>2.1</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> </organization> <inceptionYear>2002</inceptionYear> <package>org.commonjava.diff.cli</package> <description> This is the command line interface for commonjava-diff. </description> <dependencies> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-diff</artifactId> <version>2.1</version> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-console</artifactId> <version>2.0-2</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.0.3</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> </dependency> </dependencies> <build> <sourceDirectory>${basedir}/src/java</sourceDirectory> </build> </project> |
From: John C. <joh...@co...> - 2004-07-09 21:43:22
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava/diff/cli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17552/cli/src/java/org/commonjava/diff/cli Added Files: Main.java Log Message: o Separated Main into subproject called 'cli' to remove requirement for commonjava-console in main diff engine project, o Removed dependency on FileSizeConstants, and hence commonjava-util o Copied DescriptiveStats from commonjava-math to . (commonjava-diff) to remove dependency on that lib. o Re-tested engine, and all's well. --- NEW FILE: Main.java --- /* Created on Jan 16, 2004 */ package org.commonjava.diff.cli; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import org.commonjava.console.Command; import org.commonjava.console.CommandLine; import org.commonjava.console.CommandLineException; import org.commonjava.console.option.Arg; import org.commonjava.console.option.Option; import org.commonjava.console.option.OptionFormat; import org.commonjava.console.option.SingleArgOptionalOption; import org.commonjava.console.option.SingleArgRequiredOption; /** * @author jdcasey */ public class Main extends Command{ private static final Option OLD = new SingleArgRequiredOption('o', "old", OptionFormat.FILE_FORMAT, "Old file."); private static final Option NEW = new SingleArgRequiredOption('n', "new", OptionFormat.FILE_FORMAT, "New file."); private static final Option MAX_LINE_LEN = new SingleArgOptionalOption('l', "maxlength", OptionFormat.NUMBER_FORMAT, "Maximum Line Length."); private static final Option[] TEMPLATE = {OLD, NEW, MAX_LINE_LEN}; public static final int CODE_OK = 0; public static final int CODE_OLD_FILE_MISSING = -1; public static final int CODE_OLD_FILE_ERROR = -2; public static final int CODE_NEW_FILE_MISSING = -3; public static final int CODE_NEW_FILE_ERROR = -4; public static final int CODE_ERROR_COMPUTING_DIFF = -5; public static void main(String[] args) { try { Main main = new Main(); main.setIn(System.in); main.setOut(System.out); main.setErr(System.err); main.parseArgs(args); main.executeCommand(); } catch (CommandLineException e) { e.printStackTrace(); } } /** * @param description */ public Main() { super("Compute the differences between two files."); addCommandTemplate(TEMPLATE); } /* (non-Javadoc) * @see org.commonjava.console.Command#executeCommand() */ public int executeCommand() throws CommandLineException { CommandLine cmdLine = getCommandLine(); Arg oldArg = (Arg)cmdLine.getOption(OLD.getLongName()); Arg newArg = (Arg)cmdLine.getOption(NEW.getLongName()); Arg lineLen = (Arg)cmdLine.getOption(MAX_LINE_LEN.getLongName()); File old = (File)oldArg.getValue(); File neo = (File)newArg.getValue(); Long maxLen = null; if(lineLen.hasValue()) { maxLen = (Long)lineLen.getValue(); } FileInputStream oldIn = null; MappedByteBuffer oldMap = null; try { oldIn = new FileInputStream(old); FileChannel oldChannel = oldIn.getChannel(); oldMap = oldChannel.map(FileChannel.MapMode.READ_ONLY, 0, oldChannel.size()); } catch (FileNotFoundException e) { e.printStackTrace(getErr()); getErr().flush(); return CODE_OLD_FILE_MISSING; } catch (IOException e) { e.printStackTrace(getErr()); getErr().flush(); return CODE_OLD_FILE_ERROR; } FileInputStream newIn = null; MappedByteBuffer newMap = null; try { newIn = new FileInputStream(neo); FileChannel newChannel = newIn.getChannel(); newMap = newChannel.map(FileChannel.MapMode.READ_ONLY, 0, newChannel.size()); } catch (FileNotFoundException e) { e.printStackTrace(getErr()); getErr().flush(); return CODE_NEW_FILE_MISSING; } catch (IOException e) { e.printStackTrace(getErr()); getErr().flush(); return CODE_NEW_FILE_ERROR; } DiffOperation[] ops = null; try { if (maxLen == null) { ops = DiffEngine.getInstance().compute(oldMap, newMap); } else { ops = DiffEngine.getInstance().compute(oldMap, newMap, maxLen.intValue()); } } catch (IOException e) { e.printStackTrace(getErr()); getErr().flush(); return CODE_ERROR_COMPUTING_DIFF; } return CODE_OK; } } |
From: John C. <joh...@co...> - 2004-07-09 21:43:16
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava/diff/cli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17476/cli/src/java/org/commonjava/diff/cli Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava/diff/cli added to the repository |
From: John C. <joh...@co...> - 2004-07-09 21:43:16
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava/diff In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17476/cli/src/java/org/commonjava/diff Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava/diff added to the repository |
From: John C. <joh...@co...> - 2004-07-09 21:43:16
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17476/cli/src/java Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java added to the repository |
From: John C. <joh...@co...> - 2004-07-09 21:43:16
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17476/cli/src/java/org/commonjava Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org/commonjava added to the repository |
From: John C. <joh...@co...> - 2004-07-09 21:43:16
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17476/cli/src/java/org Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src/java/org added to the repository |
From: John C. <joh...@co...> - 2004-07-09 21:43:14
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17476/cli/src Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli/src added to the repository |
From: John C. <joh...@co...> - 2004-07-09 21:43:14
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17476/cli Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-diff/cli added to the repository |
From: John C. <joh...@co...> - 2004-06-28 04:13:08
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13817 Modified Files: .classpath Added Files: .cvsignore Log Message: o Fixed a NPE when the long-name is specified and no value is supplied. o Added debug statements for the parseArgs() functionality. --- NEW FILE: .cvsignore --- target Index: .classpath =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-console/.classpath,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- .classpath 17 Mar 2004 03:52:48 -0000 1.5 +++ .classpath 28 Jun 2004 04:12:55 -0000 1.6 @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="src" path="src/java"/> - <classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-util-2.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.2.jar"/> - <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="src" path="src/java"/> + <classpathentry sourcepath="JRE_SRC" kind="var" path="JRE_LIB"/> + <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-util-2.0-5.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.2.jar"/> + <classpathentry kind="output" path="target/classes"/> </classpath> |
From: John C. <joh...@co...> - 2004-06-28 04:13:08
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-console/src/java/org/commonjava/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13817/src/java/org/commonjava/console Modified Files: CommandLine.java Log Message: o Fixed a NPE when the long-name is specified and no value is supplied. o Added debug statements for the parseArgs() functionality. Index: CommandLine.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-console/src/java/org/commonjava/console/CommandLine.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CommandLine.java 15 Apr 2004 15:23:54 -0000 1.3 +++ CommandLine.java 28 Jun 2004 04:12:54 -0000 1.4 @@ -112,7 +112,7 @@ String key = args[i].substring(2, ((eqPos < 0)?(args[i].length()):(eqPos))); String val = ((eqPos < 0)?(null):(args[i].substring(eqPos+1))); - if(val.startsWith("\"")){ + if(val != null && val.startsWith("\"")){ StringBuffer buf = new StringBuffer(val.substring(1)); i++; for(; i<args.length; i++){ @@ -131,6 +131,9 @@ val = buf.toString(); } + if(LOG.isDebugEnabled()) { + LOG.debug("Adding long option: " + key + " with value: " + val); + } vals.put(key, val); } else if(args[i].charAt(0) == '-'){ @@ -141,6 +144,9 @@ char c = args[i].charAt(j); Character shortName = new Character(c); if(j+1 < argLen){ + if(LOG.isDebugEnabled()) { + LOG.debug("Adding short option: " + shortName + " with null value."); + } vals.put(shortName, null); } else{ @@ -166,19 +172,31 @@ val = buf.toString(); } + if(LOG.isDebugEnabled()) { + LOG.debug("Adding short option: " + shortName + " with value: " + val); + } vals.put(shortName, val); } else{ + if(LOG.isDebugEnabled()) { + LOG.debug("Adding short option: " + shortName + " with null value."); + } vals.put(shortName, null); } } } } else{ + if(LOG.isDebugEnabled()) { + LOG.debug("Adding command argument: " + args[i]); + } nonOptions.add(args[i]); } } else{ + if(LOG.isDebugEnabled()) { + LOG.debug("Adding command argument: " + args[i]); + } nonOptions.add(args[i]); } } |
From: John C. <joh...@co...> - 2004-06-28 04:11:32
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-reflection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13494 Modified Files: .classpath Log Message: . Index: .classpath =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-reflection/.classpath,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- .classpath 20 Feb 2004 21:18:52 -0000 1.4 +++ .classpath 28 Jun 2004 04:11:24 -0000 1.5 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="src" path="src\java"> + <classpathentry excluding="" kind="src" path="src/java"> </classpathentry> - <classpathentry kind="var" rootpath="JRE_SRCROOT" path="JRE_LIB" sourcepath="JRE_SRC"> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> </classpathentry> <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.2.jar"> </classpathentry> - <classpathentry kind="output" path="target\classes"> + <classpathentry kind="output" path="target/classes"> </classpathentry> </classpath> \ No newline at end of file |
From: John C. <joh...@co...> - 2004-06-24 01:06:10
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-reflection/src/java/org/commonjava/reflection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18618/src/java/org/commonjava/reflection Modified Files: Reflector.java Log Message: added getField() and getStaticField(). Index: Reflector.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-reflection/src/java/org/commonjava/reflection/Reflector.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Reflector.java 20 Apr 2004 22:52:05 -0000 1.3 +++ Reflector.java 24 Jun 2004 01:06:01 -0000 1.4 @@ -16,6 +16,7 @@ package org.commonjava.reflection; import java.lang.reflect.Constructor; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; @@ -161,6 +162,41 @@ } } + public static Object getStaticField(Class targetClass, String fieldName) + throws ReflectorException + { + try { + Field field = targetClass.getField(fieldName); + return field.get(null); + } catch (SecurityException e) { + throw new ReflectorException(e); + } catch (NoSuchFieldException e) { + throw new ReflectorException(e); + } catch (IllegalArgumentException e) { + throw new ReflectorException(e); + } catch (IllegalAccessException e) { + throw new ReflectorException(e); + } + } + + public static Object getField(Object target, String fieldName) + throws ReflectorException + { + try { + Class targetClass = target.getClass(); + Field field = targetClass.getField(fieldName); + return field.get(target); + } catch (SecurityException e) { + throw new ReflectorException(e); + } catch (NoSuchFieldException e) { + throw new ReflectorException(e); + } catch (IllegalArgumentException e) { + throw new ReflectorException(e); + } catch (IllegalAccessException e) { + throw new ReflectorException(e); + } + } + /** Invoke the specified static method with the specified params... * * @param targetClass The target class of the invocation |
From: John C. <joh...@co...> - 2004-06-24 01:06:10
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-reflection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18618 Modified Files: project.xml Log Message: added getField() and getStaticField(). Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-reflection/project.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- project.xml 20 Apr 2004 22:52:06 -0000 1.4 +++ project.xml 24 Jun 2004 01:06:01 -0000 1.5 @@ -5,7 +5,7 @@ <id>commonjava-reflection</id> <name>Reflective Utilities</name> <groupId>commonjava</groupId> - <currentVersion>2.0-2</currentVersion> + <currentVersion>2.0-3</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> |
From: John C. <joh...@co...> - 2004-04-23 19:48:31
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21823/src/java/org/commonjava/config/snapin Modified Files: SnapInContainerFactory.java Log Message: fixed the factory to use a default constructor, not the getInstance() method. Index: SnapInContainerFactory.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin/SnapInContainerFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SnapInContainerFactory.java 23 Apr 2004 19:47:31 -0000 1.1 +++ SnapInContainerFactory.java 23 Apr 2004 19:48:21 -0000 1.2 @@ -39,7 +39,7 @@ if(container == null){ try{ SnapInContainerLoader loader = - (SnapInContainerLoader)ImplFinder.findSingletonImplementation( + (SnapInContainerLoader)ImplFinder.findImplementation( SnapInContainerLoader.class, SnapInContainer.LOADER_SYSPROP, GenericSnapInContainerLoader.class, |
From: John C. <joh...@co...> - 2004-04-23 19:47:40
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21646 Modified Files: project.xml Log Message: added more component-ized method of loading configurations. Deprecated static getContainer() in SnapInContainerLoader. Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/project.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- project.xml 19 Feb 2004 23:17:08 -0000 1.4 +++ project.xml 23 Apr 2004 19:47:31 -0000 1.5 @@ -5,7 +5,7 @@ <id>commonjava-config</id> <name>Configurations</name> <groupId>commonjava</groupId> - <currentVersion>2.1-1</currentVersion> + <currentVersion>2.2</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> |
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21646/src/java/org/commonjava/config/snapin Modified Files: GenericSnapInContainerLoader.java SnapInContainer.java SnapInContainerLoader.java Added Files: SnapInContainerFactory.java Log Message: added more component-ized method of loading configurations. Deprecated static getContainer() in SnapInContainerLoader. Index: GenericSnapInContainerLoader.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin/GenericSnapInContainerLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GenericSnapInContainerLoader.java 18 Feb 2004 06:11:00 -0000 1.3 +++ GenericSnapInContainerLoader.java 23 Apr 2004 19:47:31 -0000 1.4 @@ -11,23 +11,17 @@ public final class GenericSnapInContainerLoader extends SnapInContainerLoader { - private static final String DEFAULT_LOCATION = "cprs:///configuration.xml"; - private static final SnapInContainerLoader INSTANCE = new GenericSnapInContainerLoader(); - /** - * */ - private GenericSnapInContainerLoader() + public GenericSnapInContainerLoader() { } public static SnapInContainerLoader getInstance(){ - return INSTANCE; + return new GenericSnapInContainerLoader(); } - public SnapInContainer loadSnapInContainer() throws SnapInLoaderException{ - String location = System.getProperty(SnapInContainerLoader.LOCATION_SYSPROP, DEFAULT_LOCATION); - + public SnapInContainer loadSnapInContainer(String location, boolean isDefault) throws SnapInLoaderException{ try{ DocumentDriver driver = new DocumentDriver(); GenericSnapInContainer container = Index: SnapInContainer.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin/SnapInContainer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SnapInContainer.java 9 Jan 2004 05:05:13 -0000 1.1 +++ SnapInContainer.java 23 Apr 2004 19:47:31 -0000 1.2 @@ -11,6 +11,15 @@ */ public interface SnapInContainer { + /** System property for specifying the location of the container's persistent state. */ + public static final String LOCATION_SYSPROP = "org.commonjava.config.snapin.file.location"; + + /** System property for specifying the loader for the container. */ + public static final String LOADER_SYSPROP = "org.commonjava.config.snapin.container.loader"; + + /** Default location of the container's persistent state. */ + public static final String DEFAULT_LOCATION = "cprs:///configuration.xml"; + /** Return the snapIn for the specified id, within this configuration instance. * @param snapInId The identifier to lookup * @return the associated snapIn, or null. Index: SnapInContainerLoader.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin/SnapInContainerLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SnapInContainerLoader.java 18 Feb 2004 06:11:00 -0000 1.3 +++ SnapInContainerLoader.java 23 Apr 2004 19:47:31 -0000 1.4 @@ -9,26 +9,30 @@ */ public abstract class SnapInContainerLoader { - public static final String LOCATION_SYSPROP = "org.commonjava.config.snapin.file.location"; - public static final String LOADER_SYSPROP = "org.commonjava.config.snapin.container.loader"; private static SnapInContainer container; - public abstract SnapInContainer loadSnapInContainer() throws SnapInLoaderException; + public abstract SnapInContainer loadSnapInContainer(String location, boolean isDefaultLocation) throws SnapInLoaderException; + /** + * @deprecated Use SnapInContainerFactory instead. + */ public static SnapInContainer getSnapInContainer() throws SnapInLoaderException{ + String location = System.getProperty(SnapInContainer.LOCATION_SYSPROP, SnapInContainer.DEFAULT_LOCATION); + + boolean isDefault = SnapInContainer.DEFAULT_LOCATION.equals(location); synchronized(SnapInContainer.class){ if(container == null){ try{ SnapInContainerLoader loader = (SnapInContainerLoader)ImplFinder.findSingletonImplementation( SnapInContainerLoader.class, - LOADER_SYSPROP, + SnapInContainer.LOADER_SYSPROP, GenericSnapInContainerLoader.class, new Object[]{} ); - container = loader.loadSnapInContainer(); + container = loader.loadSnapInContainer(location, isDefault); } catch (FinderException e){ throw new SnapInLoaderException( --- NEW FILE: SnapInContainerFactory.java --- /* * Created on Apr 23, 2004 * */ package org.commonjava.config.snapin; import java.util.Map; import java.util.TreeMap; import org.commonjava.reflection.FinderException; import org.commonjava.reflection.ImplFinder; /** Factory used to load/retain/retrieve SnapInContainer instances. * * @author John Casey * */ public final class SnapInContainerFactory { public static Map containers = new TreeMap(); /** Create a new factory for loading/retrieving SnapInContainer instances. */ public SnapInContainerFactory() { } public SnapInContainer getDefaultContainer() throws SnapInLoaderException{ String location = System.getProperty(SnapInContainer.LOCATION_SYSPROP, SnapInContainer.DEFAULT_LOCATION); return _getContainer(location, true); } public SnapInContainer getContainer(String location) throws SnapInLoaderException{ return _getContainer(location, false); } private SnapInContainer _getContainer(String location, boolean isDefault) throws SnapInLoaderException{ synchronized(SnapInContainer.class){ SnapInContainer container = (SnapInContainer)containers.get(location); if(container == null){ try{ SnapInContainerLoader loader = (SnapInContainerLoader)ImplFinder.findSingletonImplementation( SnapInContainerLoader.class, SnapInContainer.LOADER_SYSPROP, GenericSnapInContainerLoader.class, new Object[]{} ); container = loader.loadSnapInContainer(location, isDefault); } catch (FinderException e){ throw new SnapInLoaderException( "Error finding loader class for snap-in configuration container.", e ); } } return container; } } } |