Skip to content

Commit

Permalink
Set java level to 7. Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimilian committed Jul 25, 2016
1 parent 936e778 commit 861d064
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -62,7 +62,7 @@

<properties>
<jenkins.version>1.608</jenkins.version> <!-- SimpleBuildWrapper.createLoggerDecorator -->
<java.level>6</java.level>
<java.level>7</java.level>
<hamcrest.version>1.3</hamcrest.version>
</properties>

Expand Down
Expand Up @@ -24,7 +24,6 @@
package hudson.plugins.timestamper.annotator;

import hudson.model.Run;
import hudson.plugins.timestamper.io.Closeables;

import java.io.BufferedInputStream;
import java.io.IOException;
Expand All @@ -34,7 +33,7 @@

/**
* Implementation of ConsoleLogParser.
*
*
* @author Steven G. Brown
*/
@Immutable
Expand All @@ -46,7 +45,7 @@ class ConsoleLogParserImpl implements ConsoleLogParser {

/**
* Create a new {@link ConsoleLogParserImpl}.
*
*
* @param pos
* the position to find in the console log file. A non-negative
* position is from the start of the file, and a negative position is
Expand All @@ -63,8 +62,7 @@ class ConsoleLogParserImpl implements ConsoleLogParser {
public ConsoleLogParser.Result seek(Run<?, ?> build) throws IOException {
ConsoleLogParser.Result result = new ConsoleLogParser.Result();
result.atNewLine = true;
InputStream inputStream = new BufferedInputStream(build.getLogInputStream());
try {
try (InputStream inputStream = new BufferedInputStream(build.getLogInputStream())) {
long posFromStart = pos;
if (pos < 0) {
posFromStart = build.getLogText().length() + pos;
Expand All @@ -80,8 +78,6 @@ public ConsoleLogParser.Result seek(Run<?, ?> build) throws IOException {
result.lineNumber++;
}
}
} finally {
Closeables.closeQuietly(inputStream);
}
return result;
}
Expand Down

0 comments on commit 861d064

Please sign in to comment.