svn commit: r1500836 - /commons/proper/chain/trunk/pom.xml
Author: simonetripodi Date: Mon Jul 8 16:53:54 2013 New Revision: 1500836 URL: http://svn.apache.org/r1500836 Log: [CHAIN-106] JavaDoc report contains JavaDocs of cookbook examples initial attempt of excluding undesired apidocs be published Modified: commons/proper/chain/trunk/pom.xml Modified: commons/proper/chain/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/pom.xml?rev=1500836&r1=1500835&r2=1500836&view=diff == --- commons/proper/chain/trunk/pom.xml (original) +++ commons/proper/chain/trunk/pom.xml Mon Jul 8 16:53:54 2013 @@ -227,6 +227,7 @@ maven-javadoc-plugin true + org.apache.commons.chain2.cookbook:org.apache.commons.chain2.apps
svn commit: r1500821 - /commons/proper/chain/trunk/test-utils/
Author: simonetripodi Date: Mon Jul 8 16:25:15 2013 New Revision: 1500821 URL: http://svn.apache.org/r1500821 Log: updated ignore list Modified: commons/proper/chain/trunk/test-utils/ (props changed) Propchange: commons/proper/chain/trunk/test-utils/ -- --- svn:ignore (added) +++ svn:ignore Mon Jul 8 16:25:15 2013 @@ -0,0 +1,2 @@ +target +.settings
svn commit: r1486948 [5/5] - in /commons/sandbox/graph/branches/modularization: ./ api/ api/src/ api/src/main/ api/src/main/java/ api/src/main/java/org/ api/src/main/java/org/apache/ api/src/main/java
Modified: commons/sandbox/graph/branches/modularization/visit/src/test/java/org/apache/commons/graph/visit/NodeSequenceVisitor.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/modularization/visit/src/test/java/org/apache/commons/graph/visit/NodeSequenceVisitor.java?rev=1486948&r1=1486620&r2=1486948&view=diff == --- commons/sandbox/graph/branches/modularization/visit/src/test/java/org/apache/commons/graph/visit/NodeSequenceVisitor.java (original) +++ commons/sandbox/graph/branches/modularization/visit/src/test/java/org/apache/commons/graph/visit/NodeSequenceVisitor.java Tue May 28 15:00:27 2013 @@ -24,9 +24,9 @@ import static java.util.Collections.unmo import java.util.ArrayList; import java.util.List; -import org.apache.commons.graph.model.BaseLabeledEdge; -import org.apache.commons.graph.model.BaseLabeledVertex; import org.apache.commons.graph.model.UndirectedMutableGraph; +import org.apache.commons.graph.model.labeled.BaseLabeledEdge; +import org.apache.commons.graph.model.labeled.BaseLabeledVertex; public final class NodeSequenceVisitor extends BaseGraphVisitHandler, List> Modified: commons/sandbox/graph/branches/modularization/visit/src/test/java/org/apache/commons/graph/visit/VisitTestCase.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/modularization/visit/src/test/java/org/apache/commons/graph/visit/VisitTestCase.java?rev=1486948&r1=1486620&r2=1486948&view=diff == --- commons/sandbox/graph/branches/modularization/visit/src/test/java/org/apache/commons/graph/visit/VisitTestCase.java (original) +++ commons/sandbox/graph/branches/modularization/visit/src/test/java/org/apache/commons/graph/visit/VisitTestCase.java Tue May 28 15:00:27 2013 @@ -19,8 +19,8 @@ package org.apache.commons.graph.visit; * under the License. */ -import static org.apache.commons.graph.CommonsGraph.newUndirectedMutableGraph; -import static org.apache.commons.graph.CommonsGraph.visit; +import static org.apache.commons.graph.model.GraphUtils.newUndirectedMutableGraph; +import static org.apache.commons.graph.visit.GraphVisitor.visit; import static org.junit.Assert.assertEquals; import java.util.ArrayList; @@ -28,9 +28,9 @@ import java.util.List; import org.apache.commons.graph.Graph; import org.apache.commons.graph.builder.AbstractGraphConnection; -import org.apache.commons.graph.model.BaseLabeledEdge; -import org.apache.commons.graph.model.BaseLabeledVertex; import org.apache.commons.graph.model.UndirectedMutableGraph; +import org.apache.commons.graph.model.labeled.BaseLabeledEdge; +import org.apache.commons.graph.model.labeled.BaseLabeledVertex; import org.junit.Test; public final class VisitTestCase
svn commit: r1486530 - /commons/sandbox/graph/branches/modularization/
Author: simonetripodi Date: Mon May 27 07:48:58 2013 New Revision: 1486530 URL: http://svn.apache.org/r1486530 Log: created the modularization branch to split the big monolith in small modules Added: commons/sandbox/graph/branches/modularization/ (props changed) - copied from r1486529, commons/sandbox/graph/trunk/ Propchange: commons/sandbox/graph/branches/modularization/ -- --- svn:ignore (added) +++ svn:ignore Mon May 27 07:48:58 2013 @@ -0,0 +1,15 @@ +target +test-reports +*~ +velocity.log* +.classpath +.project +maven.log +InvertedEdgeAdapter.patch +maven-eclipse.xml +.externalToolBuilders +.settings + +commons-graph.iml +.idea +bin Propchange: commons/sandbox/graph/branches/modularization/ -- svn:mergeinfo = /commons/sandbox/graph/trunk:1298136 Propchange: commons/sandbox/graph/branches/modularization/ -- svnmerge-integrated = /commons/sandbox/graph/trunk:1-1297889
svn commit: r1486528 - /commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java
Author: simonetripodi Date: Mon May 27 07:38:38 2013 New Revision: 1486528 URL: http://svn.apache.org/r1486528 Log: if the ConfigParser is not available in the classpath, then the application is in an illegal status Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java?rev=1486528&r1=1486527&r2=1486528&view=diff == --- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java (original) +++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CatalogFactory.java Mon May 27 07:38:38 2013 @@ -226,8 +226,8 @@ public abstract class CatalogFactory
svn commit: r1486526 - /commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/XmlConfigParser.java
Author: simonetripodi Date: Mon May 27 07:22:45 2013 New Revision: 1486526 URL: http://svn.apache.org/r1486526 Log: CHAIN-72 - configuration façade APIs XmlConfigParser must implement the ConfigParser interface Modified: commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/XmlConfigParser.java Modified: commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/XmlConfigParser.java URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/XmlConfigParser.java?rev=1486526&r1=1486525&r2=1486526&view=diff == --- commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/XmlConfigParser.java (original) +++ commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/XmlConfigParser.java Mon May 27 07:22:45 2013 @@ -17,6 +17,7 @@ package org.apache.commons.chain2.config.xml; import org.apache.commons.chain2.config.ChainConfigurationException; +import org.apache.commons.chain2.config.ConfigParser; import org.apache.commons.digester3.Digester; import org.apache.commons.digester3.RuleSet; @@ -33,7 +34,7 @@ import java.net.URL; * * @version $Id: ConfigParser.java 1364104 2012-07-21 14:25:54Z elijah $ */ -public class XmlConfigParser { +public class XmlConfigParser implements ConfigParser { // - Instance Variables /**
svn commit: r1486478 - in /commons/proper/chain/trunk: api/ apps/cookbook-examples/ apps/example1/ apps/example2/ configuration/api/src/main/java/org/apache/commons/chain2/config/ configuration/xml/ c
Author: simonetripodi Date: Sun May 26 21:21:21 2013 New Revision: 1486478 URL: http://svn.apache.org/r1486478 Log: CHAIN-72 - configuration façade APIs still better separation between configuration APIs and XML implementation configuration exception moved to configuration package XML related classes moved in proper config.xml subpackage configuration exception moved to the configuration package/module registry throws a runtime exception rather than a configuration exception trivial: updated ignore list Added: commons/proper/chain/trunk/configuration/api/src/main/java/org/apache/commons/chain2/config/ChainConfigurationException.java - copied, changed from r1457658, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainConfigurationException.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/ commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/ConfigCatalogRule.java - copied, changed from r1486474, commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigCatalogRule.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/ConfigDefineRule.java - copied, changed from r1486474, commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigDefineRule.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/ConfigRegisterRule.java - copied, changed from r1486474, commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigRegisterRule.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/ConfigRuleSet.java - copied, changed from r1486474, commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigRuleSet.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/XmlConfigParser.java - copied, changed from r1486474, commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigParser.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/package-info.java - copied, changed from r1486474, commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/package-info.java commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/xml/ commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/xml/ConfigParser2TestCase.java - copied, changed from r1457658, commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/ConfigParser2TestCase.java commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/xml/ConfigParserTestCase.java - copied, changed from r1457658, commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/ConfigParserTestCase.java commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/xml/TestChain.java - copied, changed from r1457658, commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/TestChain.java commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/xml/TestCommand.java - copied, changed from r1457658, commons/proper/chain/trunk/configuration/xml/src/test/java/org/apache/commons/chain2/config/TestCommand.java commons/proper/chain/trunk/configuration/xml/src/test/resources/org/apache/commons/chain2/config/xml/ commons/proper/chain/trunk/configuration/xml/src/test/resources/org/apache/commons/chain2/config/xml/test-config-2.xml - copied, changed from r1457658, commons/proper/chain/trunk/configuration/xml/src/test/resources/org/apache/commons/chain2/config/test-config-2.xml commons/proper/chain/trunk/configuration/xml/src/test/resources/org/apache/commons/chain2/config/xml/test-config.xml - copied, changed from r1457658, commons/proper/chain/trunk/configuration/xml/src/test/resources/org/apache/commons/chain2/config/test-config.xml Removed: commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigCatalogRule.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigDefineRule.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigParser.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config/ConfigRegisterRule.java commons/proper/chain/trunk/configuration/xml/src/main/java/org/apache/commons/chain2/config
svn commit: r1484153 - in /commons/sandbox/graph/trunk: ./ src/benchmarks/java/org/apache/commons/graph/shortestpath/ src/main/java/org/apache/commons/graph/shortestpath/ src/test/java/org/apache/comm
Author: simonetripodi Date: Sat May 18 17:50:00 2013 New Revision: 1484153 URL: http://svn.apache.org/r1484153 Log: SANDBOX-457 - Adding an implementation of a bidirectional Dijkstra's algorithm applied patch provided by Rodion Efremov [rodion.efre...@cs.helsinki.fi] Added: commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/shortestpath/ commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/shortestpath/UniVsBiDijkstraBenchmarkTestCase.java (with props) commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BidirDijkstraTestCase.java (with props) Modified: commons/sandbox/graph/trunk/pom.xml commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultShortestPathAlgorithmSelector.java commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/PredecessorsList.java commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/ShortestPathAlgorithmSelector.java Modified: commons/sandbox/graph/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/pom.xml?rev=1484153&r1=1484152&r2=1484153&view=diff == --- commons/sandbox/graph/trunk/pom.xml (original) +++ commons/sandbox/graph/trunk/pom.xml Sat May 18 17:50:00 2013 @@ -92,6 +92,10 @@ Matthew Pocock turingatemyhamster AT gmail DOT com + + Rodion Efremov + rodion dot efremov at cs dot helsinki dot fi + Added: commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/shortestpath/UniVsBiDijkstraBenchmarkTestCase.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/shortestpath/UniVsBiDijkstraBenchmarkTestCase.java?rev=1484153&view=auto == --- commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/shortestpath/UniVsBiDijkstraBenchmarkTestCase.java (added) +++ commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/shortestpath/UniVsBiDijkstraBenchmarkTestCase.java Sat May 18 17:50:00 2013 @@ -0,0 +1,204 @@ +package org.apache.commons.graph.shortestpath; + +/* + * 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. + */ + +import static java.lang.String.format; +import static java.lang.String.valueOf; +import static org.apache.commons.graph.CommonsGraph.findShortestPath; +import static org.apache.commons.graph.CommonsGraph.newDirectedMutableGraph; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; + +import org.apache.commons.graph.builder.AbstractGraphConnection; +import org.apache.commons.graph.GraphException; +import org.apache.commons.graph.Mapper; +import org.apache.commons.graph.model.BaseLabeledVertex; +import org.apache.commons.graph.model.BaseLabeledWeightedEdge; +import org.apache.commons.graph.model.BaseWeightedEdge; +import org.apache.commons.graph.model.DirectedMutableGraph; +import org.apache.commons.graph.WeightedPath; +import org.apache.commons.graph.weight.OrderedMonoid; +import org.apache.commons.graph.weight.primitive.DoubleWeightBaseOperations; + +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; + +import com.carrotsearch.junitbenchmarks.BenchmarkOptions; +import com.carrotsearch.junitbenchmarks.BenchmarkRule; +import com.carrotsearch.junitbenchmarks.annotation.AxisRange; +import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart; + +@AxisRange( min = 0, max = 2 ) +@BenchmarkMethodChart( filePrefix = "dijkstras" ) +@BenchmarkOptions( benchmarkRounds = 10, warmupRounds = 5 ) +public final class UniVsBiDijkstraBenchmarkTestCase +{ +private static final int NODES = 5000; +private static final int EDGES = 10; + +@Rule +public BenchmarkRule benchmarkRun = new BenchmarkRule(); + +private static DirectedMutableGraph> graph; + +private static Mapper, Double> weig
svn commit: r1646 - /release/commons/fileupload/RELEASE-NOTES.txt
Author: simonetripodi Date: Wed Mar 27 20:37:53 2013 New Revision: 1646 Log: added missing release notes for fileupload component Added: release/commons/fileupload/RELEASE-NOTES.txt Added: release/commons/fileupload/RELEASE-NOTES.txt == --- release/commons/fileupload/RELEASE-NOTES.txt (added) +++ release/commons/fileupload/RELEASE-NOTES.txt Wed Mar 27 20:37:53 2013 @@ -0,0 +1,98 @@ + + + Apache Commons-FileUpload +Version 1.3 + Release Notes + + +INTRODUCTION + + +This is a maintenance release, new projects are encouraged to +use this release of FileUpload. +There is no urgency for existing projects to upgrade. + +IMPORTANT NOTES + + + * SECURITY - CVE-2013-0248, see http://seclists.org/fulldisclosure/2013/Mar/76 + +DEPENDENCIES += + +FileUpload 1.3 users should upgrade to the recommended dependency set below +where possible. + +The Recommended Dependency Set for FileUpload 1.3 is: + Apache Commons-IO 2.2 + +Sub-task += + + * [FILEUPLOAD-216] - Update the project tree dirs according to default Maven conventions + * [FILEUPLOAD-217] - drop JDK1.3 support and update to Java5 + * [FILEUPLOAD-218] - Update version in POM + * [FILEUPLOAD-219] - upgrade tests to JUnit 4 + * [FILEUPLOAD-220] - replace package.html with package-info.java + * [FILEUPLOAD-221] - FileItemHeadersImpl can now use LinkedHashMap + * [FILEUPLOAD-222] - Mark @deprecated classes/methods with @Deprecated annotation + * [FILEUPLOAD-233] - Base64Decoder doesn't correctly implement RFC 4648 + +Bug += + + * [FILEUPLOAD-143] - "Stream ended unexpectedly" when posting from a Flash client + * [FILEUPLOAD-173] - Manifest for OSGi has invalid syntax + * [FILEUPLOAD-183] - commons-io dependency does not get loaded by maven if only dependency to commons-fileupload is specified + * [FILEUPLOAD-185] - http://commons.apache.org/fileupload/index.html is out of date + * [FILEUPLOAD-186] - http://commons.apache.org/fileupload/index.html should not mention nightly builds + * [FILEUPLOAD-189] - DiskFileItemFactory use of FileCleaningTracker is documented or coded wrong + * [FILEUPLOAD-195] - Error reading the file size larger than 2 gb + * [FILEUPLOAD-197] - ServletFileUpload isMultipartContent method does not support HTTP PUT + * [FILEUPLOAD-199] - Uploads have unexpected results for files with non-ASCII names - support RFC2047 + * [FILEUPLOAD-202] - org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly + * [FILEUPLOAD-204] - FileItem.getHeaders() returns always null. + * [FILEUPLOAD-212] - Insecure request size checking + * [FILEUPLOAD-214] - ServletFileUpload only accepts POST requests + * [FILEUPLOAD-228] - (Servlet|Portlet)RequestContext#contentLength() must return request.getContentLength() if Content-length header is not available + * [FILEUPLOAD-229] - toLowerCase() is Locale-dependent; should use toLowerCase(Locale.ENGLISH) instead + * [FILEUPLOAD-232] - There are no unit tests for the new utils.mime classes + +Improvement += + + * [FILEUPLOAD-182] - Documentation: add simple HTML form example to fileupload user guide + * [FILEUPLOAD-207] - enhance file read/write performance + * [FILEUPLOAD-209] - Add Support for Generic Types + * [FILEUPLOAD-210] - Process HTTP Requests Into Maps + * [FILEUPLOAD-223] - Update commons-io dependency to latest version that supports JDK1.5 + * [FILEUPLOAD-224] - Avoid string concatenations while parsing headers, use buffers instead + * [FILEUPLOAD-225] - Replace java.rmi.server.UID() with java.util.UUID + * [FILEUPLOAD-226] - DiskFileItem.counter could be converted to AtomicInteger (or AtomicLong?) + * [FILEUPLOAD-227] - Private immutable fields which could be final + +Task += + + * [FILEUPLOAD-201] - Update to JDK 1.5 and bump IO dependency to 2.0.1 + * [FILEUPLOAD-215] - version 1.3 improvement tasks + +OTHER NOTES + + + * This is the first version of Apache Commons FileUpload which requires Java5
svn commit: r1646 - /release/commons/fileupload/RELEASE-NOTES.txt
Author: simonetripodi Date: Wed Mar 27 20:37:53 2013 New Revision: 1646 Log: added missing release notes for fileupload component Added: release/commons/fileupload/RELEASE-NOTES.txt Added: release/commons/fileupload/RELEASE-NOTES.txt == --- release/commons/fileupload/RELEASE-NOTES.txt (added) +++ release/commons/fileupload/RELEASE-NOTES.txt Wed Mar 27 20:37:53 2013 @@ -0,0 +1,98 @@ + + + Apache Commons-FileUpload +Version 1.3 + Release Notes + + +INTRODUCTION + + +This is a maintenance release, new projects are encouraged to +use this release of FileUpload. +There is no urgency for existing projects to upgrade. + +IMPORTANT NOTES + + + * SECURITY - CVE-2013-0248, see http://seclists.org/fulldisclosure/2013/Mar/76 + +DEPENDENCIES += + +FileUpload 1.3 users should upgrade to the recommended dependency set below +where possible. + +The Recommended Dependency Set for FileUpload 1.3 is: + Apache Commons-IO 2.2 + +Sub-task += + + * [FILEUPLOAD-216] - Update the project tree dirs according to default Maven conventions + * [FILEUPLOAD-217] - drop JDK1.3 support and update to Java5 + * [FILEUPLOAD-218] - Update version in POM + * [FILEUPLOAD-219] - upgrade tests to JUnit 4 + * [FILEUPLOAD-220] - replace package.html with package-info.java + * [FILEUPLOAD-221] - FileItemHeadersImpl can now use LinkedHashMap + * [FILEUPLOAD-222] - Mark @deprecated classes/methods with @Deprecated annotation + * [FILEUPLOAD-233] - Base64Decoder doesn't correctly implement RFC 4648 + +Bug += + + * [FILEUPLOAD-143] - "Stream ended unexpectedly" when posting from a Flash client + * [FILEUPLOAD-173] - Manifest for OSGi has invalid syntax + * [FILEUPLOAD-183] - commons-io dependency does not get loaded by maven if only dependency to commons-fileupload is specified + * [FILEUPLOAD-185] - http://commons.apache.org/fileupload/index.html is out of date + * [FILEUPLOAD-186] - http://commons.apache.org/fileupload/index.html should not mention nightly builds + * [FILEUPLOAD-189] - DiskFileItemFactory use of FileCleaningTracker is documented or coded wrong + * [FILEUPLOAD-195] - Error reading the file size larger than 2 gb + * [FILEUPLOAD-197] - ServletFileUpload isMultipartContent method does not support HTTP PUT + * [FILEUPLOAD-199] - Uploads have unexpected results for files with non-ASCII names - support RFC2047 + * [FILEUPLOAD-202] - org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly + * [FILEUPLOAD-204] - FileItem.getHeaders() returns always null. + * [FILEUPLOAD-212] - Insecure request size checking + * [FILEUPLOAD-214] - ServletFileUpload only accepts POST requests + * [FILEUPLOAD-228] - (Servlet|Portlet)RequestContext#contentLength() must return request.getContentLength() if Content-length header is not available + * [FILEUPLOAD-229] - toLowerCase() is Locale-dependent; should use toLowerCase(Locale.ENGLISH) instead + * [FILEUPLOAD-232] - There are no unit tests for the new utils.mime classes + +Improvement += + + * [FILEUPLOAD-182] - Documentation: add simple HTML form example to fileupload user guide + * [FILEUPLOAD-207] - enhance file read/write performance + * [FILEUPLOAD-209] - Add Support for Generic Types + * [FILEUPLOAD-210] - Process HTTP Requests Into Maps + * [FILEUPLOAD-223] - Update commons-io dependency to latest version that supports JDK1.5 + * [FILEUPLOAD-224] - Avoid string concatenations while parsing headers, use buffers instead + * [FILEUPLOAD-225] - Replace java.rmi.server.UID() with java.util.UUID + * [FILEUPLOAD-226] - DiskFileItem.counter could be converted to AtomicInteger (or AtomicLong?) + * [FILEUPLOAD-227] - Private immutable fields which could be final + +Task += + + * [FILEUPLOAD-201] - Update to JDK 1.5 and bump IO dependency to 2.0.1 + * [FILEUPLOAD-215] - version 1.3 improvement tasks + +OTHER NOTES + + + * This is the first version of Apache Commons FileUpload which requires Java5
svn commit: r856185 - in /websites/production/commons/content/proper/commons-fileupload: ./ apidocs/ apidocs/org/apache/commons/fileupload/ apidocs/org/apache/commons/fileupload/class-use/ apidocs/org
Author: simonetripodi Date: Wed Mar 27 16:59:49 2013 New Revision: 856185 Log: Site checkin for project Commons FileUpload [This commit notification would consist of 150 parts, which exceeds the limit of 50 ones, so it was shortened to the summary.]
svn commit: r1644 - in /release/commons/fileupload: binaries/ source/
Author: simonetripodi Date: Wed Mar 27 16:54:51 2013 New Revision: 1644 Log: FileUpload RC2 passed to vote so source and binaries archive can be promoted - http://markmail.org/message/syqfaf2tuno45jr4 Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz (with props) release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.asc (with props) release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.md5 release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.sha1 release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip (with props) release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.asc (with props) release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.md5 release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.sha1 release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz (with props) release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz.asc (with props) release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz.md5 release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz.sha1 release/commons/fileupload/source/commons-fileupload-1.3-src.zip (with props) release/commons/fileupload/source/commons-fileupload-1.3-src.zip.asc (with props) release/commons/fileupload/source/commons-fileupload-1.3-src.zip.md5 release/commons/fileupload/source/commons-fileupload-1.3-src.zip.sha1 Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz == Binary file - no diff available. Propchange: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz -- svn:mime-type = application/x-gzip Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.asc == Binary file - no diff available. Propchange: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.asc -- svn:mime-type = application/pgp-signature Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.md5 == --- release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.md5 (added) +++ release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.md5 Wed Mar 27 16:54:51 2013 @@ -0,0 +1 @@ +d354abbcf2de72525aded71fc5f3b354 \ No newline at end of file Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.sha1 == --- release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.sha1 (added) +++ release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.sha1 Wed Mar 27 16:54:51 2013 @@ -0,0 +1 @@ +33b0dee2bcbb628fc7647385b70e6ea5021c22cc \ No newline at end of file Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip == Binary file - no diff available. Propchange: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip -- svn:mime-type = application/zip Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.asc == Binary file - no diff available. Propchange: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.asc -- svn:mime-type = application/pgp-signature Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.md5 == --- release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.md5 (added) +++ release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.md5 Wed Mar 27 16:54:51 2013 @@ -0,0 +1 @@ +512c37586926f9fd453967985685509a \ No newline at end of file Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.sha1 == --- release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.sha1 (added) +++ release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.sha1 Wed Mar 27 16:54:51 2013 @@ -0,0 +1 @@ +39b4cbbb4e8ca0d894bd9fbd3e480ea1753e29d2 \ No newline at end of file Added: release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz == Binary
svn commit: r1644 - in /release/commons/fileupload: binaries/ source/
Author: simonetripodi Date: Wed Mar 27 16:54:51 2013 New Revision: 1644 Log: FileUpload RC2 passed to vote so source and binaries archive can be promoted - http://markmail.org/message/syqfaf2tuno45jr4 Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz (with props) release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.asc (with props) release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.md5 release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.sha1 release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip (with props) release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.asc (with props) release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.md5 release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.sha1 release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz (with props) release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz.asc (with props) release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz.md5 release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz.sha1 release/commons/fileupload/source/commons-fileupload-1.3-src.zip (with props) release/commons/fileupload/source/commons-fileupload-1.3-src.zip.asc (with props) release/commons/fileupload/source/commons-fileupload-1.3-src.zip.md5 release/commons/fileupload/source/commons-fileupload-1.3-src.zip.sha1 Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz == Binary file - no diff available. Propchange: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz -- svn:mime-type = application/x-gzip Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.asc == Binary file - no diff available. Propchange: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.asc -- svn:mime-type = application/pgp-signature Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.md5 == --- release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.md5 (added) +++ release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.md5 Wed Mar 27 16:54:51 2013 @@ -0,0 +1 @@ +d354abbcf2de72525aded71fc5f3b354 \ No newline at end of file Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.sha1 == --- release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.sha1 (added) +++ release/commons/fileupload/binaries/commons-fileupload-1.3-bin.tar.gz.sha1 Wed Mar 27 16:54:51 2013 @@ -0,0 +1 @@ +33b0dee2bcbb628fc7647385b70e6ea5021c22cc \ No newline at end of file Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip == Binary file - no diff available. Propchange: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip -- svn:mime-type = application/zip Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.asc == Binary file - no diff available. Propchange: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.asc -- svn:mime-type = application/pgp-signature Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.md5 == --- release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.md5 (added) +++ release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.md5 Wed Mar 27 16:54:51 2013 @@ -0,0 +1 @@ +512c37586926f9fd453967985685509a \ No newline at end of file Added: release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.sha1 == --- release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.sha1 (added) +++ release/commons/fileupload/binaries/commons-fileupload-1.3-bin.zip.sha1 Wed Mar 27 16:54:51 2013 @@ -0,0 +1 @@ +39b4cbbb4e8ca0d894bd9fbd3e480ea1753e29d2 \ No newline at end of file Added: release/commons/fileupload/source/commons-fileupload-1.3-src.tar.gz == Binary
svn commit: r1461704 - /commons/proper/fileupload/tags/FILEUPLOAD_1_3/
Author: simonetripodi Date: Wed Mar 27 16:51:43 2013 New Revision: 1461704 URL: http://svn.apache.org/r1461704 Log: FileUpload RC2 passed to vote so this will be the release tag - http://markmail.org/message/syqfaf2tuno45jr4 Added: commons/proper/fileupload/tags/FILEUPLOAD_1_3/ - copied from r1461703, commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2/
svn commit: r1461663 - in /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util: ContextClassLoader.java EnhancedClassLoader.java
Author: simonetripodi Date: Wed Mar 27 15:47:54 2013 New Revision: 1461663 URL: http://svn.apache.org/r1461663 Log: fixed rawtypes warnings Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/ContextClassLoader.java commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/EnhancedClassLoader.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/ContextClassLoader.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/ContextClassLoader.java?rev=1461663&r1=1461662&r2=1461663&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/ContextClassLoader.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/ContextClassLoader.java Wed Mar 27 15:47:54 2013 @@ -40,7 +40,7 @@ public class ContextClassLoader * === Overridden methods * === */ -protected Class findClass( String name ) +protected Class findClass( String name ) throws ClassNotFoundException { if ( ( context != null ) && ( context.getClassResolver() != null ) ) Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/EnhancedClassLoader.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/EnhancedClassLoader.java?rev=1461663&r1=1461662&r2=1461663&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/EnhancedClassLoader.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/util/EnhancedClassLoader.java Wed Mar 27 15:47:54 2013 @@ -35,7 +35,7 @@ public class EnhancedClassLoader * === Overridden methods * === */ -public Class defineClass( String enhancedClassName, byte[] byteCode ) +public Class defineClass( String enhancedClassName, byte[] byteCode ) { return defineClass( enhancedClassName, byteCode, 0, byteCode.length ); }
svn commit: r1461660 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java
Author: simonetripodi Date: Wed Mar 27 15:45:59 2013 New Revision: 1461660 URL: http://svn.apache.org/r1461660 Log: stack overflow error due to methods signature collisions Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java?rev=1461660&r1=1461659&r2=1461660&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java Wed Mar 27 15:45:59 2013 @@ -19,8 +19,6 @@ */ package org.apache.commons.ognl.test; -import static org.junit.Assert.assertTrue; - import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Array; @@ -28,6 +26,7 @@ import java.lang.reflect.Array; import org.apache.commons.ognl.Ognl; import org.apache.commons.ognl.OgnlContext; import org.apache.commons.ognl.SimpleNode; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -168,7 +167,7 @@ public abstract class OgnlTestCase if ( expected != null && expected.getClass().isArray() && actual != null && actual.getClass().isArray() ) { -assertEquals( Array.getLength( expected ), Array.getLength( actual ) ); +Assert.assertEquals( Array.getLength( expected ), Array.getLength( actual ) ); int length = Array.getLength( expected ); @@ -179,7 +178,7 @@ public abstract class OgnlTestCase if ( aexpected != null && aactual != null && Boolean.class.isAssignableFrom( aexpected.getClass() ) ) { -assertEquals( aexpected.toString(), aactual.toString() ); +Assert.assertEquals( aexpected.toString(), aactual.toString() ); } else OgnlTestCase.assertEquals( aexpected, aactual ); @@ -189,12 +188,12 @@ public abstract class OgnlTestCase && Character.class.isInstance( actual ) ) { -assertEquals( ( (Character) expected ).charValue(), ( (Character) actual ).charValue() ); +Assert.assertEquals( ( (Character) expected ).charValue(), ( (Character) actual ).charValue() ); } else { -assertEquals( expected, actual ); +Assert.assertEquals( expected, actual ); } } @@ -236,7 +235,7 @@ public abstract class OgnlTestCase if ( testedResult instanceof Class ) { -assertTrue( Exception.class.isAssignableFrom( (Class) testedResult ) ); +Assert.assertTrue( Exception.class.isAssignableFrom( (Class) testedResult ) ); } else {
svn commit: r1461658 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/NumericConversionTest.java
Author: simonetripodi Date: Wed Mar 27 15:39:07 2013 New Revision: 1461658 URL: http://svn.apache.org/r1461658 Log: fixed rawtypes warnings trivial code format Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/NumericConversionTest.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/NumericConversionTest.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/NumericConversionTest.java?rev=1461658&r1=1461657&r2=1461658&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/NumericConversionTest.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/NumericConversionTest.java Wed Mar 27 15:39:07 2013 @@ -34,13 +34,14 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -@RunWith(value = Parameterized.class) +@RunWith( value = Parameterized.class ) public class NumericConversionTest extends OgnlTestCase { + private static Object[][] TESTS = { -/* To Integer.class */ -{ "55", Integer.class, new Integer( 55 ) }, { new Integer( 55 ), Integer.class, new Integer( 55 ) }, +/* To Integer.class */ +{ "55", Integer.class, new Integer( 55 ) }, { new Integer( 55 ), Integer.class, new Integer( 55 ) }, { new Double( 55 ), Integer.class, new Integer( 55 ) }, { Boolean.TRUE, Integer.class, new Integer( 1 ) }, { new Byte( (byte) 55 ), Integer.class, new Integer( 55 ) }, { new Character( (char) 55 ), Integer.class, new Integer( 55 ) }, @@ -151,7 +152,7 @@ public class NumericConversionTest private Object value; -private Class toClass; +private Class toClass; private Object expectedValue; @@ -182,7 +183,7 @@ public class NumericConversionTest * === Constructors * === */ -public NumericConversionTest( Object value, Class toClass, Object expectedValue, int scale ) +public NumericConversionTest( Object value, Class toClass, Object expectedValue, int scale ) { super( value + " [" + value.getClass().getName() + "] -> " + toClass.getName() + " == " + expectedValue + " [" + expectedValue.getClass().getName() + "]"
svn commit: r1461656 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java
Author: simonetripodi Date: Wed Mar 27 15:33:21 2013 New Revision: 1461656 URL: http://svn.apache.org/r1461656 Log: trivial: code format, it was not respecting the standard Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java?rev=1461656&r1=1461655&r2=1461656&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java Wed Mar 27 15:33:21 2013 @@ -63,23 +63,33 @@ public abstract class OgnlTestCase * Returns true if object1 is equal to object2 in either the sense that they are the same object or, if both are * non-null if they are equal in the equals() sense. */ -public static boolean isEqual(Object object1, Object object2) { +public static boolean isEqual( Object object1, Object object2 ) +{ boolean result = false; -if (object1 == object2) { +if ( object1 == object2 ) +{ result = true; -} else { -if ((object1 != null) && object1.getClass().isArray()) { -if ((object2 != null) && object2.getClass().isArray() && (object2.getClass() == object1.getClass())) { -result = (Array.getLength(object1) == Array.getLength(object2)); -if (result) { -for (int i = 0, icount = Array.getLength(object1); result && (i < icount); i++) { -result = isEqual(Array.get(object1, i), Array.get(object2, i)); +} +else +{ +if ( ( object1 != null ) && object1.getClass().isArray() ) +{ +if ( ( object2 != null ) && object2.getClass().isArray() && ( object2.getClass() == object1.getClass() ) ) +{ +result = ( Array.getLength( object1 ) == Array.getLength( object2 ) ); +if ( result ) +{ +for ( int i = 0, icount = Array.getLength( object1 ); result && ( i < icount ); i++ ) +{ +result = isEqual( Array.get( object1, i ), Array.get( object2, i ) ); } } } -} else { -result = (object1 != null) && (object2 != null) && object1.equals(object2); +} +else +{ +result = ( object1 != null ) && ( object2 != null ) && object1.equals( object2 ); } } return result; @@ -119,57 +129,72 @@ public abstract class OgnlTestCase * === Public methods * === */ -public String getExpressionDump(SimpleNode node) { +public String getExpressionDump( SimpleNode node ) +{ StringWriter writer = new StringWriter(); -node.dump(new PrintWriter(writer), " "); +node.dump( new PrintWriter( writer ), " " ); return writer.toString(); } -public String getExpressionString() { +public String getExpressionString() +{ return _expressionString; } public SimpleNode getExpression() -throws Exception { -if (_expression == null) { -_expression = (SimpleNode) Ognl.parseExpression(_expressionString); +throws Exception +{ +if ( _expression == null ) +{ +_expression = (SimpleNode) Ognl.parseExpression( _expressionString ); } -if (_compileExpressions) { -_expression = (SimpleNode) Ognl.compileExpression(_context, _root, _expressionString); +if ( _compileExpressions ) +{ +_expression = (SimpleNode) Ognl.compileExpression( _context, _root, _expressionString ); } return _expression; } -public Object getExpectedResult() { +public Object getExpectedResult() +{ return _expectedResult; } -public static void assertEquals(Object expected, Object actual) { -if (expected != null && expected.getClass().isArray() && actual != null && actual.getClass().isArray()) { +public static void assertEquals( Object expected, Object actual ) +{ +if ( expected != null && expected.getClass().isArray() && actual != null &am
svn commit: r1461653 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java
Author: simonetripodi Date: Wed Mar 27 15:31:12 2013 New Revision: 1461653 URL: http://svn.apache.org/r1461653 Log: trivial: static import of assertTrue method Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java?rev=1461653&r1=1461652&r2=1461653&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java Wed Mar 27 15:31:12 2013 @@ -19,17 +19,18 @@ */ package org.apache.commons.ognl.test; -import junit.framework.Assert; +import static org.junit.Assert.assertTrue; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.reflect.Array; + import org.apache.commons.ognl.Ognl; import org.apache.commons.ognl.OgnlContext; import org.apache.commons.ognl.SimpleNode; import org.junit.Before; import org.junit.Test; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.reflect.Array; - public abstract class OgnlTestCase { @@ -149,7 +150,7 @@ public abstract class OgnlTestCase public static void assertEquals(Object expected, Object actual) { if (expected != null && expected.getClass().isArray() && actual != null && actual.getClass().isArray()) { -Assert.assertEquals(Array.getLength(expected), Array.getLength(actual)); +assertEquals(Array.getLength(expected), Array.getLength(actual)); int length = Array.getLength(expected); @@ -158,17 +159,17 @@ public abstract class OgnlTestCase Object aactual = Array.get(actual, i); if (aexpected != null && aactual != null && Boolean.class.isAssignableFrom(aexpected.getClass())) { -Assert.assertEquals(aexpected.toString(), aactual.toString()); +assertEquals(aexpected.toString(), aactual.toString()); } else OgnlTestCase.assertEquals(aexpected, aactual); } } else if (expected != null && actual != null && Character.class.isInstance(expected) && Character.class.isInstance(actual)) { -Assert.assertEquals(((Character) expected).charValue(), ((Character) actual).charValue()); +assertEquals(((Character) expected).charValue(), ((Character) actual).charValue()); } else { -Assert.assertEquals(expected, actual); +assertEquals(expected, actual); } } @@ -203,7 +204,7 @@ public abstract class OgnlTestCase } if (testedResult instanceof Class) { -Assert.assertTrue(Exception.class.isAssignableFrom((Class) testedResult)); +assertTrue(Exception.class.isAssignableFrom((Class) testedResult)); } else { throw ex; }
svn commit: r1461652 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java
Author: simonetripodi Date: Wed Mar 27 15:29:57 2013 New Revision: 1461652 URL: http://svn.apache.org/r1461652 Log: suppressed rawtype warning by specifying generics Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java?rev=1461652&r1=1461651&r2=1461652&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/OgnlTestCase.java Wed Mar 27 15:29:57 2013 @@ -203,7 +203,7 @@ public abstract class OgnlTestCase } if (testedResult instanceof Class) { -Assert.assertTrue(Exception.class.isAssignableFrom((Class) testedResult)); +Assert.assertTrue(Exception.class.isAssignableFrom((Class) testedResult)); } else { throw ex; }
svn commit: r1461651 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/objects/Bean3.java
Author: simonetripodi Date: Wed Mar 27 15:28:32 2013 New Revision: 1461651 URL: http://svn.apache.org/r1461651 Log: suppressed rawtype warning by specifying generics Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/objects/Bean3.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/objects/Bean3.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/objects/Bean3.java?rev=1461651&r1=1461650&r2=1461651&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/objects/Bean3.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/objects/Bean3.java Wed Mar 27 15:28:32 2013 @@ -26,9 +26,9 @@ public class Bean3 { private int value = 100; -private Map map; +private Map map; { -map = new HashMap(); +map = new HashMap(); map.put( "foo", "bar" ); map.put( "bar", "baz" ); } @@ -57,7 +57,7 @@ public class Bean3 _indexValue = value; } -public Map getMap() +public Map getMap() { return map; }
svn commit: r1461650 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertyNotFoundTest.java
Author: simonetripodi Date: Wed Mar 27 15:26:33 2013 New Revision: 1461650 URL: http://svn.apache.org/r1461650 Log: suppressed rawtype warning by specifying generics Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertyNotFoundTest.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertyNotFoundTest.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertyNotFoundTest.java?rev=1461650&r1=1461649&r2=1461650&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertyNotFoundTest.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertyNotFoundTest.java Wed Mar 27 15:26:33 2013 @@ -75,12 +75,12 @@ public class PropertyNotFoundTest public static class BlahPropertyAccessor implements PropertyAccessor { -public void setProperty( Map context, Object target, Object name, Object value ) +public void setProperty( Map context, Object target, Object name, Object value ) throws OgnlException { } -public Object getProperty( Map context, Object target, Object name ) +public Object getProperty( Map context, Object target, Object name ) throws OgnlException { if ( "x".equals( name ) || "y".equals( name ) )
svn commit: r1461647 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertySetterTest.java
Author: simonetripodi Date: Wed Mar 27 15:24:49 2013 New Revision: 1461647 URL: http://svn.apache.org/r1461647 Log: suppressed rawtype warning by specifying generics Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertySetterTest.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertySetterTest.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertySetterTest.java?rev=1461647&r1=1461646&r2=1461647&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertySetterTest.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/PropertySetterTest.java Wed Mar 27 15:24:49 2013 @@ -33,7 +33,7 @@ public class PropertySetterTest extends TestCase { -private Map map; +private Map map; private TestObject testObject = new TestObject( "propertyValue" ); @@ -73,7 +73,7 @@ public class PropertySetterTest } } -public Map getMap() +public Map getMap() { return map; }
svn commit: r1461640 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/SetterTest.java
Author: simonetripodi Date: Wed Mar 27 15:21:01 2013 New Revision: 1461640 URL: http://svn.apache.org/r1461640 Log: trivial: suppressed rawtype warning by specifying generics Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/SetterTest.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/SetterTest.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/SetterTest.java?rev=1461640&r1=1461639&r2=1461640&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/SetterTest.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/test/SetterTest.java Wed Mar 27 15:21:01 2013 @@ -34,7 +34,7 @@ public class SetterTest { private static Root ROOT = new Root(); -static Set _list = new HashSet(); +static Set _list = new HashSet(); static { _list.add( "Test1" ); @@ -54,7 +54,7 @@ public class SetterTest { ROOT, "settableList[|]", "bar", "oompa" }, { ROOT, "settableList[|]", "oompa" }, { ROOT, "map.newValue", new Integer( 101 ), new Integer( 555 ) }, -{ ROOT, "map", ROOT.getMap(), new HashMap(), NoSuchPropertyException.class }, +{ ROOT, "map", ROOT.getMap(), new HashMap(), NoSuchPropertyException.class }, { ROOT.getMap(), "newValue2 || put(\"newValue2\",987), newValue2", new Integer( 987 ), new Integer( 1002 ) }, { ROOT, "map.(someMissingKey || newValue)", new Integer( 555 ), new Integer( 666 ) }, { ROOT.getMap(), "newValue || someMissingKey", new Integer( 666 ), new Integer( 666 ) }, // no setting happens!
svn commit: r1461635 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/TestOgnlRuntime.java
Author: simonetripodi Date: Wed Mar 27 15:16:44 2013 New Revision: 1461635 URL: http://svn.apache.org/r1461635 Log: trivial: suppressed rawtype warning by specifying generics, muted unused warning (the object method is just a test method) Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/TestOgnlRuntime.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/TestOgnlRuntime.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/TestOgnlRuntime.java?rev=1461635&r1=1461634&r2=1461635&view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/TestOgnlRuntime.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/TestOgnlRuntime.java Wed Mar 27 15:16:44 2013 @@ -75,7 +75,7 @@ public class TestOgnlRuntime public void test_Get_Private_Class() throws Exception { -List list = Arrays.asList( "hello", "world" ); +List list = Arrays.asList( "hello", "world" ); Method m = OgnlRuntime.getReadMethod( list.getClass(), "iterator" ); assertNotNull( m ); @@ -275,7 +275,7 @@ public class TestOgnlRuntime Method method = OgnlRuntime.getSetMethod( context, GenericCracker.class, "param" ); assertNotNull( method ); -Class[] types = method.getParameterTypes(); +Class[] types = method.getParameterTypes(); assertEquals( 1, types.length ); assertEquals( Integer.class, types[0] ); } @@ -301,7 +301,7 @@ public class TestOgnlRuntime Method method = OgnlRuntime.getSetMethod( context, GameGeneric.class, "ids" ); assertNotNull( method ); -Class[] types = OgnlRuntime.findParameterTypes( GameGeneric.class, method ); +Class[] types = OgnlRuntime.findParameterTypes( GameGeneric.class, method ); assertEquals( 1, types.length ); assertEquals( Long[].class, types[0] ); } @@ -315,7 +315,7 @@ public class TestOgnlRuntime Method method = OgnlRuntime.getSetMethod( context, BaseGeneric.class, "ids" ); assertNotNull( method ); -Class[] types = OgnlRuntime.findParameterTypes( BaseGeneric.class, method ); +Class[] types = OgnlRuntime.findParameterTypes( BaseGeneric.class, method ); assertEquals( 1, types.length ); assertEquals( Serializable[].class, types[0] ); } @@ -324,7 +324,7 @@ public class TestOgnlRuntime public void test_Get_Declared_Methods_With_Synthetic_Methods() throws Exception { -List result = OgnlRuntime.getDeclaredMethods( SubclassSyntheticObject.class, "list", false ); +List result = OgnlRuntime.getDeclaredMethods( SubclassSyntheticObject.class, "list", false ); // synthetic method would be // "public volatile java.util.List org.ognl.test.objects.SubclassSyntheticObject.getList()", @@ -345,6 +345,7 @@ public class TestOgnlRuntime private static class GenericParent { +@SuppressWarnings( "unused" ) public void save( T entity ) { @@ -373,11 +374,11 @@ public class TestOgnlRuntime Method saveMethod = GenericParent.class.getMethod( "save", Object.class ); System.out.println( saveMethod ); -Class[] longClass = OgnlRuntime.findParameterTypes( LongChild.class, saveMethod ); +Class[] longClass = OgnlRuntime.findParameterTypes( LongChild.class, saveMethod ); assertNotSame( longClass[0], String.class ); assertSame( longClass[0], Long.class ); -Class[] stringClass = OgnlRuntime.findParameterTypes( StringChild.class, saveMethod ); +Class[] stringClass = OgnlRuntime.findParameterTypes( StringChild.class, saveMethod ); assertNotSame( "The cached parameter types from previous calls are used", stringClass[0], Long.class ); assertSame( stringClass[0], String.class ); }
svn commit: r1461633 - /commons/proper/ognl/trunk/doap_ognl.rdf
Author: simonetripodi Date: Wed Mar 27 15:07:47 2013 New Revision: 1461633 URL: http://svn.apache.org/r1461633 Log: initial checkin of missing DOAP descripto for OGNL component Added: commons/proper/ognl/trunk/doap_ognl.rdf (with props) Added: commons/proper/ognl/trunk/doap_ognl.rdf URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/doap_ognl.rdf?rev=1461633&view=auto == --- commons/proper/ognl/trunk/doap_ognl.rdf (added) +++ commons/proper/ognl/trunk/doap_ognl.rdf Wed Mar 27 15:07:47 2013 @@ -0,0 +1,48 @@ + + +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/fileupload/";> +Apache Commons FileUpload +http://commons.apache.org/proper/commons-ognl/"/> +Java +http://projects.apache.org/category/library"/> +http://usefulinc.com/doap/licenses/asl20"/> +http://issues.apache.org/jira/browse/OGNL"/> +http://commons.apache.org/proper/commons-ognl/download_ognl.cgi"/> +http://commons.apache.org/"/> +Object Graph Navigation Library + +The Apache Commons OGNL library is a Java development framework for Object-Graph Navigation Language, +plus other extras such as list projection and selection and lambda expressions. + + + +http://svn.apache.org/repos/asf"/> +http://svn.apache.org/repos/asf/commons/proper/ognl"/> + + + + +commons-ognl +2013-??-?? +4.0 + + +http://commons.apache.org/mail-lists.html"/> + + Propchange: commons/proper/ognl/trunk/doap_ognl.rdf -- svn:eol-style = native Propchange: commons/proper/ognl/trunk/doap_ognl.rdf -- svn:keywords = Date Revision Author HeadURL Id
svn commit: r1461629 - /commons/proper/ognl/trunk/src/main/assembly/bin.xml
Author: simonetripodi Date: Wed Mar 27 14:59:57 2013 New Revision: 1461629 URL: http://svn.apache.org/r1461629 Log: ${project.build.directory} could be overridden in the POM and forget to be updated in the assembly descriptor Modified: commons/proper/ognl/trunk/src/main/assembly/bin.xml Modified: commons/proper/ognl/trunk/src/main/assembly/bin.xml URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/assembly/bin.xml?rev=1461629&r1=1461628&r2=1461629&view=diff == --- commons/proper/ognl/trunk/src/main/assembly/bin.xml (original) +++ commons/proper/ognl/trunk/src/main/assembly/bin.xml Wed Mar 27 14:59:57 2013 @@ -34,14 +34,14 @@ - target + ${project.build.directory} *.jar - target/site/apidocs + ${project.build.directory}/site/apidocs apidocs
svn commit: r1461628 - /commons/proper/ognl/trunk/src/main/assembly/src.xml
Author: simonetripodi Date: Wed Mar 27 14:58:15 2013 New Revision: 1461628 URL: http://svn.apache.org/r1461628 Log: use the `exclude` logic to create the sources archive, rather than specifying what has to be included Modified: commons/proper/ognl/trunk/src/main/assembly/src.xml Modified: commons/proper/ognl/trunk/src/main/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/assembly/src.xml?rev=1461628&r1=1461627&r2=1461628&view=diff == --- commons/proper/ognl/trunk/src/main/assembly/src.xml (original) +++ commons/proper/ognl/trunk/src/main/assembly/src.xml Wed Mar 27 14:58:15 2013 @@ -26,17 +26,17 @@ ${project.build.finalName}-src - -checkstyle.xml -LICENSE.txt -NOTICE.txt -pom.xml -RELEASE-NOTES.txt -findbugs-exclude-filter.xml - - - - src + ${basedir} + +**/.classpath +**/.project +**/.settings/ +**/doap_*.rdf +**/bin/ +**/.externalToolBuilders/ +**/${project.build.directory}/ +**/download*.cgi +
svn commit: r1461622 - in /commons/proper/ognl/trunk/src/main/assembly: bin.xml src.xml
Author: simonetripodi Date: Wed Mar 27 14:51:45 2013 New Revision: 1461622 URL: http://svn.apache.org/r1461622 Log: reuse already defined properties rather than composing them to create the baseDirectory Modified: commons/proper/ognl/trunk/src/main/assembly/bin.xml commons/proper/ognl/trunk/src/main/assembly/src.xml Modified: commons/proper/ognl/trunk/src/main/assembly/bin.xml URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/assembly/bin.xml?rev=1461622&r1=1461621&r2=1461622&view=diff == --- commons/proper/ognl/trunk/src/main/assembly/bin.xml (original) +++ commons/proper/ognl/trunk/src/main/assembly/bin.xml Wed Mar 27 14:51:45 2013 @@ -23,6 +23,7 @@ tar.gz zip + ${project.build.finalName}-bin false Modified: commons/proper/ognl/trunk/src/main/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/assembly/src.xml?rev=1461622&r1=1461621&r2=1461622&view=diff == --- commons/proper/ognl/trunk/src/main/assembly/src.xml (original) +++ commons/proper/ognl/trunk/src/main/assembly/src.xml Wed Mar 27 14:51:45 2013 @@ -23,7 +23,7 @@ tar.gz zip - ${project.artifactId}-${commons.release.version}-src + ${project.build.finalName}-src
svn commit: r1461620 - in /commons/proper/ognl/trunk/src/main/assembly: bin.xml src.xml
Author: simonetripodi Date: Wed Mar 27 14:49:50 2013 New Revision: 1461620 URL: http://svn.apache.org/r1461620 Log: trivial: 2 spaces indentation for XML documents Modified: commons/proper/ognl/trunk/src/main/assembly/bin.xml commons/proper/ognl/trunk/src/main/assembly/src.xml Modified: commons/proper/ognl/trunk/src/main/assembly/bin.xml URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/assembly/bin.xml?rev=1461620&r1=1461619&r2=1461620&view=diff == --- commons/proper/ognl/trunk/src/main/assembly/bin.xml (original) +++ commons/proper/ognl/trunk/src/main/assembly/bin.xml Wed Mar 27 14:49:50 2013 @@ -7,7 +7,7 @@ (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 +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, @@ -16,32 +16,32 @@ limitations under the License. --> http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"; -xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd";> -bin - -tar.gz -zip - -false - - - -LICENSE.txt -NOTICE.txt -RELEASE-NOTES.txt - - - -target - - -*.jar - - - -target/site/apidocs -apidocs - - +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd";> + bin + +tar.gz +zip + + false + + + +LICENSE.txt +NOTICE.txt +RELEASE-NOTES.txt + + + + target + + +*.jar + + + + target/site/apidocs + apidocs + + Modified: commons/proper/ognl/trunk/src/main/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/assembly/src.xml?rev=1461620&r1=1461619&r2=1461620&view=diff == --- commons/proper/ognl/trunk/src/main/assembly/src.xml (original) +++ commons/proper/ognl/trunk/src/main/assembly/src.xml Wed Mar 27 14:49:50 2013 @@ -7,7 +7,7 @@ (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 +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, @@ -16,27 +16,27 @@ limitations under the License. --> http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"; -xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd";> -src - -tar.gz -zip - - ${project.artifactId}-${commons.release.version}-src - - - -checkstyle.xml -LICENSE.txt -NOTICE.txt -pom.xml -RELEASE-NOTES.txt -findbugs-exclude-filter.xml - - - -src - - +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd";> + src + +tar.gz +zip + + ${project.artifactId}-${commons.release.version}-src + + + +checkstyle.xml +LICENSE.txt +NOTICE.txt +pom.xml +RELEASE-NOTES.txt +findbugs-exclude-filter.xml + + + + src + +
svn commit: r1461611 - /commons/proper/ognl/trunk/pom.xml
Author: simonetripodi Date: Wed Mar 27 14:39:12 2013 New Revision: 1461611 URL: http://svn.apache.org/r1461611 Log: trivial: changing email address pattern makes the site-plugin able to retrieve the associated gravatar and creates an enhanced team-list page Modified: commons/proper/ognl/trunk/pom.xml Modified: commons/proper/ognl/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/pom.xml?rev=1461611&r1=1461610&r2=1461611&view=diff == --- commons/proper/ognl/trunk/pom.xml (original) +++ commons/proper/ognl/trunk/pom.xml Wed Mar 27 14:39:12 2013 @@ -51,7 +51,7 @@ limitations under the License. Antonio Petrelli apetrelli - apetrelli at apache dot org + apetre...@apache.org Committer Emeritus @@ -60,7 +60,7 @@ limitations under the License. Christian Grobmeier grobmeier - grobmeier at apache dot org + grobme...@apache.org PMC Member Committer @@ -69,7 +69,7 @@ limitations under the License. Jesse Kuhnert jkuhnert - jkuhnert at apache dot org + jkuhn...@apache.org Committer @@ -77,7 +77,7 @@ limitations under the License. Jochen Wiedmann jochen - jochen at apache dot org + joc...@apache.org PMC Member Committer @@ -86,7 +86,7 @@ limitations under the License. Lukasz Lenart lukaszlenart - lukaszlenart at apache dot org + lukaszlen...@apache.org Committer @@ -94,7 +94,7 @@ limitations under the License. Olivier Lamy olamy - olamy at apache dot org + ol...@apache.org Committer @@ -102,7 +102,7 @@ limitations under the License. Luke Blanshard leadpipe - leadpipe at apache dot org + leadp...@apache.org Committer @@ -110,7 +110,7 @@ limitations under the License. Marc Andrew Davidson javadrewd - javadrewd at apache dot org + javadr...@apache.org Committer @@ -118,7 +118,7 @@ limitations under the License. Maurizio Cucchiara mcucchiara - mcucchiara at apache dot org + mcucchi...@apache.org Committer @@ -126,7 +126,7 @@ limitations under the License. Simone Tripodi simonetripodi - simonetripodi at apache dot org + simonetrip...@apache.org PMC Member Committer @@ -135,7 +135,7 @@ limitations under the License. Upayavira upayavira - upayavira at apache dot org + upayav...@apache.org Committer @@ -148,7 +148,7 @@ limitations under the License. Adrian Cumiskey - acumiskey at apache dot org + acumis...@apache.org
svn commit: r1461601 - in /commons/proper/chain/trunk/core/src: main/java/org/apache/commons/chain2/impl/CatalogBase.java test/java/org/apache/commons/chain2/impl/CatalogBaseTestCase.java
Author: simonetripodi Date: Wed Mar 27 14:23:12 2013 New Revision: 1461601 URL: http://svn.apache.org/r1461601 Log: [CHAIN-80] NPE when submitting null commands map to CatalogBase - patch submitted by Steve Westwood Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogBase.java commons/proper/chain/trunk/core/src/test/java/org/apache/commons/chain2/impl/CatalogBaseTestCase.java Modified: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogBase.java URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogBase.java?rev=1461601&r1=1461600&r2=1461601&view=diff == --- commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogBase.java (original) +++ commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/impl/CatalogBase.java Wed Mar 27 14:23:12 2013 @@ -58,10 +58,16 @@ public class CatalogBaseString and all values should be Command. * * @param commands Map of Commands. + * + * @exception IllegalArgumentException if commands + * is null * * @since Chain 1.1 */ -public CatalogBase(Map> commands ) { +public CatalogBase(Map> commands) { +if (commands == null) { +throw new IllegalArgumentException("'commands' parameter must be not null"); +} this.commands.putAll( commands ); } Modified: commons/proper/chain/trunk/core/src/test/java/org/apache/commons/chain2/impl/CatalogBaseTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/core/src/test/java/org/apache/commons/chain2/impl/CatalogBaseTestCase.java?rev=1461601&r1=1461600&r2=1461601&view=diff == --- commons/proper/chain/trunk/core/src/test/java/org/apache/commons/chain2/impl/CatalogBaseTestCase.java (original) +++ commons/proper/chain/trunk/core/src/test/java/org/apache/commons/chain2/impl/CatalogBaseTestCase.java Wed Mar 27 14:23:12 2013 @@ -19,9 +19,10 @@ package org.apache.commons.chain2.impl; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; import java.util.Iterator; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.chain2.Catalog; import org.apache.commons.chain2.Command; @@ -145,7 +146,31 @@ public class CatalogBaseTestCase { assertNull(catalog.getCommand("ChainBase")); } - +// Test construction with commands collection +@Test +public void testInstantiationWithMapOfCommands() { +@SuppressWarnings("serial") +Map>> +commands = new ConcurrentHashMap>>() { +{ +put("AddingCommand", new AddingCommand("", null)); +} +}; + +CatalogBase> +catalog = new CatalogBase>(commands); + +assertEquals("Correct command count", 1, catalog.getCommands().size()); +} + +// Examine construction with null commands collection +@Test(expected = IllegalArgumentException.class) +public void testInstantiationWithNullMapOfCommands() { +Map>> commands = null; +@SuppressWarnings("unused") +CatalogBase> +catalog = new CatalogBase>(commands); +} // Support Methods
svn commit: r1461327 - /commons/proper/fileupload/trunk/src/main/assembly/src.xml
Author: simonetripodi Date: Tue Mar 26 21:34:33 2013 New Revision: 1461327 URL: http://svn.apache.org/r1461327 Log: trivial: just avoid to hardcode the build directory that can potentially be modified in the pom Modified: commons/proper/fileupload/trunk/src/main/assembly/src.xml Modified: commons/proper/fileupload/trunk/src/main/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/assembly/src.xml?rev=1461327&r1=1461326&r2=1461327&view=diff == --- commons/proper/fileupload/trunk/src/main/assembly/src.xml (original) +++ commons/proper/fileupload/trunk/src/main/assembly/src.xml Tue Mar 26 21:34:33 2013 @@ -34,7 +34,7 @@ **/doap_*.rdf **/bin/ **/.externalToolBuilders/ -**/target/ +**/${project.build.directory}/ **/download*.cgi
svn commit: r1461325 - /commons/proper/fileupload/trunk/src/main/assembly/src.xml
Author: simonetripodi Date: Tue Mar 26 21:32:35 2013 New Revision: 1461325 URL: http://svn.apache.org/r1461325 Log: releng: DOAP descriptor not part of the source archive release Modified: commons/proper/fileupload/trunk/src/main/assembly/src.xml Modified: commons/proper/fileupload/trunk/src/main/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/assembly/src.xml?rev=1461325&r1=1461324&r2=1461325&view=diff == --- commons/proper/fileupload/trunk/src/main/assembly/src.xml (original) +++ commons/proper/fileupload/trunk/src/main/assembly/src.xml Tue Mar 26 21:32:35 2013 @@ -31,7 +31,7 @@ **/.classpath **/.project **/.settings/ -**/.doap_*.rdf +**/doap_*.rdf **/bin/ **/.externalToolBuilders/ **/target/
svn commit: r1461194 - /commons/proper/fileupload/trunk/src/main/assembly/bin.xml
Author: simonetripodi Date: Tue Mar 26 15:55:33 2013 New Revision: 1461194 URL: http://svn.apache.org/r1461194 Log: trivial: baseDirectory not specified in -bin archive Modified: commons/proper/fileupload/trunk/src/main/assembly/bin.xml Modified: commons/proper/fileupload/trunk/src/main/assembly/bin.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/assembly/bin.xml?rev=1461194&r1=1461193&r2=1461194&view=diff == --- commons/proper/fileupload/trunk/src/main/assembly/bin.xml (original) +++ commons/proper/fileupload/trunk/src/main/assembly/bin.xml Tue Mar 26 15:55:33 2013 @@ -23,6 +23,7 @@ tar.gz zip + ${project.build.finalName}-bin true
svn commit: r1461191 - /commons/proper/fileupload/trunk/src/main/assembly/src.xml
Author: simonetripodi Date: Tue Mar 26 15:42:39 2013 New Revision: 1461191 URL: http://svn.apache.org/r1461191 Log: trivial: ${artifactId}-${version} = ${project.build.finalName} Modified: commons/proper/fileupload/trunk/src/main/assembly/src.xml Modified: commons/proper/fileupload/trunk/src/main/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/assembly/src.xml?rev=1461191&r1=1461190&r2=1461191&view=diff == --- commons/proper/fileupload/trunk/src/main/assembly/src.xml (original) +++ commons/proper/fileupload/trunk/src/main/assembly/src.xml Tue Mar 26 15:42:39 2013 @@ -23,7 +23,7 @@ tar.gz zip - ${artifactId}-${version}-src + ${project.build.finalName}-src ${basedir}
svn commit: r1461190 - /commons/proper/fileupload/trunk/src/main/assembly/bin.xml
Author: simonetripodi Date: Tue Mar 26 15:32:12 2013 New Revision: 1461190 URL: http://svn.apache.org/r1461190 Log: trivial: just avoid to hardcode the build directory that can potentially be modified in the pom Modified: commons/proper/fileupload/trunk/src/main/assembly/bin.xml Modified: commons/proper/fileupload/trunk/src/main/assembly/bin.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/assembly/bin.xml?rev=1461190&r1=1461189&r2=1461190&view=diff == --- commons/proper/fileupload/trunk/src/main/assembly/bin.xml (original) +++ commons/proper/fileupload/trunk/src/main/assembly/bin.xml Tue Mar 26 15:32:12 2013 @@ -32,7 +32,7 @@ - target + ${project.build.directory} lib ${project.build.finalName}.jar
svn commit: r1461185 - /commons/proper/fileupload/trunk/src/main/assembly/bin.xml
Author: simonetripodi Date: Tue Mar 26 15:25:20 2013 New Revision: 1461185 URL: http://svn.apache.org/r1461185 Log: releng: as pointed by Manu and Bene, just include the main artifact in the -bin archive Modified: commons/proper/fileupload/trunk/src/main/assembly/bin.xml Modified: commons/proper/fileupload/trunk/src/main/assembly/bin.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/assembly/bin.xml?rev=1461185&r1=1461184&r2=1461185&view=diff == --- commons/proper/fileupload/trunk/src/main/assembly/bin.xml (original) +++ commons/proper/fileupload/trunk/src/main/assembly/bin.xml Tue Mar 26 15:25:20 2013 @@ -35,7 +35,7 @@ target lib -*.jar +${project.build.finalName}.jar
svn commit: r1461182 - /commons/proper/fileupload/trunk/src/main/assembly/src.xml
Author: simonetripodi Date: Tue Mar 26 15:18:46 2013 New Revision: 1461182 URL: http://svn.apache.org/r1461182 Log: releng: DOAP descriptor not part of the source archive release Modified: commons/proper/fileupload/trunk/src/main/assembly/src.xml Modified: commons/proper/fileupload/trunk/src/main/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/assembly/src.xml?rev=1461182&r1=1461181&r2=1461182&view=diff == --- commons/proper/fileupload/trunk/src/main/assembly/src.xml (original) +++ commons/proper/fileupload/trunk/src/main/assembly/src.xml Tue Mar 26 15:18:46 2013 @@ -31,6 +31,7 @@ **/.classpath **/.project **/.settings/ +**/.doap_*.rdf **/bin/ **/.externalToolBuilders/ **/target/
svn commit: r1460339 - /commons/proper/fileupload/trunk/pom.xml
Author: simonetripodi Date: Sun Mar 24 12:36:11 2013 New Revision: 1460339 URL: http://svn.apache.org/r1460339 Log: [maven-release-plugin] prepare for next development iteration Modified: commons/proper/fileupload/trunk/pom.xml Modified: commons/proper/fileupload/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/pom.xml?rev=1460339&r1=1460338&r2=1460339&view=diff == --- commons/proper/fileupload/trunk/pom.xml (original) +++ commons/proper/fileupload/trunk/pom.xml Sun Mar 24 12:36:11 2013 @@ -26,7 +26,7 @@ commons-fileupload commons-fileupload - 1.3 + 1.4-SNAPSHOT Commons FileUpload @@ -165,9 +165,9 @@ - scm:svn:http://svn.apache.org/repos/asf/commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2 - scm:svn:https://svn.apache.org/repos/asf/commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2 - http://svn.apache.org/viewvc/commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2 + scm:svn:http://svn.apache.org/repos/asf/commons/proper/fileupload/trunk + scm:svn:https://svn.apache.org/repos/asf/commons/proper/fileupload/trunk +http://svn.apache.org/viewvc/commons/proper/fileupload/trunk jira
svn commit: r1460338 - /commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2/
Author: simonetripodi Date: Sun Mar 24 12:36:06 2013 New Revision: 1460338 URL: http://svn.apache.org/r1460338 Log: [maven-release-plugin] copy for tag FILEUPLOAD_1_3_RC2 Added: commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2/ - copied from r1460337, commons/proper/fileupload/trunk/
svn commit: r1460337 - /commons/proper/fileupload/trunk/pom.xml
Author: simonetripodi Date: Sun Mar 24 12:35:59 2013 New Revision: 1460337 URL: http://svn.apache.org/r1460337 Log: [maven-release-plugin] prepare release FILEUPLOAD_1_3_RC2 Modified: commons/proper/fileupload/trunk/pom.xml Modified: commons/proper/fileupload/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/pom.xml?rev=1460337&r1=1460336&r2=1460337&view=diff == --- commons/proper/fileupload/trunk/pom.xml (original) +++ commons/proper/fileupload/trunk/pom.xml Sun Mar 24 12:35:59 2013 @@ -26,7 +26,7 @@ commons-fileupload commons-fileupload - 1.3-SNAPSHOT + 1.3 Commons FileUpload @@ -165,9 +165,9 @@ - scm:svn:http://svn.apache.org/repos/asf/commons/proper/fileupload/trunk - scm:svn:https://svn.apache.org/repos/asf/commons/proper/fileupload/trunk -http://svn.apache.org/viewvc/commons/proper/fileupload/trunk + scm:svn:http://svn.apache.org/repos/asf/commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2 + scm:svn:https://svn.apache.org/repos/asf/commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2 + http://svn.apache.org/viewvc/commons/proper/fileupload/tags/FILEUPLOAD_1_3_RC2 jira
svn commit: r1460336 - /commons/proper/fileupload/trunk/doap_fileupload.rdf
Author: simonetripodi Date: Sun Mar 24 12:32:39 2013 New Revision: 1460336 URL: http://svn.apache.org/r1460336 Log: releng: updated estimated release date Modified: commons/proper/fileupload/trunk/doap_fileupload.rdf Modified: commons/proper/fileupload/trunk/doap_fileupload.rdf URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/doap_fileupload.rdf?rev=1460336&r1=1460335&r2=1460336&view=diff == --- commons/proper/fileupload/trunk/doap_fileupload.rdf (original) +++ commons/proper/fileupload/trunk/doap_fileupload.rdf Sun Mar 24 12:32:39 2013 @@ -40,7 +40,7 @@ commons-fileupload -2013-02-12 +2013-03-27 1.3
svn commit: r1460334 - /commons/proper/fileupload/trunk/src/site/site.xml
Author: simonetripodi Date: Sun Mar 24 12:27:48 2013 New Revision: 1460334 URL: http://svn.apache.org/r1460334 Log: added missing direct download link in the site menu Modified: commons/proper/fileupload/trunk/src/site/site.xml Modified: commons/proper/fileupload/trunk/src/site/site.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/site/site.xml?rev=1460334&r1=1460333&r2=1460334&view=diff == --- commons/proper/fileupload/trunk/src/site/site.xml (original) +++ commons/proper/fileupload/trunk/src/site/site.xml Sun Mar 24 12:27:48 2013 @@ -31,6 +31,7 @@ +
svn commit: r1460329 - /commons/proper/fileupload/trunk/src/site/xdoc/index.xml
Author: simonetripodi Date: Sun Mar 24 12:17:28 2013 New Revision: 1460329 URL: http://svn.apache.org/r1460329 Log: releng: updated estimated release date Modified: commons/proper/fileupload/trunk/src/site/xdoc/index.xml Modified: commons/proper/fileupload/trunk/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/site/xdoc/index.xml?rev=1460329&r1=1460328&r2=1460329&view=diff == --- commons/proper/fileupload/trunk/src/site/xdoc/index.xml (original) +++ commons/proper/fileupload/trunk/src/site/xdoc/index.xml Sun Mar 24 12:17:28 2013 @@ -66,7 +66,7 @@ -FileUpload 1.3 - 12 March 2013 +FileUpload 1.3 - 27 March 2013 Download the binary and source distributions from a mirror site http://commons.apache.org/fileupload/download_fileupload.cgi";>here
svn commit: r1460328 - /commons/proper/fileupload/trunk/src/changes/changes.xml
Author: simonetripodi Date: Sun Mar 24 12:14:40 2013 New Revision: 1460328 URL: http://svn.apache.org/r1460328 Log: releng: updated estimated release date Modified: commons/proper/fileupload/trunk/src/changes/changes.xml Modified: commons/proper/fileupload/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/changes/changes.xml?rev=1460328&r1=1460327&r2=1460328&view=diff == --- commons/proper/fileupload/trunk/src/changes/changes.xml (original) +++ commons/proper/fileupload/trunk/src/changes/changes.xml Sun Mar 24 12:14:40 2013 @@ -43,7 +43,7 @@ The type attribute can be add,u - + SECURITY - CVE-2013-0248. Update the Javadoc and documentation to make
svn commit: r1460326 - in /commons/proper/fileupload/trunk: RELEASE-NOTES.txt src/changes/changes.xml
Author: simonetripodi Date: Sun Mar 24 12:12:05 2013 New Revision: 1460326 URL: http://svn.apache.org/r1460326 Log: releng: FILEUPLOAD-215 edited to reflect current 1.3 release, not old 1.2.3 development release Modified: commons/proper/fileupload/trunk/RELEASE-NOTES.txt commons/proper/fileupload/trunk/src/changes/changes.xml Modified: commons/proper/fileupload/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/RELEASE-NOTES.txt?rev=1460326&r1=1460325&r2=1460326&view=diff == --- commons/proper/fileupload/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/fileupload/trunk/RELEASE-NOTES.txt Sun Mar 24 12:12:05 2013 @@ -90,7 +90,7 @@ Task = * [FILEUPLOAD-201] - Update to JDK 1.5 and bump IO dependency to 2.0.1 - * [FILEUPLOAD-215] - version 1.2.3 improvement tasks + * [FILEUPLOAD-215] - version 1.3 improvement tasks OTHER NOTES Modified: commons/proper/fileupload/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/changes/changes.xml?rev=1460326&r1=1460325&r2=1460326&view=diff == --- commons/proper/fileupload/trunk/src/changes/changes.xml (original) +++ commons/proper/fileupload/trunk/src/changes/changes.xml Sun Mar 24 12:12:05 2013 @@ -160,7 +160,7 @@ The type attribute can be add,u Update to JDK 1.5 and bump IO dependency to 2.0.1 -version 1.2.3 improvement tasks +version 1.3 improvement tasks
svn commit: r1460324 - in /commons/proper/fileupload/trunk: RELEASE-NOTES.txt src/changes/changes.xml
Author: simonetripodi Date: Sun Mar 24 12:10:44 2013 New Revision: 1460324 URL: http://svn.apache.org/r1460324 Log: releng: changes list in sync with latest issues on JIRA Modified: commons/proper/fileupload/trunk/RELEASE-NOTES.txt commons/proper/fileupload/trunk/src/changes/changes.xml Modified: commons/proper/fileupload/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/RELEASE-NOTES.txt?rev=1460324&r1=1460323&r2=1460324&view=diff == --- commons/proper/fileupload/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/fileupload/trunk/RELEASE-NOTES.txt Sun Mar 24 12:10:44 2013 @@ -51,6 +51,7 @@ Sub-task * [FILEUPLOAD-220] - replace package.html with package-info.java * [FILEUPLOAD-221] - FileItemHeadersImpl can now use LinkedHashMap * [FILEUPLOAD-222] - Mark @deprecated classes/methods with @Deprecated annotation + * [FILEUPLOAD-233] - Base64Decoder doesn't correctly implement RFC 4648 Bug = @@ -70,6 +71,7 @@ Bug * [FILEUPLOAD-214] - ServletFileUpload only accepts POST requests * [FILEUPLOAD-228] - (Servlet|Portlet)RequestContext#contentLength() must return request.getContentLength() if Content-length header is not available * [FILEUPLOAD-229] - toLowerCase() is Locale-dependent; should use toLowerCase(Locale.ENGLISH) instead + * [FILEUPLOAD-232] - There are no unit tests for the new utils.mime classes Improvement = Modified: commons/proper/fileupload/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/changes/changes.xml?rev=1460324&r1=1460323&r2=1460324&view=diff == --- commons/proper/fileupload/trunk/src/changes/changes.xml (original) +++ commons/proper/fileupload/trunk/src/changes/changes.xml Sun Mar 24 12:10:44 2013 @@ -72,6 +72,9 @@ The type attribute can be add,u Mark @deprecated classes/methods with @Deprecated annotation + +Base64Decoder doesn't correctly implement RFC 4648 + "Stream ended unexpectedly" when posting from a Flash client @@ -121,6 +124,9 @@ The type attribute can be add,u toLowerCase() is Locale-dependent; should use toLowerCase(Locale.ENGLISH) instead + +There are no unit tests for the new utils.mime classes + Documentation: add simple HTML form example to fileupload user guide
svn commit: r1459188 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
Author: simonetripodi Date: Thu Mar 21 08:27:25 2013 New Revision: 1459188 URL: http://svn.apache.org/r1459188 Log: trivial: '3' is a magic number. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1459188&r1=1459187&r2=1459188&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Thu Mar 21 08:27:25 2013 @@ -122,11 +122,13 @@ final class Base64Decoder { // CHECKSTYLE IGNORE MagicNumber FOR NEXT 1 LINE out.write((cache[1] << 4) | (cache[2] >> 2)); // 4 bits of b2 plus 4 bits of b3 outLen++; +// CHECKSTYLE IGNORE MagicNumber FOR NEXT 1 LINE if (cache[3] != PAD_BYTE) { // CHECKSTYLE IGNORE MagicNumber FOR NEXT 1 LINE out.write((cache[2] << 6) | cache[3]);// 2 bits of b3 plus 6 bits of b4 outLen++; } +// CHECKSTYLE IGNORE MagicNumber FOR NEXT 1 LINE } else if (cache[3] != PAD_BYTE) { // if byte 3 is pad, byte 4 must be pad too throw new IOException("Invalid Base64 input: incorrect padding"); }
svn commit: r1459184 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
Author: simonetripodi Date: Thu Mar 21 08:18:19 2013 New Revision: 1459184 URL: http://svn.apache.org/r1459184 Log: trivial: '{' is not preceded with whitespace. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1459184&r1=1459183&r2=1459184&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Thu Mar 21 08:18:19 2013 @@ -134,7 +134,7 @@ final class Base64Decoder { } } // Check for anything left over -if (cachedBytes != 0){ +if (cachedBytes != 0) { throw new IOException("Invalid Base64 input: truncated"); } return outLen;
svn commit: r1459183 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
Author: simonetripodi Date: Thu Mar 21 08:17:36 2013 New Revision: 1459183 URL: http://svn.apache.org/r1459183 Log: trivial: Line has trailing spaces Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1459183&r1=1459182&r2=1459183&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Thu Mar 21 08:17:36 2013 @@ -128,7 +128,7 @@ final class Base64Decoder { outLen++; } } else if (cache[3] != PAD_BYTE) { // if byte 3 is pad, byte 4 must be pad too -throw new IOException("Invalid Base64 input: incorrect padding"); +throw new IOException("Invalid Base64 input: incorrect padding"); } cachedBytes = 0; }
svn commit: r1458684 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/SizesTest.java
Author: simonetripodi Date: Wed Mar 20 08:31:53 2013 New Revision: 1458684 URL: http://svn.apache.org/r1458684 Log: trivial: dropped trailing spaces in empty lines Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/SizesTest.java Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/SizesTest.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/SizesTest.java?rev=1458684&r1=1458683&r2=1458684&view=diff == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/SizesTest.java (original) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/SizesTest.java Wed Mar 20 08:31:53 2013 @@ -168,7 +168,7 @@ public class SizesTest extends FileUploa } catch (FileUploadBase.FileSizeLimitExceededException e) { assertEquals(5, e.getPermittedSize()); } - + // provided Content-Length is wrong, actual content is larger -> handled by LimitedInputStream upload = new ServletFileUpload(new DiskFileItemFactory()); upload.setFileSizeMax(15); @@ -205,7 +205,7 @@ public class SizesTest extends FileUploa ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory()); upload.setFileSizeMax(-1); upload.setSizeMax(200); - + MockHttpServletRequest req = new MockHttpServletRequest(request.getBytes("US-ASCII"), CONTENT_TYPE); try { upload.parseRequest(req); @@ -225,7 +225,7 @@ public class SizesTest extends FileUploa "Content-Type: text/whatever\r\n" + "Content-Length: 10\r\n" + "\r\n" + -"This is the content of the file\n" + +"This is the content of the file\n" + "\r\n" + "-1234\r\n" + "Content-Disposition: form-data; name=\"file2\"; filename=\"foo2.tab\"\r\n" + @@ -246,15 +246,15 @@ public class SizesTest extends FileUploa MockHttpServletRequest req = new MockHttpServletRequest(request.getBytes("US-ASCII"), CONTENT_TYPE); req.setContentLength(-1); req.setReadLimit(10); - + FileItemIterator it = upload.getItemIterator(req); assertTrue(it.hasNext()); - + FileItemStream item = it.next(); assertFalse(item.isFormField()); assertEquals("file1", item.getFieldName()); assertEquals("foo1.tab", item.getName()); - + try { InputStream stream = item.openStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
svn commit: r1458278 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java
Author: simonetripodi Date: Tue Mar 19 13:44:37 2013 New Revision: 1458278 URL: http://svn.apache.org/r1458278 Log: [FILEUPLOAD-232] initial checkin of QuotedPrintableDecoderTestCase class Added: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java (with props) Added: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java?rev=1458278&view=auto == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java (added) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java Tue Mar 19 13:44:37 2013 @@ -0,0 +1,71 @@ +/* + * 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.fileupload.util.mime; + +import static org.junit.Assert.assertArrayEquals; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import org.junit.Test; + +/** + * @since 1.3 + */ +public final class QuotedPrintableDecoderTestCase { + +private static final String US_ASCII_CHARSET = "US-ASCII"; + +@Test +public void basicEncodeDecode() throws Exception { +assertEncoded("= Hello there =\r\n", "=3D Hello there =3D=0D=0A"); +} + +@Test(expected = IOException.class) +public void invalidQuotedPrintableEncoding() throws Exception { +assertEncoded("abc123_-.*~!@#$%^&()+{}\"\\;:`,/[]", "YWJjMTIzXy0uKn4hQCMkJV4mKCkre31cIlxcOzpgLC9bXQ=="); +} + +@Test +public void unsafeDecode() throws Exception { +assertEncoded("=\r\n", "=3D=0D=0A"); +} + +/** + * This is NOT supported by Commons-Codec, see CODEC-121. + * + * @throws Exception + * @see https://issues.apache.org/jira/browse/CODEC-121";>CODEC-121 + */ +@Test +public void softLineBreakDecode() throws Exception { +assertEncoded("If you believe that truth=beauty, then surely mathematics is the most beautiful branch of philosophy.", + "If you believe that truth=3Dbeauty, then surely=20=\r\nmathematics is the most beautiful branch of philosophy."); +} + +private static void assertEncoded(String clearText, String encoded) throws Exception { +byte[] expected = clearText.getBytes(US_ASCII_CHARSET); + +ByteArrayOutputStream out = new ByteArrayOutputStream(encoded.length()); +byte[] encodedData = encoded.getBytes(US_ASCII_CHARSET); +QuotedPrintableDecoder.decode(encodedData, out); +byte[] actual = out.toByteArray(); + +assertArrayEquals(expected, actual); +} + +} Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java -- svn:eol-style = native Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoderTestCase.java -- svn:mime-type = text/plain
svn commit: r1458277 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
Author: simonetripodi Date: Tue Mar 19 13:43:09 2013 New Revision: 1458277 URL: http://svn.apache.org/r1458277 Log: aligned issue documentation reference to @see tag Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java?rev=1458277&r1=1458276&r2=1458277&view=diff == Files commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java (original) and commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Tue Mar 19 13:43:09 2013 differ
svn commit: r1458269 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
Author: simonetripodi Date: Tue Mar 19 13:22:32 2013 New Revision: 1458269 URL: http://svn.apache.org/r1458269 Log: added a test to see how this Base64 decoder impl behaves compared to https://issues.apache.org/jira/browse/CODEC-68 Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java?rev=1458269&r1=1458268&r2=1458269&view=diff == Files commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java (original) and commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Tue Mar 19 13:22:32 2013 differ
svn commit: r1458266 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
Author: simonetripodi Date: Tue Mar 19 13:08:50 2013 New Revision: 1458266 URL: http://svn.apache.org/r1458266 Log: added a test where the encoded input string has the padding char in the middle; contrary to commons-codec, it doesn't halt and continues translating Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java?rev=1458266&r1=1458265&r2=1458266&view=diff == Files commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java (original) and commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Tue Mar 19 13:08:50 2013 differ
svn commit: r1458245 - in /commons/proper/fileupload/trunk/src: main/java/org/apache/commons/fileupload/util/mime/ test/java/org/apache/commons/fileupload/util/mime/
Author: simonetripodi Date: Tue Mar 19 12:30:02 2013 New Revision: 1458245 URL: http://svn.apache.org/r1458245 Log: no needs to specify always the offset and the length of the byte[] has to be decoded, since in this implementation there's always the need to decode the whole buffer Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1458245&r1=1458244&r2=1458245&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Tue Mar 19 12:30:02 2013 @@ -82,21 +82,19 @@ final class Base64Decoder { * whitespace characters will be ignored. * * @param data the buffer containing the Base64-encoded data - * @param off the start offset (zero-based) - * @param length the number of bytes to convert * @param out the output stream to hold the decoded bytes * * @return the number of bytes produced. */ -public static int decode(byte[] data, int off, int length, OutputStream out) throws IOException { +public static int decode(byte[] data, OutputStream out) throws IOException { byteb1, b2, b3, b4; intoutLen = 0; -if (data.length == 0 || length == 0) { +if (data.length == 0) { return outLen; } -intend = off + length; +intend = data.length; while (end > 0) { if (!ignore((char) data[end - 1])) { @@ -106,7 +104,7 @@ final class Base64Decoder { end--; } -int i = off; +int i = 0; // CHECKSTYLE IGNORE MagicNumber FOR NEXT 1 LINE int finish = end - 4; // last set of 4 bytes might include padding Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1458245&r1=1458244&r2=1458245&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Tue Mar 19 12:30:02 2013 @@ -243,9 +243,9 @@ public final class MimeUtility { // Base64 encoded? if (encoding.equals(BASE64_ENCODING_MARKER)) { -Base64Decoder.decode(encodedData, 0, encodedData.length, out); +Base64Decoder.decode(encodedData, out); } else if (encoding.equals(QUOTEDPRINTABLE_ENCODING_MARKER)) { // maybe quoted printable. -QuotedPrintableDecoder.decode(encodedData, 0, encodedData.length, out); +QuotedPrintableDecoder.decode(encodedData, out); } else { throw new UnsupportedEncodingException("Unknown RFC 2047 encoding: " + encoding); } Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1458245&r1=1458244&r2=1458245&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Tue Mar 19 12:30:02 2013 @@ -63,14 +63,14 @@ final class QuotedPrintableDecoder { * Decode the encoded byte data writing it to the given output stream. * * @param data The array of byte data to decode. - * @param offStarting offset within the array. - * @param length The length of data to encode. * @param outThe output stream used to return the decoded data
svn commit: r1458236 - in /commons/proper/fileupload/trunk/src: main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTest
Author: simonetripodi Date: Tue Mar 19 11:56:27 2013 New Revision: 1458236 URL: http://svn.apache.org/r1458236 Log: [FILEUPLOAD-233] fixed and re-enabled the test case where an empty string doesn't need to be decoded Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1458236&r1=1458235&r2=1458236&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Tue Mar 19 11:56:27 2013 @@ -92,6 +92,10 @@ final class Base64Decoder { byteb1, b2, b3, b4; intoutLen = 0; +if (data.length == 0 || length == 0) { +return outLen; +} + intend = off + length; while (end > 0) { Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java?rev=1458236&r1=1458235&r2=1458236&view=diff == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java (original) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Tue Mar 19 11:56:27 2013 @@ -45,7 +45,7 @@ public final class Base64DecoderTestCase */ @Test public void rfc4648Section10Decode() throws Exception { -// assertEncoded("", ""); +assertEncoded("", ""); assertEncoded("f", "Zg=="); assertEncoded("fo", "Zm8="); // assertEncoded("foo", "Zm9v");
svn commit: r1458213 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java
Author: simonetripodi Date: Tue Mar 19 10:37:37 2013 New Revision: 1458213 URL: http://svn.apache.org/r1458213 Log: initial checkin of Base64 Decoder test case, which clearly demonstrate the current Base64 implementation is broken Added: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java (with props) Added: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java?rev=1458213&view=auto == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java (added) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java Tue Mar 19 10:37:37 2013 @@ -0,0 +1,68 @@ +/* + * 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.fileupload.util.mime; + +import static org.junit.Assert.assertArrayEquals; + +import java.io.ByteArrayOutputStream; + +import org.junit.Test; + +/** + * @since 1.3 + */ +public final class Base64DecoderTestCase { + +private static final String US_ASCII_CHARSET = "US-ASCII"; + +/** + * Tests RFC 4648 section 10 test vectors. + * + * BASE64("") = "" + * BASE64("f") = "Zg==" + * BASE64("fo") = "Zm8=" + * BASE64("foo") = "Zm9v" + * BASE64("foob") = "Zm9vYg==" + * BASE64("fooba") = "Zm9vYmE=" + * BASE64("foobar") = "Zm9vYmFy" + * + * + * @see http://tools.ietf.org/html/rfc4648";>http://tools.ietf.org/html/rfc4648 + */ +@Test +public void rfc4648Section10Decode() throws Exception { +// assertEncoded("", ""); +assertEncoded("f", "Zg=="); +assertEncoded("fo", "Zm8="); +// assertEncoded("foo", "Zm9v"); +assertEncoded("foob", "Zm9vYg=="); +assertEncoded("fooba", "Zm9vYmE="); +// assertEncoded("foobar", "Zm9vYmFy"); +} + +private static void assertEncoded(String clearText, String encoded) throws Exception { +byte[] expected = clearText.getBytes(US_ASCII_CHARSET); + +ByteArrayOutputStream out = new ByteArrayOutputStream(encoded.length()); +byte[] encodedData = encoded.getBytes(US_ASCII_CHARSET); +Base64Decoder.decode(encodedData, 0, encodedData.length, out); +byte[] actual = out.toByteArray(); + +assertArrayEquals(expected, actual); +} + +} Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java -- svn:eol-style = native Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/Base64DecoderTestCase.java -- svn:mime-type = text/plain
svn commit: r1458210 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java
Author: simonetripodi Date: Tue Mar 19 10:21:19 2013 New Revision: 1458210 URL: http://svn.apache.org/r1458210 Log: extracted and documented constants that are used inside each algorithm iteration Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1458210&r1=1458209&r2=1458210&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Tue Mar 19 10:21:19 2013 @@ -31,11 +31,31 @@ import java.util.Map; public final class MimeUtility { /** + * The {@code US-ASCII} charset identifier constant. + */ +private static final String US_ASCII_CHARSET = "US-ASCII"; + +/** + * The marker to indicate text is encoded with BASE64 algorithm. + */ +private static final String BASE64_ENCODING_MARKER = "B"; + +/** + * The marker to indicate text is encoded with QuotedPrintable algorithm. + */ +private static final String QUOTEDPRINTABLE_ENCODING_MARKER = "Q"; + +/** * If the text contains any encoded tokens, those tokens will be marked with "=?". */ private static final String ENCODED_TOKEN_MARKER = "=?"; /** + * If the text contains any encoded tokens, those tokens will terminate with "=?". + */ +private static final String ENCODED_TOKEN_FINISHER = "?="; + +/** * The linear whitespace chars sequence. */ private static final String LINEAR_WHITESPACE = " \t\r\n"; @@ -203,7 +223,7 @@ public final class MimeUtility { String encoding = word.substring(charsetPos + 1, encodingPos); // and finally the encoded text. -int encodedTextPos = word.indexOf("?=", encodingPos + 1); +int encodedTextPos = word.indexOf(ENCODED_TOKEN_FINISHER, encodingPos + 1); if (encodedTextPos == -1) { throw new ParseException("Missing encoded text in RFC 2047 encoded-word: " + word); } @@ -219,12 +239,12 @@ public final class MimeUtility { // the decoder writes directly to an output stream. ByteArrayOutputStream out = new ByteArrayOutputStream(encodedText.length()); -byte[] encodedData = encodedText.getBytes("US-ASCII"); +byte[] encodedData = encodedText.getBytes(US_ASCII_CHARSET); // Base64 encoded? -if (encoding.equals("B")) { +if (encoding.equals(BASE64_ENCODING_MARKER)) { Base64Decoder.decode(encodedData, 0, encodedData.length, out); -} else if (encoding.equals("Q")) { // maybe quoted printable. +} else if (encoding.equals(QUOTEDPRINTABLE_ENCODING_MARKER)) { // maybe quoted printable. QuotedPrintableDecoder.decode(encodedData, 0, encodedData.length, out); } else { throw new UnsupportedEncodingException("Unknown RFC 2047 encoding: " + encoding);
svn commit: r1457989 - /commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml
Author: simonetripodi Date: Mon Mar 18 20:55:56 2013 New Revision: 1457989 URL: http://svn.apache.org/r1457989 Log: checkstyle: exclude *.properties files from check - for some unknown reason (to me, at least) *.properties file were included in the report Modified: commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml Modified: commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml?rev=1457989&r1=1457988&r2=1457989&view=diff == --- commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml (original) +++ commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml Mon Mar 18 20:55:56 2013 @@ -20,4 +20,5 @@ --> +
svn commit: r1457983 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java
Author: simonetripodi Date: Mon Mar 18 20:47:27 2013 New Revision: 1457983 URL: http://svn.apache.org/r1457983 Log: explicit test methods signatures Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java?rev=1457983&r1=1457982&r2=1457983&view=diff == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java (original) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java Mon Mar 18 20:47:27 2013 @@ -35,17 +35,17 @@ public final class MimeUtilityTestCase { } @Test -public void decodeUtf8QEncoded() throws Exception { +public void decodeUtf8QuotedPrintableEncoded() throws Exception { assertEncoded(" hé! àèôu !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?="); } @Test -public void decodeUtf8BEncoded() throws Exception { +public void decodeUtf8Base64Encoded() throws Exception { assertEncoded(" hé! àèôu !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?="); } @Test -public void decodeIso88591BEncoded() throws Exception { +public void decodeIso88591Base64Encoded() throws Exception { assertEncoded("If you can read this you understand the example.", "=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\"\r\n"); }
svn commit: r1457974 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java
Author: simonetripodi Date: Mon Mar 18 20:26:48 2013 New Revision: 1457974 URL: http://svn.apache.org/r1457974 Log: typo Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1457974&r1=1457973&r2=1457974&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Mon Mar 18 20:26:48 2013 @@ -73,7 +73,7 @@ public final class MimeUtility { * * @param text The text to decode. * - * @return The decoded test string. + * @return The decoded text string. * @throws UnsupportedEncodingException if the detected encoding in the input text is not supported. */ public static String decodeText(String text) throws UnsupportedEncodingException {
svn commit: r1457973 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java
Author: simonetripodi Date: Mon Mar 18 20:26:15 2013 New Revision: 1457973 URL: http://svn.apache.org/r1457973 Log: added missing javadoc comment to justify the UnsupportedEncodingException Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1457973&r1=1457972&r2=1457973&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Mon Mar 18 20:26:15 2013 @@ -74,7 +74,7 @@ public final class MimeUtility { * @param text The text to decode. * * @return The decoded test string. - * @throws UnsupportedEncodingException + * @throws UnsupportedEncodingException if the detected encoding in the input text is not supported. */ public static String decodeText(String text) throws UnsupportedEncodingException { // if the text contains any encoded tokens, those tokens will be marked with "=?". If the
svn commit: r1457865 - in /commons/proper/fileupload/trunk: ./ src/checkstyle/ src/main/java/org/apache/commons/fileupload/util/mime/
Author: simonetripodi Date: Mon Mar 18 17:05:47 2013 New Revision: 1457865 URL: http://svn.apache.org/r1457865 Log: as discussed in ML, there are MagicNumbers which don't make sense to extract as constant for the sake to make just Checkstyle happy, so MagicNumbers have been reverted - dropped also the constants used only once - and added the related suppressions for interested files Added: commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml (with props) Modified: commons/proper/fileupload/trunk/pom.xml commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/pom.xml?rev=1457865&r1=1457864&r2=1457865&view=diff == --- commons/proper/fileupload/trunk/pom.xml (original) +++ commons/proper/fileupload/trunk/pom.xml Mon Mar 18 17:05:47 2013 @@ -259,6 +259,7 @@ 2.10 ${basedir}/src/checkstyle/fileupload_checks.xml + ${basedir}/src/checkstyle/checkstyle-suppressions.xml false ${basedir}/src/checkstyle/license-header.txt Added: commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml?rev=1457865&view=auto == --- commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml (added) +++ commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml Mon Mar 18 17:05:47 2013 @@ -0,0 +1,23 @@ + +http://www.puppycrawl.com/dtds/suppressions_1_0.dtd";> + + + + Propchange: commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml -- svn:eol-style = native Propchange: commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml -- svn:keywords = Date Revision Author HeadURL Id Propchange: commons/proper/fileupload/trunk/src/checkstyle/checkstyle-suppressions.xml -- svn:mime-type = text/xml Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1457865&r1=1457864&r2=1457865&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Mon Mar 18 17:05:47 2013 @@ -25,26 +25,6 @@ import java.io.OutputStream; final class Base64Decoder { /** - * Bytes per undecoded block. - */ -private static final int BYTES_PER_UNENCODED_BLOCK = 3; - -/** - * 2 bits mask. - */ -private static final int MASK_2BITS = 2; - -/** - * 4 bits mask. - */ -private static final int MASK_4BITS = 4; - -/** - * 6 bits mask. - */ -private static final int MASK_6BITS = 6; - -/** * Set up the encoding table. */ private static final byte[] ENCODING_TABLE = { @@ -67,15 +47,10 @@ final class Base64Decoder { private static final byte PADDING = (byte) '='; /** - * The number of possible byte values; i.e. positives, negatives and zero. - */ -private static final int DISTINCT_BYTE_VALUES = Byte.MAX_VALUE - Byte.MIN_VALUE + 1; - -/** * Set up the decoding table; this is indexed by a byte converted to an int, * so must be at least as large as the number of different byte values. */ -private static final byte[] DECODING_TABLE = new byte[DISTINCT_BYTE_VALUES]; +private static final byte[] DECODING_TABLE = new byte[256]; static { for (int i = 0; i < ENCODING_TABLE.length; i++) { @@ -127,7 +102,7 @@ final class Base64Decoder { } int i = off; -int finish = end - MASK_4BITS; +int finish = end - 4; while (i < finish) { while ((i < finish) && ignore((char) data[i])) { @@ -154,40 +129,40 @@ final class Base64Decoder { b4 = DECODING_TABLE[data[i++]]; -out.write((b1 << MASK_2BITS) | (b2 >> MASK_4BITS)); -
svn commit: r1457859 - in /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload: util/ util/mime/ util/mime/MimeUtilityTestCase.java utils/
Author: simonetripodi Date: Mon Mar 18 16:51:05 2013 New Revision: 1457859 URL: http://svn.apache.org/r1457859 Log: [FILEUPLOAD-232] mime test class relocated in the right util.mime package Added: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/ - copied from r1457788, commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java - copied, changed from r1457847, commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Removed: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/ Copied: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java (from r1457847, commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java) URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java?p2=commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java&p1=commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java&r1=1457847&r2=1457859&rev=1457859&view=diff == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java (original) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java Mon Mar 18 16:51:05 2013 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.fileupload.utils.mime; +package org.apache.commons.fileupload.util.mime; import static org.junit.Assert.assertEquals;
svn commit: r1457847 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
Author: simonetripodi Date: Mon Mar 18 16:31:08 2013 New Revision: 1457847 URL: http://svn.apache.org/r1457847 Log: [FILEUPLOAD-232] added ISO-8859-1?B encoded test, renamed UTF-8 encoded test methods Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java?rev=1457847&r1=1457846&r2=1457847&view=diff == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java (original) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Mon Mar 18 16:31:08 2013 @@ -35,15 +35,21 @@ public final class MimeUtilityTestCase { } @Test -public void decodeQEncoded() throws Exception { +public void decodeUtf8QEncoded() throws Exception { assertEncoded(" hé! àèôu !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?="); } @Test -public void decodeBEncoded() throws Exception { +public void decodeUtf8BEncoded() throws Exception { assertEncoded(" hé! àèôu !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?="); } +@Test +public void decodeIso88591BEncoded() throws Exception { +assertEncoded("If you can read this you understand the example.", + "=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\"\r\n"); +} + private static void assertEncoded(String expected, String encoded) throws Exception { assertEquals(expected, MimeUtility.decodeText(encoded)); }
svn commit: r1457843 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
Author: simonetripodi Date: Mon Mar 18 16:18:01 2013 New Revision: 1457843 URL: http://svn.apache.org/r1457843 Log: trivial: javadoc comments Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java?rev=1457843&r1=1457842&r2=1457843&view=diff == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java (original) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Mon Mar 18 16:18:01 2013 @@ -22,6 +22,9 @@ import org.apache.commons.fileupload.uti import org.junit.Test; /** + * Use the online http://dogmamix.com/MimeHeadersDecoder/";>MimeHeadersDecoder + * to validate expected values. + * * @since 1.3 */ public final class MimeUtilityTestCase {
svn commit: r1457803 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
Author: simonetripodi Date: Mon Mar 18 15:17:17 2013 New Revision: 1457803 URL: http://svn.apache.org/r1457803 Log: [FILEUPLOAD-232] test cases granularization, massive test cases make hard to understand which is the failing assertion Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java?rev=1457803&r1=1457802&r2=1457803&view=diff == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java (original) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Mon Mar 18 15:17:17 2013 @@ -27,11 +27,17 @@ import org.junit.Test; public final class MimeUtilityTestCase { @Test -public void testEncodeText() throws Exception { +public void noNeedToDecode() throws Exception { assertEncoded("abc", "abc"); +} +@Test +public void decodeQEncoded() throws Exception { assertEncoded(" hé! àèôu !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?="); +} +@Test +public void decodeBEncoded() throws Exception { assertEncoded(" hé! àèôu !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?="); }
svn commit: r1457788 - in /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils: ./ mime/ mime/MimeUtilityTestCase.java
Author: simonetripodi Date: Mon Mar 18 14:56:34 2013 New Revision: 1457788 URL: http://svn.apache.org/r1457788 Log: [FILEUPLOAD-232] started importing MimeUtility test case from http://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.4_spec-1.4/src/test/java/javax/mail/internet/MimeUtilityTest.java Added: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java (with props) Added: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java?rev=1457788&view=auto == --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java (added) +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Mon Mar 18 14:56:34 2013 @@ -0,0 +1,42 @@ +/* + * 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.fileupload.utils.mime; + +import static org.junit.Assert.assertEquals; + +import org.apache.commons.fileupload.util.mime.MimeUtility; +import org.junit.Test; + +/** + * @since 1.3 + */ +public final class MimeUtilityTestCase { + +@Test +public void testEncodeText() throws Exception { +assertEncoded("abc", "abc"); + +assertEncoded(" hé! àèôu !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?="); + +assertEncoded(" hé! àèôu !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?="); +} + +private static void assertEncoded(String expected, String encoded) throws Exception { +assertEquals(expected, MimeUtility.decodeText(encoded)); +} + +} Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java -- svn:eol-style = native Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java -- svn:mime-type = text/plain
svn commit: r1457666 - /commons/proper/digester/trunk/src/changes/changes.xml
Author: simonetripodi Date: Mon Mar 18 07:53:34 2013 New Revision: 1457666 URL: http://svn.apache.org/r1457666 Log: [DIGESTER-172] issue reported by Nick Williams, patch provided by Ivan Diana Modified: commons/proper/digester/trunk/src/changes/changes.xml Modified: commons/proper/digester/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/changes/changes.xml?rev=1457666&r1=1457665&r2=1457666&view=diff == --- commons/proper/digester/trunk/src/changes/changes.xml (original) +++ commons/proper/digester/trunk/src/changes/changes.xml Mon Mar 18 07:53:34 2013 @@ -32,8 +32,8 @@ No way to enable schema validation from DigesterLoader - patch provided by Ivan Diana - - Even with custom ErrorHandler, SAX errors are still written to stderr + + Even with custom ErrorHandler, SAX errors are still written to stderr - patch provided by Ivan Diana Add DefaultThrowingErrorHandler to Digester API - patch provided by Ivan Diana
svn commit: r1457665 - in /commons/proper/digester/trunk: core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java core/src/test/java/org/apache/commons/digester3/Digester171Te
Author: simonetripodi Date: Mon Mar 18 07:52:27 2013 New Revision: 1457665 URL: http://svn.apache.org/r1457665 Log: [DIGESTER-171] #comment added a default implementation of ErrorHandlr that simply throws the detected exception - patch provided by Ivan Diana #resolve Added: commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java (with props) commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/Digester171TestCase.java (with props) Modified: commons/proper/digester/trunk/src/changes/changes.xml Added: commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java?rev=1457665&view=auto == --- commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java (added) +++ commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java Mon Mar 18 07:52:27 2013 @@ -0,0 +1,60 @@ +package org.apache.commons.digester3; + +/* + * 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. + */ + +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/** + * @since 3.2 + */ +public class DefaultThrowingErrorHandler +implements ErrorHandler +{ + +/** + * {@inheritDoc} + */ +public void warning( SAXParseException e ) +throws SAXException +{ +throw e; +} + +/** + * {@inheritDoc} + */ +public void fatalError( SAXParseException e ) +throws SAXException +{ +throw e; +} + +/** + * {@inheritDoc} + */ +public void error( SAXParseException e ) +throws SAXException +{ +throw e; +} + +} Propchange: commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java -- svn:eol-style = native Propchange: commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java -- svn:mime-type = text/plain Added: commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/Digester171TestCase.java URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/Digester171TestCase.java?rev=1457665&view=auto == --- commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/Digester171TestCase.java (added) +++ commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/Digester171TestCase.java Mon Mar 18 07:52:27 2013 @@ -0,0 +1,75 @@ +package org.apache.commons.digester3; + +/* + * 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 p
svn commit: r1457663 - in /commons/proper/digester/trunk: core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java src/changes/changes.xml
Author: simonetripodi Date: Mon Mar 18 07:38:36 2013 New Revision: 1457663 URL: http://svn.apache.org/r1457663 Log: [DIGESTER-173] added a testcase that demonstrates DTD validation suppression - props to Ivan Diana that submitted the patch Modified: commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java commons/proper/digester/trunk/src/changes/changes.xml Modified: commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java?rev=1457663&r1=1457662&r2=1457663&view=diff == --- commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java (original) +++ commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java Mon Mar 18 07:38:36 2013 @@ -1,4 +1,4 @@ -/* +/* * 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. @@ -110,4 +110,26 @@ public class DTDValidationTestCase .parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd.xml" ) ); } +@Test +public void testDigesterLoaderFeatureDisabled() +throws Exception +{ + newLoader( new AbstractRulesModule() +{ + + @Override +protected void configure() +{ +// do nothing +} + +} ) +.setFeature("http://xml.org/sax/features/validation";, false) +.setFeature("http://xml.org/sax/features/external-parameter-entities";, false) + .setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar";, false) + .setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd";, false) +.newDigester() +.parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd-error.xml" ) ); +} + } Modified: commons/proper/digester/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/changes/changes.xml?rev=1457663&r1=1457662&r2=1457663&view=diff == --- commons/proper/digester/trunk/src/changes/changes.xml (original) +++ commons/proper/digester/trunk/src/changes/changes.xml Mon Mar 18 07:38:36 2013 @@ -29,8 +29,8 @@ Inner List Annotation has wrong @Target for most of the predefined annotation rules - - No way to enable schema validation from DigesterLoader + + No way to enable schema validation from DigesterLoader - patch provided by Ivan Diana Even with custom ErrorHandler, SAX errors are still written to stderr
svn commit: r1457657 - in /commons/proper/chain/trunk: ./ api/ api/src/ api/src/main/ api/src/main/java/ api/src/main/java/org/ api/src/main/java/org/apache/ api/src/main/java/org/apache/commons/ api/
Author: simonetripodi Date: Mon Mar 18 06:42:27 2013 New Revision: 1457657 URL: http://svn.apache.org/r1457657 Log: [CHAIN-79] #comment APIs extracted from default implementation module #resolve Added: commons/proper/chain/trunk/api/ (with props) commons/proper/chain/trunk/api/pom.xml (with props) commons/proper/chain/trunk/api/src/ commons/proper/chain/trunk/api/src/main/ commons/proper/chain/trunk/api/src/main/java/ commons/proper/chain/trunk/api/src/main/java/org/ commons/proper/chain/trunk/api/src/main/java/org/apache/ commons/proper/chain/trunk/api/src/main/java/org/apache/commons/ commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/ commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/Catalog.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Catalog.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/Chain.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chain.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/ChainException.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainException.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/ChainExecutor.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainExecutor.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/Chains.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chains.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/Command.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Command.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/CommandSetter.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CommandSetter.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/Context.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Context.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/Filter.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Filter.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/NameSetter.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/NameSetter.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/NamedCommandSetter.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/NamedCommandSetter.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/ToExecutorCommandSetter.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ToExecutorCommandSetter.java commons/proper/chain/trunk/api/src/main/java/org/apache/commons/chain2/package-info.java - copied unchanged from r1457297, commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/package-info.java commons/proper/chain/trunk/api/src/test/ commons/proper/chain/trunk/api/src/test/java/ commons/proper/chain/trunk/api/src/test/java/org/ commons/proper/chain/trunk/api/src/test/java/org/apache/ commons/proper/chain/trunk/api/src/test/java/org/apache/commons/ commons/proper/chain/trunk/api/src/test/java/org/apache/commons/chain2/ Removed: commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Catalog.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chain.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainException.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/ChainExecutor.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Chains.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Command.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/CommandSetter.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Context.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/Filter.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/NameSetter.java commons/proper/chain/trunk/core/src/main/java/org/apache/commons/chain2/NamedCommandSetter.java commons
svn commit: r1457300 - in /commons/proper/chain/trunk: pom.xml src/changes/changes.xml
Author: simonetripodi Date: Sat Mar 16 20:03:18 2013 New Revision: 1457300 URL: http://svn.apache.org/r1457300 Log: [CHAIN-78] #comment updated to parent 28, props to Steve Westwood #resolve Modified: commons/proper/chain/trunk/pom.xml commons/proper/chain/trunk/src/changes/changes.xml Modified: commons/proper/chain/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/pom.xml?rev=1457300&r1=1457299&r2=1457300&view=diff == --- commons/proper/chain/trunk/pom.xml (original) +++ commons/proper/chain/trunk/pom.xml Sat Mar 16 20:03:18 2013 @@ -23,7 +23,7 @@ org.apache.commons commons-parent -25 +28 org.apache.commons Modified: commons/proper/chain/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/src/changes/changes.xml?rev=1457300&r1=1457299&r2=1457300&view=diff == --- commons/proper/chain/trunk/src/changes/changes.xml (original) +++ commons/proper/chain/trunk/src/changes/changes.xml Sat Mar 16 20:03:18 2013 @@ -41,6 +41,9 @@ The type attribute can be add,u + +Move to a more recent version of commons-parent POM + Update serialVersionUID in all classes to a date based format.
svn commit: r1457298 - /commons/proper/chain/trunk/configuration/xml/
Author: simonetripodi Date: Sat Mar 16 19:59:59 2013 New Revision: 1457298 URL: http://svn.apache.org/r1457298 Log: trivial: updated ignore list Modified: commons/proper/chain/trunk/configuration/xml/ (props changed) Propchange: commons/proper/chain/trunk/configuration/xml/ -- --- svn:ignore (original) +++ svn:ignore Sat Mar 16 19:59:59 2013 @@ -1 +1,2 @@ target +.settings
svn commit: r1457004 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java
Author: simonetripodi Date: Fri Mar 15 16:21:27 2013 New Revision: 1457004 URL: http://svn.apache.org/r1457004 Log: checkstyle: First sentence should end with a period. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1457004&r1=1457003&r2=1457004&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Fri Mar 15 16:21:27 2013 @@ -31,7 +31,7 @@ import java.util.Map; public final class MimeUtility { /** - * If the text contains any encoded tokens, those tokens will be marked with "=?" + * If the text contains any encoded tokens, those tokens will be marked with "=?". */ private static final String ENCODED_TOKEN_MARKER = "=?";
svn commit: r1457003 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
Author: simonetripodi Date: Fri Mar 15 16:20:27 2013 New Revision: 1457003 URL: http://svn.apache.org/r1457003 Log: checkstyle: magic numbers Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1457003&r1=1457002&r2=1457003&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Fri Mar 15 16:20:27 2013 @@ -25,6 +25,26 @@ import java.io.OutputStream; final class Base64Decoder { /** + * Bytes per undecoded block. + */ +private static final int BYTES_PER_UNENCODED_BLOCK = 3; + +/** + * 2 bits mask. + */ +private static final int MASK_2BITS = 2; + +/** + * 4 bits mask. + */ +private static final int MASK_4BITS = 4; + +/** + * 6 bits mask. + */ +private static final int MASK_6BITS = 6; + +/** * Set up the encoding table. */ private static final byte[] ENCODING_TABLE = { @@ -101,7 +121,7 @@ final class Base64Decoder { } int i = off; -int finish = end - 4; +int finish = end - MASK_4BITS; while (i < finish) { while ((i < finish) && ignore((char) data[i])) { @@ -128,40 +148,40 @@ final class Base64Decoder { b4 = DECODING_TABLE[data[i++]]; -out.write((b1 << 2) | (b2 >> 4)); -out.write((b2 << 4) | (b3 >> 2)); -out.write((b3 << 6) | b4); +out.write((b1 << MASK_2BITS) | (b2 >> MASK_4BITS)); +out.write((b2 << MASK_4BITS) | (b3 >> MASK_2BITS)); +out.write((b3 << MASK_6BITS) | b4); -outLen += 3; +outLen += BYTES_PER_UNENCODED_BLOCK; } -if (data[end - 2] == PADDING) { -b1 = DECODING_TABLE[data[end - 4]]; -b2 = DECODING_TABLE[data[end - 3]]; +if (data[end - MASK_2BITS] == PADDING) { +b1 = DECODING_TABLE[data[end - MASK_4BITS]]; +b2 = DECODING_TABLE[data[end - BYTES_PER_UNENCODED_BLOCK]]; -out.write((b1 << 2) | (b2 >> 4)); +out.write((b1 << MASK_2BITS) | (b2 >> MASK_4BITS)); outLen += 1; } else if (data[end - 1] == PADDING) { -b1 = DECODING_TABLE[data[end - 4]]; -b2 = DECODING_TABLE[data[end - 3]]; -b3 = DECODING_TABLE[data[end - 2]]; +b1 = DECODING_TABLE[data[end - MASK_4BITS]]; +b2 = DECODING_TABLE[data[end - BYTES_PER_UNENCODED_BLOCK]]; +b3 = DECODING_TABLE[data[end - MASK_2BITS]]; -out.write((b1 << 2) | (b2 >> 4)); -out.write((b2 << 4) | (b3 >> 2)); +out.write((b1 << MASK_2BITS) | (b2 >> MASK_4BITS)); +out.write((b2 << MASK_4BITS) | (b3 >> MASK_2BITS)); -outLen += 2; +outLen += MASK_2BITS; } else { -b1 = DECODING_TABLE[data[end - 4]]; -b2 = DECODING_TABLE[data[end - 3]]; -b3 = DECODING_TABLE[data[end - 2]]; +b1 = DECODING_TABLE[data[end - MASK_4BITS]]; +b2 = DECODING_TABLE[data[end - BYTES_PER_UNENCODED_BLOCK]]; +b3 = DECODING_TABLE[data[end - MASK_2BITS]]; b4 = DECODING_TABLE[data[end - 1]]; -out.write((b1 << 2) | (b2 >> 4)); -out.write((b2 << 4) | (b3 >> 2)); -out.write((b3 << 6) | b4); +out.write((b1 << MASK_2BITS) | (b2 >> MASK_4BITS)); +out.write((b2 << MASK_4BITS) | (b3 >> MASK_2BITS)); +out.write((b3 << MASK_6BITS) | b4); -outLen += 3; +outLen += BYTES_PER_UNENCODED_BLOCK; } return outLen;
svn commit: r1456995 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
Author: simonetripodi Date: Fri Mar 15 15:48:57 2013 New Revision: 1456995 URL: http://svn.apache.org/r1456995 Log: trivial: code format Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1456995&r1=1456994&r2=1456995&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Fri Mar 15 15:48:57 2013 @@ -76,8 +76,7 @@ final class Base64Decoder { * @param c the char has to be checked. * @return true, if the input char has to be checked, false otherwise. */ -private static boolean ignore( -charc) { +private static boolean ignore(char c) { return (c == '\n' || c == '\r' || c == '\t' || c == ' '); } @@ -87,12 +86,7 @@ final class Base64Decoder { * * @return the number of bytes produced. */ -public static int decode( -byte[]data, -intoff, -intlength, -OutputStreamout) -throws IOException { +public static int decode(byte[] data, int off, int length, OutputStream out) throws IOException { byteb1, b2, b3, b4; intoutLen = 0;
svn commit: r1456980 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
Author: simonetripodi Date: Fri Mar 15 15:03:46 2013 New Revision: 1456980 URL: http://svn.apache.org/r1456980 Log: Javadoc sentences start with upper case letters Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1456980&r1=1456979&r2=1456980&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Fri Mar 15 15:03:46 2013 @@ -25,7 +25,7 @@ import java.io.OutputStream; final class Base64Decoder { /** - * set up the encoding table. + * Set up the encoding table. */ private static final byte[] ENCODING_TABLE = { (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G', @@ -48,12 +48,12 @@ final class Base64Decoder { private static final byte PADDING = (byte) '='; /** - * the decoding table size. + * The decoding table size. */ private static final int DECODING_TABLE_SIZE = 256; /** - * set up the decoding table. + * Set up the decoding table. */ private static final byte[] DECODING_TABLE = new byte[DECODING_TABLE_SIZE]; @@ -82,7 +82,7 @@ final class Base64Decoder { } /** - * decode the base 64 encoded byte data writing it to the given output stream, + * Decode the base 64 encoded byte data writing it to the given output stream, * whitespace characters will be ignored. * * @return the number of bytes produced.
svn commit: r1456977 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java
Author: simonetripodi Date: Fri Mar 15 14:56:20 2013 New Revision: 1456977 URL: http://svn.apache.org/r1456977 Log: trivial: extracted constants Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1456977&r1=1456976&r2=1456977&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Fri Mar 15 14:56:20 2013 @@ -31,6 +31,11 @@ import java.util.Map; public final class MimeUtility { /** + * If the text contains any encoded tokens, those tokens will be marked with "=?" + */ +private static final String ENCODED_TOKEN_MARKER = "=?"; + +/** * The linear whitespace chars sequence. */ private static final String LINEAR_WHITESPACE = " \t\r\n"; @@ -74,7 +79,7 @@ public final class MimeUtility { public static String decodeText(String text) throws UnsupportedEncodingException { // if the text contains any encoded tokens, those tokens will be marked with "=?". If the // source string doesn't contain that sequent, no decoding is required. -if (text.indexOf("=?") < 0) { +if (text.indexOf(ENCODED_TOKEN_MARKER) < 0) { return text; } @@ -124,7 +129,7 @@ public final class MimeUtility { // pull out the word token. String word = text.substring(wordStart, offset); // is the token encoded? decode the word -if (word.startsWith("=?")) { +if (word.startsWith(ENCODED_TOKEN_MARKER)) { try { // if this gives a parsing failure, treat it like a non-encoded word. String decodedWord = decodeWord(word); @@ -177,7 +182,7 @@ public final class MimeUtility { // encoded words start with the characters "=?". If this not an encoded word, we throw a // ParseException for the caller. -if (!word.startsWith("=?")) { +if (!word.startsWith(ENCODED_TOKEN_MARKER)) { throw new ParseException("Invalid RFC 2047 encoded-word: " + word); }
svn commit: r1456973 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java
Author: simonetripodi Date: Fri Mar 15 14:53:48 2013 New Revision: 1456973 URL: http://svn.apache.org/r1456973 Log: trivial: use StringBuilder in place of StringBuffer Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1456973&r1=1456972&r2=1456973&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Fri Mar 15 14:53:48 2013 @@ -84,7 +84,7 @@ public final class MimeUtility { int startWhiteSpace = -1; int endWhiteSpace = -1; -StringBuffer decodedText = new StringBuffer(text.length()); +StringBuilder decodedText = new StringBuilder(text.length()); boolean previousTokenEncoded = false;
svn commit: r1456873 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 10:38:11 2013 New Revision: 1456873 URL: http://svn.apache.org/r1456873 Log: trivial: code format Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456873&r1=1456872&r2=1456873&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 10:38:11 2013 @@ -27,8 +27,7 @@ final class QuotedPrintableDecoder { /** * set up the encoding table. */ -private static final byte[] ENCODING_TABLE = -{ +private static final byte[] ENCODING_TABLE = { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F' };
svn commit: r1456871 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
Author: simonetripodi Date: Fri Mar 15 10:37:01 2013 New Revision: 1456871 URL: http://svn.apache.org/r1456871 Log: checkstyle: '256' is a magic number. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1456871&r1=1456870&r2=1456871&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Fri Mar 15 10:37:01 2013 @@ -48,9 +48,14 @@ final class Base64Decoder { private static final byte PADDING = (byte) '='; /** + * the decoding table size. + */ +private static final int DECODING_TABLE_SIZE = 256; + +/** * set up the decoding table. */ -private static final byte[] DECODING_TABLE = new byte[256]; +private static final byte[] DECODING_TABLE = new byte[DECODING_TABLE_SIZE]; static { for (int i = 0; i < ENCODING_TABLE.length; i++) {
svn commit: r1456862 - /commons/proper/fileupload/trunk/pom.xml
Author: simonetripodi Date: Fri Mar 15 10:17:47 2013 New Revision: 1456862 URL: http://svn.apache.org/r1456862 Log: excluded org.apache.commons.fileupload.util.mime package from OSGi export - props to Felix Meshberger for pointing it Modified: commons/proper/fileupload/trunk/pom.xml Modified: commons/proper/fileupload/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/pom.xml?rev=1456862&r1=1456861&r2=1456862&view=diff == --- commons/proper/fileupload/trunk/pom.xml (original) +++ commons/proper/fileupload/trunk/pom.xml Fri Mar 15 10:17:47 2013 @@ -182,6 +182,7 @@ RC2 FILEUPLOAD 12310476 + !org.apache.commons.fileupload.util.mime,org.apache.commons.*;version=${project.version};-noimport:=true !javax.portlet,* javax.portlet
svn commit: r1456857 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 10:11:09 2013 New Revision: 1456857 URL: http://svn.apache.org/r1456857 Log: checkstyle: '4' is a magic number. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456857&r1=1456856&r2=1456857&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 10:11:09 2013 @@ -34,6 +34,11 @@ final class QuotedPrintableDecoder { }; /** + * The default number of byte shift for decode. + */ +private static final int OUT_SHIFT = 4; + +/** * the decoding table size. */ private static final int DECODING_TABLE_SIZE = 128; @@ -99,7 +104,7 @@ final class QuotedPrintableDecoder { // this is a hex pair we need to convert back to a single byte. byte c1 = DECODING_TABLE[b1]; byte c2 = DECODING_TABLE[b2]; -out.write((c1 << 4) | c2); +out.write((c1 << OUT_SHIFT) | c2); // 3 bytes in, one byte out bytesWritten++; }
svn commit: r1456852 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 10:02:37 2013 New Revision: 1456852 URL: http://svn.apache.org/r1456852 Log: checkstyle: '128' is a magic number. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456852&r1=1456851&r2=1456852&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 10:02:37 2013 @@ -34,9 +34,14 @@ final class QuotedPrintableDecoder { }; /** + * the decoding table size. + */ +private static final int DECODING_TABLE_SIZE = 128; + +/** * set up the decoding table. */ -private static final byte[] DECODING_TABLE = new byte[128]; +private static final byte[] DECODING_TABLE = new byte[DECODING_TABLE_SIZE]; static { // initialize the decoding table
svn commit: r1456850 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
Author: simonetripodi Date: Fri Mar 15 09:53:09 2013 New Revision: 1456850 URL: http://svn.apache.org/r1456850 Log: checkstyle: Missing a Javadoc comment Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1456850&r1=1456849&r2=1456850&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Fri Mar 15 09:53:09 2013 @@ -24,6 +24,9 @@ import java.io.OutputStream; */ final class Base64Decoder { +/** + * set up the encoding table. + */ private static final byte[] ENCODING_TABLE = { (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G', (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M', (byte) 'N', @@ -39,9 +42,12 @@ final class Base64Decoder { (byte) '+', (byte) '/' }; +/** + * The padding byte. + */ private static final byte PADDING = (byte) '='; -/* +/** * set up the decoding table. */ private static final byte[] DECODING_TABLE = new byte[256]; @@ -52,10 +58,19 @@ final class Base64Decoder { } } +/** + * Hidden constructor, this class must not be instantiated. + */ private Base64Decoder() { // do nothing } +/** + * Checks if the input char must be skipped from the decode. + * + * @param c the char has to be checked. + * @return true, if the input char has to be checked, false otherwise. + */ private static boolean ignore( charc) { return (c == '\n' || c == '\r' || c == '\t' || c == ' ');
svn commit: r1456843 - in /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime: Base64Decoder.java MimeUtility.java
Author: simonetripodi Date: Fri Mar 15 09:49:34 2013 New Revision: 1456843 URL: http://svn.apache.org/r1456843 Log: minor Base64Decoder refactoring to reflect QuotedPrintableDecoder structure Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java?rev=1456843&r1=1456842&r2=1456843&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java Fri Mar 15 09:49:34 2013 @@ -24,7 +24,7 @@ import java.io.OutputStream; */ final class Base64Decoder { -private final byte[] encodingTable = { +private static final byte[] ENCODING_TABLE = { (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G', (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M', (byte) 'N', (byte) 'O', (byte) 'P', (byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U', @@ -39,24 +39,24 @@ final class Base64Decoder { (byte) '+', (byte) '/' }; -private byte padding = (byte) '='; +private static final byte PADDING = (byte) '='; /* * set up the decoding table. */ -private final byte[] decodingTable = new byte[256]; +private static final byte[] DECODING_TABLE = new byte[256]; -protected void initialiseDecodingTable() { -for (int i = 0; i < encodingTable.length; i++) { -decodingTable[encodingTable[i]] = (byte) i; +static { +for (int i = 0; i < ENCODING_TABLE.length; i++) { +DECODING_TABLE[ENCODING_TABLE[i]] = (byte) i; } } -public Base64Decoder() { -initialiseDecodingTable(); +private Base64Decoder() { +// do nothing } -private boolean ignore( +private static boolean ignore( charc) { return (c == '\n' || c == '\r' || c == '\t' || c == ' '); } @@ -67,7 +67,7 @@ final class Base64Decoder { * * @return the number of bytes produced. */ -public int decode( +public static int decode( byte[]data, intoff, intlength, @@ -94,25 +94,25 @@ final class Base64Decoder { i++; } -b1 = decodingTable[data[i++]]; +b1 = DECODING_TABLE[data[i++]]; while ((i < finish) && ignore((char) data[i])) { i++; } -b2 = decodingTable[data[i++]]; +b2 = DECODING_TABLE[data[i++]]; while ((i < finish) && ignore((char) data[i])) { i++; } -b3 = decodingTable[data[i++]]; +b3 = DECODING_TABLE[data[i++]]; while ((i < finish) && ignore((char) data[i])) { i++; } -b4 = decodingTable[data[i++]]; +b4 = DECODING_TABLE[data[i++]]; out.write((b1 << 2) | (b2 >> 4)); out.write((b2 << 4) | (b3 >> 2)); @@ -121,27 +121,27 @@ final class Base64Decoder { outLen += 3; } -if (data[end - 2] == padding) { -b1 = decodingTable[data[end - 4]]; -b2 = decodingTable[data[end - 3]]; +if (data[end - 2] == PADDING) { +b1 = DECODING_TABLE[data[end - 4]]; +b2 = DECODING_TABLE[data[end - 3]]; out.write((b1 << 2) | (b2 >> 4)); outLen += 1; -} else if (data[end - 1] == padding) { -b1 = decodingTable[data[end - 4]]; -b2 = decodingTable[data[end - 3]]; -b3 = decodingTable[data[end - 2]]; +} else if (data[end - 1] == PADDING) { +b1 = DECODING_TABLE[data[end - 4]]; +b2 = DECODING_TABLE[data[end - 3]]; +b3 = DECODING_TABLE[data[end - 2]]; out.write((b1 << 2) | (b2 >> 4)); out.write((b2 << 4) | (b3 >> 2)); outLen += 2; } else { -
svn commit: r1456838 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 09:42:02 2013 New Revision: 1456838 URL: http://svn.apache.org/r1456838 Log: checkstyle: First sentence should end with a period. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456838&r1=1456837&r2=1456838&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 09:42:02 2013 @@ -53,7 +53,7 @@ final class QuotedPrintableDecoder { } /** - * decode the uuencoded byte data writing it to the given output stream + * decode the uuencoded byte data writing it to the given output stream. * * @param data The array of byte data to decode. * @param offStarting offset within the array.
svn commit: r1456837 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 09:40:38 2013 New Revision: 1456837 URL: http://svn.apache.org/r1456837 Log: checkstyle: Utility classes should not have a public or default constructor Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456837&r1=1456836&r2=1456837&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 09:40:38 2013 @@ -46,6 +46,13 @@ final class QuotedPrintableDecoder { } /** + * Hidden constructor, this class must not be instantiated. + */ +private QuotedPrintableDecoder() { +// do nothing +} + +/** * decode the uuencoded byte data writing it to the given output stream * * @param data The array of byte data to decode.
svn commit: r1456834 - in /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime: MimeUtility.java QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 09:36:35 2013 New Revision: 1456834 URL: http://svn.apache.org/r1456834 Log: dropped unused variables, decode() method made static Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1456834&r1=1456833&r2=1456834&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Fri Mar 15 09:36:35 2013 @@ -225,8 +225,7 @@ public final class MimeUtility { if (encoding.equals("B")) { BASE64_DECODER.decode(encodedData, 0, encodedData.length, out); } else if (encoding.equals("Q")) { // maybe quoted printable. -QuotedPrintableDecoder dataEncoder = new QuotedPrintableDecoder(); -dataEncoder.decodeWord(encodedData, 0, encodedData.length, out); +QuotedPrintableDecoder.decodeWord(encodedData, 0, encodedData.length, out); } else { throw new UnsupportedEncodingException("Unknown RFC 2047 encoding: " + encoding); } Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456834&r1=1456833&r2=1456834&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 09:36:35 2013 @@ -46,64 +46,6 @@ final class QuotedPrintableDecoder { } /** - * default number of characters we will write per line. - */ -private static final int DEFAULT_CHARS_PER_LINE = 76; - -/** - * the output stream we're wrapped around - */ -protected OutputStream out; - -/** - * the number of bytes written; - */ -protected int bytesWritten = 0; - -/** - * number of bytes written on the current line - */ -protected int lineCount = 0; - -/** - * line length we're dealing with - */ -protected int lineLength; - -/** - * number of deferred whitespace characters in decode mode. - */ -protected int deferredWhitespace = 0; - -/** - * internal parsed character cache. - */ -protected int cachedCharacter = -1; - -/** - * indicates whether the last character was a '\r', potentially part of a CRLF sequence. - */ -protected boolean lastCR = false; - -/** - * remember whether last character was a white space. - */ -protected boolean lastWhitespace = false; - -public QuotedPrintableDecoder() { -this(null, DEFAULT_CHARS_PER_LINE); -} - -public QuotedPrintableDecoder(OutputStream out) { -this(out, DEFAULT_CHARS_PER_LINE); -} - -public QuotedPrintableDecoder(OutputStream out, int lineLength) { -this.out = out; -this.lineLength = lineLength; -} - -/** * decode the uuencoded byte data writing it to the given output stream * * @param data The array of byte data to decode. @@ -114,10 +56,7 @@ final class QuotedPrintableDecoder { * @return the number of bytes produced. * @exception IOException */ -public int decodeWord(byte[] data, int off, int length, OutputStream out) throws IOException { -// make sure we're writing to the correct stream -this.out = out; - +public static int decodeWord(byte[] data, int off, int length, OutputStream out) throws IOException { int endOffset = off + length; int bytesWritten = 0;
svn commit: r1456832 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 09:29:30 2013 New Revision: 1456832 URL: http://svn.apache.org/r1456832 Log: checkstyle: Missing a Javadoc comment. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456832&r1=1456831&r2=1456832&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 09:29:30 2013 @@ -45,30 +45,49 @@ final class QuotedPrintableDecoder { } } -// default number of characters we will write per line. +/** + * default number of characters we will write per line. + */ private static final int DEFAULT_CHARS_PER_LINE = 76; -// the output stream we're wrapped around +/** + * the output stream we're wrapped around + */ protected OutputStream out; -// the number of bytes written; +/** + * the number of bytes written; + */ protected int bytesWritten = 0; -// number of bytes written on the current line +/** + * number of bytes written on the current line + */ protected int lineCount = 0; -// line length we're dealing with +/** + * line length we're dealing with + */ protected int lineLength; -// number of deferred whitespace characters in decode mode. +/** + * number of deferred whitespace characters in decode mode. + */ protected int deferredWhitespace = 0; +/** + * internal parsed character cache. + */ protected int cachedCharacter = -1; -// indicates whether the last character was a '\r', potentially part of a CRLF sequence. +/** + * indicates whether the last character was a '\r', potentially part of a CRLF sequence. + */ protected boolean lastCR = false; -// remember whether last character was a white space. +/** + * remember whether last character was a white space. + */ protected boolean lastWhitespace = false; public QuotedPrintableDecoder() {
svn commit: r1456829 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 09:27:34 2013 New Revision: 1456829 URL: http://svn.apache.org/r1456829 Log: checkstyle: 'private' modifier out of order with the JLS suggestions. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456829&r1=1456828&r2=1456829&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 09:27:34 2013 @@ -46,7 +46,7 @@ final class QuotedPrintableDecoder { } // default number of characters we will write per line. -static private final int DEFAULT_CHARS_PER_LINE = 76; +private static final int DEFAULT_CHARS_PER_LINE = 76; // the output stream we're wrapped around protected OutputStream out;
svn commit: r1456828 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 09:26:30 2013 New Revision: 1456828 URL: http://svn.apache.org/r1456828 Log: checkstyle: 'cast' is not followed by whitespace. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456828&r1=1456827&r2=1456828&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 09:26:30 2013 @@ -29,8 +29,8 @@ final class QuotedPrintableDecoder { */ private static final byte[] ENCODING_TABLE = { -(byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', -(byte)'8', (byte)'9', (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F' +(byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', +(byte) '8', (byte) '9', (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F' }; /** @@ -41,7 +41,7 @@ final class QuotedPrintableDecoder { static { // initialize the decoding table for (int i = 0; i < ENCODING_TABLE.length; i++) { -DECODING_TABLE[ENCODING_TABLE[i]] = (byte)i; +DECODING_TABLE[ENCODING_TABLE[i]] = (byte) i; } }
svn commit: r1456827 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: simonetripodi Date: Fri Mar 15 09:25:11 2013 New Revision: 1456827 URL: http://svn.apache.org/r1456827 Log: checkstyle: 'protected' modifier out of order with the JLS suggestions. internal data structures made private, no reasons to be protected Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456827&r1=1456826&r2=1456827&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Fri Mar 15 09:25:11 2013 @@ -27,7 +27,7 @@ final class QuotedPrintableDecoder { /** * set up the encoding table. */ -static protected final byte[] ENCODING_TABLE = +private static final byte[] ENCODING_TABLE = { (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F' @@ -36,7 +36,7 @@ final class QuotedPrintableDecoder { /** * set up the decoding table. */ -static protected final byte[] DECODING_TABLE = new byte[128]; +private static final byte[] DECODING_TABLE = new byte[128]; static { // initialize the decoding table
svn commit: r1456825 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java
Author: simonetripodi Date: Fri Mar 15 09:22:22 2013 New Revision: 1456825 URL: http://svn.apache.org/r1456825 Log: trivial: no need to expose ParseException outside the mime package, since it is used internally only Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java?rev=1456825&r1=1456824&r2=1456825&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java Fri Mar 15 09:22:22 2013 @@ -19,7 +19,7 @@ package org.apache.commons.fileupload.ut /** * @since 1.3 */ -public final class ParseException extends Exception { +final class ParseException extends Exception { /** * The UID to use when serializing this instance.
svn commit: r1456824 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java
Author: simonetripodi Date: Fri Mar 15 09:19:35 2013 New Revision: 1456824 URL: http://svn.apache.org/r1456824 Log: checkstyle: Missing a Javadoc comment. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java?rev=1456824&r1=1456823&r2=1456824&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java Fri Mar 15 09:19:35 2013 @@ -22,10 +22,15 @@ package org.apache.commons.fileupload.ut public final class ParseException extends Exception { /** - * + * The UID to use when serializing this instance. */ private static final long serialVersionUID = 5355281266579392077L; +/** + * Constructs a new exception with the specified detail message. + * + * @param message the detail message. + */ public ParseException(String message) { super(message); }
svn commit: r1456821 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java
Author: simonetripodi Date: Fri Mar 15 09:17:28 2013 New Revision: 1456821 URL: http://svn.apache.org/r1456821 Log: checkstyle: Avoid inline conditionals. Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1456821&r1=1456820&r2=1456821&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Fri Mar 15 09:17:28 2013 @@ -255,7 +255,10 @@ public final class MimeUtility { String mappedCharset = MIME2JAVA.get(charset.toLowerCase(Locale.ENGLISH)); // if there is no mapping, then the original name is used. Many of the MIME character set // names map directly back into Java. The reverse isn't necessarily true. -return mappedCharset == null ? charset : mappedCharset; +if (mappedCharset == null) { +return charset; +} +return mappedCharset; } }
svn commit: r1456820 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java
Author: simonetripodi Date: Fri Mar 15 09:15:18 2013 New Revision: 1456820 URL: http://svn.apache.org/r1456820 Log: trivial: added comment on empty catch block Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java?rev=1456820&r1=1456819&r2=1456820&view=diff == --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java (original) +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/MimeUtility.java Fri Mar 15 09:15:18 2013 @@ -148,6 +148,7 @@ public final class MimeUtility { continue; } catch (ParseException e) { +// just ignore it, skip to next word } } // this is a normal token, so it doesn't matter what the previous token was. Add the white space