-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b70
-
generic
-
generic
A DESCRIPTION OF THE FIX :
BUG ID: None -->eliminate compiler warnings from the TransferHandler.
file(s): javax.swing.TransferHandler
JDK: jdk-6-rc-bin-b64-linux-i586-15_dec_2005.bin
This patch eliminates compiler warnings: deprecated methods, non generic use of instances, etc...
I implemented 2 small patches for other classes and in both cases the volume of compiler warnings was inflated by this class. Hence I decided to reduce a major source of the clutter.
unified diff:
--- /home/nstuff/java6/jdk1.6.0/javax/swing/TransferHandler.java Thu Dec 15 02:17:39 2005
+++ /home/javarefs/javax/swing/TransferHandler.java Fri Jan 6 21:06:55 2006
@@ -56,7 +56,7 @@
* @since 1.4
*/
public class TransferHandler implements Serializable {
-
+ static final long serialVersionUID = -3484629443370726912L;
/**
* An <code>int</code> representing no transfer action.
*/
@@ -839,7 +839,7 @@
* has data of the type represented by property type. Null is
* returned if there is no match.
*/
- private DataFlavor getPropertyDataFlavor(Class k, DataFlavor[] flavors) {
+ private DataFlavor getPropertyDataFlavor(Class<?> k, DataFlavor[] flavors) {
for(int i = 0; i < flavors.length; i++) {
DataFlavor flavor = flavors[i];
if ("application".equals(flavor.getPrimaryType()) &&
@@ -955,7 +955,7 @@
* implementations install to manipulate a drop insertion location.
*/
static class SwingDropTarget extends DropTarget implements UIResource {
-
+ static final long serialVersionUID = 7543339017631048676L;
SwingDropTarget(Component c) {
super();
setComponent(c);
@@ -1048,7 +1048,7 @@
private static class DropHandler implements DropTargetListener,
Serializable,
ActionListener {
-
+ static final long serialVersionUID = 5676466986181769442L;
private Timer timer;
private Point lastPosition;
private Rectangle outer = new Rectangle();
@@ -1077,7 +1077,7 @@
private void updateAutoscrollRegion(JComponent c) {
// compute the outer
Rectangle visible = c.getVisibleRect();
- outer.reshape(visible.x, visible.y, visible.width, visible.height);
+ outer.setBounds(visible.x, visible.y, visible.width, visible.height);
// compute the insets
Insets i = new Insets(0, 0, 0, 0);
@@ -1094,7 +1094,7 @@
}
// set the inner from the insets
- inner.reshape(visible.x + i.left,
+ inner.setBounds(visible.x + i.left,
visible.y + i.top,
visible.width - (i.left + i.right),
visible.height - (i.top + i.bottom));
@@ -1403,7 +1403,7 @@
}
private static class SwingDragGestureRecognizer extends DragGestureRecognizer {
-
+ static final long serialVersionUID = 1567130077767708977L;
SwingDragGestureRecognizer(DragGestureListener dgl) {
super(DragSource.getDefaultDragSource(), null, NONE, dgl);
}
JUnit TESTCASE :
This patch is about the elimination of compiler warnings. Im assuming that the compiler should be sufficient as a test.
FIX FOR BUG NUMBER:
NONE --> eliminate compiler warnings from the TransferHandler
BUG ID: None -->eliminate compiler warnings from the TransferHandler.
file(s): javax.swing.TransferHandler
JDK: jdk-6-rc-bin-b64-linux-i586-15_dec_2005.bin
This patch eliminates compiler warnings: deprecated methods, non generic use of instances, etc...
I implemented 2 small patches for other classes and in both cases the volume of compiler warnings was inflated by this class. Hence I decided to reduce a major source of the clutter.
unified diff:
--- /home/nstuff/java6/jdk1.6.0/javax/swing/TransferHandler.java Thu Dec 15 02:17:39 2005
+++ /home/javarefs/javax/swing/TransferHandler.java Fri Jan 6 21:06:55 2006
@@ -56,7 +56,7 @@
* @since 1.4
*/
public class TransferHandler implements Serializable {
-
+ static final long serialVersionUID = -3484629443370726912L;
/**
* An <code>int</code> representing no transfer action.
*/
@@ -839,7 +839,7 @@
* has data of the type represented by property type. Null is
* returned if there is no match.
*/
- private DataFlavor getPropertyDataFlavor(Class k, DataFlavor[] flavors) {
+ private DataFlavor getPropertyDataFlavor(Class<?> k, DataFlavor[] flavors) {
for(int i = 0; i < flavors.length; i++) {
DataFlavor flavor = flavors[i];
if ("application".equals(flavor.getPrimaryType()) &&
@@ -955,7 +955,7 @@
* implementations install to manipulate a drop insertion location.
*/
static class SwingDropTarget extends DropTarget implements UIResource {
-
+ static final long serialVersionUID = 7543339017631048676L;
SwingDropTarget(Component c) {
super();
setComponent(c);
@@ -1048,7 +1048,7 @@
private static class DropHandler implements DropTargetListener,
Serializable,
ActionListener {
-
+ static final long serialVersionUID = 5676466986181769442L;
private Timer timer;
private Point lastPosition;
private Rectangle outer = new Rectangle();
@@ -1077,7 +1077,7 @@
private void updateAutoscrollRegion(JComponent c) {
// compute the outer
Rectangle visible = c.getVisibleRect();
- outer.reshape(visible.x, visible.y, visible.width, visible.height);
+ outer.setBounds(visible.x, visible.y, visible.width, visible.height);
// compute the insets
Insets i = new Insets(0, 0, 0, 0);
@@ -1094,7 +1094,7 @@
}
// set the inner from the insets
- inner.reshape(visible.x + i.left,
+ inner.setBounds(visible.x + i.left,
visible.y + i.top,
visible.width - (i.left + i.right),
visible.height - (i.top + i.bottom));
@@ -1403,7 +1403,7 @@
}
private static class SwingDragGestureRecognizer extends DragGestureRecognizer {
-
+ static final long serialVersionUID = 1567130077767708977L;
SwingDragGestureRecognizer(DragGestureListener dgl) {
super(DragSource.getDefaultDragSource(), null, NONE, dgl);
}
JUnit TESTCASE :
This patch is about the elimination of compiler warnings. Im assuming that the compiler should be sufficient as a test.
FIX FOR BUG NUMBER:
NONE --> eliminate compiler warnings from the TransferHandler