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/12 15:17:37 UTC
[commons-io] 03/06: Formatting.
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-io.git
commit 6f82a453f410ffbf03a7a518ba2de48074af7ab8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 12 09:59:04 2020 -0500
Formatting.
---
.../commons/io/input/UnixLineEndingInputStream.java | 21 ++++++++++-----------
.../io/input/WindowsLineEndingInputStream.java | 2 +-
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java b/src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java
index fba1944..1b92bb8 100644
--- a/src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java
@@ -43,7 +43,7 @@ public class UnixLineEndingInputStream extends InputStream {
* @param in The input stream to wrap
* @param ensureLineFeedAtEndOfFile true to ensure that the file ends with LF
*/
- public UnixLineEndingInputStream( final InputStream in, final boolean ensureLineFeedAtEndOfFile ) {
+ public UnixLineEndingInputStream(final InputStream in, final boolean ensureLineFeedAtEndOfFile) {
this.target = in;
this.ensureLineFeedAtEndOfFile = ensureLineFeedAtEndOfFile;
}
@@ -56,7 +56,7 @@ public class UnixLineEndingInputStream extends InputStream {
private int readWithUpdate() throws IOException {
final int target = this.target.read();
eofSeen = target == -1;
- if ( eofSeen ) {
+ if (eofSeen) {
return target;
}
slashNSeen = target == '\n';
@@ -70,19 +70,18 @@ public class UnixLineEndingInputStream extends InputStream {
@Override
public int read() throws IOException {
final boolean previousWasSlashR = slashRSeen;
- if ( eofSeen ) {
+ if (eofSeen) {
return eofGame(previousWasSlashR);
}
final int target = readWithUpdate();
- if ( eofSeen ) {
+ if (eofSeen) {
return eofGame(previousWasSlashR);
}
- if (slashRSeen)
- {
+ if (slashRSeen) {
return '\n';
}
- if ( previousWasSlashR && slashNSeen){
+ if (previousWasSlashR && slashNSeen) {
return read();
}
@@ -95,10 +94,10 @@ public class UnixLineEndingInputStream extends InputStream {
* @return The next char to output to the stream
*/
private int eofGame(final boolean previousWasSlashR) {
- if ( previousWasSlashR || !ensureLineFeedAtEndOfFile ) {
+ if (previousWasSlashR || !ensureLineFeedAtEndOfFile) {
return -1;
}
- if ( !slashNSeen ) {
+ if (!slashNSeen) {
slashNSeen = true;
return '\n';
}
@@ -119,7 +118,7 @@ public class UnixLineEndingInputStream extends InputStream {
* {@inheritDoc}
*/
@Override
- public synchronized void mark( final int readlimit ) {
- throw new UnsupportedOperationException( "Mark notsupported" );
+ public synchronized void mark(final int readlimit) {
+ throw new UnsupportedOperationException("Mark notsupported");
}
}
diff --git a/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java b/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
index 39964f7..2a81251 100644
--- a/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
@@ -44,7 +44,7 @@ public class WindowsLineEndingInputStream extends InputStream {
* @param in The input stream to wrap
* @param ensureLineFeedAtEndOfFile true to ensure that the file ends with CRLF
*/
- public WindowsLineEndingInputStream( final InputStream in, final boolean ensureLineFeedAtEndOfFile ) {
+ public WindowsLineEndingInputStream(final InputStream in, final boolean ensureLineFeedAtEndOfFile) {
this.target = in;
this.ensureLineFeedAtEndOfFile = ensureLineFeedAtEndOfFile;
}