diff options
author | Claude Brisson <cbrisson@apache.org> | 2017-01-28 19:21:08 +0000 |
---|---|---|
committer | Claude Brisson <cbrisson@apache.org> | 2017-01-28 19:21:08 +0000 |
commit | 23e6d0faeb4648ec700481fb3f01214bd81f4f79 (patch) | |
tree | 9dcf8c9be8710fa85f2dd31ea18604584445882f /velocity-engine-core/src/main/java/org/apache/velocity/io | |
parent | 34e78d04e1edf70a291f2acbf9d891466bc9582a (diff) | |
download | apache-velocity-engine-23e6d0faeb4648ec700481fb3f01214bd81f4f79.tar.gz |
[engine] full code review (foreach loops and some other problems detected by code analysis tools)
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1780734 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/main/java/org/apache/velocity/io')
3 files changed, 7 insertions, 7 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/io/Filter.java b/velocity-engine-core/src/main/java/org/apache/velocity/io/Filter.java index 2ff2e8bd..021e43e7 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/io/Filter.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/io/Filter.java @@ -28,5 +28,5 @@ import java.io.IOException; public interface Filter { - public void writeReference(String ref) throws IOException; + void writeReference(String ref) throws IOException; } diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/io/UnicodeInputStream.java b/velocity-engine-core/src/main/java/org/apache/velocity/io/UnicodeInputStream.java index 65748f7d..ce9bbb06 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/io/UnicodeInputStream.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/io/UnicodeInputStream.java @@ -194,7 +194,7 @@ public class UnicodeInputStream return (encoding != null) ? encoding.getEncoding() : null; } - private final UnicodeBOM match(final UnicodeBOM matchEncoding, final UnicodeBOM noMatchEncoding) + private UnicodeBOM match(final UnicodeBOM matchEncoding, final UnicodeBOM noMatchEncoding) throws IOException { byte [] bom = matchEncoding.getBytes(); @@ -218,7 +218,7 @@ public class UnicodeInputStream return matchEncoding; } - private final boolean readByte() + private boolean readByte() throws IOException { int res = inputStream.read(); @@ -236,7 +236,7 @@ public class UnicodeInputStream return true; } - private final void pushback(final UnicodeBOM matchBOM) + private void pushback(final UnicodeBOM matchBOM) throws IOException { int count = pos; // By default, all bytes are pushed back. diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/io/VelocityWriter.java b/velocity-engine-core/src/main/java/org/apache/velocity/io/VelocityWriter.java index c09681b0..40817ca4 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/io/VelocityWriter.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/io/VelocityWriter.java @@ -120,7 +120,7 @@ public final class VelocityWriter extends Writer implements Filter * flushing the stream itself. This method is non-private only so that it * may be invoked by PrintStream. */ - private final void flushBuffer() throws IOException + private void flushBuffer() throws IOException { if (bufferSize == 0) return; @@ -138,7 +138,7 @@ public final class VelocityWriter extends Writer implements Filter nextChar = 0; } - private final void bufferOverflow() throws IOException + private void bufferOverflow() throws IOException { throw new IOException("overflow"); } @@ -204,7 +204,7 @@ public final class VelocityWriter extends Writer implements Filter * <code>java.lang.Math</code> if we've run out of file * descriptors and we're trying to print a stack trace. */ - private final int min(int a, int b) + private int min(int a, int b) { return (a < b ? a : b); } |