[RFC][PATCH][icedtea-web]: Added support for signed JNLP file- Updated Patch
Dr Andrew John Hughes
ahughes at redhat.com
Mon Jul 25 06:54:00 PDT 2011
On 09:15 Thu 21 Jul , Jiri Vanek wrote:
> On 07/20/2011 10:26 PM, Deepak Bhole wrote:
> > * Saad Mohammad<smohammad at redhat.com> [2011-07-19 11:04]:
> >> > I have attached the updated copy of Patch1.
> >> >
> >> > On 07/19/2011 02:47 AM, Jiri Vanek wrote:
> >>>> > >>
> >>>> > >>I hope this is the 110% for Patch1! ;)
> >>> > >99% ;)
> >> >
> >> > This is for sure the 110% ;)
> >> >
> >> > --
> >> > Cheers,
> >> > Saad Mohammad
> >> >
> > Hi Saad,
> >
> > I have a few minor corrections for this one...
> >
> >> > +
> >> > + if (appTemplate == null&& launchJNLP == null)
> >> > + throw new NullPointerException(
> >> > + "Template JNLP file and Launching JNLP file are both null.");
> >> > + else if (appTemplate == null)
> >> > + throw new NullPointerException("Template JNLP file is null.");
> >> > + else if (launchJNLP == null)
> >> > + throw new NullPointerException("Launching JNLP file is null.");
> >> > +
> > Throwing RuntimeExceptions is generally not a good idea. Consider making
> > the above a checked exception.
>
> I believe nullpointer exception is correct here. Or it will make mess later.
> Although to repalce it with JNLMatch exception can do no harm.
>
I don't see the point of throwing an NPE, catching it and throwing it attached to something else.
> >
> >> > + XMLElement appTemplateXML = new XMLElement();
> >> > + XMLElement launchJNLPXML = new XMLElement();
> >> > +
> >> > + // Remove the comments and CDATA from the JNLP file
> >> > + final PipedInputStream pinTemplate = new PipedInputStream();
> >> > + final PipedOutputStream poutTemplate = new PipedOutputStream(pinTemplate);
> >> > + appTemplateXML.sanitizeInput(appTemplate, poutTemplate);
> >> > +
> >> > + final PipedInputStream pinJNLPFile = new PipedInputStream();
> >> > + final PipedOutputStream poutJNLPFile = new PipedOutputStream(pinJNLPFile);
> >> > + launchJNLPXML.sanitizeInput(launchJNLP, poutJNLPFile);
> >> > +
> > The above streams are never closed.
>
> I' guess, ...
>
> ...see previous email..
>
> ...l) s.close();
> }
>
>
> around s.close() yo can possibly clsoe io exception into JNLPMatcherException.
>
You need a finally block.
>
>
> Regards J.
>
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37
More information about the distro-pkg-dev
mailing list