this.contents = contents;
if (oldOwner != null) oldOwner.lostOwnership(this, oldContents); }  FlavorListener[] fs = getFlavorListeners(); if (fs.length > 0) {     boolean newFlavors = ((contents != null && oldContents == null) || (contents == null && oldContents != null)); if (!newFlavors && contents != null && oldContents != null) { DataFlavor[] df1 = contents.getTransferDataFlavors(); DataFlavor[] df2 = oldContents.getTransferDataFlavors(); newFlavors = df1.length != df2.length;  for (int i = 0; !newFlavors && i < df1.length; i++) newFlavors = !df1[i].equals(df2[i]); }  if (newFlavors) { FlavorEvent e = new FlavorEvent(this); for (int i = 0; i < fs.length; i++) fs[i].flavorsChanged(e); } }
  public synchronized void setContents(Transferable contents, ClipboardOwner owner)  {  if (this.owner != owner)    if (this.owner != null)      this.owner.lostOwnership(this, contents);   this.owner = owner;  this.contents = contents;  }