jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java

Print this page
rev 5675 : 7186946: Refine unpacker resource usage
Reviewed-by: jrose, jjh, mschoene

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -105,11 +105,11 @@
      * Closes its input but not its output.  (The output can accumulate more elements.)
      * @param in an InputStream.
      * @param out a JarOutputStream.
      * @exception IOException if an error is encountered.
      */
-    public void unpack(InputStream in, JarOutputStream out) throws IOException {
+    public synchronized void unpack(InputStream in, JarOutputStream out) throws IOException {
         if (in == null) {
             throw new NullPointerException("null input");
         }
         if (out == null) {
             throw new NullPointerException("null output");

@@ -150,11 +150,11 @@
      * Does not close its output.  (The output can accumulate more elements.)
      * @param in a File.
      * @param out a JarOutputStream.
      * @exception IOException if an error is encountered.
      */
-    public void unpack(File in, JarOutputStream out) throws IOException {
+    public synchronized void unpack(File in, JarOutputStream out) throws IOException {
         if (in == null) {
             throw new NullPointerException("null input");
         }
         if (out == null) {
             throw new NullPointerException("null output");