You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/02/25 18:30:45 UTC

[isis] branch master updated: ISIS-1841 fix typos, enhance java-doc

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new dd11151  ISIS-1841 fix typos, enhance java-doc
dd11151 is described below

commit dd111515b7cfba7f1b9da287ffd41e3187010a22
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Feb 25 19:30:45 2018 +0100

    ISIS-1841 fix typos, enhance java-doc
---
 .../org/apache/isis/applib/internal/base/_Bytes.java     | 14 ++++++++------
 .../org/apache/isis/applib/internal/base/BytesTest.java  | 16 ++++++++--------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/internal/base/_Bytes.java b/core/applib/src/main/java/org/apache/isis/applib/internal/base/_Bytes.java
index 12c725c..e3a1056 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/internal/base/_Bytes.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/internal/base/_Bytes.java
@@ -43,10 +43,11 @@ public final class _Bytes {
 	// -- BASE-64 ENCODING
 
 	/**
-	 * 
+	 * Encodes all bytes from the specified byte array into a newly-allocated byte array using 
+	 * the specified {@code encoder}.
 	 * @param encoder
 	 * @param input
-	 * @return null if {@code str} is null
+	 * @return null if {@code input} is null
 	 */
 	public final static byte[] encodeToBase64(Base64.Encoder encoder, final byte[] input) {
 		if(input==null) {
@@ -57,10 +58,11 @@ public final class _Bytes {
 	}
 
 	/**
-	 * 
+	 * Decodes all bytes from the input byte array using the specified {@code decoder}, writing the 
+	 * results into a newly-allocated output byte array.
 	 * @param decoder
 	 * @param base64
-	 * @return null if {@code str} is null
+	 * @return null if {@code base64} is null
 	 */
 	public final static byte[] decodeBase64(Base64.Decoder decoder, final byte[] base64) {
 		if(base64==null) {
@@ -77,7 +79,7 @@ public final class _Bytes {
 	 * However, following symmetry holds: <br/>
 	 * {@code x == decompress(compress(x))}
 	 * @param input
-	 * @return null if {@code str} is null
+	 * @return null if {@code input} is null
 	 */
 	public static final byte[] compress(byte[] input) {
 		if(input==null) {
@@ -98,7 +100,7 @@ public final class _Bytes {
 	 * However, following symmetry holds: <br/>
 	 * {@code x == decompress(compress(x))}
 	 * @param compressed
-	 * @return null if {@code str} is null
+	 * @return null if {@code compressed} is null
 	 */
 	public static final byte[] decompress(byte[] compressed) {
 		if(compressed==null) {
diff --git a/core/applib/src/test/java/org/apache/isis/applib/internal/base/BytesTest.java b/core/applib/src/test/java/org/apache/isis/applib/internal/base/BytesTest.java
index 907b260..c653284 100644
--- a/core/applib/src/test/java/org/apache/isis/applib/internal/base/BytesTest.java
+++ b/core/applib/src/test/java/org/apache/isis/applib/internal/base/BytesTest.java
@@ -33,7 +33,7 @@ public class BytesTest {
 	final int n = 256;
 	private final byte[] allBytes = new byte[n];
 	
-	private final byte[] testimonal = 
+	private final byte[] testimonial = 
 			_Strings.toBytes(
 					"https://docs.oracle.com/javase/8/docs/api/java/util/Base64.html#basic?"+
 					"0-theme-entityPageContainer-entity-rows-2-rowContents-1-col-tabGroups-1-panel-"
@@ -64,14 +64,14 @@ public class BytesTest {
 	
 	@Test
 	public void compressIdentityWithTestimonial() throws Exception {
-		Assert.assertArrayEquals(testimonal,
-				_Bytes.decompress(_Bytes.compress(testimonal)));
+		Assert.assertArrayEquals(testimonial,
+				_Bytes.decompress(_Bytes.compress(testimonial)));
 	}
 	
 	@Test
 	public void compressionRatio() throws Exception {
 		// lower is better
-		final double compressionRatio = (double)_Bytes.compress(testimonal).length / testimonal.length;
+		final double compressionRatio = (double)_Bytes.compress(testimonial).length / testimonial.length;
 		Assert.assertThat(compressionRatio, lessThan(0.7));
 	}
 	
@@ -94,10 +94,10 @@ public class BytesTest {
 	
 	@Test
 	public void base64IdentityWithTestimonial() throws Exception {
-		Assert.assertArrayEquals(testimonal,
+		Assert.assertArrayEquals(testimonial,
 				_Bytes.decodeBase64(
 						Base64.getUrlDecoder(), 
-						_Bytes.encodeToBase64(Base64.getUrlEncoder(), testimonal)));
+						_Bytes.encodeToBase64(Base64.getUrlEncoder(), testimonial)));
 	}
 	
 	// -- OPERATOR COMPOSITION
@@ -119,9 +119,9 @@ public class BytesTest {
 	
 	@Test
 	public void composedIdentityWithTestimonial() throws Exception {
-		Assert.assertArrayEquals(testimonal,
+		Assert.assertArrayEquals(testimonial,
 				_Bytes.ofCompressedUrlBase64.apply(
-						_Bytes.asCompressedUrlBase64.apply(testimonal)));
+						_Bytes.asCompressedUrlBase64.apply(testimonial)));
 	}
 	
 }

-- 
To stop receiving notification emails like this one, please contact
ahuber@apache.org.