src/java.desktop/unix/classes/sun/awt/X11/XDragSourceContextPeer.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -108,22 +108,21 @@
       throws InvalidDnDOperationException {
     theInstance.setTrigger(dge);
         return theInstance;
     }
 
-    @SuppressWarnings("deprecation")
     protected void startDrag(Transferable transferable,
                              long[] formats, Map<Long, DataFlavor> formatMap) {
         Component component = getTrigger().getComponent();
         Component c = null;
         XWindowPeer wpeer = null;
 
         for (c = component; c != null && !(c instanceof Window);
              c = AWTAccessor.getComponentAccessor().getParent(c));
 
         if (c instanceof Window) {
-            wpeer = (XWindowPeer)c.getPeer();
+            wpeer = AWTAccessor.getComponentAccessor().getPeer(c);
         }
 
         if (wpeer == null) {
             throw new InvalidDnDOperationException(
                 "Cannot find top-level for the drag source component");