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:36 UTC
[commons-io] 02/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 f17997c19b67bb07d51124ba751d5fc7f6e892b0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 12 09:58:14 2020 -0500
Formatting.
---
.../io/input/WindowsLineEndingInputStream.java | 23 +++++++++++-----------
1 file changed, 11 insertions(+), 12 deletions(-)
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 ccf321e..39964f7 100644
--- a/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
@@ -57,7 +57,7 @@ public class WindowsLineEndingInputStream extends InputStream {
private int readWithUpdate() throws IOException {
final int target = this.target.read();
eofSeen = target == -1;
- if ( eofSeen ) {
+ if (eofSeen) {
return target;
}
slashRSeen = target == '\r';
@@ -70,20 +70,19 @@ public class WindowsLineEndingInputStream extends InputStream {
*/
@Override
public int read() throws IOException {
- if ( eofSeen ) {
+ if (eofSeen) {
return eofGame();
- } else if ( injectSlashN ) {
+ } else if (injectSlashN) {
injectSlashN = false;
return '\n';
} else {
final boolean prevWasSlashR = slashRSeen;
final int target = readWithUpdate();
- if ( eofSeen ) {
+ if (eofSeen) {
return eofGame();
}
- if ( target == '\n' ) {
- if ( !prevWasSlashR )
- {
+ if (target == '\n') {
+ if (!prevWasSlashR) {
injectSlashN = true;
return '\r';
}
@@ -98,14 +97,14 @@ public class WindowsLineEndingInputStream extends InputStream {
*/
private int eofGame() {
- if ( !ensureLineFeedAtEndOfFile ) {
+ if (!ensureLineFeedAtEndOfFile) {
return -1;
}
- if ( !slashNSeen && !slashRSeen ) {
+ if (!slashNSeen && !slashRSeen) {
slashRSeen = true;
return '\r';
}
- if ( !slashNSeen ) {
+ if (!slashNSeen) {
slashRSeen = false;
slashNSeen = true;
return '\n';
@@ -127,7 +126,7 @@ public class WindowsLineEndingInputStream extends InputStream {
* {@inheritDoc}
*/
@Override
- public synchronized void mark( final int readlimit ) {
- throw new UnsupportedOperationException( "Mark not supported" );
+ public synchronized void mark(final int readlimit) {
+ throw new UnsupportedOperationException("Mark not supported");
}
}