Skip to content
Permalink
Browse files

[JENKINS-15382] removed Java 1.6 dependency

(cherry picked from commit 8240440)
  • Loading branch information...
kohsuke authored and olivergondza committed Jul 2, 2013
1 parent bcf9a84 commit 36ef7c646734582b18178f83b6bb2c13e598b610
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/src/main/java/hudson/util/TextFile.java
@@ -34,6 +34,7 @@
import java.io.RandomAccessFile;
import java.io.Reader;
import java.io.StringWriter;
import java.nio.*;
import java.nio.charset.Charset;

/**
@@ -154,7 +155,7 @@ public void write(String text) throws IOException {
byte[] tail = new byte[(int) (len-pos)];
raf.readFully(tail);

String tails = new String(tail,cs);
String tails = cs.decode(java.nio.ByteBuffer.wrap(tail)).toString();

return new String(tails.substring(Math.max(0,tails.length()-numChars))); // trim the baggage of substring by allocating a new String
} finally {

0 comments on commit 36ef7c6

Please sign in to comment.
You can’t perform that action at this time.