You can always fix and send a PR :) On Mon, Oct 26, 2015 at 12:19 PM, Gayan Gunawardana <ga...@wso2.com> wrote:
> Hi Kernel Team, > > Referring to location [1] there will be possible code Improvement. > > public static void copyInputStream(InputStream in, OutputStream out) > throws IOException { > byte[] buf = new byte[BYTE_ARRAY_SIZE]; > int len; > while ((len = in.read(buf)) > 0) { > out.write(buf, 0, len); > } > > in.close(); > out.close(); > } > > If in.close() throws an IOException, out.close() would not be executed. > Can you please look into this ? > > [1] > https://github.com/wso2/carbon-kernel/blob/master/core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/utils/IOStreamUtils.java > > Thanks, > Gayan > -- > Gayan Gunawardana > Software Engineer; WSO2 Inc.; http://wso2.com/ > Email: ga...@wso2.com > Mobile: +94 (71) 8020933 > -- *Kishanthan Thangarajah* Associate Technical Lead, Platform Technologies Team, WSO2, Inc. lean.enterprise.middleware Mobile - +94773426635 Blog - *http://kishanthan.wordpress.com <http://kishanthan.wordpress.com>* Twitter - *http://twitter.com/kishanthan <http://twitter.com/kishanthan>*
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev