SUGGESTED FIX
--- XSelection.java 2007-01-12 19:22:14.000000000 +0300
***************
*** 30,36 ****
public class XSelection {
/* Maps atoms to XSelection instances. */
! private static final Hashtable table = new Hashtable();
/* Prevents from parallel selection data request processing. */
private static final Object lock = new Object();
/* The property in which the owner should place the requested data. */
--- 30,36 ----
public class XSelection {
/* Maps atoms to XSelection instances. */
! private static final Hashtable<XAtom, XSelection> table = new Hashtable<XAtom, XSelection>();
/* Prevents from parallel selection data request processing. */
private static final Object lock = new Object();
/* The property in which the owner should place the requested data. */
***************
*** 113,119 ****
* <code>null</code> if none exists.
*/
static XSelection getSelection(XAtom atom) {
! return (XSelection)table.get(atom);
}
/**
--- 113,119 ----
* <code>null</code> if none exists.
*/
static XSelection getSelection(XAtom atom) {
! return table.get(atom);
}
/**
***************
*** 746,752 ****
XSelection selection = getSelection(selectionAtom);
if (selection != null) {
selection.isSelectionNotifyProcessed = true;
! selection.clipboard.checkChange(formats);
}
}
--- 746,754 ----
XSelection selection = getSelection(selectionAtom);
if (selection != null) {
selection.isSelectionNotifyProcessed = true;
! if (selection.clipboard != null) {
! selection.clipboard.checkChange(formats);
! }
}
}
|
EVALUATION
Here is a problematic code:
XSelection selection = getSelection(selectionAtom);
if (selection != null) {
selection.isSelectionNotifyProcessed = true;
selection.clipboard.checkChange(formats);
}
it looks like sometime clipboard is null and we do not handle this (in this particular
place), all other places which work with clipboard check it for null.
So, it looks like we should also add the check here.
|