You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/12/16 22:15:31 UTC

[commons-vfs] branch master updated (2ce2648 -> 1db6b4b)

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

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git.


    from 2ce2648  Allow Spotbugs to run from the build.
     new 2c3d380  Fix Spotbugs issue.
     new 1db6b4b  Fix Spotbugs issue.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commons/vfs2/provider/ram/RamFileRandomAccessContent.java     | 3 ++-
 .../src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java | 8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)


[commons-vfs] 02/02: Fix Spotbugs issue.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git

commit 1db6b4b31ffb5c3c1153fbbdb84c34e47f836ef1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Dec 16 17:15:15 2020 -0500

    Fix Spotbugs issue.
---
 .../apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
index 26c4b9d..644df8e 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
@@ -22,6 +22,7 @@ import java.io.DataOutputStream;
 import java.io.EOFException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.Charset;
 
 import org.apache.commons.vfs2.RandomAccessContent;
 import org.apache.commons.vfs2.util.RandomAccessMode;
@@ -461,7 +462,7 @@ public class RamFileRandomAccessContent implements RandomAccessContent {
      */
     @Override
     public void writeBytes(final String s) throws IOException {
-        write(s.getBytes());
+        write(s.getBytes(Charset.defaultCharset()));
     }
 
     /*


[commons-vfs] 01/02: Fix Spotbugs issue.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git

commit 2c3d3807149c2849aef15c8bf91d9ef970a5e7b2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Dec 16 17:10:07 2020 -0500

    Fix Spotbugs issue.
---
 .../src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java
index 313ba75..e80ca8d 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java
@@ -19,6 +19,7 @@ package org.apache.commons.vfs2.tasks;
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.Charset;
 import java.util.Date;
 
 import org.apache.commons.vfs2.FileContent;
@@ -124,10 +125,9 @@ public class ShowFileTask extends VfsTask {
      * Writes the content of the file to Ant log.
      */
     private void logContent(final FileObject file, final String prefix) throws Exception {
-        try (
-            final InputStream instr = file.getContent().getInputStream();
-            final BufferedReader reader = new BufferedReader(new InputStreamReader(instr)); )
-        {
+        try (final FileContent content = file.getContent();
+            final InputStream instr = content.getInputStream();
+            final BufferedReader reader = new BufferedReader(new InputStreamReader(instr, Charset.defaultCharset()))) {
             while (true) {
                 final String line = reader.readLine();
                 if (line == null) {