src/share/classes/sun/awt/datatransfer/SunClipboard.java
Print this page
rev 9717 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by:
*** 79,89 ****
/**
* A set of <code>DataFlavor</code>s that is available on
* this clipboard. It is used for tracking changes
* of <code>DataFlavor</code>s available on this clipboard.
*/
! private volatile Set currentDataFlavors;
public SunClipboard(String name) {
super(name);
CLIPBOARD_FLAVOR_LISTENER_KEY = new StringBuffer(name + "_CLIPBOARD_FLAVOR_LISTENER_KEY");
--- 79,89 ----
/**
* A set of <code>DataFlavor</code>s that is available on
* this clipboard. It is used for tracking changes
* of <code>DataFlavor</code>s available on this clipboard.
*/
! private volatile Set<DataFlavor> currentDataFlavors;
public SunClipboard(String name) {
super(name);
CLIPBOARD_FLAVOR_LISTENER_KEY = new StringBuffer(name + "_CLIPBOARD_FLAVOR_LISTENER_KEY");
*** 339,349 ****
protected abstract long[] getClipboardFormats();
protected abstract byte[] getClipboardData(long format) throws IOException;
! private static Set formatArrayAsDataFlavorSet(long[] formats) {
return (formats == null) ? null :
DataTransferer.getInstance().
getFlavorsForFormatsAsSet(formats, flavorMap);
}
--- 339,349 ----
protected abstract long[] getClipboardFormats();
protected abstract byte[] getClipboardData(long format) throws IOException;
! private static Set<DataFlavor> formatArrayAsDataFlavorSet(long[] formats) {
return (formats == null) ? null :
DataTransferer.getInstance().
getFlavorsForFormatsAsSet(formats, flavorMap);
}
*** 418,428 ****
*
* @param formats data formats that have just been retrieved from
* this clipboard
*/
public void checkChange(long[] formats) {
! Set prevDataFlavors = currentDataFlavors;
currentDataFlavors = formatArrayAsDataFlavorSet(formats);
if (Objects.equals(prevDataFlavors, currentDataFlavors)) {
// we've been able to successfully get available on the clipboard
// DataFlavors this and previous time and they are coincident;
--- 418,428 ----
*
* @param formats data formats that have just been retrieved from
* this clipboard
*/
public void checkChange(long[] formats) {
! Set<DataFlavor> prevDataFlavors = currentDataFlavors;
currentDataFlavors = formatArrayAsDataFlavorSet(formats);
if (Objects.equals(prevDataFlavors, currentDataFlavors)) {
// we've been able to successfully get available on the clipboard
// DataFlavors this and previous time and they are coincident;