< prev index next >
src/java.desktop/windows/classes/sun/awt/windows/WClipboard.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1996, 2014, 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
--- 1,7 ----
/*
! * Copyright (c) 1996, 2020, 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
*** 31,41 ****
import java.io.IOException;
import java.util.Map;
import sun.awt.datatransfer.DataTransferer;
import sun.awt.datatransfer.SunClipboard;
!
/**
* A class which interfaces with the Windows clipboard in order to support
* data transfer via Clipboard operations. Most of the work is provided by
* sun.awt.datatransfer.DataTransferer.
--- 31,41 ----
import java.io.IOException;
import java.util.Map;
import sun.awt.datatransfer.DataTransferer;
import sun.awt.datatransfer.SunClipboard;
! import sun.util.logging.PlatformLogger;
/**
* A class which interfaces with the Windows clipboard in order to support
* data transfer via Clipboard operations. Most of the work is provided by
* sun.awt.datatransfer.DataTransferer.
*** 49,58 ****
--- 49,60 ----
*/
final class WClipboard extends SunClipboard {
private boolean isClipboardViewerRegistered;
+ private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.windows.WClipboard");
+
WClipboard() {
super("System");
}
@Override
*** 75,96 ****
openClipboard(this);
try {
for (Long format : formatMap.keySet()) {
DataFlavor flavor = formatMap.get(format);
-
try {
byte[] bytes = WDataTransferer.getInstance().
translateTransferable(contents, flavor, format);
publishClipboardData(format, bytes);
} catch (IOException e) {
! // Fix 4696186: don't print exception if data with
! // javaJVMLocalObjectMimeType failed to serialize.
! // May remove this if-check when 5078787 is fixed.
! if (!(flavor.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType) &&
! e instanceof java.io.NotSerializableException)) {
! e.printStackTrace();
}
}
}
} finally {
closeClipboard();
--- 77,93 ----
openClipboard(this);
try {
for (Long format : formatMap.keySet()) {
DataFlavor flavor = formatMap.get(format);
try {
byte[] bytes = WDataTransferer.getInstance().
translateTransferable(contents, flavor, format);
publishClipboardData(format, bytes);
} catch (IOException e) {
! if (log.isLoggable(PlatformLogger.Level.WARNING)) {
! log.warning("Registered service providers failed to encode ", e);
}
}
}
} finally {
closeClipboard();
< prev index next >