[RFC][icedtea-web:netx]: handle error code returning functions
Denis Lila
dlila at redhat.com
Wed Mar 9 14:35:58 PST 2011
Hi.
findbugs found 10 cases where we call methods such as
File.delete() and File.mkdirs() that can fail without
throwing exceptions and we don't handle the return
value that indicates error. The attach patch attempts
to fix that.
I haven't tested it yet. I will do so tomorrow. I just
wanted to get some feedback on the way I'm handling things.
ChangeLog:
+ * netx/net/sourceforge/jnlp/Launcher.java
+ (markNetxRunning): Throw exception if directories can't be created.
+ * netx/net/sourceforge/jnlp/cache/CacheDirectory.java
+ (cleanParent): Print error message if file can't be deleted.
+ * netx/net/sourceforge/jnlp/cache/CacheUtil.java
+ (getCacheFile): Throw exception if directories can't be created.
+ * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
+ (save): Throw exception if directories can't be created.
+ * netx/net/sourceforge/jnlp/controlpanel/CachePane.java
+ (createButtonPanel): Print error message if file can't be deleted.
+ * netx/net/sourceforge/jnlp/resources/Messages.properties
+ Added messages.
+ * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
+ (initializeStreams): Throw exception if directories can't be created.
+ * netx/net/sourceforge/jnlp/services/XPersistenceService.java
+ (create, get): Throw exception if directories can't be created.
+ (delete): Print error message if file can't be deleted.
+ * netx/net/sourceforge/jnlp/util/FileUtils.java
+ (createRestrictedFile): Throw exceptin if file permissions can't be
+ changed.
Regards,
Denis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deleteMkdirs.patch
Type: text/x-patch
Size: 11269 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20110309/b8c971fc/deleteMkdirs.patch
More information about the distro-pkg-dev
mailing list