svn commit: r799972 - /commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java
Author: niallp Date: Sun Aug 2 02:56:37 2009 New Revision: 799972 URL: http://svn.apache.org/viewvc?rev=799972&view=rev Log: Increase test coverage slightly - test values generated using http://swoodbridge.com/DoubleMetaPhone/mptest.php3 Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java?rev=799972&r1=799971&r2=799972&view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java Sun Aug 2 02:56:37 2009 @@ -1093,6 +1093,9 @@ assertDoubleMetaphone("MKFR", "MacCafferey"); assertDoubleMetaphone("STFN", "Stephan"); assertDoubleMetaphone("KSSK", "Kuczewski"); +assertDoubleMetaphone("MKLL", "McClelland"); +assertDoubleMetaphone("SNHS", "san jose"); +assertDoubleMetaphone("SNFP", "xenophobia"); assertDoubleMetaphoneAlt("TSTN", "testing"); assertDoubleMetaphoneAlt("T", "The"); @@ -1107,6 +1110,9 @@ assertDoubleMetaphoneAlt("MKFR", "MacCafferey"); assertDoubleMetaphoneAlt("STFN", "Stephan"); assertDoubleMetaphoneAlt("KXFS", "Kutchefski"); +assertDoubleMetaphoneAlt("MKLL", "McClelland"); +assertDoubleMetaphoneAlt("SNHS", "san jose"); +assertDoubleMetaphoneAlt("SNFP", "xenophobia"); } public void testEmpty() {
svn commit: r799969 - /commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml
Author: sebb Date: Sun Aug 2 02:17:09 2009 New Revision: 799969 URL: http://svn.apache.org/viewvc?rev=799969&view=rev Log: JEXL-43 Documentation clarifications and new 2.0 features Modified: commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml Modified: commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml?rev=799969&r1=799968&r2=799969&view=diff == --- commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml (original) +++ commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml Sun Aug 2 02:17:09 2009 @@ -6,9 +6,9 @@ The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -45,8 +45,13 @@ Comments -Specified using ## and extend to the end of line, e.g. +Specified using ## or //and extend to the end of line, e.g. ## This is a comment +Also specified using //, e.g. +// This is a comment +Multiple lines comments are specified using /*...*/, e.g. +/* This is a +multi-line comment */ @@ -60,7 +65,7 @@ Invalid: 9v,!a99,1$ -Variable names are case-sensitive, e.g. var1 and Var1 are different variables. +Variable names are case-sensitive, e.g. var1 and Var1 are different variables. JEXL also supports ant-style variables, e.g. my.dotted.var @@ -68,7 +73,7 @@ N.B. the following keywords are reserved, and cannot be used as a variable name or property when using the dot operator: or and eq ne lt gt le ge div mod not null true false new - For example, + For example, my.new.dotted.var is invalid. In such cases, the [ ] operator can be used, for example: @@ -100,6 +105,24 @@ A block is simply multiple statements inside curly braces ({, }). + + Assignment + +Assigns the value of a variable (my.var = 'a value') using a +JexlContext as initial resolver. Both beans and ant-ish +variables assignment are supported. + + + + Method calls + +Calls a method of an object, e.g. +"hello world".hashCode() will call the hashCode method +of the "hello world" String. +In case of multiple arguments and overloading, Jexl will make the best effort to find +the most appropriate non ambiguous method to call. + + @@ -114,15 +137,16 @@ 1 or more digits from 0 to 9, followed by a decimal point and then one or more digits from -0 to 9. +0 to 9. String literals -Can start and end with either ' or ", e.g. +Can start and end with either ' or " delimiters, e.g. "Hello world" and 'Hello world' are equivalent. +The escape character is \; it only escapes the string delimiter @@ -172,6 +196,26 @@ size("Hello") returns 5. + + new + +Creates a new instance using a fully-qualified class name or Class: +new("java.lang.Double", 10) returns 10.0. +Note that the first argument of new can be a variable or any +expression evaluating as a String or Class; the rest of the arguments are used +as arguments to the constructor for the class considered. +In case of multiple constructors, Jexl will make the best effort to find +the most appropriate non ambiguous constructor to call. + + + + ns:function + +A JexlEngine can register objects or classes used as function namespaces. +This can allow expressions like: +math:cosinus(23.0) + + @@ -204,7 +248,7 @@ Bitwise and -The usual & operator is used, e.g. +The usual & operator is used, e.g. 33 & 4, 0010 0001 & 0100 =
svn commit: r799967 - in /commons/proper/math/trunk/src/site/xdoc: developers.xml index.xml proposal.xml releases.xml tasks.xml
Author: billbarker Date: Sun Aug 2 01:06:03 2009 New Revision: 799967 URL: http://svn.apache.org/viewvc?rev=799967&view=rev Log: remove references to deleted style sheet Modified: commons/proper/math/trunk/src/site/xdoc/developers.xml commons/proper/math/trunk/src/site/xdoc/index.xml commons/proper/math/trunk/src/site/xdoc/proposal.xml commons/proper/math/trunk/src/site/xdoc/releases.xml commons/proper/math/trunk/src/site/xdoc/tasks.xml Modified: commons/proper/math/trunk/src/site/xdoc/developers.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/developers.xml?rev=799967&r1=799966&r2=799967&view=diff == --- commons/proper/math/trunk/src/site/xdoc/developers.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/developers.xml Sun Aug 2 01:06:03 2009 @@ -16,7 +16,6 @@ limitations under the License. --> - Modified: commons/proper/math/trunk/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/index.xml?rev=799967&r1=799966&r2=799967&view=diff == --- commons/proper/math/trunk/src/site/xdoc/index.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/index.xml Sun Aug 2 01:06:03 2009 @@ -17,7 +17,6 @@ limitations under the License. --> - Modified: commons/proper/math/trunk/src/site/xdoc/proposal.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/proposal.xml?rev=799967&r1=799966&r2=799967&view=diff == --- commons/proper/math/trunk/src/site/xdoc/proposal.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/proposal.xml Sun Aug 2 01:06:03 2009 @@ -17,7 +17,6 @@ limitations under the License. --> - Modified: commons/proper/math/trunk/src/site/xdoc/releases.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/releases.xml?rev=799967&r1=799966&r2=799967&view=diff == --- commons/proper/math/trunk/src/site/xdoc/releases.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/releases.xml Sun Aug 2 01:06:03 2009 @@ -17,7 +17,6 @@ limitations under the License. --> - Modified: commons/proper/math/trunk/src/site/xdoc/tasks.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/tasks.xml?rev=799967&r1=799966&r2=799967&view=diff == --- commons/proper/math/trunk/src/site/xdoc/tasks.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/tasks.xml Sun Aug 2 01:06:03 2009 @@ -17,7 +17,6 @@ limitations under the License. --> -
svn commit: r799933 - /commons/proper/math/trunk/src/site/xdoc/xdoc.xsl
Author: psteitz Date: Sat Aug 1 21:43:45 2009 New Revision: 799933 URL: http://svn.apache.org/viewvc?rev=799933&view=rev Log: Removed vestigal m1 file. Removed: commons/proper/math/trunk/src/site/xdoc/xdoc.xsl
svn commit: r799932 - in /commons/proper/jexl/branches/2.0/src: java/org/apache/commons/jexl/scripting/JexlScriptEngine.java java/org/apache/commons/jexl/scripting/JexlScriptObject.java test/org/apach
Author: sebb Date: Sat Aug 1 21:37:09 2009 New Revision: 799932 URL: http://svn.apache.org/viewvc?rev=799932&view=rev Log: Initial implementation of "JEXL" engine-scoped object Added: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptObject.java (with props) Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java?rev=799932&r1=799931&r2=799932&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java Sat Aug 1 21:37:09 2009 @@ -49,12 +49,18 @@ * If no variable is found, and the JEXL script is writing to a variable, * it will be stored in the ENGINE scope. * + * + * The implementation also creates the "JEXL" script object as an instance of the + * class {...@link JexlScriptObject} for access to utility methods and variables. + * * See * http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html";>Java Scripting API * Javadoc. */ public class JexlScriptEngine extends AbstractScriptEngine { +public static final String JEXL_OBJECT_KEY = "JEXL"; + public static final String CONTEXT_KEY = "context"; private final ScriptEngineFactory factory; @@ -68,6 +74,8 @@ public JexlScriptEngine(final ScriptEngineFactory _factory) { factory = _factory; engine = new JexlEngine(); +// Add utility object +this.put(JEXL_OBJECT_KEY, new JexlScriptObject()); } /** {...@inheritdoc} */ @@ -110,6 +118,7 @@ } // This is mandated by JSR-223 (end of section SCR.4.3.4.1.2 - Script Execution) context.setAttribute(CONTEXT_KEY, context, ScriptContext.ENGINE_SCOPE); + try { Script script = engine.createScript(scriptText); JexlContext ctxt = new JexlContext(){ Added: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptObject.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptObject.java?rev=799932&view=auto == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptObject.java (added) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptObject.java Sat Aug 1 21:37:09 2009 @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.commons.jexl.scripting; + +import java.io.PrintStream; + +/** + * Implements variables and methods for use by JEXL scripts. + * + * The following items are defined: + * + * out - System.out + * err - System.err + * + * + * + */ +public class JexlScriptObject { + + public JexlScriptObject(){ + +} + +public static PrintStream getOut() { +return System.out; +} + +public static PrintStream getErr() { +return System.err; +} + +} Propchange: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptObject.java -- svn:eol-style = native Propchange: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptObject.java -- svn:keywords = Author Date Id Revision Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/org/a
svn commit: r799931 - /commons/proper/math/trunk/src/site/xdoc/navigation.xml
Author: psteitz Date: Sat Aug 1 21:35:31 2009 New Revision: 799931 URL: http://svn.apache.org/viewvc?rev=799931&view=rev Log: Dropped vestigal m1 file. Removed: commons/proper/math/trunk/src/site/xdoc/navigation.xml
svn commit: r799930 - /commons/proper/math/trunk/src/main/assembly/src.xml
Author: psteitz Date: Sat Aug 1 21:34:50 2009 New Revision: 799930 URL: http://svn.apache.org/viewvc?rev=799930&view=rev Log: Added test-jar.xml to source distro, cleaned up. Modified: commons/proper/math/trunk/src/main/assembly/src.xml Modified: commons/proper/math/trunk/src/main/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/assembly/src.xml?rev=799930&r1=799929&r2=799930&view=diff == --- commons/proper/math/trunk/src/main/assembly/src.xml (original) +++ commons/proper/math/trunk/src/main/assembly/src.xml Sat Aug 1 21:34:50 2009 @@ -27,19 +27,8 @@ -LICENSE* -NOTICE* -pom.xml -project.xml -project.properties -maven.xml -build.xml -build.properties.sample -checkstyle.xml -RELEASE-NOTES* -release-notes.jsl -findbugs-exclude-filter.xml -license-header.txt +*.txt +*.xml
svn commit: r799926 - in /commons/proper/jexl/branches/2.0/src: java/org/apache/commons/jexl/scripting/JexlScriptEngine.java test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
Author: sebb Date: Sat Aug 1 21:09:34 2009 New Revision: 799926 URL: http://svn.apache.org/viewvc?rev=799926&view=rev Log: Ensure "context" key is defined in engine context Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java?rev=799926&r1=799925&r2=799926&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java Sat Aug 1 21:09:34 2009 @@ -55,6 +55,8 @@ */ public class JexlScriptEngine extends AbstractScriptEngine { +public static final String CONTEXT_KEY = "context"; + private final ScriptEngineFactory factory; private final JexlEngine engine; @@ -107,7 +109,7 @@ throw new NullPointerException("script and context must be non-null"); } // This is mandated by JSR-223 (end of section SCR.4.3.4.1.2 - Script Execution) -context.setAttribute("context", context, ScriptContext.ENGINE_SCOPE); +context.setAttribute(CONTEXT_KEY, context, ScriptContext.ENGINE_SCOPE); try { Script script = engine.createScript(scriptText); JexlContext ctxt = new JexlContext(){ Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java?rev=799926&r1=799925&r2=799926&view=diff == --- commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java (original) +++ commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Sat Aug 1 21:09:34 2009 @@ -49,6 +49,7 @@ assertEquals(newValue,engine.eval("old=value;value=value+1")); assertEquals(initialValue,engine.get("old")); assertEquals(newValue,engine.get("value")); + assertEquals(engine.getContext(),engine.get(JexlScriptEngine.CONTEXT_KEY)); } public void testNulls() throws Exception {
svn commit: r799925 - /commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
Author: sebb Date: Sat Aug 1 21:01:52 2009 New Revision: 799925 URL: http://svn.apache.org/viewvc?rev=799925&view=rev Log: Minor tidyup Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java?rev=799925&r1=799924&r2=799925&view=diff == --- commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java (original) +++ commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Sat Aug 1 21:01:52 2009 @@ -23,8 +23,6 @@ import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - import junit.framework.TestCase; public class JexlScriptEngineTest extends TestCase { @@ -116,7 +114,7 @@ assertNull(engine.get("this.is.a.test")); assertEquals(Boolean.TRUE, engine.eval("empty(this.is.a.test)")); final Object mymap = engine.eval("testmap=[ 'key1' => 'value1', 'key2' => 'value2' ]"); -assertTrue(mymap instanceof Map); -assertEquals(2,((Map)mymap).size()); +assertTrue(mymap instanceof Map); +assertEquals(2,((Map)mymap).size()); } }
svn commit: r799924 - /commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml
Author: psteitz Date: Sat Aug 1 20:57:47 2009 New Revision: 799924 URL: http://svn.apache.org/viewvc?rev=799924&view=rev Log: Added missing reference to genetics package. Modified: commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml Modified: commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml?rev=799924&r1=799923&r2=799924&view=diff == --- commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml Sat Aug 1 20:57:47 2009 @@ -71,7 +71,7 @@ -Commons Math is divided into fourteen subpackages, based on functionality provided. +Commons Math is divided into fifteen subpackages, based on functionality provided. org.apache.commons.math.stat - statistics, statistical tests org.apache.commons.math.analysis - rootfinding, integration, interpolation, polynomials @@ -87,6 +87,7 @@ org.apache.commons.math.estimation - parametric estimation problems org.apache.commons.math.optimization - functions minimization org.apache.commons.math.ode - Ordinary Differential Equations integration + org.apache.commons.math.genetics - Genetic Algorithms Package javadocs are here
svn commit: r799919 - /commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml
Author: sebb Date: Sat Aug 1 20:25:38 2009 New Revision: 799919 URL: http://svn.apache.org/viewvc?rev=799919&view=rev Log: JEXL-50 - correct DIV documentation JEXL-64 - clarify allowable variable names Modified: commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml Modified: commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml?rev=799919&r1=799918&r2=799919&view=diff == --- commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml (original) +++ commons/proper/jexl/branches/2.0/xdocs/reference/syntax.xml Sat Aug 1 20:25:38 2009 @@ -60,8 +60,19 @@ Invalid: 9v,!a99,1$ +Variable names are case-sensitive, e.g. var1 and Var1 are different variables. + + JEXL also supports ant-style variables, e.g. my.dotted.var is a valid variable name. + + N.B. the following keywords are reserved, and cannot be used as a variable name or property when using the dot operator: + or and eq ne lt gt le ge div mod not null true false new + For example, + my.new.dotted.var + is invalid. + In such cases, the [ ] operator can be used, for example: + my.['new'].dotted.var NOTE: JEXL does not support variables with hyphens in them, e.g. @@ -306,17 +317,11 @@ Division -The usual / operator is used. +The usual / operator is used, or one can use the div operator. For example val1 / val2 - - - - Integer Division - -The div operator is used. -For example -4 div 3 gives 1. +or +val1 div val2
svn commit: r799918 - /commons/proper/compress/trunk/src/changes/changes.xml
Author: bodewig Date: Sat Aug 1 20:25:13 2009 New Revision: 799918 URL: http://svn.apache.org/viewvc?rev=799918&view=rev Log: document today's changes Modified: commons/proper/compress/trunk/src/changes/changes.xml Modified: commons/proper/compress/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/changes/changes.xml?rev=799918&r1=799917&r2=799918&view=diff == --- commons/proper/compress/trunk/src/changes/changes.xml (original) +++ commons/proper/compress/trunk/src/changes/changes.xml Sat Aug 1 20:25:13 2009 @@ -23,6 +23,17 @@ + +Delegate all read and write methods in GZip stream in order to +speed up operations. + + +ArchiveEntry now has a getLastModifiedDate method. + + +The ar and cpio streams now properly read and write last +modified times. + TarOutputStream can leave garbage at the end of the archive
svn commit: r799917 - in /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip: GzipCompressorInputStream.java GzipCompressorOutputStream.java
Author: bodewig Date: Sat Aug 1 20:17:00 2009 New Revision: 799917 URL: http://svn.apache.org/viewvc?rev=799917&view=rev Log: delegate all read/write methods in gzip streams. COMPRESS-83 Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java?rev=799917&r1=799916&r2=799917&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java Sat Aug 1 20:17:00 2009 @@ -47,7 +47,26 @@ * @see java.io.InputStream#read() */ public int read() throws IOException { -this.count(1); -return in.read(); +int read = in.read(); +this.count(read < 0 ? -1 : 1); +return read; +} + +/* (non-Javadoc) + * @see java.io.InputStream#read(byte[]) + */ +public int read(byte[] b) throws IOException { +int read = in.read(b); +this.count(read); +return read; +} + +/* (non-Javadoc) + * @see java.io.InputStream#read(byte[], int, int) + */ +public int read(byte[] b, int from, int length) throws IOException { +int read = in.read(b, from, length); +this.count(read); +return read; } } Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java?rev=799917&r1=799916&r2=799917&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java Sat Aug 1 20:17:00 2009 @@ -36,6 +36,14 @@ out.write(b); } +public void write(byte[] b) throws IOException { +out.write(b); +} + +public void write(byte[] b, int from, int length) throws IOException { +out.write(b, from, length); +} + public void close() throws IOException { out.close(); }
svn commit: r799915 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/cpio/ test/java/org/apache/commons/compress/archivers/
Author: bodewig Date: Sat Aug 1 20:07:53 2009 New Revision: 799915 URL: http://svn.apache.org/viewvc?rev=799915&view=rev Log: check name/directory/size and lastModified read from cpio is consistent with what we write Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java?rev=799915&r1=799914&r2=799915&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java Sat Aug 1 20:07:53 2009 @@ -264,6 +264,7 @@ } // TODO set other fields as needed setMode(mode); +setTime(inputFile.lastModified() / 1000); } /** Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java?rev=799915&r1=799914&r2=799915&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java Sat Aug 1 20:07:53 2009 @@ -48,7 +48,7 @@ * entry.setFileSize(contents.length()); * entry.setMode(CpioConstants.C_ISREG); // regular file * ... set other attributes, e.g. time, number of links - * out.putNextEntry(entry); + * out.putArchiveEntry(entry); * out.write(testContents.getBytes()); * out.close(); * Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java?rev=799915&r1=799914&r2=799915&view=diff == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java (original) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java Sat Aug 1 20:07:53 2009 @@ -29,6 +29,8 @@ import org.apache.commons.compress.AbstractTestCase; import org.apache.commons.compress.archivers.cpio.CpioArchiveEntry; import org.apache.commons.compress.archivers.cpio.CpioConstants; +import org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream; +import org.apache.commons.compress.archivers.cpio.CpioArchiveOutputStream; import org.apache.commons.compress.utils.IOUtils; public final class CpioTestCase extends AbstractTestCase { @@ -88,11 +90,11 @@ Map result = new HashMap(); ArchiveEntry entry = null; while ((entry = in.getNextEntry()) != null) { -File target = new File(dir, entry.getName()); -final OutputStream out = new FileOutputStream(target); +File cpioget = new File(dir, entry.getName()); +final OutputStream out = new FileOutputStream(cpioget); IOUtils.copy(in, out); out.close(); -result.put(entry.getName(), target); +result.put(entry.getName(), cpioget); } in.close(); is.close(); @@ -106,4 +108,191 @@ assertEquals("length of " + t.getAbsolutePath(), file2Length, t.length()); } +public void testDirectoryEntryFromFile() throws Exception { +File[] tmp = createTempDirAndFile(); +File archive = null; +CpioArchiveOutputStream tos = null; +CpioArchiveInputStream tis = null; +try { +archive = File.createTempFile("test.", ".cpio", tmp[0]); +archive.deleteOnExit(); +tos = new CpioArchiveOutputStream(new FileOutputStream(archive)); +long beforeArchiveWrite = tmp[0].lastModified(); +CpioArchiveEntry in = new CpioArchiveEntry(tmp[0], "foo"); +tos.putArchiveEntry(in); +tos.closeArchiveEntry(); +tos.close(); +tos = null; +tis = new CpioArchiveInputStream(new FileInputStream(archive)); +CpioArchiveEntry out = tis.g
svn commit: r799914 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java test/java/org/apache/commons/compress/archivers/ArTestCase.ja
Author: bodewig Date: Sat Aug 1 19:52:32 2009 New Revision: 799914 URL: http://svn.apache.org/viewvc?rev=799914&view=rev Log: check name/size and lastModified read from ar is consistent with what we write Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java?rev=799914&r1=799913&r2=799914&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java Sat Aug 1 19:52:32 2009 @@ -121,7 +121,7 @@ offset += write(n); offset = fill(offset, 16, ' '); -final String m = "" + (pEntry.getLastModified() / 1000); +final String m = "" + (pEntry.getLastModified()); if (m.length() > 12) { throw new IOException("modified too long"); } Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java?rev=799914&r1=799913&r2=799914&view=diff == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java (original) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java Sat Aug 1 19:52:32 2009 @@ -28,6 +28,8 @@ import org.apache.commons.compress.AbstractTestCase; import org.apache.commons.compress.archivers.ar.ArArchiveEntry; +import org.apache.commons.compress.archivers.ar.ArArchiveInputStream; +import org.apache.commons.compress.archivers.ar.ArArchiveOutputStream; import org.apache.commons.compress.utils.IOUtils; public final class ArTestCase extends AbstractTestCase { @@ -179,4 +181,192 @@ } +// TODO: revisit - does AR not support storing directories? +public void XtestDirectoryEntryFromFile() throws Exception { +File[] tmp = createTempDirAndFile(); +File archive = null; +ArArchiveOutputStream aos = null; +ArArchiveInputStream ais = null; +try { +archive = File.createTempFile("test.", ".ar", tmp[0]); +archive.deleteOnExit(); +aos = new ArArchiveOutputStream(new FileOutputStream(archive)); +long beforeArchiveWrite = tmp[0].lastModified(); +ArArchiveEntry in = new ArArchiveEntry(tmp[0], "foo"); +aos.putArchiveEntry(in); +aos.closeArchiveEntry(); +aos.close(); +aos = null; +ais = new ArArchiveInputStream(new FileInputStream(archive)); +ArArchiveEntry out = ais.getNextArEntry(); +ais.close(); +ais = null; +assertNotNull(out); +assertEquals("foo/", out.getName()); +assertEquals(0, out.getSize()); +// AR stores time with a granularity of 1 second +assertEquals(beforeArchiveWrite / 1000, + out.getLastModifiedDate().getTime() / 1000); +assertTrue(out.isDirectory()); +} finally { +if (ais != null) { +ais.close(); +} +if (aos != null) { +aos.close(); +} +if (archive != null) { +archive.delete(); +} +tmp[1].delete(); +tmp[0].delete(); +} +} + +// TODO: revisit - does AR not support storing directories? +public void XtestExplicitDirectoryEntry() throws Exception { +File[] tmp = createTempDirAndFile(); +File archive = null; +ArArchiveOutputStream aos = null; +ArArchiveInputStream ais = null; +try { +archive = File.createTempFile("test.", ".ar", tmp[0]); +archive.deleteOnExit(); +aos = new ArArchiveOutputStream(new FileOutputStream(archive)); +long beforeArchiveWrite = tmp[0].lastModified(); +ArArchiveEntry in = new ArArchiveEntry("foo", 0, 0, 0, 0, + tmp[1].lastModified() / 1000); +aos.putArchiveEntry(in); +aos.closeArchiveEntry(); +aos.close(); +aos = null; +ais = new ArArchiveInputStream(new FileInputStream(archive)); +
svn commit: r799913 - in /commons/proper/math/trunk/src/test/java/org/apache/commons/math: estimation/MinpackTest.java optimization/general/MinpackTest.java
Author: luc Date: Sat Aug 1 19:41:25 2009 New Revision: 799913 URL: http://svn.apache.org/viewvc?rev=799913&view=rev Log: changed test threshold, it was too tight for JRockit Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/estimation/MinpackTest.java commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/estimation/MinpackTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/estimation/MinpackTest.java?rev=799913&r1=799912&r2=799913&view=diff == --- commons/proper/math/trunk/src/test/java/org/apache/commons/math/estimation/MinpackTest.java (original) +++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/estimation/MinpackTest.java Sat Aug 1 19:41:25 2009 @@ -1206,6 +1206,7 @@ double[] theoreticalMinParams) { super(m, startParams, theoreticalStartCost, theoreticalMinCost, theoreticalMinParams); + setCostAccuracy(2.5e-8); } @Override Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java?rev=799913&r1=799912&r2=799913&view=diff == --- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java (original) +++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java Sat Aug 1 19:41:25 2009 @@ -1196,6 +1196,7 @@ double[] theoreticalMinParams) { super(m, startParams, theoreticalMinCost, theoreticalMinParams); + setCostAccuracy(2.5e-8); } @Override
svn commit: r799911 - in /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers: TarTestCase.java ZipTestCase.java
Author: bodewig Date: Sat Aug 1 19:32:12 2009 New Revision: 799911 URL: http://svn.apache.org/viewvc?rev=799911&view=rev Log: check name/directory/size and lastModified read from tar is consistent with what we write Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java?rev=799911&r1=799910&r2=799911&view=diff == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java (original) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java Sat Aug 1 19:32:12 2009 @@ -27,6 +27,8 @@ import org.apache.commons.compress.AbstractTestCase; import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; +import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.compress.utils.IOUtils; public final class TarTestCase extends AbstractTestCase { @@ -112,4 +114,189 @@ out.close(); } +public void testDirectoryEntryFromFile() throws Exception { +File[] tmp = createTempDirAndFile(); +File archive = null; +TarArchiveOutputStream tos = null; +TarArchiveInputStream tis = null; +try { +archive = File.createTempFile("test.", ".tar", tmp[0]); +archive.deleteOnExit(); +tos = new TarArchiveOutputStream(new FileOutputStream(archive)); +long beforeArchiveWrite = tmp[0].lastModified(); +TarArchiveEntry in = new TarArchiveEntry(tmp[0], "foo"); +tos.putArchiveEntry(in); +tos.closeArchiveEntry(); +tos.close(); +tos = null; +tis = new TarArchiveInputStream(new FileInputStream(archive)); +TarArchiveEntry out = tis.getNextTarEntry(); +tis.close(); +tis = null; +assertNotNull(out); +assertEquals("foo/", out.getName()); +assertEquals(0, out.getSize()); +// TAR stores time with a granularity of 1 second +assertEquals(beforeArchiveWrite / 1000, + out.getLastModifiedDate().getTime() / 1000); +assertTrue(out.isDirectory()); +} finally { +if (tis != null) { +tis.close(); +} +if (tos != null) { +tos.close(); +} +if (archive != null) { +archive.delete(); +} +tmp[1].delete(); +tmp[0].delete(); +} +} + +public void testExplicitDirectoryEntry() throws Exception { +File[] tmp = createTempDirAndFile(); +File archive = null; +TarArchiveOutputStream tos = null; +TarArchiveInputStream tis = null; +try { +archive = File.createTempFile("test.", ".tar", tmp[0]); +archive.deleteOnExit(); +tos = new TarArchiveOutputStream(new FileOutputStream(archive)); +long beforeArchiveWrite = tmp[0].lastModified(); +TarArchiveEntry in = new TarArchiveEntry("foo/"); +in.setModTime(beforeArchiveWrite); +tos.putArchiveEntry(in); +tos.closeArchiveEntry(); +tos.close(); +tos = null; +tis = new TarArchiveInputStream(new FileInputStream(archive)); +TarArchiveEntry out = tis.getNextTarEntry(); +tis.close(); +tis = null; +assertNotNull(out); +assertEquals("foo/", out.getName()); +assertEquals(0, out.getSize()); +assertEquals(beforeArchiveWrite / 1000, + out.getLastModifiedDate().getTime() / 1000); +assertTrue(out.isDirectory()); +} finally { +if (tis != null) { +tis.close(); +} +if (tos != null) { +tos.close(); +} +if (archive != null) { +archive.delete(); +} +tmp[1].delete(); +tmp[0].delete(); +} +} + +public void testFileEntryFromFile() throws Exception { +File[] tmp = createTempDirAndFile(); +File archive = null; +TarArchiveOutputStream tos = null; +TarArchiveInputStream tis = null; +FileInputStream fis = null; +try { +archive = File.createTempFile("test.", ".tar", tmp[0]); +archive.deleteOnExit
svn commit: r799910 - in /commons/proper/jexl/branches/2.0/src: java/org/apache/commons/jexl/scripting/JexlScriptEngine.java test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
Author: sebb Date: Sat Aug 1 19:31:11 2009 New Revision: 799910 URL: http://svn.apache.org/viewvc?rev=799910&view=rev Log: Script engine must throw NPE if either parameter is null Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java?rev=799910&r1=799909&r2=799910&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java Sat Aug 1 19:31:11 2009 @@ -75,6 +75,10 @@ /** {...@inheritdoc} */ public Object eval(Reader script, ScriptContext context) throws ScriptException { +// This is mandated by JSR-223 (see SCR.5.5.2 Methods) +if (script == null || context == null) { +throw new NullPointerException("script and context must be non-null"); +} BufferedReader reader = new BufferedReader(script); StringBuilder buffer = new StringBuilder(); try { @@ -98,8 +102,9 @@ /** {...@inheritdoc} */ @SuppressWarnings("unchecked") public Object eval(String scriptText, final ScriptContext context) throws ScriptException { -if (scriptText == null) { -return null; +// This is mandated by JSR-223 (see SCR.5.5.2 Methods) +if (scriptText == null || context == null) { +throw new NullPointerException("script and context must be non-null"); } // This is mandated by JSR-223 (end of section SCR.4.3.4.1.2 - Script Execution) context.setAttribute("context", context, ScriptContext.ENGINE_SCOPE); Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java?rev=799910&r1=799909&r2=799910&view=diff == --- commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java (original) +++ commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Sat Aug 1 19:31:11 2009 @@ -18,10 +18,12 @@ package org.apache.commons.jexl.scripting; +import java.io.Reader; import java.util.Map; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; +import javax.script.ScriptException; import junit.framework.TestCase; @@ -50,6 +52,25 @@ assertEquals(initialValue,engine.get("old")); assertEquals(newValue,engine.get("value")); } + +public void testNulls() throws Exception { +ScriptEngineManager manager = new ScriptEngineManager(); +assertNotNull("Manager should not be null", manager); +ScriptEngine engine = manager.getEngineByName("jexl"); +assertNotNull("Engine should not be null (name)", engine); +try { +engine.eval((String)null); +fail("Should have caused NPE"); +} catch (NullPointerException e) { +// NOOP +} +try { +engine.eval((Reader)null); +fail("Should have caused NPE"); +} catch (NullPointerException e) { +// NOOP +} +} public void testEngineNames() throws Exception { ScriptEngine engine;
svn commit: r799909 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/zip/ test/java/org/apache/commons/compress/ test/java/org/apache/commons/compress/archivers
Author: bodewig Date: Sat Aug 1 19:17:58 2009 New Revision: 799909 URL: http://svn.apache.org/viewvc?rev=799909&view=rev Log: check name/directory/size and lastModified read from zip is consistent with what we write Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java?rev=799909&r1=799908&r2=799909&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java Sat Aug 1 19:17:58 2009 @@ -87,7 +87,8 @@ } public ZipArchiveEntry(File inputFile, String entryName) { -this(entryName); +this(inputFile.isDirectory() && !entryName.endsWith("/") ? + entryName + "/" : entryName); if (inputFile.isFile()){ setSize(inputFile.length()); } Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java?rev=799909&r1=799908&r2=799909&view=diff == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java (original) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java Sat Aug 1 19:17:58 2009 @@ -338,4 +338,25 @@ protected String getExpectedString(ArchiveEntry entry) { return entry.getName(); } + +/** + * Creates a temporary directory and a temporary file inside that + * directory, returns both of them (the directory is the first + * element of the two element array). + */ +protected File[] createTempDirAndFile() throws IOException { +File tmpDir = File.createTempFile("testdir", ""); +tmpDir.delete(); +tmpDir.mkdir(); +tmpDir.deleteOnExit(); +File tmpFile = File.createTempFile("testfile", "", tmpDir); +tmpFile.deleteOnExit(); +FileOutputStream fos = new FileOutputStream(tmpFile); +try { +fos.write(new byte[] {'f', 'o', 'o'}); +return new File[] {tmpDir, tmpFile}; +} finally { +fos.close(); +} +} } Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java?rev=799909&r1=799908&r2=799909&view=diff == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java (original) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java Sat Aug 1 19:17:58 2009 @@ -24,10 +24,13 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; +import java.util.Date; import java.util.List; import org.apache.commons.compress.AbstractTestCase; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; +import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; +import org.apache.commons.compress.archivers.zip.ZipFile; import org.apache.commons.compress.utils.IOUtils; public final class ZipTestCase extends AbstractTestCase { @@ -153,4 +156,174 @@ results.contains("test2.xml"); results.contains("test3.xml"); } + +public void testDirectoryEntryFromFile() throws Exception { +File[] tmp = createTempDirAndFile(); +File archive = null; +ZipArchiveOutputStream zos = null; +ZipFile zf = null; +try { +archive = File.createTempFile("test.", ".zip", tmp[0]); +archive.deleteOnExit(); +zos = new ZipArchiveOutputStream(archive); +long beforeArchiveWrite = tmp[0].lastModified(); +ZipArchiveEntry in = new ZipArchiveEntry(tmp[0], "foo"); +zos.putArchiveEntry(in); +zos.closeArchiveEntry(); +zos.close(); +zos = null; +zf = new ZipFile(archive); +ZipArchiveEntry out = zf.getEntry("foo/"); +asse
svn commit: r799906 - in /commons/proper/math/trunk: RELEASE-NOTES.txt src/main/java/org/apache/commons/math/linear/RealMatrix.java src/site/xdoc/changes.xml
Author: luc Date: Sat Aug 1 19:01:59 2009 New Revision: 799906 URL: http://svn.apache.org/viewvc?rev=799906&view=rev Log: fixed an error in RealMatrix javadoc JIRA: MATH-281 Modified: commons/proper/math/trunk/RELEASE-NOTES.txt commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java commons/proper/math/trunk/src/site/xdoc/changes.xml Modified: commons/proper/math/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/RELEASE-NOTES.txt?rev=799906&r1=799905&r2=799906&view=diff == --- commons/proper/math/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/math/trunk/RELEASE-NOTES.txt Sat Aug 1 19:01:59 2009 @@ -367,6 +367,8 @@ when a tentative bracketing interval has a root exactly at one of its end points. Previously, such intervals triggered an exception. +o MATH-281: Fixed an error in RealMatrix javadoc + Changes: o Changed the return type of the various interpolation algorithms to Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java?rev=799906&r1=799905&r2=799906&view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealMatrix.java Sat Aug 1 19:01:59 2009 @@ -60,7 +60,7 @@ * Compute this minus m. * * @param mmatrix to be subtracted - * @return this + m + * @return this - m * @throws IllegalArgumentException if m is not the same size as this */ RealMatrix subtract(RealMatrix m) throws IllegalArgumentException; Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=799906&r1=799905&r2=799906&view=diff == --- commons/proper/math/trunk/src/site/xdoc/changes.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/changes.xml Sat Aug 1 19:01:59 2009 @@ -65,6 +65,9 @@ Most of the compilation errors users will encounter after the switch will be due to classes moved due to package reorganization. These errors are simply solved by adjusting the import statements in users code."> + +Fixed an error in RealMatrix javadoc + Added an implementation of the Mersenne twister pseudo random number generator from Makoto Matsumoto and Takuji Nishimura
svn commit: r799905 - /commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
Author: sebb Date: Sat Aug 1 18:48:54 2009 New Revision: 799905 URL: http://svn.apache.org/viewvc?rev=799905&view=rev Log: Change assertions so they don't depend on order of Map iteration. Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java?rev=799905&r1=799904&r2=799905&view=diff == --- commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java (original) +++ commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Sat Aug 1 18:48:54 2009 @@ -18,6 +18,8 @@ package org.apache.commons.jexl.scripting; +import java.util.Map; + import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; @@ -93,6 +95,7 @@ assertNull(engine.get("this.is.a.test")); assertEquals(Boolean.TRUE, engine.eval("empty(this.is.a.test)")); final Object mymap = engine.eval("testmap=[ 'key1' => 'value1', 'key2' => 'value2' ]"); -assertEquals("{key1=value1, key2=value2}",mymap.toString()); +assertTrue(mymap instanceof Map); +assertEquals(2,((Map)mymap).size()); } }
svn commit: r799903 - in /commons/proper/jexl/branches/2.0/src: java/org/apache/commons/jexl/Interpreter.java test/org/apache/commons/jexl/IssuesTest.java
Author: sebb Date: Sat Aug 1 17:56:55 2009 New Revision: 799903 URL: http://svn.apache.org/viewvc?rev=799903&view=rev Log: JEXL-62 Avoid NPE in Interpreter when () omitted from method with no parameters (e.g. var.hashCode) Includes test case. Thanks for patch by Henri Biestro . Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/IssuesTest.java Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java?rev=799903&r1=799902&r2=799903&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/Interpreter.java Sat Aug 1 17:56:55 2009 @@ -279,6 +279,7 @@ JexlNode propertyNode = null; Object property = null; boolean isVariable = true; +int v = 0; StringBuilder variableName = null; // 1: follow children till penultimate int last = left.jjtGetNumChildren() - 1; @@ -293,9 +294,11 @@ // if we get null back as a result, check for an ant variable if (isVariable) { String name = ((ASTIdentifier) objectNode).image; -if (c == 0) { +if (v == 0) { variableName = new StringBuilder(name); -} else { +v = 1; +} +for(; v <= c; ++v) { variableName.append('.'); variableName.append(name); } @@ -958,6 +961,7 @@ StringBuilder variableName = null; Map vars = context.getVars(); boolean isVariable = true; +int v = 0; for (int i = 0; i < numChildren; i++) { JexlNode theNode = node.jjtGetChild(i); isVariable &= (theNode instanceof ASTIdentifier); @@ -965,9 +969,11 @@ // if we get null back a result, check for an ant variable if (result == null && isVariable) { String name = ((ASTIdentifier) theNode).image; -if (i == 0) { +if (v == 0) { variableName = new StringBuilder(name); -} else { +v = 1; +} +for(; v <= i; ++v) { variableName.append('.'); variableName.append(name); } Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/IssuesTest.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/IssuesTest.java?rev=799903&r1=799902&r2=799903&view=diff == --- commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/IssuesTest.java (original) +++ commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/IssuesTest.java Sat Aug 1 17:56:55 2009 @@ -183,4 +183,35 @@ } } +// JEXL-62 +public void test62() throws Exception { +JexlContext ctxt; +JexlEngine jexl = new JexlEngine(); +jexl.setSilent(true); // to avoid throwing JexlException on null method call + +Script jscript; + +ctxt = JexlHelper.createContext(); +jscript = jexl.createScript("dummy.hashCode()"); +assertEquals(jscript.getText(), null, jscript.execute(ctxt)); // OK + +ctxt.getVars().put("dummy", "abcd"); +assertEquals(jscript.getText(), Integer.valueOf("abcd".hashCode()), jscript.execute(ctxt)); // OK + +jscript = jexl.createScript("dummy.hashCode"); +assertEquals(jscript.getText(), null, jscript.execute(ctxt)); // OK + +Expression jexpr; + +ctxt = JexlHelper.createContext(); +jexpr = jexl.createExpression("dummy.hashCode()"); +assertEquals(jexpr.getExpression(), null, jexpr.evaluate(ctxt)); // OK + +ctxt.getVars().put("dummy", "abcd"); +assertEquals(jexpr.getExpression(), Integer.valueOf("abcd".hashCode()), jexpr.evaluate(ctxt)); // OK + +jexpr = jexl.createExpression("dummy.hashCode"); +assertEquals(jexpr.getExpression(), null, jexpr.evaluate(ctxt)); // OK +} + } \ No newline at end of file
svn commit: r799902 - /commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
Author: sebb Date: Sat Aug 1 17:19:21 2009 New Revision: 799902 URL: http://svn.apache.org/viewvc?rev=799902&view=rev Log: Another simple test Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java?rev=799902&r1=799901&r2=799902&view=diff == --- commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java (original) +++ commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java Sat Aug 1 17:19:21 2009 @@ -81,6 +81,18 @@ assertEquals(Long.valueOf(8),engine.get("both")); assertEquals(Integer.valueOf(42),engine.get("newvar")); assertNull(manager.get("newvar")); -// TODO how to delete variables in Jexl? +} + +public void testDottedNames() throws Exception { +ScriptEngine engine; +ScriptEngineManager manager = new ScriptEngineManager(); +assertNotNull("Manager should not be null", manager); +engine = manager.getEngineByName("JEXL"); +assertNotNull("Engine should not be null (JEXL)", engine); +engine.eval("this.is.a.test=null"); +assertNull(engine.get("this.is.a.test")); +assertEquals(Boolean.TRUE, engine.eval("empty(this.is.a.test)")); +final Object mymap = engine.eval("testmap=[ 'key1' => 'value1', 'key2' => 'value2' ]"); +assertEquals("{key1=value1, key2=value2}",mymap.toString()); } }
svn commit: r799900 - /commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java
Author: sebb Date: Sat Aug 1 17:18:36 2009 New Revision: 799900 URL: http://svn.apache.org/viewvc?rev=799900&view=rev Log: Javadoc Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java?rev=799900&r1=799899&r2=799900&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlEngine.java Sat Aug 1 17:18:36 2009 @@ -102,8 +102,8 @@ */ protected final Parser parser = new Parser(new StringReader(";")); //$NON-NLS-1$ /** - * Whether expressions evaluated by this engine will throw exceptions or - * return null. + * Whether expressions evaluated by this engine will throw exceptions (false) or + * return null (true). Default is false. */ protected boolean silent = false; /** @@ -192,7 +192,7 @@ /** * Checks whether this engine throws JexlException during evaluation. - * @return true if silent, false otherwise + * @return true if silent, false (default) otherwise */ public boolean isSilent() { return this.silent;
svn commit: r799892 - /commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java
Author: sebb Date: Sat Aug 1 15:52:15 2009 New Revision: 799892 URL: http://svn.apache.org/viewvc?rev=799892&view=rev Log: Correct Javadoc to agree with updated implementation Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java?rev=799892&r1=799891&r2=799892&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/JexlScriptEngine.java Sat Aug 1 15:52:15 2009 @@ -42,7 +42,12 @@ /** * Implements the Jexl ScriptEngine for JSF-223. * - * This implementation only gives access to the ENGINE_SCOPE bindings. + * This implementation gives access to both ENGINE_SCOPE and GLOBAL_SCOPE bindings. + * When a JEXL script accesses a variable for read or write, + * this implementation checks first ENGINE and then GLOBAL scope. + * The first one found is used. + * If no variable is found, and the JEXL script is writing to a variable, + * it will be stored in the ENGINE scope. * * See * http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html";>Java Scripting API
svn commit: r799884 - /commons/proper/math/trunk/test-jar.xml
Author: luc Date: Sat Aug 1 15:10:11 2009 New Revision: 799884 URL: http://svn.apache.org/viewvc?rev=799884&view=rev Log: updated test-jar.xml according to new maven-compliant standard directory layout Modified: commons/proper/math/trunk/test-jar.xml Modified: commons/proper/math/trunk/test-jar.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/test-jar.xml?rev=799884&r1=799883&r2=799884&view=diff == --- commons/proper/math/trunk/test-jar.xml (original) +++ commons/proper/math/trunk/test-jar.xml Sat Aug 1 15:10:11 2009 @@ -81,7 +81,7 @@ - + @@ -107,7 +107,7 @@ - +
svn commit: r799882 - in /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers: ar/ArArchiveEntry.java ar/ArArchiveInputStream.java cpio/CpioArchiveOutputStream.java
Author: bodewig Date: Sat Aug 1 15:04:22 2009 New Revision: 799882 URL: http://svn.apache.org/viewvc?rev=799882&view=rev Log: now ar and cpio really use seconds internally and read/write them as such. Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java?rev=799882&r1=799881&r2=799882&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java Sat Aug 1 15:04:22 2009 @@ -70,11 +70,32 @@ private final long lastModified; private final long length; +/** + * Create a new instance using a couple of default values. + * + * Sets userId and groupId to 0, the octal file mode to 644 and + * the last modified time to the current time. + * + * @param name name of the entry + * @param length length of the entry in bytes + */ public ArArchiveEntry(String name, long length) { -this(name, length, 0, 0, DEFAULT_MODE, System.currentTimeMillis()); +this(name, length, 0, 0, DEFAULT_MODE, + System.currentTimeMillis() / 1000); } -public ArArchiveEntry(String name, long length, int userId, int groupId, int mode, long lastModified) { +/** + * Create a new instance. + * + * @param name name of the entry + * @param length length of the entry in bytes + * @param userId numeric user id + * @param groupId numeric group id + * @param mode file mode + * @param lastModified last modified time in seconds since the epoch + */ +public ArArchiveEntry(String name, long length, int userId, int groupId, + int mode, long lastModified) { this.name = name; this.length = length; this.userId = userId; @@ -83,9 +104,13 @@ this.lastModified = lastModified; } +/** + * Create a new instance using the attributes of the given file + */ public ArArchiveEntry(File inputFile, String entryName) { // TODO sort out mode -this(entryName, inputFile.isFile() ? inputFile.length() : 0, 0, 0, 0, inputFile.lastModified()); +this(entryName, inputFile.isFile() ? inputFile.length() : 0, + 0, 0, 0, inputFile.lastModified() / 1000); } public long getSize() { @@ -108,6 +133,9 @@ return mode; } +/** + * Last modified time in seconds since the epoch. + */ public long getLastModified() { return lastModified; } Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java?rev=799882&r1=799881&r2=799882&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java Sat Aug 1 15:04:22 2009 @@ -142,10 +142,20 @@ if (temp.endsWith("/")) { temp = temp.substring(0, temp.length() - 1); } -currentEntry = new ArArchiveEntry(temp, Long.parseLong(new String(length).trim())); +currentEntry = new ArArchiveEntry(temp, asLong(length), asInt(userid), + asInt(groupid), asInt(filemode), + asLong(lastmodified)); return currentEntry; } +private long asLong(byte[] input) { +return Long.parseLong(new String(input).trim()); +} + +private int asInt(byte[] input) { +return Integer.parseInt(new String(input).trim()); +} + /* * (non-Javadoc) * Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java?rev=799882&r1=799881&r2=799882&view=diff ===
svn commit: r799881 - /commons/proper/math/trunk/build.xml
Author: luc Date: Sat Aug 1 14:54:20 2009 New Revision: 799881 URL: http://svn.apache.org/viewvc?rev=799881&view=rev Log: updated ant build.xml according to new maven-compliant standard directory layout Modified: commons/proper/math/trunk/build.xml Modified: commons/proper/math/trunk/build.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/build.xml?rev=799881&r1=799880&r2=799881&view=diff == --- commons/proper/math/trunk/build.xml (original) +++ commons/proper/math/trunk/build.xml Sat Aug 1 14:54:20 2009 @@ -52,13 +52,16 @@ - + - + - + + + + @@ -167,7 +170,7 @@ - +
svn commit: r799880 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/ main/java/org/apache/commons/compress/archivers/ar/ main/java/org/apache/commons/compress/
Author: bodewig Date: Sat Aug 1 14:53:32 2009 New Revision: 799880 URL: http://svn.apache.org/viewvc?rev=799880&view=rev Log: whitespace Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveEntry.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java?rev=799880&r1=799879&r2=799880&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java Sat Aug 1 14:53:32 2009 @@ -26,16 +26,16 @@ public interface ArchiveEntry { /** The name of the entry in the archive. May refer to a file or directory or other item */ - public String getName(); - - /** The (uncompressed) size of the entry. May be -1 (SIZE_UNKNOWN) if the size is unknown */ - public long getSize(); - - /** Special value indicating that the size is unknown */ - public static final long SIZE_UNKNOWN = -1; - - /** True if the entry refers to a directory */ - public boolean isDirectory(); +public String getName(); + +/** The (uncompressed) size of the entry. May be -1 (SIZE_UNKNOWN) if the size is unknown */ +public long getSize(); + +/** Special value indicating that the size is unknown */ +public static final long SIZE_UNKNOWN = -1; + +/** True if the entry refers to a directory */ +public boolean isDirectory(); /** The last modified date of the entry */ public Date getLastModifiedDate(); Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java?rev=799880&r1=799879&r2=799880&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java Sat Aug 1 14:53:32 2009 @@ -56,74 +56,74 @@ /** The trailer for each entry */ public static final String TRAILER = "`\012"; - + /** * SVR4/GNU adds a trailing / to names; BSD does not. * They also vary in how names longer than 16 characters are represented. * (Not yet supported by this implementation) */ private final String name; - private final int userId; - private final int groupId; - private final int mode; +private final int userId; +private final int groupId; +private final int mode; private static final int DEFAULT_MODE = 33188; // = (octal) 0100644 - private final long lastModified; - private final long length; +private final long lastModified; +private final long length; - public ArArchiveEntry(String name, long length) { - this(name, length, 0, 0, DEFAULT_MODE, System.currentTimeMillis()); - } - - public ArArchiveEntry(String name, long length, int userId, int groupId, int mode, long lastModified) { - this.name = name; - this.length = length; - this.userId = userId; - this.groupId = groupId; - this.mode = mode; - this.lastModified = lastModified; - } +public ArArchiveEntry(String name, long length) { +this(name, length, 0, 0, DEFAULT_MODE, System.currentTimeMillis()); +} - public ArArchiveEntry(File inputFile, String entryName) { - // TODO sort out mode +public ArArchiveEntry(String name, long length, int userId, int groupId, int mode, long lastModified) { +this.name = name; +this.length = length; +this.userId = userId; +this.groupId = groupId; +this.mode = mode; +this.lastModified = lastModified; +} + +public ArArchiveEntry(File inputFile, String entryName) { +// TODO sort out mode this(entryName, inputFile.isFile() ? inputFile.length() : 0, 0, 0, 0, inputFile.lastModified()); } public long getSize() { - return this.getLength(); - } - -
svn commit: r799879 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/ main/java/org/apache/commons/compress/archivers/ar/ main/java/org/apache/commons/compress/
Author: bodewig Date: Sat Aug 1 14:52:15 2009 New Revision: 799879 URL: http://svn.apache.org/viewvc?rev=799879&view=rev Log: add getLastModifiedDate to ArchiveEntry - implement it assuming cpio and ar use seconds since epoch for their time values Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveEntry.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java Sat Aug 1 14:52:15 2009 @@ -18,6 +18,8 @@ */ package org.apache.commons.compress.archivers; +import java.util.Date; + /** * Represents an entry of an archive. */ @@ -34,4 +36,7 @@ /** True if the entry refers to a directory */ public boolean isDirectory(); + +/** The last modified date of the entry */ +public Date getLastModifiedDate(); } Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java Sat Aug 1 14:52:15 2009 @@ -19,6 +19,7 @@ package org.apache.commons.compress.archivers.ar; import java.io.File; +import java.util.Date; import org.apache.commons.compress.archivers.ArchiveEntry; @@ -111,6 +112,11 @@ return lastModified; } +/** {...@inheritdocs} */ +public Date getLastModifiedDate() { +return new Date(1000 * getLastModified()); +} + public long getLength() { return length; } Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java Sat Aug 1 14:52:15 2009 @@ -19,6 +19,7 @@ package org.apache.commons.compress.archivers.cpio; import java.io.File; +import java.util.Date; import org.apache.commons.compress.archivers.ArchiveEntry; @@ -492,6 +493,11 @@ return this.mtime; } +/** {...@inheritdocs} */ +public Date getLastModifiedDate() { +return new Date(1000 * getTime()); +} + /** * Get the user id. * Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java Sat Aug 1 14:52:15 2009 @@ -463,6 +463,11 @@ return new Date(modTime * MILLIS_PER_SECOND); } +/** {...@inheritdocs} */ +public Date getLastModifiedDate() { +return getModTime(); +} + /** * Get this entry's file. * Modified: commons/proper/compress/trunk/src
svn commit: r799875 - in /commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl: context/package.html junit/package.html package.html parser/package.html scripting/package.html util/intros
Author: sebb Date: Sat Aug 1 14:44:44 2009 New Revision: 799875 URL: http://svn.apache.org/viewvc?rev=799875&view=rev Log: Add missing AL headers; close tags properly Added: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/package.html (with props) Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/context/package.html commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/junit/package.html commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/package.html commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/util/introspection/package.html commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/util/package.html Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/context/package.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/context/package.html?rev=799875&r1=799874&r2=799875&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/context/package.html (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/context/package.html Sat Aug 1 14:44:44 2009 @@ -1,10 +1,26 @@ + Package Documentation for org.apache.commons.jexl.context Package Simple JexlContext implementations. - + Introduction Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/junit/package.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/junit/package.html?rev=799875&r1=799874&r2=799875&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/junit/package.html (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/junit/package.html Sat Aug 1 14:44:44 2009 @@ -1,10 +1,26 @@ + Package Documentation for org.apache.commons.jexl.junit Package Using JEXL expressions in JUnit assertions. - + Introduction Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/package.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/package.html?rev=799875&r1=799874&r2=799875&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/package.html (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/package.html Sat Aug 1 14:44:44 2009 @@ -1,10 +1,26 @@ + Package Documentation for org.apache.commons.jexl Package Provides a framework for evaluating JEXL expressions. - + Introduction Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html?rev=799875&r1=799874&r2=799875&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html Sat Aug 1 14:44:44 2009 @@ -1,4 +1,20 @@ + Package Documentation for org.apache.commons.jexl.parser Package Added: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/package.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/package.html?rev=799875&view=auto == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/package.html (added) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/package.html Sat Aug 1 14:44:44 2009 @@ -0,0 +1,34 @@ + + + + Package Documentation for org.apache.commons.jexl.scripting Package + + + Contains the JSR-223 Scripting Engine for JEXL script. + + + +Introduction + + + Introduction + + This package contains the JSR-223 Scripting Engine for JEXL script. + + + Propchange: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/scripting/package.html -- svn:eol-style = native Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/util/introspection/package.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/util/introspection/package.html?rev=799875&r
svn commit: r799874 - in /commons/proper/math/trunk: ./ src/test/java/ src/test/java/org/ src/test/java/org/apache/commons/math/random/ src/test/java/org/apache/commons/math/stat/data/ src/test/org/ s
Author: luc Date: Sat Aug 1 14:44:08 2009 New Revision: 799874 URL: http://svn.apache.org/viewvc?rev=799874&view=rev Log: moved test java and resources directories for compliance with maven standard directory layout Added: commons/proper/math/trunk/src/test/java/ commons/proper/math/trunk/src/test/java/org/ - copied from r799858, commons/proper/math/trunk/src/test/org/ commons/proper/math/trunk/src/test/resources/ commons/proper/math/trunk/src/test/resources/org/ commons/proper/math/trunk/src/test/resources/org/apache/ commons/proper/math/trunk/src/test/resources/org/apache/commons/ commons/proper/math/trunk/src/test/resources/org/apache/commons/math/ commons/proper/math/trunk/src/test/resources/org/apache/commons/math/random/ commons/proper/math/trunk/src/test/resources/org/apache/commons/math/random/emptyFile.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/random/emptyFile.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/random/testData.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/random/testData.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/ commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/ commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/Lew.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/Lew.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/Lottery.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/Lottery.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/Mavro.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/Mavro.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/Michelso.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/Michelso.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/NumAcc1.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/NumAcc1.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/NumAcc2.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/NumAcc2.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/NumAcc3.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/NumAcc3.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/NumAcc4.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/NumAcc4.txt commons/proper/math/trunk/src/test/resources/org/apache/commons/math/stat/data/PiDigits.txt - copied unchanged from r799858, commons/proper/math/trunk/src/test/org/apache/commons/math/stat/data/PiDigits.txt Removed: commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/emptyFile.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/testData.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/Lew.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/Lottery.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/Mavro.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/Michelso.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/NumAcc1.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/NumAcc2.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/NumAcc3.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/NumAcc4.txt commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/data/PiDigits.txt commons/proper/math/trunk/src/test/org/ Modified: commons/proper/math/trunk/pom.xml Modified: commons/proper/math/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/pom.xml?rev=799874&r1=799873&r2=799874&view=diff == --- commons/proper/math/trunk/pom.xml (original) +++ commons/proper/math/trunk/pom.xml Sat Aug 1 14:44:08 2009 @@ -229,16 +229,6 @@ -src/test - - - src/test - -**/*.xml -**/*.txt - - - org.apache.maven.plugins
svn commit: r799872 - in /commons/proper/jexl/branches/2.0: PROPOSAL.html STATUS.html doap_jexl.rdf
Author: sebb Date: Sat Aug 1 14:34:51 2009 New Revision: 799872 URL: http://svn.apache.org/viewvc?rev=799872&view=rev Log: Add missing AL headers; close tags properly Modified: commons/proper/jexl/branches/2.0/PROPOSAL.html commons/proper/jexl/branches/2.0/STATUS.html commons/proper/jexl/branches/2.0/doap_jexl.rdf Modified: commons/proper/jexl/branches/2.0/PROPOSAL.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/PROPOSAL.html?rev=799872&r1=799871&r2=799872&view=diff == --- commons/proper/jexl/branches/2.0/PROPOSAL.html (original) +++ commons/proper/jexl/branches/2.0/PROPOSAL.html Sat Aug 1 14:34:51 2009 @@ -1,4 +1,20 @@ + Proposal for Jexl Package Modified: commons/proper/jexl/branches/2.0/STATUS.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/STATUS.html?rev=799872&r1=799871&r2=799872&view=diff == --- commons/proper/jexl/branches/2.0/STATUS.html (original) +++ commons/proper/jexl/branches/2.0/STATUS.html Sat Aug 1 14:34:51 2009 @@ -1,19 +1,35 @@ + Status File for Apache Commons "Jexl" Package - + The Apache Commons Jexl Package -$Id$ +$Id$ [Introduction] [Dependencies] [Release Info] [Committers] [Action Items] - + @@ -63,7 +79,7 @@ 3. RELEASE INFO -Current Release: +Current Release: Planned Next Release: TBD @@ -81,7 +97,7 @@ mailto:pro...@apache.org";>Peter Royal - 5. ACTION ITEMS +5. ACTION ITEMS Want to help? Here's some "to do" items the team has identified. Modified: commons/proper/jexl/branches/2.0/doap_jexl.rdf URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/doap_jexl.rdf?rev=799872&r1=799871&r2=799872&view=diff == --- commons/proper/jexl/branches/2.0/doap_jexl.rdf (original) +++ commons/proper/jexl/branches/2.0/doap_jexl.rdf Sat Aug 1 14:34:51 2009 @@ -1,4 +1,20 @@ + http://usefulinc.com/ns/doap#"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:asfext="http://projects.apache.org/ns/asfext#"; xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; xmlns:doap="http://usefulinc.com/ns/doap#"; xml:lang="en"> http://commons.apache.org/jexl/";> Apache Commons JEXL
svn commit: r799870 - in /commons/proper/math/trunk: pom.xml src/java/ src/main/java/
Author: luc Date: Sat Aug 1 14:30:25 2009 New Revision: 799870 URL: http://svn.apache.org/viewvc?rev=799870&view=rev Log: moved main java directory for compliance with maven standard directory layout Added: commons/proper/math/trunk/src/main/java/ - copied from r799858, commons/proper/math/trunk/src/java/ Removed: commons/proper/math/trunk/src/java/ Modified: commons/proper/math/trunk/pom.xml Modified: commons/proper/math/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/pom.xml?rev=799870&r1=799869&r2=799870&view=diff == --- commons/proper/math/trunk/pom.xml (original) +++ commons/proper/math/trunk/pom.xml Sat Aug 1 14:30:25 2009 @@ -229,7 +229,6 @@ -src/java src/test
svn commit: r799869 - /commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html
Author: sebb Date: Sat Aug 1 14:26:44 2009 New Revision: 799869 URL: http://svn.apache.org/viewvc?rev=799869&view=rev Log: Close tags Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html?rev=799869&r1=799868&r2=799869&view=diff == --- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html (original) +++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/parser/package.html Sat Aug 1 14:26:44 2009 @@ -4,7 +4,7 @@ Contains the Parser for JEXL script. - + Introduction
svn commit: r799866 - in /commons/proper/math/trunk: pom.xml src/assembly/ src/main/assembly/
Author: luc Date: Sat Aug 1 14:23:42 2009 New Revision: 799866 URL: http://svn.apache.org/viewvc?rev=799866&view=rev Log: moved assembly directory for compliance with maven standard directory layout Added: commons/proper/math/trunk/src/main/assembly/ - copied from r799858, commons/proper/math/trunk/src/assembly/ Removed: commons/proper/math/trunk/src/assembly/ Modified: commons/proper/math/trunk/pom.xml Modified: commons/proper/math/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/pom.xml?rev=799866&r1=799865&r2=799866&view=diff == --- commons/proper/math/trunk/pom.xml (original) +++ commons/proper/math/trunk/pom.xml Sat Aug 1 14:23:42 2009 @@ -258,8 +258,8 @@ 2.2-beta-4 - src/assembly/src.xml - src/assembly/bin.xml + src/main/assembly/src.xml + src/main/assembly/bin.xml
svn commit: r799859 - in /commons/proper/codec/trunk: RELEASE-NOTES.txt xdocs/changes.xml
Author: niallp Date: Sat Aug 1 13:42:25 2009 New Revision: 799859 URL: http://svn.apache.org/viewvc?rev=799859&view=rev Log: Update the release notes for CODEC-59, CODEC-78 and CODEC-81 Modified: commons/proper/codec/trunk/RELEASE-NOTES.txt commons/proper/codec/trunk/xdocs/changes.xml Modified: commons/proper/codec/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/RELEASE-NOTES.txt?rev=799859&r1=799858&r2=799859&view=diff == --- commons/proper/codec/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/codec/trunk/RELEASE-NOTES.txt Sat Aug 1 13:42:25 2009 @@ -23,6 +23,7 @@ o [CODEC-52] Digest on InputStreams. o [CODEC-39] DigestUtils: Add methods for SHA-256, SHA-384, and SHA-512. o [CODEC-69] Streaming Base64 (Base64InputStream and Base64OutputStream added). +o [CODEC-59] Add methods to Base64 which work with String instead of byte[] Fixed bugs: @@ -39,6 +40,8 @@ o [CODEC-10] Using US_ENGLISH in Soundex caused an NullPointerException. o [CODEC-6] Source tarball spews files all over the place. o [CODEC-22] Base64.isArrayByteBase64() throws an ArrayIndexOutOfBoundsException for negative octets +o [CODEC-78] Base64: Improve Code Coverage +o [CODEC-81] Base64's new constructor parameters ignored Changes: Modified: commons/proper/codec/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/xdocs/changes.xml?rev=799859&r1=799858&r2=799859&view=diff == --- commons/proper/codec/trunk/xdocs/changes.xml (original) +++ commons/proper/codec/trunk/xdocs/changes.xml Sat Aug 1 13:42:25 2009 @@ -86,6 +86,15 @@ Streaming Base64 (Base64InputStream and Base64OutputStream added). + + Base64: Improve Code Coverage + + + Add methods to Base64 which work with String instead of byte[] + + + Base64's new constructor parameters ignored +
svn commit: r799857 [2/2] - in /commons/proper/math/trunk: ./ src/assembly/ src/java/org/apache/commons/math/ src/java/org/apache/commons/math/analysis/ src/java/org/apache/commons/math/analysis/integ
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/ranking/NaturalRankingTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/ranking/NaturalRankingTest.java?rev=799857&r1=799856&r2=799857&view=diff == --- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/ranking/NaturalRankingTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/ranking/NaturalRankingTest.java Sat Aug 1 13:07:12 2009 @@ -26,7 +26,7 @@ * Test cases for NaturalRanking class * * @since 2.0 - * @version $Revision:$ $Date:$ + * @version $Revision$ $Date$ */ public class NaturalRankingTest extends TestCase { Propchange: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/ranking/NaturalRankingTest.java -- svn:keywords = Author Date Id Revision Propchange: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/MultipleLinearRegressionAbstractTest.java ('svn:mergeinfo' removed) Propchange: commons/proper/math/trunk/src/test/org/apache/commons/math/util/OpenIntToFieldTest.java -- svn:keywords = Author Date Id Revision Propchange: commons/proper/math/trunk/test-jar.xml -- svn:keywords = Date Author Id Revision HeadURL
svn commit: r799849 - /commons/proper/math/trunk/src/test/org/apache/commons/math/ode/TestProblem3.java
Author: luc Date: Sat Aug 1 12:15:19 2009 New Revision: 799849 URL: http://svn.apache.org/viewvc?rev=799849&view=rev Log: added a protection against infinite loops that occur with some JVM (Sun before 1.4, JRockit, ...) Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/TestProblem3.java Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/TestProblem3.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/TestProblem3.java?rev=799849&r1=799848&r2=799849&view=diff == --- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/TestProblem3.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/TestProblem3.java Sat Aug 1 12:15:19 2009 @@ -104,8 +104,8 @@ // solve Kepler's equation double E = t; double d = 0; -double corr = 0; -do { +double corr = 999.0; +for (int i = 0; (i < 50) && (Math.abs(corr) > 1.0e-12); ++i) { double f2 = e * Math.sin(E); double f0 = d - f2; double f1 = 1 - e * Math.cos(E); @@ -113,7 +113,7 @@ corr = f0 * f12 / (f1 * f12 - f0 * f2); d -= corr; E = t + d; -} while (Math.abs(corr) > 1.0e-12); +}; double cosE = Math.cos(E); double sinE = Math.sin(E);
svn commit: r799815 - in /commons/proper/codec/trunk/src: java/org/apache/commons/codec/binary/Base64.java test/org/apache/commons/codec/binary/Base64Test.java
Author: ggregory Date: Sat Aug 1 08:48:04 2009 New Revision: 799815 URL: http://svn.apache.org/viewvc?rev=799815&view=rev Log: [CODEC-78] Base64: Improve Code Coverage. Patch applied: https://issues.apache.org/jira/secure/attachment/12415223/codec78-evenMoreCoverage.patch Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java?rev=799815&r1=799814&r2=799815&view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java Sat Aug 1 08:48:04 2009 @@ -314,6 +314,10 @@ * @since 1.4 */ public Base64(int lineLength, byte[] lineSeparator, boolean urlSafe) { +if (lineSeparator == null) { +lineLength = 0; // disable chunk-separating +lineSeparator = CHUNK_SEPARATOR; // this just gets ignored +} this.lineLength = lineLength > 0 ? (lineLength / 4) * 4 : 0; this.lineSeparator = new byte[lineSeparator.length]; System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length); @@ -957,7 +961,7 @@ if (mod != 0) { len += 4 - mod; } -if (chunkSize > 0 && chunkSeparator != null) { +if (chunkSize > 0) { boolean lenChunksPerfectly = len % chunkSize == 0; len += (len / chunkSize) * chunkSeparator.length; if (!lenChunksPerfectly) { Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java?rev=799815&r1=799814&r2=799815&view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java Sat Aug 1 08:48:04 2009 @@ -63,6 +63,21 @@ byte[] encodedBytes = Base64.encodeBase64(StringUtils.getBytesUtf8(content)); encodedContent = StringUtils.newStringUtf8(encodedBytes); assertTrue("encoding hello world", encodedContent.equals("SGVsbG8gV29ybGQ=")); + +Base64 b64 = new Base64(76, null); // null lineSeparator same as saying no-chunking +encodedBytes = b64.encode(StringUtils.getBytesUtf8(content)); +encodedContent = StringUtils.newStringUtf8(encodedBytes); +assertTrue("encoding hello world", encodedContent.equals("SGVsbG8gV29ybGQ=")); + +b64 = new Base64(0, null); // null lineSeparator same as saying no-chunking +encodedBytes = b64.encode(StringUtils.getBytesUtf8(content)); +encodedContent = StringUtils.newStringUtf8(encodedBytes); +assertTrue("encoding hello world", encodedContent.equals("SGVsbG8gV29ybGQ=")); + +// bogus characters to decode (to skip actually) +byte[] decode = b64.decode("SGVsbG{éé}8gV29ybGQ="); +String decodeString = StringUtils.newStringUtf8(decode); +assertTrue("decode hello world", decodeString.equals("Hello World")); } /**