Fixing situations related to #68586: use a specific ClassLoader when making javaee5_merge5
authorjglick@netbeans.org
Wed, 16 Nov 2005 21:44:50 +0000
changeset 87bd6cb339885b
parent 86 c7f69e7c0a03
child 88 2f9f8798c64d
Fixing situations related to #68586: use a specific ClassLoader when making
class-based DataFlavor's, to avoid reliance on the context class loader.
openide.util/src/org/openide/util/datatransfer/ExTransferable.java
     1.1 --- a/openide.util/src/org/openide/util/datatransfer/ExTransferable.java	Fri Nov 11 23:14:02 2005 +0000
     1.2 +++ b/openide.util/src/org/openide/util/datatransfer/ExTransferable.java	Wed Nov 16 21:44:50 2005 +0000
     1.3 @@ -7,22 +7,20 @@
     1.4   * http://www.sun.com/
     1.5   *
     1.6   * The Original Code is NetBeans. The Initial Developer of the Original
     1.7 - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
     1.8 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
     1.9   * Microsystems, Inc. All Rights Reserved.
    1.10   */
    1.11 +
    1.12  package org.openide.util.datatransfer;
    1.13  
    1.14 -import org.openide.util.NbBundle;
    1.15 -
    1.16 -import java.awt.datatransfer.*;
    1.17 -
    1.18 +import java.awt.datatransfer.DataFlavor;
    1.19 +import java.awt.datatransfer.Transferable;
    1.20 +import java.awt.datatransfer.UnsupportedFlavorException;
    1.21  import java.io.IOException;
    1.22 -
    1.23  import java.util.HashSet;
    1.24  import java.util.LinkedHashMap;
    1.25 -
    1.26  import javax.swing.event.EventListenerList;
    1.27 -
    1.28 +import org.openide.util.NbBundle;
    1.29  
    1.30  /** Provides additional operations on
    1.31  * a transferable.
    1.32 @@ -35,10 +33,17 @@
    1.33  
    1.34      /** Flavor for transfer of multiple objects.
    1.35      */
    1.36 -    public static final DataFlavor multiFlavor = new DataFlavor(
    1.37 -            "application/x-java-openide-multinode;class=org.openide.util.datatransfer.MultiTransferObject", // NOI18N
    1.38 -            NbBundle.getBundle(ExTransferable.class).getString("transferFlavorsMultiFlavorName")
    1.39 -        );
    1.40 +    public static final DataFlavor multiFlavor;
    1.41 +    static {
    1.42 +        try {
    1.43 +            multiFlavor = new DataFlavor(
    1.44 +                    "application/x-java-openide-multinode;class=org.openide.util.datatransfer.MultiTransferObject", // NOI18N
    1.45 +                    NbBundle.getBundle(ExTransferable.class).getString("transferFlavorsMultiFlavorName"),
    1.46 +                    MultiTransferObject.class.getClassLoader());
    1.47 +        } catch (ClassNotFoundException e) {
    1.48 +            throw new AssertionError(e);
    1.49 +        }
    1.50 +    }
    1.51  
    1.52      /** hash map that assigns objects to dataflavors (DataFlavor, Single) */
    1.53      private LinkedHashMap map;