diff options
author | Veronika Irvine <veronika> | 2004-11-16 20:12:12 +0000 |
---|---|---|
committer | Veronika Irvine <veronika> | 2004-11-16 20:12:12 +0000 |
commit | 6cc167878be759cb98ee6bf5f21d6694a32cc4e4 (patch) | |
tree | 20860f6a95d2667455c5851bb0d23622cdfbce96 /bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java | |
parent | f753371bde5263ae126944d176335b7c49501cdc (diff) | |
download | eclipse.platform.swt-6cc167878be759cb98ee6bf5f21d6694a32cc4e4.tar.gz eclipse.platform.swt-6cc167878be759cb98ee6bf5f21d6694a32cc4e4.tar.xz eclipse.platform.swt-6cc167878be759cb98ee6bf5f21d6694a32cc4e4.zip |
Add validation checking for transfer types
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java index b15839aa4b..8d3993b478 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java @@ -63,7 +63,7 @@ public static FileTransfer getInstance () { */ public void javaToNative(Object object, TransferData transferData) { transferData.result = 0; - if (!validate(object) || !isSupportedType(transferData)) { + if (!_validate(object) || !isSupportedType(transferData)) { DND.error(DND.ERROR_INVALID_DATA); } String[] files = (String[])object; @@ -186,7 +186,7 @@ protected String[] getTypeNames(){ return new String[]{URI_LIST}; } -protected boolean validate(Object object) { +boolean _validate(Object object) { if (object == null || !(object instanceof String[]) || ((String[])object).length == 0) return false; String[] strings = (String[])object; for (int i = 0; i < strings.length; i++) { @@ -194,4 +194,8 @@ protected boolean validate(Object object) { } return true; } + +protected boolean validate(Object object) { + return _validate(object); +} } |