svn commit: r1294542 - /commons/proper/digester/trunk/src/site/site.xml
Author: simonetripodi Date: Tue Feb 28 10:09:03 2012 New Revision: 1294542 URL: http://svn.apache.org/viewvc?rev=1294542view=rev Log: added site XSD descriptor Modified: commons/proper/digester/trunk/src/site/site.xml Modified: commons/proper/digester/trunk/src/site/site.xml URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/site/site.xml?rev=1294542r1=1294541r2=1294542view=diff == --- commons/proper/digester/trunk/src/site/site.xml (original) +++ commons/proper/digester/trunk/src/site/site.xml Tue Feb 28 10:09:03 2012 @@ -15,7 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. -- -project name=Digester +project xmlns=http://maven.apache.org/DECORATION/1.1.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation=http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd; + name=Digester bannerRight nameCommons Digester/name
svn commit: r1294543 - /commons/proper/chain/trunk/src/site/site.xml
Author: simonetripodi Date: Tue Feb 28 10:09:37 2012 New Revision: 1294543 URL: http://svn.apache.org/viewvc?rev=1294543view=rev Log: added site XSD descriptor Modified: commons/proper/chain/trunk/src/site/site.xml Modified: commons/proper/chain/trunk/src/site/site.xml URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/src/site/site.xml?rev=1294543r1=1294542r2=1294543view=diff == --- commons/proper/chain/trunk/src/site/site.xml (original) +++ commons/proper/chain/trunk/src/site/site.xml Tue Feb 28 10:09:37 2012 @@ -15,7 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. -- -project name=Commons Chain +project xmlns=http://maven.apache.org/DECORATION/1.1.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation=http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd; + name=Commons Chain + bannerRight nameCommons Chain/name src/images/chain-logo-white.png/src
svn commit: r1294585 - /commons/proper/compress/trunk/src/site/xdoc/tar.xml
Author: bodewig Date: Tue Feb 28 11:17:23 2012 New Revision: 1294585 URL: http://svn.apache.org/viewvc?rev=1294585view=rev Log: typo Modified: commons/proper/compress/trunk/src/site/xdoc/tar.xml Modified: commons/proper/compress/trunk/src/site/xdoc/tar.xml URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/site/xdoc/tar.xml?rev=1294585r1=1294584r2=1294585view=diff == --- commons/proper/compress/trunk/src/site/xdoc/tar.xml (original) +++ commons/proper/compress/trunk/src/site/xdoc/tar.xml Tue Feb 28 11:17:23 2012 @@ -85,7 +85,7 @@ href=http://developer.berlios.de/projects/star;star/a and later adopted by GNU and BSD tar. This method is not supported by all implementations./li - licodeBUGFILE_POSIX/code: use a PAX a + licodeBIGFILE_POSIX/code: use a PAX a href=http://pubs.opengroup.org/onlinepubs/009695399/utilities/pax.html#tag_04_100_13_03;extended header/a as defined by POSIX 1003.1. Most modern tar implementations are able to extract such archives./li
svn commit: r1294680 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/univariate/BrentOptimizerTest.java
Author: luc Date: Tue Feb 28 14:56:26 2012 New Revision: 1294680 URL: http://svn.apache.org/viewvc?rev=1294680view=rev Log: Added a test. Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/univariate/BrentOptimizerTest.java Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/univariate/BrentOptimizerTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/univariate/BrentOptimizerTest.java?rev=1294680r1=1294679r2=1294680view=diff == --- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/univariate/BrentOptimizerTest.java (original) +++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/univariate/BrentOptimizerTest.java Tue Feb 28 14:56:26 2012 @@ -17,6 +17,8 @@ package org.apache.commons.math3.optimization.univariate; +import org.apache.commons.math3.exception.NumberIsTooLargeException; +import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.exception.TooManyEvaluationsException; import org.apache.commons.math3.analysis.QuinticFunction; import org.apache.commons.math3.analysis.SinFunction; @@ -50,6 +52,30 @@ public final class BrentOptimizerTest { } @Test +public void testBoundaries() { +final double lower = -1.0; +final double upper = +1.0; +UnivariateFunction f = new UnivariateFunction() { +public double value(double x) { +if (x lower) { +throw new NumberIsTooSmallException(x, lower, true); +} else if (x upper) { +throw new NumberIsTooLargeException(x, upper, true); +} else { +return x; +} +} +}; +UnivariateOptimizer optimizer = new BrentOptimizer(1e-10, 1e-14); +Assert.assertEquals(lower, +optimizer.optimize(100, f, GoalType.MINIMIZE, lower, upper).getPoint(), +1.0e-8); +Assert.assertEquals(upper, +optimizer.optimize(100, f, GoalType.MAXIMIZE, lower, upper).getPoint(), +1.0e-8); +} + +@Test public void testQuinticMin() { // The function has local minima at -0.27195613 and 0.82221643. UnivariateFunction f = new QuinticFunction();
svn commit: r1294749 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
Author: sebb Date: Tue Feb 28 17:49:19 2012 New Revision: 1294749 URL: http://svn.apache.org/viewvc?rev=1294749view=rev Log: Javadoc corrections Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java?rev=1294749r1=1294748r2=1294749view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Tue Feb 28 17:49:19 2012 @@ -64,10 +64,9 @@ public class FTPTimestampParserImpl impl * member has not been defined, attempt to parse with the defaultDateFormat * member. If that fails, throw a ParseException. * - * This method allows a {@link Calendar} instance to be passed in which represents the - * current (system) time. - * - * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String) + * This method assumes that the server time is the same as the local time. + * + * @see FTPTimestampParserImpl#parseTimestamp(String, Calendar) * * @param timestampStr The timestamp to be parsed */ @@ -77,16 +76,15 @@ public class FTPTimestampParserImpl impl } /** - * Implements the one {@link FTPTimestampParser#parseTimestamp(String) method} - * in the {@link FTPTimestampParser FTPTimestampParser} interface - * according to this algorithm: - * * If the recentDateFormat member has been defined, try to parse the * supplied string with that. If that parse fails, or if the recentDateFormat * member has not been defined, attempt to parse with the defaultDateFormat * member. If that fails, throw a ParseException. * - * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String) + * This method allows a {@link Calendar} instance to be passed in which represents the + * current (system) time. + * + * @see FTPTimestampParser#parseTimestamp(String) * @param timestampStr The timestamp to be parsed * @param serverTime The current time for the server * @since 1.5
svn commit: r1294760 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java
Author: sebb Date: Tue Feb 28 18:31:57 2012 New Revision: 1294760 URL: http://svn.apache.org/viewvc?rev=1294760view=rev Log: Clone calendar to ensure original settings are preserved. [Previously, the hour was not reset] Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java?rev=1294760r1=1294759r2=1294760view=diff == --- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java (original) +++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java Tue Feb 28 18:31:57 2012 @@ -62,13 +62,14 @@ public class FTPTimestampParserImplTest public void testParseTimestampWithSlop() { Calendar cal = Calendar.getInstance(); -cal.add(Calendar.HOUR_OF_DAY, 1); cal.set(Calendar.SECOND,0); cal.set(Calendar.MILLISECOND,0); -Date anHourFromNow = cal.getTime(); -cal.add(Calendar.DATE, 1); -Date anHourFromNowTomorrow = cal.getTime(); -cal.add(Calendar.DATE, -1); + +Calendar caltemp = (Calendar) cal.clone(); +caltemp.add(Calendar.HOUR_OF_DAY, 1); +Date anHourFromNow = caltemp.getTime(); +caltemp.add(Calendar.DATE, 1); +Date anHourFromNowTomorrow = caltemp.getTime(); FTPTimestampParserImpl parser = new FTPTimestampParserImpl();
svn commit: r1294794 - in /commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats: png/PngConstants.java png/PngWriter.java psd/PsdConstants.java
Author: damjan Date: Tue Feb 28 19:16:15 2012 New Revision: 1294794 URL: http://svn.apache.org/viewvc?rev=1294794view=rev Log: Do not allow final arrays to be mutated. This completes the changeset for SANSELAN-42 by getting rid of all public static final arrays (at least, as found by FindBugs). Jira issue key: SANSELAN-42 Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngConstants.java commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngWriter.java commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/psd/PsdConstants.java Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngConstants.java URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngConstants.java?rev=1294794r1=1294793r2=1294794view=diff == --- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngConstants.java (original) +++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngConstants.java Tue Feb 28 19:16:15 2012 @@ -17,6 +17,7 @@ package org.apache.commons.sanselan.formats.png; import org.apache.commons.sanselan.SanselanConstants; +import org.apache.commons.sanselan.common.BinaryConstant; import org.apache.commons.sanselan.common.BinaryFileFunctions; public interface PngConstants extends SanselanConstants @@ -24,28 +25,28 @@ public interface PngConstants extends Sa public static final int COMPRESSION_DEFLATE_INFLATE = 0; -public final static byte[] IHDR_CHUNK_TYPE = new byte[] { 73, 72, 68, 82 }; -public final static byte[] PLTE_CHUNK_TYPE = new byte[] { 80, 76, 84, 69 }; -public final static byte[] IEND_CHUNK_TYPE = new byte[] { 73, 69, 78, 68 }; -public final static byte[] IDAT_CHUNK_TYPE = new byte[] { 73, 68, 65, 84 }; -public final static byte[] iTXt_CHUNK_TYPE = new byte[] { // +public final static BinaryConstant IHDR_CHUNK_TYPE = new BinaryConstant(new byte[] { 73, 72, 68, 82 }); +public final static BinaryConstant PLTE_CHUNK_TYPE = new BinaryConstant(new byte[] { 80, 76, 84, 69 }); +public final static BinaryConstant IEND_CHUNK_TYPE = new BinaryConstant(new byte[] { 73, 69, 78, 68 }); +public final static BinaryConstant IDAT_CHUNK_TYPE = new BinaryConstant(new byte[] { 73, 68, 65, 84 }); +public final static BinaryConstant iTXt_CHUNK_TYPE = new BinaryConstant(new byte[] { // 105, // 84, // 88, // 116, // -}; -public final static byte[] tEXt_CHUNK_TYPE = new byte[] { // +}); +public final static BinaryConstant tEXt_CHUNK_TYPE = new BinaryConstant(new byte[] { // 0x74, // 0x45, // 0x58, // 0x74, // -}; -public final static byte[] zTXt_CHUNK_TYPE = new byte[] { // +}); +public final static BinaryConstant zTXt_CHUNK_TYPE = new BinaryConstant(new byte[] { // 0x7A, // 0x54, // 0x58, // 0x74, // -}; +}); public final static int IEND = BinaryFileFunctions.charsToQuad('I', 'E', 'N', 'D'); @@ -74,8 +75,8 @@ public interface PngConstants extends Sa public final static int iTXt = BinaryFileFunctions.charsToQuad('i', 'T', 'X', 't'); -public static final byte PNG_Signature[] = { -(byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, }; +public static final BinaryConstant PNG_Signature = new BinaryConstant(new byte[]{ +(byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, }); public static final String PARAM_KEY_PNG_BIT_DEPTH = PNG_BIT_DEPTH; public static final String PARAM_KEY_PNG_FORCE_INDEXED_COLOR = PNG_FORCE_INDEXED_COLOR; Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngWriter.java URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngWriter.java?rev=1294794r1=1294793r2=1294794view=diff == --- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngWriter.java (original) +++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/png/PngWriter.java Tue Feb 28 19:16:15 2012 @@ -144,7 +144,7 @@ public class PngWriter implements PngCon // Debug.debug(baos, baos.toByteArray()); -writeChunk(os, IHDR_CHUNK_TYPE, baos.toByteArray()); +writeChunk(os, IHDR_CHUNK_TYPE.toByteArray(), baos.toByteArray()); } private void writeChunkiTXt(OutputStream os, PngText.iTXt text) @@ -177,7 +177,7 @@ public class PngWriter implements PngCon
svn commit: r1294807 - in /commons/proper/sanselan/trunk/src: main/java/org/apache/commons/sanselan/common/bytesource/ main/java/org/apache/commons/sanselan/formats/bmp/ main/java/org/apache/commons/s
Author: damjan Date: Tue Feb 28 20:06:34 2012 New Revision: 1294807 URL: http://svn.apache.org/viewvc?rev=1294807view=rev Log: Fix many ByteSource.getInputStream() leaks, where the stream returned wasn't closed in a finally block. Jira issue key: SANSELAN-63 Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/common/bytesource/ByteSource.java commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/bmp/BmpImageParser.java commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pcx/PcxImageParser.java commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/psd/PsdImageParser.java commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/icc/IccProfileParser.java commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/common/bytesource/ByteSourceDataTest.java Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/common/bytesource/ByteSource.java URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/common/bytesource/ByteSource.java?rev=1294807r1=1294806r2=1294807view=diff == --- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/common/bytesource/ByteSource.java (original) +++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/common/bytesource/ByteSource.java Tue Feb 28 20:06:34 2012 @@ -32,10 +32,19 @@ public abstract class ByteSource extends public final InputStream getInputStream(int start) throws IOException { -InputStream is = getInputStream(); - -skipBytes(is, start); - +InputStream is = null; +boolean succeeded = false; +try { +is = getInputStream(); +skipBytes(is, start); +succeeded = true; +} finally { +if (!succeeded) { +if (is != null) { +is.close(); +} +} +} return is; } Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/bmp/BmpImageParser.java URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/bmp/BmpImageParser.java?rev=1294807r1=1294806r2=1294807view=diff == --- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/bmp/BmpImageParser.java (original) +++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/bmp/BmpImageParser.java Tue Feb 28 20:06:34 2012 @@ -593,8 +593,19 @@ public class BmpImageParser extends Imag throw new ImageReadException(Unknown parameter: + firstKey); } -ImageContents ic = readImageContents(byteSource.getInputStream(), -FormatCompliance.getDefault(), verbose); +InputStream is = null; +ImageContents ic = null; +try { +is = byteSource.getInputStream(); +ic = readImageContents(is, FormatCompliance.getDefault(), verbose); +} finally { +if (is != null) { +try { +is.close(); +} catch (IOException ignore) { +} +} +} if (ic == null) throw new ImageReadException(Couldn't read BMP Data); @@ -671,7 +682,18 @@ public class BmpImageParser extends Imag FormatCompliance result = new FormatCompliance(byteSource .getDescription()); -readImageContents(byteSource.getInputStream(), result, verbose); +InputStream is = null; +try { +is = byteSource.getInputStream(); +readImageContents(is, result, verbose); +} finally { +if (is != null) { +try { +is.close(); +} catch (IOException ignore) { +} +} +} return result; } @@ -679,7 +701,18 @@ public class BmpImageParser extends Imag public BufferedImage getBufferedImage(ByteSource byteSource, Map params) throws ImageReadException, IOException { -return getBufferedImage(byteSource.getInputStream(), params); +InputStream is = null; +try { +is = byteSource.getInputStream(); +return getBufferedImage(is, params); +} finally { +if (is != null) { +try { +is.close(); +} catch (IOException ignore) { +} +} +} } public BufferedImage getBufferedImage(InputStream inputStream, Map params) Modified:
svn commit: r1294866 - in /commons/sandbox/graph/trunk/src/site: site.xml xdoc/model/weights.xml
Author: cs Date: Tue Feb 28 22:30:34 2012 New Revision: 1294866 URL: http://svn.apache.org/viewvc?rev=1294866view=rev Log: added documentation for weights (types, operations, usage, customization) Added: commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml Modified: commons/sandbox/graph/trunk/src/site/site.xml Modified: commons/sandbox/graph/trunk/src/site/site.xml URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/site/site.xml?rev=1294866r1=1294865r2=1294866view=diff == --- commons/sandbox/graph/trunk/src/site/site.xml (original) +++ commons/sandbox/graph/trunk/src/site/site.xml Tue Feb 28 22:30:34 2012 @@ -33,6 +33,7 @@ menu name=Graph Model item name=Introduction href=/model/intro.html / item name=Base in-memory model href=/model/base.html / + item name=Weight model href=/model/weights.html / /menu menu name=Graph Algorithms Added: commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml?rev=1294866view=auto == --- commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml (added) +++ commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml Tue Feb 28 22:30:34 2012 @@ -0,0 +1,94 @@ +?xml version=1.0? +!-- + 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. +-- +document xmlns=http://maven.apache.org/XDOC/2.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation=http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd; + properties +titleCommons Graph - Introduction to weight model/title +author email=d...@commons.apache.orgCommons Documentation Team/author + /properties + body +section name=Introduction + pCommons Graph offers a powerful and customizable abstraction to represent weighted objects + (e.g. edges, vertices, paths). It is available out of the box for all common types of weight and + can be easily extended with user-defined implementations./p + + pThe package a href=../apidocs/org/apache/commons/graph/weight/package-summary.htmlorg.apache.commons.graph.weight/a + contains a hierarchy of interfaces responsible for different operations and properties of weights, + like the possibility to a href=../apidocs/org/apache/commons/graph/weight/Semigroup.htmlapply binary operations/a + or to a href=../apidocs/org/apache/commons/graph/weight/OrderedMonoid.htmlcompare two elements/a. + Each algorithm dealing with weights specifies the desired properties as an input parameter./p +/section + +section name=Dealing with weights + pLet us assume that we have a a href=../apidocs/org/apache/commons/graph/WeightedGraph.htmlWeightedGraph/a + whose edges are assigned weights of type Double. + If we want to find the shortest path using Dijkstra's algorithm we will to pass an + implementation of the interface a href=../apidocs/org/apache/commons/graph/weight/OrderedMonoid.htmlOrderedMonoid/a, + like the built-in a href=../apidocs/org/apache/commons/graph/weight/primitive/DoubleWeightBaseOperations.htmlDoubleWeightBaseOperations/a:/p + +sourceWeightedGraphlt;V, WE, Doublegt; graph; +V source, destination; +// populate graph and initialise source and destination ... +WeightedPathlt;V, WE, Doublegt; shortestPath = +findShortestPath( graph ).from( source ).to( destination ).applyingDijkstra( new DoubleWeightBaseOperations() ); +/source + + pThe subpackage a href=../apidocs/org/apache/commons/graph/weight/primitive/package-summary.htmlorg.apache.commons.graph.weight.primitive/a + contains base implementations for the most common primitive types of weight: Integer, Long, Float, Double, BigInteger, BigDecimal./p + +/section + +section name=Custom weight types + pCommons Graph allows to easily extend the small set of supported weight types + by implementing a new class responsible for properties and operations for each
svn commit: r1294872 - /commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml
Author: cs Date: Tue Feb 28 22:34:47 2012 New Revision: 1294872 URL: http://svn.apache.org/viewvc?rev=1294872view=rev Log: typo in docs for weights Modified: commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml Modified: commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml?rev=1294872r1=1294871r2=1294872view=diff == --- commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml (original) +++ commons/sandbox/graph/trunk/src/site/xdoc/model/weights.xml Tue Feb 28 22:34:47 2012 @@ -37,7 +37,7 @@ section name=Dealing with weights pLet us assume that we have a a href=../apidocs/org/apache/commons/graph/WeightedGraph.htmlWeightedGraph/a whose edges are assigned weights of type Double. - If we want to find the shortest path using Dijkstra's algorithm we will to pass an + If we want to find the shortest path using Dijkstra's algorithm we need an implementation of the interface a href=../apidocs/org/apache/commons/graph/weight/OrderedMonoid.htmlOrderedMonoid/a, like the built-in a href=../apidocs/org/apache/commons/graph/weight/primitive/DoubleWeightBaseOperations.htmlDoubleWeightBaseOperations/a:/p
svn commit: r1294922 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java test/java/org/apache/commons/net/ftp/parser/FTPTime
Author: sebb Date: Wed Feb 29 01:07:22 2012 New Revision: 1294922 URL: http://svn.apache.org/viewvc?rev=1294922view=rev Log: NET-444 FTPTimestampParserImpl fails to parse future dates correctly on Feb 28th in a leap year Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1294922r1=1294921r2=1294922view=diff == --- commons/proper/net/trunk/src/changes/changes.xml (original) +++ commons/proper/net/trunk/src/changes/changes.xml Wed Feb 29 01:07:22 2012 @@ -62,6 +62,13 @@ The action type attribute can be add,u -- body +release version=3.2 date=TBA description= + +TBA +action issue=NET-444 dev=sebb type=fix +FTPTimestampParserImpl fails to parse future dates correctly on Feb 28th in a leap year. +/action +/release release version=3.1 date=Feb 20, 2012 description= This release fixes a few bugs and adds some new functionality (see below). It is binary compatible with previous releases Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java?rev=1294922r1=1294921r2=1294922view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Wed Feb 29 01:07:22 2012 @@ -90,67 +90,58 @@ public class FTPTimestampParserImpl impl * @since 1.5 */ public Calendar parseTimestamp(String timestampStr, Calendar serverTime) throws ParseException { -Calendar now = (Calendar) serverTime.clone();// Copy this, because we may change it -now.setTimeZone(this.getServerTimeZone()); -Calendar working = (Calendar) now.clone(); +Calendar working = (Calendar) serverTime.clone(); working.setTimeZone(getServerTimeZone()); // is this needed? -ParsePosition pp = new ParsePosition(0); Date parsed = null; + if (recentDateFormat != null) { +Calendar now = (Calendar) serverTime.clone();// Copy this, because we may change it +now.setTimeZone(this.getServerTimeZone()); if (lenientFutureDates) { // add a day to now so that slop doesn't cause a date // slightly in the future to roll back a full year. (Bug 35181 = NET-83) now.add(Calendar.DATE, 1); } -parsed = recentDateFormat.parse(timestampStr, pp); -} -if (parsed != null pp.getIndex() == timestampStr.length()) -{ -working.setTime(parsed); -working.set(Calendar.YEAR, now.get(Calendar.YEAR)); - -if (working.after(now)) { -working.add(Calendar.YEAR, -1); -} -} else { // Temporarily add the current year to the short date time // to cope with short-date leap year strings. // e.g. Java's DateFormatter will assume that Feb 29 12:00 refers to // Feb 29 1970 (an invalid date) rather than a potentially valid leap year date. // This is pretty bad hack to work around the deficiencies of the JDK date/time classes. -if (recentDateFormat != null) { -pp = new ParsePosition(0); -int year = now.get(Calendar.YEAR); -String timeStampStrPlusYear = timestampStr + + year; -SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + , -recentDateFormat.getDateFormatSymbols()); -hackFormatter.setLenient(false); -hackFormatter.setTimeZone(recentDateFormat.getTimeZone()); -parsed = hackFormatter.parse(timeStampStrPlusYear, pp); -} -if (parsed != null pp.getIndex() == timestampStr.length() + 5) { +String year = Integer.toString(now.get(Calendar.YEAR)); +String timeStampStrPlusYear = timestampStr + + year; +SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + , +recentDateFormat.getDateFormatSymbols()); +hackFormatter.setLenient(false); +
svn commit: r1294964 - in /commons/proper/sanselan/trunk: ./ src/main/java/org/apache/commons/sanselan/formats/xpm/ src/main/resources/ src/main/resources/org/ src/main/resources/org/apache/ src/main/
Author: damjan Date: Wed Feb 29 03:52:27 2012 New Revision: 1294964 URL: http://svn.apache.org/viewvc?rev=1294964view=rev Log: Added support for symbolic color names in XPM files. Imported rgb.txt from the X.org project to provide these, and added its MIT license to LICENSE.txt. Fixed some bugs in rgb.txt parsing. Added a test image that uses a symbolic color. Also updated website's format support. Added: commons/proper/sanselan/trunk/src/main/resources/ commons/proper/sanselan/trunk/src/main/resources/org/ commons/proper/sanselan/trunk/src/main/resources/org/apache/ commons/proper/sanselan/trunk/src/main/resources/org/apache/commons/ commons/proper/sanselan/trunk/src/main/resources/org/apache/commons/sanselan/ commons/proper/sanselan/trunk/src/main/resources/org/apache/commons/sanselan/formats/ commons/proper/sanselan/trunk/src/main/resources/org/apache/commons/sanselan/formats/xpm/ commons/proper/sanselan/trunk/src/main/resources/org/apache/commons/sanselan/formats/xpm/rgb.txt (with props) commons/proper/sanselan/trunk/src/test/data/images/xpm/1/symbolic.xpm Modified: commons/proper/sanselan/trunk/LICENSE.txt commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/xpm/XpmImageParser.java commons/proper/sanselan/trunk/src/site/xdoc/formatsupport.xml commons/proper/sanselan/trunk/src/test/data/images/xpm/1/info.txt Modified: commons/proper/sanselan/trunk/LICENSE.txt URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/LICENSE.txt?rev=1294964r1=1294963r2=1294964view=diff == --- commons/proper/sanselan/trunk/LICENSE.txt (original) +++ commons/proper/sanselan/trunk/LICENSE.txt Wed Feb 29 03:52:27 2012 @@ -200,3 +200,57 @@ 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. + + +EXTERNAL COMPONENTS + +Apache Commons Sanselan includes a number of components with separate copyright +notices and license terms. Your use of these components is subject to the terms +and conditions of the following licenses. + +rgb.txt comes from the X.org project and is under the following licenses: + + Copyright 1985, 1989, 1998 The Open Group + + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name of The Open Group shall + not be used in advertising or otherwise to promote the sale, use or + other dealings in this Software without prior written authorization + from The Open Group. + + Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the Software), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/xpm/XpmImageParser.java URL: