jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncBufferedOutputStream.java
changeset 10694 cf59e2badd14
parent 1337 e8d6cef36199
child 18780 f47b920867e7
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncBufferedOutputStream.java	Mon Sep 26 11:48:37 2011 -0700
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncBufferedOutputStream.java	Mon Sep 26 17:20:45 2011 -0700
@@ -33,8 +33,8 @@
 
         final byte[] buf;
         static final int size=8*1024;
-        private static ThreadLocal bufCahce = new ThreadLocal() {
-        protected synchronized Object initialValue() {
+        private static ThreadLocal<byte[]> bufCahce = new ThreadLocal<byte[]>() {
+        protected synchronized byte[] initialValue() {
             return new byte[size];
         }
     };
@@ -44,7 +44,7 @@
          * @param out the outputstream to buffer
          */
         public UnsyncBufferedOutputStream(OutputStream out) {
-                buf=(byte[])bufCahce.get();
+                buf=bufCahce.get();
                 this.out=out;
         }