Skip to content
Commits on Source (9)
Apache Commons Codec
Copyright 2002-2017 The Apache Software Foundation
Copyright 2002-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
The Apache Software Foundation (https://www.apache.org/).
src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java
contains test data from http://aspell.net/test/orig/batch0.tab.
......
Apache Apache Commons Codec 1.14 RELEASE NOTES
December 30 2019
The Apache Commons Codec package contains simple encoder and decoders for
various formats such as Base64 and Hexadecimal. In addition to these
widely used encoders and decoders, the codec package also maintains a
collection of phonetic encoding utilities.
Feature and fix release.
Changes in this version include:
New features:
o CODEC-264: Add MurmurHash3.hash128x64 methods to fix sign extension error during seeding in hash128 methods. Thanks to Claude Warren.
o CODEC-267: Add MurmurHash3.hash32x86 methods and IncrementalHash32x86 to fix sign extension error in hash32 methods. Thanks to Claude Warren.
o CODEC-272: Add RandomAccessFile digest methods #31. Thanks to Behrang, Alex Herbert, Gary Gregory.
o CODEC-273: Add Path APIs to org.apache.commons.codec.digest.DigestUtils similar to File APIs. Thanks to Gary Gregory.
o CODEC-274: Add SHA-512/224 and SHA-512/256 to DigestUtils for Java 9 and up. Thanks to Gary Gregory.
o CODEC-275: Add missing note in javadoc when sign extension error is present #34. Thanks to Claude Warren.
Fixed Bugs:
o CODEC-261: Hex: Allow encoding read-only ByteBuffer.
o CODEC-259: Hex: Only use an available ByteBuffer backing array if the length equals the remaining byte count.
o CODEC-265: BaseNCodec to expand buffer using overflow conscious code.
o CODEC-270: Base32/64: Fixed decoding check that all the final trailing bits to discard are zero.
o CODEC-269: Allow repeat calls to MurmurHash3.IncrementalHash32.end() to generate the same value.
o CODEC-276: Reliance on default encoding in MurmurHash2 and MurmurHash3. Thanks to Gary Gregory.
Changes:
o CODEC-268: MurmurHash3: Deprecate hash64 methods and hash methods accepting a String that use the default encoding.
o CODEC-277: Don't reload standard Charsets in org.apache.commons.codec.Charsets. Thanks to Gary Gregory.
o CODEC-278: Deprecate Charset constants in org.apache.commons.codec.Charsets in favor of java.nio.charset.StandardCharsets. Thanks to Gary Gregory.
For complete information on Apache Commons Codec, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons Codec website:
https://commons.apache.org/proper/commons-codec/
Download page: https://commons.apache.org/proper/commons-codec/download_pool.cgi
-------------------------------------------------------------------------------
Apache Apache Commons Codec 1.13 RELEASE NOTES
The Apache Commons Codec package contains simple encoder and decoders for
various formats such as Base64 and Hexadecimal. In addition to these
widely used encoders and decoders, the codec package also maintains a
collection of phonetic encoding utilities.
Feature and fix release.
Changes in this version include:
New features:
o CODEC-236: MurmurHash2 for 32-bit or 64-bit value. Thanks to Viliam Holub.
o CODEC-236: MurmurHash3 for 32-bit or 128-bit value. Thanks to Austin Appleby.
Fixed Bugs:
o CODEC-255: ColognePhonetic handles x incorrectly Thanks to Holger Grote.
o CODEC-254: ColognePhonetic does not treat the letter H correctly Thanks to Holger Grote.
o CODEC-134: Reject any decode request for a value that is impossible to encode to for Base32/Base64 rather than blindly decoding.
Changes:
o CODEC-236: Broken direct java.nio.ByteBuffer support in org.apache.commons.codec.binary.Hex. Thanks to Tomas Shestakov, Gary Gregory.
For complete information on Apache Commons Codec, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons Codec website:
Visit https://commons.apache.org/proper/commons-codec/
Download from https://commons.apache.org/proper/commons-codec/download_codec.cgi
-------------------------------------------------------------------------------
Apache Commons Codec 1.12 RELEASE NOTES
The Apache Commons Codec team is pleased to announce the commons-codec-1.12 release!
The Apache Commons Codec package contains simple encoder and decoders for
various formats such as Base64 and Hexadecimal. In addition to these
widely used encoders and decoders, the codec package also maintains a
collection of phonetic encoding utilities.
Changes in this version include:
New features:
o Add Percent-Encoding Codec (described in RFC3986 and RFC7578) Issue: CODEC-240. Thanks to Ioannis Sermetziadis.
o Add SHA-3 methods in DigestUtils Issue: CODEC-251. Thanks to Gary Gregory.
Fixed Bugs:
o B64 salt generator: Random -> ThreadLocalRandom Issue: CODEC-252.
o Wrong value calculated by Cologne Phonetic if a special character is placed between equal letters Issue: CODEC-250. Thanks to Alex Volodko.
o ColognePhoneticTest.testIsEncodeEquals missing assertions Issue: CODEC-246. Thanks to Oscar Luis Vera Pérez.
Changes:
o Update from Java 7 to Java 8 Issue: CODEC-253.
Have fun!
-Apache Commons Codec team
-------------------------------------------------------------------------------
Apache Commons Codec 1.11 RELEASE NOTES
The Apache Commons Codec team is pleased to announce the commons-codec-1.11-SNAPSHOT release!
The Apache Commons Codec team is pleased to announce the commons-codec-1.11 release!
The Apache Commons Codec package contains simple encoder and decoders for
various formats such as Base64 and Hexadecimal. In addition to these
......@@ -135,4 +240,4 @@ o CODEC-176: Spelling fixes in Javadoc and comments. Thanks to Ville Skyttä.
For complete information on Apache Commons Codec, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Commons Codec website:
http://commons.apache.org/proper/commons-codec/
https://commons.apache.org/proper/commons-codec/
......@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
$Id: TODO 1552922 2013-12-21 16:34:23Z ggregory $
This is a list of action items to be finished in the [codec] project.
This TODO list reflects the current direction of development, and
......
libcommons-codec-java (1.14-1) unstable; urgency=medium
* New upstream release
* Removed Damien Raude-Morvan from the uploaders (Closes: #889394)
* Standards-Version updated to 4.5.0
* Switch to debhelper level 11
* Use salsa.debian.org Vcs-* URLs
* Use a secure watch URL
-- Emmanuel Bourg <ebourg@apache.org> Mon, 27 Jan 2020 12:22:54 +0100
libcommons-codec-java (1.11-1) unstable; urgency=medium
* New upstream release
......
......@@ -4,12 +4,11 @@ Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Uploaders:
Wolfgang Baer <WBaer@gmx.de>,
Damien Raude-Morvan <drazzib@debian.org>,
Torsten Werner <twerner@debian.org>,
James Page <james.page@ubuntu.com>,
Emmanuel Bourg <ebourg@apache.org>
Build-Depends:
debhelper (>= 10),
debhelper (>= 11),
default-jdk,
junit4,
libcommons-lang3-java,
......@@ -17,9 +16,9 @@ Build-Depends:
libmaven-bundle-plugin-java,
libmaven-javadoc-plugin-java,
maven-debian-helper (>= 2.2)
Standards-Version: 4.1.1
Vcs-Git: https://anonscm.debian.org/git/pkg-java/libcommons-codec-java.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/libcommons-codec-java.git
Standards-Version: 4.5.0
Vcs-Git: https://salsa.debian.org/java-team/libcommons-codec-java.git
Vcs-Browser: https://salsa.debian.org/java-team/libcommons-codec-java
Homepage: http://commons.apache.org/codec/
Package: libcommons-codec-java
......
#!/usr/bin/make -f
%:
dh $@ --buildsystem=maven
get-orig-source:
-uscan --download-current-version --force-download --rename
dh $@
version=2
http://www.apache.org/dist/commons/codec/source/commons-codec-(.*)-src\.tar\.gz debian uupdate
version=3
https://www.apache.org/dist/commons/codec/source/commons-codec-(.*)-src\.tar\.gz debian uupdate
......@@ -20,7 +20,7 @@ limitations under the License.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>Excludes from default PMD rules.</description>
<rule ref="rulesets/java/unnecessary.xml">
<rule ref="category/java/codestyle.xml">
<exclude name="UselessParentheses"/>
</rule>
</ruleset>
\ No newline at end of file
......@@ -25,12 +25,12 @@ limitations under the License.
<parent>
<groupId>org.apache.commons</groupId>
<artifactId>commons-parent</artifactId>
<version>42</version>
<version>50</version>
</parent>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<!-- Remember to update the version in default.properties as well -->
<version>1.11</version>
<version>1.14</version>
<name>Apache Commons Codec</name>
<inceptionYear>2002</inceptionYear>
<description>
......@@ -39,24 +39,21 @@ limitations under the License.
widely used encoders and decoders, the codec package also maintains a
collection of phonetic encoding utilities.
</description>
<prerequisites>
<maven>3.0.0</maven>
</prerequisites>
<url>http://commons.apache.org/proper/commons-codec/</url>
<url>https://commons.apache.org/proper/commons-codec/</url>
<issueManagement>
<system>jira</system>
<url>http://issues.apache.org/jira/browse/CODEC</url>
<url>https://issues.apache.org/jira/browse/CODEC</url>
</issueManagement>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/commons/proper/codec/trunk</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/proper/codec/trunk</developerConnection>
<url>http://svn.apache.org/viewvc/commons/proper/codec/trunk</url>
<connection>scm:git:https://gitbox.apache.org/repos/asf?p=commons-codec.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf?p=commons-codec.git</developerConnection>
<url>https://github.com/apache/commons-codec</url>
</scm>
<distributionManagement>
<site>
<id>stagingSite</id>
<name>Apache Staging Website</name>
<url>${commons.deployment.protocol}://people.apache.org/www/commons.apache.org/${commons.componentid}/</url>
<url>${commons.deployment.protocol}://people.apache.org/www/commons.apache.org/commons-${commons.componentid}/</url>
</site>
</distributionManagement>
<developers>
......@@ -96,7 +93,7 @@ limitations under the License.
<id>ggregory</id>
<email>ggregory@apache.org</email>
<url>http://www.garygregory.com</url>
<timezone>-8</timezone>
<timezone>-5</timezone>
</developer>
<developer>
<name>David Graham</name>
......@@ -115,6 +112,11 @@ limitations under the License.
<id>tn</id>
<email>tn@apache.org</email>
</developer>
<developer>
<name>Rob Tompkins</name>
<id>chtompki</id>
<email>chtompki@apache.org</email>
</developer>
</developers>
<contributors>
<contributor>
......@@ -217,18 +219,19 @@ limitations under the License.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
<!-- 3.9+ needs Java8 -->
<version>3.8</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<!-- Fix to build on JDK 7: version 4.0.0 requires Java 8. -->
<!-- Can be dropped when CP 49 is released -->
<commons.felix.version>3.5.1</commons.felix.version>
<commons.componentid>codec</commons.componentid>
<commons.module.name>org.apache.commons.codec</commons.module.name>
<commons.release.version>1.11</commons.release.version>
<!-- The RC version used in the staging repository URL. -->
<commons.rc.version>RC1</commons.rc.version>
<commons.jira.id>CODEC</commons.jira.id>
<commons.jira.pid>12310464</commons.jira.pid>
<!-- Ensure copies work OK (can be removed later when this is in parent POM) -->
......@@ -237,9 +240,24 @@ limitations under the License.
<commons.encoding>UTF-8</commons.encoding>
<checkstyle.header.file>${basedir}/LICENSE-header.txt</checkstyle.header.file>
<checkstyle.version>2.17</checkstyle.version>
<commons.clirr.version>2.8</commons.clirr.version>
<commons.japicmp.version>0.14.3</commons.japicmp.version>
<commons.jacoco.version>0.8.5</commons.jacoco.version>
<!-- generate report even if there are binary incompatible changes -->
<commons.japicmp.breakBuildOnBinaryIncompatibleModifications>false</commons.japicmp.breakBuildOnBinaryIncompatibleModifications>
<japicmp.skip>false</japicmp.skip>
<!-- Commons Release Plugin -->
<commons.bc.version>1.13</commons.bc.version>
<commons.rc.version>RC1</commons.rc.version>
<commons.release-plugin.version>1.7</commons.release-plugin.version>
<commons.release.isDistModule>true</commons.release.isDistModule>
<commons.distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}</commons.distSvnStagingUrl>
<commons.releaseManagerName>Gary Gregory</commons.releaseManagerName>
<commons.releaseManagerKey>86fdc7e2a11262cb</commons.releaseManagerKey>
</properties>
<build>
<defaultGoal>clean verify apache-rat:check clirr:check javadoc:javadoc</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
......@@ -261,7 +279,9 @@ limitations under the License.
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes>
<exclude>src/site/resources/.htaccess</exclude>
<exclude>src/test/resources/bla.tar.xz</exclude>
<exclude>src/test/resources/empty.bin</exclude>
<exclude>src/test/resources/small.bin</exclude>
</excludes>
</configuration>
</plugin>
......@@ -310,6 +330,15 @@ limitations under the License.
<headerFile>${basedir}/LICENSE-header.txt</headerFile>
</configuration>
</plugin>
<!-- Specify source for JDK 11+ javadoc tool to ignore the 'unamed' module.
See: https://bugs.openjdk.java.net/browse/JDK-8212233.
To be removed with parent 49. -->
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
......@@ -335,7 +364,7 @@ limitations under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.8</version>
<version>${commons.pmd.version}</version>
<configuration>
<targetJdk>${maven.compiler.target}</targetJdk>
<linkXref>true</linkXref>
......@@ -366,45 +395,18 @@ limitations under the License.
<artifactId>javancss-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes>
<exclude>src/site/resources/.htaccess</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>travis</id>
<id>java9+</id>
<activation>
<property>
<name>env.TRAVIS</name>
<value>true</value>
</property>
<jdk>[9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${commons.cobertura.version}</version>
<configuration>
<formats>
<format>xml</format>
</formats>
</configuration>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.3.0</version>
</plugin>
</plugins>
</build>
<properties>
<!-- coverall version 4.3.0 does not work with java 9, see https://github.com/trautonen/coveralls-maven-plugin/issues/112 -->
<coveralls.skip>true</coveralls.skip>
</properties>
</profile>
</profiles>
</project>
......@@ -15,7 +15,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id: changes.xml 1811898 2017-10-11 23:14:36Z ggregory $ -->
<!--
This file is also used by the maven-changes-plugin to generate the release notes.
......@@ -38,13 +37,49 @@ The <action> type attribute can be add,update,fix,remove.
<document>
<properties>
<title>Changes</title>
<title>Apache Commons Codec Release Notes</title>
<author>Apache Commons Developers</author>
</properties>
<body>
<release version="1.11" date="2017-MM-DD" description="Feature and fix release.">
<!-- The first attribute below should be the issue id; makes it easier to navigate in the IDE outline -->
<release version="1.14" date="2019-12-30" description="Feature and fix release.">
<action issue="CODEC-261" dev="aherbert" type="fix">Hex: Allow encoding read-only ByteBuffer.</action>
<action issue="CODEC-259" dev="aherbert" type="fix">Hex: Only use an available ByteBuffer backing array if the length equals the remaining byte count.</action>
<action issue="CODEC-268" dev="aherbert" type="update">MurmurHash3: Deprecate hash64 methods and hash methods accepting a String that use the default encoding.</action>
<action issue="CODEC-265" dev="aherbert" type="fix">BaseNCodec to expand buffer using overflow conscious code.</action>
<action issue="CODEC-270" dev="aherbert" type="fix">Base32/64: Fixed decoding check that all the final trailing bits to discard are zero.</action>
<action issue="CODEC-264" dev="aherbert" due-to="Claude Warren" type="add">Add MurmurHash3.hash128x64 methods to fix sign extension error during seeding in hash128 methods.</action>
<action issue="CODEC-267" dev="aherbert" due-to="Claude Warren" type="add">Add MurmurHash3.hash32x86 methods and IncrementalHash32x86 to fix sign extension error in hash32 methods.</action>
<action issue="CODEC-269" dev="aherbert" type="fix">Allow repeat calls to MurmurHash3.IncrementalHash32.end() to generate the same value.</action>
<action issue="CODEC-272" dev="ggregory" type="add" due-to="Behrang, Alex Herbert, Gary Gregory">Add RandomAccessFile digest methods #31.</action>
<action issue="CODEC-273" dev="ggregory" type="add" due-to="Gary Gregory">Add Path APIs to org.apache.commons.codec.digest.DigestUtils similar to File APIs.</action>
<action issue="CODEC-274" dev="ggregory" type="add" due-to="Gary Gregory">Add SHA-512/224 and SHA-512/256 to DigestUtils for Java 9 and up.</action>
<action issue="CODEC-275" dev="ggregory" type="add" due-to="Claude Warren">Add missing note in javadoc when sign extension error is present #34.</action>
<action issue="CODEC-276" dev="ggregory" type="fix" due-to="Gary Gregory">Reliance on default encoding in MurmurHash2 and MurmurHash3.</action>
<action issue="CODEC-277" dev="ggregory" type="update" due-to="Gary Gregory">Don't reload standard Charsets in org.apache.commons.codec.Charsets.</action>
<action issue="CODEC-278" dev="ggregory" type="update" due-to="Gary Gregory">Deprecate Charset constants in org.apache.commons.codec.Charsets in favor of java.nio.charset.StandardCharsets.</action>
</release>
<release version="1.13" date="2019-07-20" description="Feature and fix release.">
<action issue="CODEC-255" dev="sebb" due-to="Holger Grote" type="fix">ColognePhonetic handles x incorrectly</action>
<action issue="CODEC-254" dev="sebb" due-to="Holger Grote" type="fix">ColognePhonetic does not treat the letter H correctly</action>
<action issue="CODEC-134" dev="tmousaw-ptc" type="fix">Reject any decode request for a value that is impossible to encode to for Base32/Base64 rather than blindly decoding.</action>
<action issue="CODEC-236" dev="melloware" due-to="Viliam Holub" type="add">MurmurHash2 for 32-bit or 64-bit value.</action>
<action issue="CODEC-236" dev="melloware" due-to="Austin Appleby" type="add">MurmurHash3 for 32-bit or 128-bit value.</action>
<action issue="CODEC-236" dev="ggregory" due-to=" Tomas Shestakov, Gary Gregory" type="update">Broken direct java.nio.ByteBuffer support in org.apache.commons.codec.binary.Hex.</action>
</release>
<release version="1.12" date="2019-02-04" description="Feature and fix release.">
<!-- The first attribute below should be the issue id; makes it easier to navigate in the IDE outline -->
<action issue="CODEC-252" dev="chtompki" type="fix">B64 salt generator: Random -> ThreadLocalRandom</action>
<action issue="CODEC-250" dev="sebb" type="fix" due-to="Alex Volodko">Wrong value calculated by Cologne Phonetic if a special character is placed between equal letters</action>
<action issue="CODEC-244" dev="ggregory" type="update">Update from Java 6 to Java 7</action>
<action issue="CODEC-240" dev="ggregory" type="add" due-to="Ioannis Sermetziadis">Add Percent-Encoding Codec (described in RFC3986 and RFC7578)</action>
<action issue="CODEC-246" dev="ggregory" type="fix" due-to="Oscar Luis Vera Pérez">ColognePhoneticTest.testIsEncodeEquals missing assertions</action>
<action issue="CODEC-251" dev="ggregory" type="add" due-to="Gary Gregory">Add SHA-3 methods in DigestUtils</action>
</release>
<release version="1.11" date="2017-10-20" description="Feature and fix release.">
<!-- The first attribute below should be the issue id; makes it easier to navigate in the IDE outline -->
<action issue="CODEC-241" type="add">Add support for XXHash32</action>
<action issue="CODEC-234" dev="ggregory" type="update" due-to="Christopher Schultz, Sebb">Base32.decode should support lowercase letters</action>
<action issue="CODEC-233" dev="sebb" type="update" due-to="Yossi Tamari">Soundex should support more algorithm variants</action>
......
......@@ -101,3 +101,5 @@ For complete information on ${project.name}, including instructions on how to su
patches, or suggestions for improvement, see the Apache ${project.name} website:
${project.url}
Download page: ${project.url}download_pool.cgi
......@@ -20,7 +20,6 @@ package org.apache.commons.codec;
/**
* Defines common decoding methods for byte array decoders.
*
* @version $Id: BinaryDecoder.java 1379145 2012-08-30 21:02:52Z tn $
*/
public interface BinaryDecoder extends Decoder {
......
......@@ -20,7 +20,6 @@ package org.apache.commons.codec;
/**
* Defines common encoding methods for byte array encoders.
*
* @version $Id: BinaryEncoder.java 1379145 2012-08-30 21:02:52Z tn $
*/
public interface BinaryEncoder extends Encoder {
......
......@@ -21,7 +21,7 @@ package org.apache.commons.codec;
* Character encoding names required of every implementation of the Java platform.
*
* From the Java documentation <a
* href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>:
* href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a>:
* <p>
* <cite>Every implementation of the Java platform is required to support the following character encodings. Consult the
* release documentation for your implementation to see if any other encodings are supported. Consult the release
......@@ -29,19 +29,19 @@ package org.apache.commons.codec;
* </p>
*
* <ul>
* <li><code>US-ASCII</code><br>
* Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set.</li>
* <li><code>ISO-8859-1</code><br>
* ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.</li>
* <li><code>UTF-8</code><br>
* Eight-bit Unicode Transformation Format.</li>
* <li><code>UTF-16BE</code><br>
* Sixteen-bit Unicode Transformation Format, big-endian byte order.</li>
* <li><code>UTF-16LE</code><br>
* Sixteen-bit Unicode Transformation Format, little-endian byte order.</li>
* <li><code>UTF-16</code><br>
* <li>{@code US-ASCII}<p>
* Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set.</p></li>
* <li>{@code ISO-8859-1}<p>
* ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.</p></li>
* <li>{@code UTF-8}<p>
* Eight-bit Unicode Transformation Format.</p></li>
* <li>{@code UTF-16BE}<p>
* Sixteen-bit Unicode Transformation Format, big-endian byte order.</p></li>
* <li>{@code UTF-16LE}<p>
* Sixteen-bit Unicode Transformation Format, little-endian byte order.</p></li>
* <li>{@code UTF-16}<p>
* Sixteen-bit Unicode Transformation Format, byte order specified by a mandatory initial byte-order mark (either order
* accepted on input, big-endian used on output.)</li>
* accepted on input, big-endian used on output.)</p></li>
* </ul>
*
* This perhaps would best belong in the [lang] project. Even if a similar interface is defined in [lang], it is not
......@@ -51,17 +51,18 @@ package org.apache.commons.codec;
* This class is immutable and thread-safe.
* </p>
*
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @see <a href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @since 1.4
* @version $Id: CharEncoding.java 1563226 2014-01-31 19:38:06Z ggregory $
*/
public class CharEncoding {
/**
* CharEncodingISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @see <a href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String ISO_8859_1 = "ISO-8859-1";
......@@ -69,8 +70,9 @@ public class CharEncoding {
* Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the Unicode character set.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @see <a href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String US_ASCII = "US-ASCII";
......@@ -79,8 +81,9 @@ public class CharEncoding {
* (either order accepted on input, big-endian used on output)
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @see <a href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String UTF_16 = "UTF-16";
......@@ -88,8 +91,9 @@ public class CharEncoding {
* Sixteen-bit Unicode Transformation Format, big-endian byte order.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @see <a href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String UTF_16BE = "UTF-16BE";
......@@ -97,8 +101,9 @@ public class CharEncoding {
* Sixteen-bit Unicode Transformation Format, little-endian byte order.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @see <a href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String UTF_16LE = "UTF-16LE";
......@@ -106,8 +111,9 @@ public class CharEncoding {
* Eight-bit Unicode Transformation Format.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @see <a href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String UTF_8 = "UTF-8";
}
......@@ -17,6 +17,7 @@
package org.apache.commons.codec;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
/**
* Charsets required of every implementation of the Java platform.
......@@ -30,19 +31,19 @@ import java.nio.charset.Charset;
* </p>
*
* <ul>
* <li><code>US-ASCII</code><br>
* Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set.</li>
* <li><code>ISO-8859-1</code><br>
* ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.</li>
* <li><code>UTF-8</code><br>
* Eight-bit Unicode Transformation Format.</li>
* <li><code>UTF-16BE</code><br>
* Sixteen-bit Unicode Transformation Format, big-endian byte order.</li>
* <li><code>UTF-16LE</code><br>
* Sixteen-bit Unicode Transformation Format, little-endian byte order.</li>
* <li><code>UTF-16</code><br>
* <li>{@code US-ASCII}<p>
* Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set.</p></li>
* <li>{@code ISO-8859-1}<p>
* ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.</p></li>
* <li>{@code UTF-8}<p>
* Eight-bit Unicode Transformation Format.</p></li>
* <li>{@code UTF-16BE}<p>
* Sixteen-bit Unicode Transformation Format, big-endian byte order.</p></li>
* <li>{@code UTF-16LE}<p>
* Sixteen-bit Unicode Transformation Format, little-endian byte order.</p></li>
* <li>{@code UTF-16}<p>
* Sixteen-bit Unicode Transformation Format, byte order specified by a mandatory initial byte-order mark (either order
* accepted on input, big-endian used on output.)</li>
* accepted on input, big-endian used on output.)</p></li>
* </ul>
*
* This perhaps would best belong in the Commons Lang project. Even if a similar class is defined in Commons Lang, it is
......@@ -54,7 +55,6 @@ import java.nio.charset.Charset;
*
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @since 1.7
* @version $Id: CharEncoding.java 1173287 2011-09-20 18:16:19Z ggregory $
*/
public class Charsets {
......@@ -63,55 +63,29 @@ public class Charsets {
// correctly and without delay on all Java platforms.
//
/**
* Returns the given Charset or the default Charset if the given Charset is null.
*
* @param charset
* A charset or null.
* @return the given Charset or the default Charset if the given Charset is null
*/
public static Charset toCharset(final Charset charset) {
return charset == null ? Charset.defaultCharset() : charset;
}
/**
* Returns a Charset for the named charset. If the name is null, return the default Charset.
*
* @param charset
* The name of the requested charset, may be null.
* @return a Charset for the named charset
* @throws java.nio.charset.UnsupportedCharsetException
* If the named charset is unavailable
*/
public static Charset toCharset(final String charset) {
return charset == null ? Charset.defaultCharset() : Charset.forName(charset);
}
/**
* CharEncodingISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
* <p>
* On Java 7 or later, use {@link java.nio.charset.StandardCharsets#ISO_8859_1} instead.
* </p>
*
* @deprecated Use {@link java.nio.charset.StandardCharsets#ISO_8859_1} instead.
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final Charset ISO_8859_1 = Charset.forName(CharEncoding.ISO_8859_1);
@Deprecated
public static final Charset ISO_8859_1 = StandardCharsets.ISO_8859_1;
/**
* Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the Unicode character set.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
* <p>
* On Java 7 or later, use {@link java.nio.charset.StandardCharsets#ISO_8859_1} instead.
* </p>
*
* @deprecated Use {@link java.nio.charset.StandardCharsets#US_ASCII} instead.
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final Charset US_ASCII = Charset.forName(CharEncoding.US_ASCII);
@Deprecated
public static final Charset US_ASCII = StandardCharsets.US_ASCII;
/**
* Sixteen-bit Unicode Transformation Format, The byte order specified by a mandatory initial byte-order mark
......@@ -119,50 +93,70 @@ public class Charsets {
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
* <p>
* On Java 7 or later, use {@link java.nio.charset.StandardCharsets#ISO_8859_1} instead.
* </p>
*
* @deprecated Use {@link java.nio.charset.StandardCharsets#UTF_16} instead.
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final Charset UTF_16 = Charset.forName(CharEncoding.UTF_16);
@Deprecated
public static final Charset UTF_16 = StandardCharsets.UTF_16;
/**
* Sixteen-bit Unicode Transformation Format, big-endian byte order.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
* <p>
* On Java 7 or later, use {@link java.nio.charset.StandardCharsets#ISO_8859_1} instead.
* </p>
*
* @deprecated Use {@link java.nio.charset.StandardCharsets#UTF_16BE} instead.
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final Charset UTF_16BE = Charset.forName(CharEncoding.UTF_16BE);
@Deprecated
public static final Charset UTF_16BE = StandardCharsets.UTF_16BE;
/**
* Sixteen-bit Unicode Transformation Format, little-endian byte order.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
* <p>
* On Java 7 or later, use {@link java.nio.charset.StandardCharsets#ISO_8859_1} instead.
* </p>
*
* @deprecated Use {@link java.nio.charset.StandardCharsets#UTF_16LE} instead.
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final Charset UTF_16LE = Charset.forName(CharEncoding.UTF_16LE);
@Deprecated
public static final Charset UTF_16LE = StandardCharsets.UTF_16LE;
/**
* Eight-bit Unicode Transformation Format.
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
* <p>
* On Java 7 or later, use {@link java.nio.charset.StandardCharsets#ISO_8859_1} instead.
* </p>
*
* @deprecated Use {@link java.nio.charset.StandardCharsets#UTF_8} instead.
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final Charset UTF_8 = Charset.forName(CharEncoding.UTF_8);
@Deprecated
public static final Charset UTF_8 = StandardCharsets.UTF_8;
/**
* Returns the given Charset or the default Charset if the given Charset is null.
*
* @param charset
* A charset or null.
* @return the given Charset or the default Charset if the given Charset is null
*/
public static Charset toCharset(final Charset charset) {
return charset == null ? Charset.defaultCharset() : charset;
}
/**
* Returns a Charset for the named charset. If the name is null, return the default Charset.
*
* @param charset
* The name of the requested charset, may be null.
* @return a Charset for the named charset
* @throws java.nio.charset.UnsupportedCharsetException
* If the named charset is unavailable
*/
public static Charset toCharset(final String charset) {
return charset == null ? Charset.defaultCharset() : Charset.forName(charset);
}
}
......@@ -25,7 +25,6 @@ package org.apache.commons.codec;
* <p>
* One of the two interfaces at the center of the codec package.
*
* @version $Id: Decoder.java 1379145 2012-08-30 21:02:52Z tn $
*/
public interface Decoder {
......
......@@ -21,7 +21,6 @@ package org.apache.commons.codec;
* Thrown when there is a failure condition during the decoding process. This exception is thrown when a {@link Decoder}
* encounters a decoding specific exception such as invalid data, or characters outside of the expected range.
*
* @version $Id: DecoderException.java 1619948 2014-08-22 22:53:55Z ggregory $
*/
public class DecoderException extends Exception {
......@@ -33,7 +32,7 @@ public class DecoderException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with <code>null</code> as its detail message. The cause is not initialized, and may
* Constructs a new exception with {@code null} as its detail message. The cause is not initialized, and may
* subsequently be initialized by a call to {@link #initCause}.
*
* @since 1.4
......@@ -56,13 +55,13 @@ public class DecoderException extends Exception {
/**
* Constructs a new exception with the specified detail message and cause.
* <p>
* Note that the detail message associated with <code>cause</code> is not automatically incorporated into this
* Note that the detail message associated with {@code cause} is not automatically incorporated into this
* exception's detail message.
*
* @param message
* The detail message which is saved for later retrieval by the {@link #getMessage()} method.
* @param cause
* The cause which is saved for later retrieval by the {@link #getCause()} method. A <code>null</code>
* The cause which is saved for later retrieval by the {@link #getCause()} method. A {@code null}
* value is permitted, and indicates that the cause is nonexistent or unknown.
* @since 1.4
*/
......@@ -72,11 +71,11 @@ public class DecoderException extends Exception {
/**
* Constructs a new exception with the specified cause and a detail message of <code>(cause==null ?
* null : cause.toString())</code> (which typically contains the class and detail message of <code>cause</code>).
* null : cause.toString())</code> (which typically contains the class and detail message of {@code cause}).
* This constructor is useful for exceptions that are little more than wrappers for other throwables.
*
* @param cause
* The cause which is saved for later retrieval by the {@link #getCause()} method. A <code>null</code>
* The cause which is saved for later retrieval by the {@link #getCause()} method. A {@code null}
* value is permitted, and indicates that the cause is nonexistent or unknown.
* @since 1.4
*/
......
......@@ -24,13 +24,12 @@ package org.apache.commons.codec;
* common generic interface which allows a user to pass a generic Object to any Encoder implementation
* in the codec package.
*
* @version $Id: Encoder.java 1379145 2012-08-30 21:02:52Z tn $
*/
public interface Encoder {
/**
* Encodes an "Object" and returns the encoded content as an Object. The Objects here may just be
* <code>byte[]</code> or <code>String</code>s depending on the implementation used.
* {@code byte[]} or {@code String}s depending on the implementation used.
*
* @param source
* An object to encode
......
......@@ -22,7 +22,6 @@ package org.apache.commons.codec;
* {@link Encoder} encounters a encoding specific exception such as invalid data, inability to calculate a checksum,
* characters outside of the expected range.
*
* @version $Id: EncoderException.java 1619948 2014-08-22 22:53:55Z ggregory $
*/
public class EncoderException extends Exception {
......@@ -34,7 +33,7 @@ public class EncoderException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with <code>null</code> as its detail message. The cause is not initialized, and may
* Constructs a new exception with {@code null} as its detail message. The cause is not initialized, and may
* subsequently be initialized by a call to {@link #initCause}.
*
* @since 1.4
......@@ -58,14 +57,14 @@ public class EncoderException extends Exception {
* Constructs a new exception with the specified detail message and cause.
*
* <p>
* Note that the detail message associated with <code>cause</code> is not automatically incorporated into this
* Note that the detail message associated with {@code cause} is not automatically incorporated into this
* exception's detail message.
* </p>
*
* @param message
* The detail message which is saved for later retrieval by the {@link #getMessage()} method.
* @param cause
* The cause which is saved for later retrieval by the {@link #getCause()} method. A <code>null</code>
* The cause which is saved for later retrieval by the {@link #getCause()} method. A {@code null}
* value is permitted, and indicates that the cause is nonexistent or unknown.
* @since 1.4
*/
......@@ -75,11 +74,11 @@ public class EncoderException extends Exception {
/**
* Constructs a new exception with the specified cause and a detail message of <code>(cause==null ?
* null : cause.toString())</code> (which typically contains the class and detail message of <code>cause</code>).
* null : cause.toString())</code> (which typically contains the class and detail message of {@code cause}).
* This constructor is useful for exceptions that are little more than wrappers for other throwables.
*
* @param cause
* The cause which is saved for later retrieval by the {@link #getCause()} method. A <code>null</code>
* The cause which is saved for later retrieval by the {@link #getCause()} method. A {@code null}
* value is permitted, and indicates that the cause is nonexistent or unknown.
* @since 1.4
*/
......