<br clear="all">Dear Sir.<br><br>Thank you for your reply.<br><br><b> I was going through the code of your below patch and I thought of maybe pointing you to this direction:-<br><br></b><div style="color:#cc0000;">     catch (IllegalBlockSizeException ex) {
</div><div style="color:#cc0000;">-            if ((totalInputLen % 8 != 0) && (padding.equals("NoPadding")))
</div><div style="color:#008800;">+            try (FileInputStream fin = new FileInputStream(pinfile);
</div><div style="color:#008800;">+                    BufferedInputStream pin = new BufferedInputStream(fin);
</div><div style="color:#008800;">+                    FileOutputStream fout = new FileOutputStream(cfile);
</div><div style="color:#008800;">+                    BufferedOutputStream cout = new BufferedOutputStream(fout)) {
</div><div style="color:#008800;">+                cipher.init(Cipher.ENCRYPT_MODE, cipherKey, params);
</div><div style="color:#008800;">+
</div><div style="color:#008800;">+                while ((len = pin.read(input, 0, bufferLen)) > 0) {
</div><div style="color:#008800;">+                    totalInputLen += len;
</div><div style="color:#008800;">+                    byte[] output = cipher.update(input, 0, len);
</div><div style="color:#008800;">+                    cout.write(output, 0, output.length);
</div><div style="color:#008800;">+                }
</div><div style="color:#008800;">+
</div><div style="color:#008800;">+                len = cipher.getOutputSize(0);
</div><div style="color:#008800;">+
</div><div style="color:#008800;">+                byte[] out = new byte[len];
</div><div style="color:#008800;">+                len = cipher.doFinal(out, 0);
</div><div style="color:#008800;">+                cout.write(out, 0, len);
</div><div style="color:#008800;">+            }
</div><div style="color:#008800;"><b>+
</b></div><div style="color:#008800;"><b>+            try (FileInputStream fin = new FileInputStream(cfile);
</b></div><div style="color:#008800;"><b>+                    BufferedInputStream cin = new BufferedInputStream(fin);
</b></div><div style="color:#008800;"><b>+                    FileOutputStream fout = new FileOutputStream(poutfile);
</b></div><div style="color:#008800;"><b>+                    BufferedOutputStream pout = new BufferedOutputStream(fout)) {
</b></div><div style="color:#008800;">+                cipher.init(Cipher.DECRYPT_MODE, cipherKey, params);
</div><div style="color:#008800;">+
</div><div style="color:#008800;">+                byte[] output = null;
</div><div style="color:#008800;">+                while ((len = cin.read(input, 0, bufferLen)) > 0) {
</div><div style="color:#008800;">+                    output = cipher.update(input, 0, len);
</div><div style="color:#008800;">+                    pout.write(output, 0, output.length);
</div><div style="color:#008800;">+                }
</div><div style="color:#008800;">+
</div><div style="color:#008800;">+                len = cipher.getOutputSize(0);
</div><div style="color:#008800;">+                byte[] out = new byte[len];
</div><div style="color:#008800;">+                len = cipher.doFinal(out, 0);
</div><div style="color:#008800;">+                pout.write(out, 0, len);
</div><div style="color:#008800;">+            }
</div><div style="color:#008800;">+
</div><div style="color:#008800;">+            diff(pinfile, poutfile);
</div><div style="color:#008800;"><b>+        } catch (IllegalBlockSizeException ex) {
</b></div><div style="color:#008800;"><b>+            if ((totalInputLen % 8 != 0) && (padding.equals("NoPadding"))) {
</b></div><div><b>                 </b>return;
</div><div style="color:#cc0000;">-            else {<br><br><b>I think that this needs a more specific approach to handling exceptions. What if a file is not found? general exception handling is ok but not a standard way of doing that.<br>
<br>May i suggest:-<br>1) if you are using a try-catch, please put specific error handlers in place. I am sure that you aware of that..<br><br><br>also, is this code commented. i do not know the meaning of each color in the code. My apologies for the ignorance as  am new to this group and still getting started...<br>
<br>Nice work....<br></b></div><br>Please let me know if you need anything else from my side.<br><br clear="all">Thanks & Regards,<br>Jitesh Dundas<br><br><a href="http://openwetware.org/wiki/Jitesh_Dundas_Lab" target="_blank">http://openwetware.org/wiki/Jitesh_Dundas_Lab</a><span style="padding-right:16px;width:16px;height:16px"></span><span style="padding-right:16px;width:16px;min-height:16px"></span><span style="padding-right:16px;width:16px;min-height:16px"></span><br>






<br>Phone:- +91-9004618282<div><br></div><br>
<br><br><div class="gmail_quote">On Fri, Jul 22, 2011 at 7:55 AM,  <span dir="ltr"><<a href="mailto:weijun.wang@oracle.com">weijun.wang@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Changeset: c8dbb9e19355<br>
Author:    weijun<br>
Date:      2011-07-22 10:25 +0800<br>
URL:       <a href="http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c8dbb9e19355" target="_blank">http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c8dbb9e19355</a><br>
<br>
6330275: Rework the PaddingTest regression test.<br>
Reviewed-by: wetmore, smarks<br>
<br>
! test/ProblemList.txt<br>
! test/com/sun/crypto/provider/Cipher/DES/PaddingTest.java<br>
<br>
</blockquote></div><br>