You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/08/30 17:50:02 UTC

svn commit: r1378996 - in /commons/proper/codec/trunk/src: main/java/org/apache/commons/codec/ main/java/org/apache/commons/codec/language/ test/java/org/apache/commons/codec/ test/java/org/apache/commons/codec/language/

Author: sebb
Date: Thu Aug 30 15:50:01 2012
New Revision: 1378996

URL: http://svn.apache.org/viewvc?rev=1378996&view=rev
Log:
Add SVN EOL setting

Modified:
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java   (contents, props changed)
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Nysiis.java   (props changed)
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java   (contents, props changed)
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/NysiisTest.java   (props changed)

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java?rev=1378996&r1=1378995&r2=1378996&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java Thu Aug 30 15:50:01 2012
@@ -1,161 +1,161 @@
-/*
- * 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.codec;
-
-import java.nio.charset.Charset;
-import java.nio.charset.UnsupportedCharsetException;
-
-/**
- * Charsets required of every implementation of the Java platform.
- *
- * From the Java documentation <a href="http://docs.oracle.com/javase/6/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
- * documentation for your implementation to see if any other encodings are supported. </cite>
- * </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/>
- * 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>
- * </ul>
- *
- * This perhaps would best belong in the Commons Lang project. Even if a similar class is defined in Commons Lang, it is
- * not foreseen that Commons Codec would be made to depend on Commons Lang.
- *
- * <p>
- * This class is immutable and thread-safe.
- * </p>
- *
- * @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 {
-
-    //
-    // This class should only contain Charset instances for required encodings. This guarantees that it will load
-    // 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(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 UnsupportedCharsetException
-     *             If the named charset is unavailable
-     */
-    public static Charset toCharset(String charset) {
-        return charset == null ? Charset.defaultCharset() : Charset.forName(charset);
-    }
-
-    /**
-     * CharEncodingISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1. </p>
-     * <p>
-     * Every implementation of the Java platform is required to support this character encoding.
-     * </p>
-     *
-     * @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);
-
-    /**
-     * <p>
-     * Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the Unicode character set.
-     * </p>
-     * <p>
-     * Every implementation of the Java platform is required to support this character encoding.
-     * </p>
-     *
-     * @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);
-
-    /**
-     * <p>
-     * Sixteen-bit Unicode Transformation Format, The byte order specified by a mandatory initial byte-order mark
-     * (either order accepted on input, big-endian used on output)
-     * </p>
-     * <p>
-     * Every implementation of the Java platform is required to support this character encoding.
-     * </p>
-     *
-     * @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);
-
-    /**
-     * <p>
-     * Sixteen-bit Unicode Transformation Format, big-endian byte order.
-     * </p>
-     * <p>
-     * Every implementation of the Java platform is required to support this character encoding.
-     * </p>
-     *
-     * @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);
-
-    /**
-     * <p>
-     * Sixteen-bit Unicode Transformation Format, little-endian byte order.
-     * </p>
-     * <p>
-     * Every implementation of the Java platform is required to support this character encoding.
-     * </p>
-     *
-     * @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);
-
-    /**
-     * <p>
-     * Eight-bit Unicode Transformation Format.
-     * </p>
-     * <p>
-     * Every implementation of the Java platform is required to support this character encoding.
-     * </p>
-     *
-     * @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);
-}
+/*
+ * 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.codec;
+
+import java.nio.charset.Charset;
+import java.nio.charset.UnsupportedCharsetException;
+
+/**
+ * Charsets required of every implementation of the Java platform.
+ *
+ * From the Java documentation <a href="http://docs.oracle.com/javase/6/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
+ * documentation for your implementation to see if any other encodings are supported. </cite>
+ * </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/>
+ * 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>
+ * </ul>
+ *
+ * This perhaps would best belong in the Commons Lang project. Even if a similar class is defined in Commons Lang, it is
+ * not foreseen that Commons Codec would be made to depend on Commons Lang.
+ *
+ * <p>
+ * This class is immutable and thread-safe.
+ * </p>
+ *
+ * @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 {
+
+    //
+    // This class should only contain Charset instances for required encodings. This guarantees that it will load
+    // 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(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 UnsupportedCharsetException
+     *             If the named charset is unavailable
+     */
+    public static Charset toCharset(String charset) {
+        return charset == null ? Charset.defaultCharset() : Charset.forName(charset);
+    }
+
+    /**
+     * CharEncodingISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1. </p>
+     * <p>
+     * Every implementation of the Java platform is required to support this character encoding.
+     * </p>
+     *
+     * @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);
+
+    /**
+     * <p>
+     * Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the Unicode character set.
+     * </p>
+     * <p>
+     * Every implementation of the Java platform is required to support this character encoding.
+     * </p>
+     *
+     * @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);
+
+    /**
+     * <p>
+     * Sixteen-bit Unicode Transformation Format, The byte order specified by a mandatory initial byte-order mark
+     * (either order accepted on input, big-endian used on output)
+     * </p>
+     * <p>
+     * Every implementation of the Java platform is required to support this character encoding.
+     * </p>
+     *
+     * @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);
+
+    /**
+     * <p>
+     * Sixteen-bit Unicode Transformation Format, big-endian byte order.
+     * </p>
+     * <p>
+     * Every implementation of the Java platform is required to support this character encoding.
+     * </p>
+     *
+     * @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);
+
+    /**
+     * <p>
+     * Sixteen-bit Unicode Transformation Format, little-endian byte order.
+     * </p>
+     * <p>
+     * Every implementation of the Java platform is required to support this character encoding.
+     * </p>
+     *
+     * @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);
+
+    /**
+     * <p>
+     * Eight-bit Unicode Transformation Format.
+     * </p>
+     * <p>
+     * Every implementation of the Java platform is required to support this character encoding.
+     * </p>
+     *
+     * @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);
+}

Propchange: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Nysiis.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java?rev=1378996&r1=1378995&r2=1378996&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java Thu Aug 30 15:50:01 2012
@@ -1,71 +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.codec;
-
-import java.nio.charset.Charset;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-
-/**
- * Sanity checks for {@link Charsets}.
- *
- * @version $Id: CharEncodingTest.java 1298985 2012-03-09 19:12:49Z ggregory $
- */
-public class CharsetsTest {
-
-    @Test
-    public void testToCharset() {
-        Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset((String) null));
-        Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset((Charset) null));
-        Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset(Charset.defaultCharset()));
-        Assert.assertEquals(Charset.forName("UTF-8"), Charsets.toCharset(Charset.forName("UTF-8")));
-    }
-
-    @Test
-    public void testIso8859_1() {
-        Assert.assertEquals("ISO-8859-1", Charsets.ISO_8859_1.name());
-    }
-
-    @Test
-    public void testUsAscii() {
-        Assert.assertEquals("US-ASCII", Charsets.US_ASCII.name());
-    }
-
-    @Test
-    public void testUtf16() {
-        Assert.assertEquals("UTF-16", Charsets.UTF_16.name());
-    }
-
-    @Test
-    public void testUtf16Be() {
-        Assert.assertEquals("UTF-16BE", Charsets.UTF_16BE.name());
-    }
-
-    @Test
-    public void testUtf16Le() {
-        Assert.assertEquals("UTF-16LE", Charsets.UTF_16LE.name());
-    }
-
-    @Test
-    public void testUtf8() {
-        Assert.assertEquals("UTF-8", Charsets.UTF_8.name());
-    }
-
-}
+/*
+ * 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.codec;
+
+import java.nio.charset.Charset;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+/**
+ * Sanity checks for {@link Charsets}.
+ *
+ * @version $Id: CharEncodingTest.java 1298985 2012-03-09 19:12:49Z ggregory $
+ */
+public class CharsetsTest {
+
+    @Test
+    public void testToCharset() {
+        Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset((String) null));
+        Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset((Charset) null));
+        Assert.assertEquals(Charset.defaultCharset(), Charsets.toCharset(Charset.defaultCharset()));
+        Assert.assertEquals(Charset.forName("UTF-8"), Charsets.toCharset(Charset.forName("UTF-8")));
+    }
+
+    @Test
+    public void testIso8859_1() {
+        Assert.assertEquals("ISO-8859-1", Charsets.ISO_8859_1.name());
+    }
+
+    @Test
+    public void testUsAscii() {
+        Assert.assertEquals("US-ASCII", Charsets.US_ASCII.name());
+    }
+
+    @Test
+    public void testUtf16() {
+        Assert.assertEquals("UTF-16", Charsets.UTF_16.name());
+    }
+
+    @Test
+    public void testUtf16Be() {
+        Assert.assertEquals("UTF-16BE", Charsets.UTF_16BE.name());
+    }
+
+    @Test
+    public void testUtf16Le() {
+        Assert.assertEquals("UTF-16LE", Charsets.UTF_16LE.name());
+    }
+
+    @Test
+    public void testUtf8() {
+        Assert.assertEquals("UTF-8", Charsets.UTF_8.name());
+    }
+
+}

