aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp
diff options
context:
space:
mode:
authorOmair Majid <[email protected]>2013-08-30 10:56:59 -0400
committerOmair Majid <[email protected]>2013-08-30 10:56:59 -0400
commit5e403e636e5ddea669f12019555f8392157e67c1 (patch)
treec6d4400dec3a76ecbe1faaa79ef53c8e84a333d5 /netx/net/sourceforge/jnlp
parent86c0b6527f5737560419c4c61f30b05997565908 (diff)
PR1058: XFileOpenService openMultiFileDialog ClassCastException
Instead of trying to create a privileged proxy for the FileContents[] array, simply create a privileged proxy for each FileContents instance and return an array of them. 2013-08-29 Omair Majid <[email protected]> PR1058 * netx/net/sourceforge/jnlp/services/XFileOpenService.java (openMultiFileDialog): Create a privileged proxy for each FileContents instance and return an array of them.
Diffstat (limited to 'netx/net/sourceforge/jnlp')
-rw-r--r--netx/net/sourceforge/jnlp/services/XFileOpenService.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/netx/net/sourceforge/jnlp/services/XFileOpenService.java b/netx/net/sourceforge/jnlp/services/XFileOpenService.java
index 7e004e3..ac5c162 100644
--- a/netx/net/sourceforge/jnlp/services/XFileOpenService.java
+++ b/netx/net/sourceforge/jnlp/services/XFileOpenService.java
@@ -91,11 +91,12 @@ class XFileOpenService implements FileOpenService {
if (chosen == JFileChooser.APPROVE_OPTION) {
File[] files = chooser.getSelectedFiles();
int length = files.length;
- XFileContents[] xfiles = new XFileContents[length];
- for (int i = 0; i < length; i++)
- xfiles[i] = new XFileContents(files[i]);
- return (FileContents[]) ServiceUtil.createPrivilegedProxy(
- FileContents.class, xfiles);
+ FileContents[] result = new FileContents[length];
+ for (int i = 0; i < length; i++) {
+ XFileContents xfile = new XFileContents(files[i]);
+ result[i] = (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class, xfile);
+ }
+ return result;
} else {
return null;
}