<br clear="all">Dear Sir.<br><br>Thank you for your reply. My apologies for the delay in reply as I get a chance to work on this in after office hours. I will study this and give you further findings on the same.<br><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;min-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 10:26 AM, Weijun Wang <span dir="ltr"><<a href="mailto:weijun.wang@oracle.com" target="_blank">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">

[ Removed several CC ]<br>
<br>
Thanks for watching the code changes of JDK 8.<br>
<br>
In this test, if the file does not exist, it's certainly a failure. Either the test itself is not complete (if pinfile not found), or the first part of the test has some error (if cfile not found). In either case, a FileNotFoundException will be thrown. The exception is unhandled and the test will report a failure. By looking at the stack trace for the exception, we will have a basic understanding of where the problem is.<br>


<br>
Isn't that what a regression test is for?<br>
<br>
There are altogether 3 try keywords here. The first is a normal try-catch, and you can see only IllegalBlockSizeException is caught. The other 2 ones are of the new try-with-resources JDK 7 feature. See<br>
<br>
<br>
<a href="http://download.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html" target="_blank">http://download.oracle.com/<u></u>javase/tutorial/essential/<u></u>exceptions/tryResourceClose.<u></u>html</a><br>


<br>
The color describes the code changes, red means removed, and green newly added. You can always click the "file" link to view the final version.<br>
<br>
Thanks<br>
Max<div><div></div><div><br>
<br>
On 07/22/2011 12:42 PM, jitesh dundas wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>
<br>
Dear Sir.<br>
<br>
Thank you for your reply.<br>
<br>
* I was going through the code of your below patch and I thought of<br>
maybe pointing you to this direction:-<br>
<br>
*<br>
catch (IllegalBlockSizeException ex) {<br>
- if ((totalInputLen % 8 != 0) && (padding.equals("NoPadding")))<br>
+ try (FileInputStream fin = new FileInputStream(pinfile);<br>
+ BufferedInputStream pin = new BufferedInputStream(fin);<br>
+ FileOutputStream fout = new FileOutputStream(cfile);<br>
+ BufferedOutputStream cout = new BufferedOutputStream(fout)) {<br>
+ cipher.init(Cipher.ENCRYPT_<u></u>MODE, cipherKey, params);<br>
+<br>
+ while ((len = pin.read(input, 0, bufferLen)) > 0) {<br>
+ totalInputLen += len;<br>
+ byte[] output = cipher.update(input, 0, len);<br>
+ cout.write(output, 0, output.length);<br>
+ }<br>
+<br>
+ len = cipher.getOutputSize(0);<br>
+<br>
+ byte[] out = new byte[len];<br>
+ len = cipher.doFinal(out, 0);<br>
+ cout.write(out, 0, len);<br>
+ }<br>
*+ *<br>
*+ try (FileInputStream fin = new FileInputStream(cfile); *<br>
*+ BufferedInputStream cin = new BufferedInputStream(fin); *<br>
*+ FileOutputStream fout = new FileOutputStream(poutfile); *<br>
*+ BufferedOutputStream pout = new BufferedOutputStream(fout)) { *<br>
+ cipher.init(Cipher.DECRYPT_<u></u>MODE, cipherKey, params);<br>
+<br>
+ byte[] output = null;<br>
+ while ((len = cin.read(input, 0, bufferLen)) > 0) {<br>
+ output = cipher.update(input, 0, len);<br>
+ pout.write(output, 0, output.length);<br>
+ }<br>
+<br>
+ len = cipher.getOutputSize(0);<br>
+ byte[] out = new byte[len];<br>
+ len = cipher.doFinal(out, 0);<br>
+ pout.write(out, 0, len);<br>
+ }<br>
+<br>
+ diff(pinfile, poutfile);<br>
*+ } catch (IllegalBlockSizeException ex) { *<br>
*+ if ((totalInputLen % 8 != 0) && (padding.equals("NoPadding"))) { *<br>
**return;<br>
- else {<br>
<br>
*I think that this needs a more specific approach to handling<br>
exceptions. What if a file is not found? general exception handling is<br>
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<br>
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<br>
the code. My apologies for the ignorance as  am new to this group and<br>
still getting started...<br>
<br>
Nice work....<br>
*<br>
<br>
Please let me know if you need anything else from my side.<br>
<br>
Thanks & Regards,<br>
Jitesh Dundas<br>
<br>
<a href="http://openwetware.org/wiki/Jitesh_Dundas_Lab" target="_blank">http://openwetware.org/wiki/<u></u>Jitesh_Dundas_Lab</a><br>
<br>
Phone:- +91-9004618282<br>
<br>
<br>
<br>
<br>
On Fri, Jul 22, 2011 at 7:55 AM, <<a href="mailto:weijun.wang@oracle.com" target="_blank">weijun.wang@oracle.com</a><br></div></div><div>
<mailto:<a href="mailto:weijun.wang@oracle.com" target="_blank">weijun.wang@oracle.com</a><u></u>>> wrote:<br>
<br>
    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/<u></u>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/<u></u>Cipher/DES/PaddingTest.java<br>
<br>
<br>
</div></blockquote>
</blockquote></div><br>