Propchange: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/NysiisTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Re: svn commit: r1378996 - in /commons/proper/codec/trunk/src: main/java/org/apache/commons/codec/ main/java/org/apache/commons/codec/language/ test/java/org/apache/commons/codec/ test/java/org/apache/commons/codec/language/

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Aug 30, 2012 at 12:36 PM, sebb AT ASF <se...@apache.org> wrote:

> On 30 August 2012 16:50,  <se...@apache.org> wrote:
> > Author: sebb
> > Date: Thu Aug 30 15:50:01 2012
> > New Revision: 1378996
> >
> > URL: http://svn.apache.org/viewvc?rev=1378996&view=rev
> > Log:
> > Add SVN EOL setting
>
> Might fix the Checkstyle trailing EOL complaints?
>

Yes!

Thank you,
Gary


>
> > Modified:
> >
> commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java
>   (contents, props changed)
> >
> commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Nysiis.java
>   (props changed)
> >
> commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java
>   (contents, props changed)
> >
> commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/NysiisTest.java
>   (props changed)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: svn commit: r1378996 - in /commons/proper/codec/trunk/src: main/java/org/apache/commons/codec/ main/java/org/apache/commons/codec/language/ test/java/org/apache/commons/codec/ test/java/org/apache/commons/codec/language/

Posted by sebb AT ASF <se...@apache.org>.
On 30 August 2012 16:50,  <se...@apache.org> wrote:
> Author: sebb
> Date: Thu Aug 30 15:50:01 2012
> New Revision: 1378996
>
> URL: http://svn.apache.org/viewvc?rev=1378996&view=rev
> Log:
> Add SVN EOL setting

Might fix the Checkstyle trailing EOL complaints?

> Modified:
>     commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java   (contents, props changed)
>     commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Nysiis.java   (props changed)
>     commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java   (contents, props changed)
>     commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/NysiisTest.java   (props changed)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org