Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbvosburgh2009-07-09 05:37:30 +0000
committerbvosburgh2009-07-09 05:37:30 +0000
commit61c51e03bf03edd607fd6e9679e3765614b11a75 (patch)
tree1fc0424945c24f80a7593f0e3b122514234e335c
parentda1354ebf4b8f43372950c6d77c1652625780533 (diff)
downloadwebtools.dali-61c51e03bf03edd607fd6e9679e3765614b11a75.tar.gz
webtools.dali-61c51e03bf03edd607fd6e9679e3765614b11a75.tar.xz
webtools.dali-61c51e03bf03edd607fd6e9679e3765614b11a75.zip
fixed compiler and FindBugs warnings
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java16
29 files changed, 103 insertions, 109 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
index 3f7db2dd3e..7171467b2d 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
@@ -796,7 +796,7 @@ public class Classpath
try {
zipFile = new ZipFile(this.canonicalFile);
} catch (IOException ex) {
- return;
+ throw new RuntimeException(ex);
}
for (Enumeration<? extends ZipEntry> stream = zipFile.entries(); stream.hasMoreElements(); ) {
ZipEntry zipEntry = stream.nextElement();
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java
index 198e745a85..dc83fe8a20 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java
@@ -162,7 +162,9 @@ public final class FileTools {
throws IOException
{
File destinationFile = new File(destinationDirectory, sourceFile.getName());
- destinationFile.createNewFile();
+ if ( ! destinationFile.createNewFile()) {
+ throw new RuntimeException("createNewFile() failed: " + destinationFile); //$NON-NLS-1$
+ }
copyToFile(sourceFile, destinationFile);
}
@@ -353,10 +355,16 @@ public final class FileTools {
if (dir.exists()) {
deleteDirectoryContents(dir);
} else {
- dir.mkdirs();
+ mkdirs(dir);
}
return dir;
}
+
+ private static void mkdirs(File dir) {
+ if ( ! dir.mkdirs()) {
+ throw new RuntimeException("mkdirs() failed: " + dir); //$NON-NLS-1$
+ }
+ }
/**
* Build and return an empty temporary directory with a
@@ -378,7 +386,7 @@ public final class FileTools {
public static File temporaryDirectory(String name) {
File dir = new File(userTemporaryDirectory(), name);
if ( ! dir.exists()) {
- dir.mkdirs();
+ mkdirs(dir);
}
return dir;
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
index b3540e2395..e27c97e1cf 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
@@ -548,7 +548,7 @@ public class HashBag<E>
@Override
public boolean equals(Object o) {
- if ( ! (o instanceof Bag.Entry)) {
+ if ( ! (o instanceof Bag.Entry<?>)) {
return false;
}
@SuppressWarnings("unchecked")
@@ -826,7 +826,7 @@ public class HashBag<E>
if (o == this) {
return true;
}
- if ( ! (o instanceof Bag)) {
+ if ( ! (o instanceof Bag<?>)) {
return false;
}
@SuppressWarnings("unchecked")
@@ -890,7 +890,7 @@ public class HashBag<E>
/**
* Reconstitute the bag from a stream (i.e. deserialize it).
*/
- private synchronized void readObject(java.io.ObjectInputStream s)
+ private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
// read in the threshold, loadfactor, and any hidden stuff
s.defaultReadObject();
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java
index 523a390f73..64eeee161d 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java
@@ -512,7 +512,7 @@ public class IdentityHashBag<E>
@Override
public boolean equals(Object o) {
- if ( ! (o instanceof Bag.Entry)) {
+ if ( ! (o instanceof Bag.Entry<?>)) {
return false;
}
@SuppressWarnings("unchecked")
@@ -783,7 +783,7 @@ public class IdentityHashBag<E>
public boolean equals(Object o) {
if (o == this) {
return true;
- } else if (o instanceof IdentityHashBag) {
+ } else if (o instanceof IdentityHashBag<?>) {
@SuppressWarnings("unchecked")
IdentityHashBag<E> b = (IdentityHashBag<E>) o;
if (b.size() != this.size()) {
@@ -796,7 +796,7 @@ public class IdentityHashBag<E>
}
}
return clone.isEmpty();
- } else if (o instanceof Bag) {
+ } else if (o instanceof Bag<?>) {
// hmmm...
return this.buildBag().equals(o);
} else {
@@ -853,7 +853,7 @@ public class IdentityHashBag<E>
/**
* Reconstitute the bag from a stream (i.e. deserialize it).
*/
- private synchronized void readObject(java.io.ObjectInputStream s)
+ private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
// read in the threshold, loadfactor, and any hidden stuff
s.defaultReadObject();
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java
index 8782e07c3e..34e995f005 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java
@@ -9,11 +9,13 @@
******************************************************************************/
package org.eclipse.jpt.utility.internal;
+import java.io.Serializable;
+
/**
* Used by various "pluggable" classes to transform objects
* into strings.
*/
-public interface StringConverter<T> {
+public interface StringConverter<T> extends Serializable {
/**
* Convert the specified object into a string.
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java
index c92701cb41..fe1db01c81 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java
@@ -74,8 +74,7 @@ public class ChainIterable<E>
* building a <code>ChainIterator.Linker</code>
*/
protected E nextLink(@SuppressWarnings("unused") E currentLink) {
- // ChainIterable.nextLink(Object) was not overridden
- throw new UnsupportedOperationException();
+ throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.java
index 4ce3d2cfab..4467a1fa55 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.java
@@ -49,8 +49,7 @@ public abstract class CloneIterable<E>
* alternative to building a <code>CloneIterator.Remover</code>.
*/
protected void remove(@SuppressWarnings("unused") E element) {
- // CloneIterable.remove(Object) was not overridden
- throw new UnsupportedOperationException();
+ throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java
index 13c87e30ab..7095937217 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java
@@ -73,8 +73,7 @@ public class FilteringIterable<E1, E2>
* alternative to building a <code>Filter</code>.
*/
protected boolean accept(@SuppressWarnings("unused") E1 o) {
- // FilteringIterable.accept(Object) was not overridden
- throw new UnsupportedOperationException();
+ throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java
index 5d3449ba0a..8f18c2a68b 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java
@@ -135,8 +135,7 @@ public class GraphIterable<E>
* alternative to building a <code>GraphIterator.MisterRogers</code>.
*/
protected Iterator<? extends E> neighbors(@SuppressWarnings("unused") E next) {
- // GraphIterable.neighbors(Object) was not overridden
- throw new UnsupportedOperationException();
+ throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.java
index 5a9ed3d89d..281da951bb 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.java
@@ -67,8 +67,7 @@ public class TransformationIterable<E1, E2>
* Transform the specified object and return the result.
*/
protected E2 transform(@SuppressWarnings("unused") E1 o) {
- // TransformationIterable.transform(Object) was not overridden
- throw new UnsupportedOperationException();
+ throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java
index 0fb08049a3..49c649cae4 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java
@@ -117,8 +117,7 @@ public class TreeIterable<E>
* alternative to building a <code>TreeIterator.Midwife</code>.
*/
protected Iterator<? extends E> children(@SuppressWarnings("unused") E next) {
- // TreeIterable.children(Object) was not overridden
- throw new UnsupportedOperationException();
+ throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java
index f806eef190..ea1f008691 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java
@@ -184,7 +184,7 @@ public class ChangeSupport
* Return the listener list for the specified listener class and aspect name.
* Return null if the listener list is not present.
*/
- protected <L extends EventListener> ListenerList<L> getListenerList_(Class<L> listenerClass, String aspectName) {
+ protected synchronized <L extends EventListener> ListenerList<L> getListenerList_(Class<L> listenerClass, String aspectName) {
for (AspectListenerListPair<?> pair : this.aspectListenerListPairs) {
if (pair.matches(listenerClass, aspectName)) {
@SuppressWarnings("unchecked") ListenerList<L> aspectListenerList = (ListenerList<L>) pair.listenerList;
@@ -2767,7 +2767,7 @@ public class ChangeSupport
@Override
boolean matches(Class<? extends EventListener> listenerClass, String aspectName) {
return (aspectName == null)
- && super.matches(listenerClass, aspectName);
+ && super.matches(listenerClass, null);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java
index d189a9101c..9e13d90b57 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java
@@ -105,7 +105,7 @@ public class BufferedWritablePropertyValueModel<T>
}
@Override
public String toString() {
- return "trigger change listener";
+ return "trigger change listener"; //$NON-NLS-1$
}
};
}
@@ -185,7 +185,7 @@ public class BufferedWritablePropertyValueModel<T>
* and replace it with the new "wrapped" value, or you could throw an
* exception.
*/
- protected void handleChangeConflict(PropertyChangeEvent event) {
+ protected void handleChangeConflict(@SuppressWarnings("unused") PropertyChangeEvent event) {
// the default is to do nothing
}
@@ -274,7 +274,7 @@ public class BufferedWritablePropertyValueModel<T>
@Override
public Boolean getValue() {
if (this.value == null) {
- throw new IllegalStateException("The method Trigger.value() may only be called during change notification.");
+ throw new IllegalStateException("The method Trigger.getValue() may only be called during change notification."); //$NON-NLS-1$
}
return this.value;
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java
index 48140a0c5b..e17251765f 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -59,7 +59,7 @@ public class ItemPropertyListValueModelAdapter<E>
}
@Override
public String toString() {
- return "item property listener: " + Arrays.asList(ItemPropertyListValueModelAdapter.this.propertyNames);
+ return "item property listener: " + Arrays.asList(ItemPropertyListValueModelAdapter.this.propertyNames); //$NON-NLS-1$
}
};
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java
index 46d7d863fb..3b46440909 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -53,7 +53,7 @@ public class ItemStateListValueModelAdapter<E>
}
@Override
public String toString() {
- return "item state listener";
+ return "item state listener"; //$NON-NLS-1$
}
};
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java
index 4e20085e98..b7a2b1e1c9 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java
@@ -182,27 +182,6 @@ public class ListCollectionValueModelAdapter<E>
return ! this.hasListeners();
}
- /**
- * Return the index of the specified item, using object
- * identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o) {
- return this.lastIdentityIndexOf(o, this.collection.size());
- }
-
- /**
- * Return the last index of the specified item, starting just before the
- * the specified endpoint, and using object identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o, int end) {
- for (int i = end; i-- > 0; ) {
- if (this.collection.get(i) == o) {
- return i;
- }
- }
- return -1;
- }
-
// ********** behavior **********
@@ -262,9 +241,7 @@ public class ListCollectionValueModelAdapter<E>
// we have to remove the items individually,
// since they are probably not in sequence
for (E removedItem : removedItems) {
- int index = this.lastIdentityIndexOf(removedItem);
- this.collection.remove(index);
- this.fireItemRemoved(VALUES, removedItem);
+ this.removeItemFromCollection(removedItem, this.collection, VALUES);
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java
index 7bdb3ab3a3..8e1e705ed0 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -53,7 +53,7 @@ public final class NullListValueModel<E>
}
public E get(int index) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0");
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0"); //$NON-NLS-1$ //$NON-NLS-2$
}
public Object[] toArray() {
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.java
index a12f9e84aa..c7e5c75ffb 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.java
@@ -33,7 +33,7 @@ public class ReadOnlyWritablePropertyValueModelWrapper<T>
}
public void setValue(T value) {
- throw new UnsupportedOperationException("setValue");
+ throw new UnsupportedOperationException();
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java
index ba878e5c19..07505827bd 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -94,7 +94,7 @@ public class TransformationPropertyValueModel<T1, T2>
* Transform the specified, non-null, value and return the result.
*/
protected T2 transform_(@SuppressWarnings("unused") T1 value) {
- throw new UnsupportedOperationException();
+ throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
}
/**
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java
index 1299097bf7..e0d74fa30e 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -83,7 +83,7 @@ public class TransformationWritablePropertyValueModel<T1, T2>
* "Reverse-transform" the specified, non-null, value and return the result.
*/
protected T1 reverseTransform_(@SuppressWarnings("unused") T2 value) {
- throw new UnsupportedOperationException();
+ throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java
index a3d7e01731..0e8a30c6ea 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -50,7 +50,7 @@ public class ValuePropertyAdapter<T extends Model>
}
@Override
public String toString() {
- return "value property listener: " + Arrays.asList(ValuePropertyAdapter.this.propertyNames);
+ return "value property listener: " + Arrays.asList(ValuePropertyAdapter.this.propertyNames); //$NON-NLS-1$
}
};
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java
index d516fdbf1b..b8253a391d 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -45,7 +45,7 @@ public class ValueStateAdapter<T extends Model>
}
@Override
public String toString() {
- return "value state listener";
+ return "value state listener"; //$NON-NLS-1$
}
};
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
index 41925bea5a..5314bb9250 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
@@ -228,13 +228,13 @@ public class PreferencePropertyValueModel<P>
}
@Override
- protected void engageSubject_() {
+ protected synchronized void engageSubject_() {
this.subject.addPreferenceChangeListener(this.preferenceChangeListener);
this.value = this.buildValue();
}
@Override
- protected void disengageSubject_() {
+ protected synchronized void disengageSubject_() {
try {
this.subject.removePreferenceChangeListener(this.preferenceChangeListener);
} catch (IllegalStateException ex) {
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java
index eeb65b4965..70dec3419d 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,8 +9,11 @@
******************************************************************************/
package org.eclipse.jpt.utility.internal.model.value.swing;
+import java.io.IOException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.EventObject;
+
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.EventListenerList;
@@ -23,6 +26,7 @@ import javax.swing.text.Element;
import javax.swing.text.PlainDocument;
import javax.swing.text.Position;
import javax.swing.text.Segment;
+
import org.eclipse.jpt.utility.internal.StringTools;
import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
@@ -52,11 +56,13 @@ public class DocumentAdapter
protected final WritablePropertyValueModel<String> stringHolder;
/** A listener that allows us to synchronize with changes made to the underlying model string. */
- protected final PropertyChangeListener stringListener;
+ protected transient PropertyChangeListener stringListener;
/** The event listener list for the document. */
protected final EventListenerList listenerList = new EventListenerList();
+ private static final long serialVersionUID = 1L;
+
// ********** constructors **********
@@ -99,7 +105,7 @@ public class DocumentAdapter
}
@Override
public String toString() {
- return "string listener";
+ return "string listener"; //$NON-NLS-1$
}
};
}
@@ -310,14 +316,21 @@ public class DocumentAdapter
return StringTools.buildToStringFor(this, this.stringHolder);
}
+ private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
+ // read in any hidden stuff
+ s.defaultReadObject();
+ this.stringListener = this.buildStringListener();
+ }
+
// ********** inner class **********
- protected interface CombinedListener extends DocumentListener, UndoableEditListener {
+ protected interface CombinedListener extends DocumentListener, UndoableEditListener, Serializable {
// just consolidate the two interfaces
}
protected class InternalListener implements CombinedListener {
+ private static final long serialVersionUID = 1L;
public void changedUpdate(DocumentEvent event) {
DocumentAdapter.this.delegateChangedUpdate(event);
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java
index 484ff33c3a..1056443971 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java
@@ -67,7 +67,7 @@ public class NumberSpinnerModelAdapter
* The step size is one.
*/
public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, int defaultValue) {
- this(numberHolder, null, null, new Integer(1), new Integer(defaultValue));
+ this(numberHolder, null, null, Integer.valueOf(1), Integer.valueOf(defaultValue));
}
/**
@@ -82,22 +82,22 @@ public class NumberSpinnerModelAdapter
* Constructor - the number holder is required.
*/
public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, int minimum, int maximum, int stepSize, int defaultValue) {
- this(numberHolder, new Integer(minimum), new Integer(maximum), new Integer(stepSize), new Integer(defaultValue));
+ this(numberHolder, Integer.valueOf(minimum), Integer.valueOf(maximum), Integer.valueOf(stepSize), Integer.valueOf(defaultValue));
}
/**
* Constructor - the number holder is required.
* Use the minimum value as the default spinner value.
*/
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double value, double minimum, double maximum, double stepSize) {
- this(numberHolder, value, minimum, maximum, stepSize, minimum);
+ public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double minimum, double maximum, double stepSize) {
+ this(numberHolder, minimum, maximum, stepSize, minimum);
}
/**
* Constructor - the number holder is required.
*/
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double value, double minimum, double maximum, double stepSize, double defaultValue) {
- this(numberHolder, new Double(minimum), new Double(maximum), new Double(stepSize), new Double(defaultValue));
+ public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double minimum, double maximum, double stepSize, double defaultValue) {
+ this(numberHolder, Double.valueOf(minimum), Double.valueOf(maximum), Double.valueOf(stepSize), Double.valueOf(defaultValue));
}
/**
@@ -126,7 +126,7 @@ public class NumberSpinnerModelAdapter
}
@Override
public String toString() {
- return "number listener";
+ return "number listener"; //$NON-NLS-1$
}
};
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java
index 61d2e3701f..eef2476212 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -61,7 +61,7 @@ public class ObjectListSelectionModel
}
@Override
public String toString() {
- return "list data listener";
+ return "list data listener"; //$NON-NLS-1$
}
};
}
@@ -75,7 +75,7 @@ public class ObjectListSelectionModel
* A subclass can override this method if the selection
* should be cleared because a change could mean the selection is invalid.
*/
- protected void listModelContentsChanged(ListDataEvent event) {
+ protected void listModelContentsChanged(@SuppressWarnings("unused") ListDataEvent event) {
/**this.clearSelection();*/
}
@@ -417,7 +417,7 @@ public class ObjectListSelectionModel
// call this method inside loops that do not modify the listModel
private int indexOf(Object object, ListModel lm, int listModelSize) {
for (int i = listModelSize; i-- > 0; ) {
- if (lm.getElementAt(i) == object) {
+ if (lm.getElementAt(i).equals(object)) {
return i;
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java
index 1caee488c8..6c5c5e738d 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java
@@ -111,7 +111,7 @@ public class RadioButtonModelAdapter
* *only* when it matches our button value
*/
public boolean reverseAccept(Object value) {
- return value == this.buttonValue;
+ return (value != null) && value.equals(this.buttonValue);
}
}
@@ -135,7 +135,7 @@ public class RadioButtonModelAdapter
* button model's default value to be used
*/
public Boolean transform(Object value) {
- return (value == null) ? null : Boolean.valueOf(value == this.buttonValue);
+ return (value == null) ? null : Boolean.valueOf(value.equals(this.buttonValue));
}
/**
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java
index 56c2f54a58..30ccdd5ab8 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java
@@ -42,31 +42,31 @@ public class SimpleDisplayable
}
public SimpleDisplayable(char c) {
- this(new Character(c));
+ this(Character.valueOf(c));
}
public SimpleDisplayable(byte b) {
- this(new Byte(b));
+ this(Byte.valueOf(b));
}
public SimpleDisplayable(short s) {
- this(new Short(s));
+ this(Short.valueOf(s));
}
public SimpleDisplayable(int i) {
- this(new Integer(i));
+ this(Integer.valueOf(i));
}
public SimpleDisplayable(long l) {
- this(new Long(l));
+ this(Long.valueOf(l));
}
public SimpleDisplayable(float f) {
- this(new Float(f));
+ this(Float.valueOf(f));
}
public SimpleDisplayable(double d) {
- this(new Double(d));
+ this(Double.valueOf(d));
}
@@ -108,7 +108,7 @@ public class SimpleDisplayable
}
public void setChar(char c) {
- this.setObject(new Character(c));
+ this.setObject(Character.valueOf(c));
}
public byte getByte() {
@@ -116,7 +116,7 @@ public class SimpleDisplayable
}
public void setByte(byte b) {
- this.setObject(new Byte(b));
+ this.setObject(Byte.valueOf(b));
}
public short getShort() {
@@ -124,7 +124,7 @@ public class SimpleDisplayable
}
public void setShort(short s) {
- this.setObject(new Short(s));
+ this.setObject(Short.valueOf(s));
}
public int getInt() {
@@ -132,7 +132,7 @@ public class SimpleDisplayable
}
public void setInt(int i) {
- this.setObject(new Integer(i));
+ this.setObject(Integer.valueOf(i));
}
public long getLong() {
@@ -140,7 +140,7 @@ public class SimpleDisplayable
}
public void setLong(long l) {
- this.setObject(new Long(l));
+ this.setObject(Long.valueOf(l));
}
public float getFloat() {
@@ -148,7 +148,7 @@ public class SimpleDisplayable
}
public void setFloat(float f) {
- this.setObject(new Float(f));
+ this.setObject(Float.valueOf(f));
}
public double getDouble() {
@@ -156,7 +156,7 @@ public class SimpleDisplayable
}
public void setDouble(double d) {
- this.setObject(new Double(d));
+ this.setObject(Double.valueOf(d));
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java
index a15e16a570..8cd5d39b53 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -93,10 +93,10 @@ public class SpinnerTableCellRenderer implements TableCellEditorAdapter.Renderer
/**
* Return the cell's foreground color.
*/
- protected Color foregroundColor(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
+ protected Color foregroundColor(JTable table, @SuppressWarnings("unused") Object value, boolean selected, boolean hasFocus, int row, int column) {
if (selected) {
if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellForeground");
+ return UIManager.getColor("Table.focusCellForeground"); //$NON-NLS-1$
}
return table.getSelectionForeground();
}
@@ -106,10 +106,10 @@ public class SpinnerTableCellRenderer implements TableCellEditorAdapter.Renderer
/**
* Return the cell's background color.
*/
- protected Color backgroundColor(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
+ protected Color backgroundColor(JTable table, @SuppressWarnings("unused") Object value, boolean selected, boolean hasFocus, int row, int column) {
if (selected) {
if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellBackground");
+ return UIManager.getColor("Table.focusCellBackground"); //$NON-NLS-1$
}
return table.getSelectionBackground();
}
@@ -119,9 +119,9 @@ public class SpinnerTableCellRenderer implements TableCellEditorAdapter.Renderer
/**
* Return the cell's border.
*/
- protected Border border(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
+ protected Border border(JTable table, @SuppressWarnings("unused") Object value, boolean selected, boolean hasFocus, @SuppressWarnings("unused") int row, @SuppressWarnings("unused") int column) {
if (hasFocus) {
- return UIManager.getBorder("Table.focusCellHighlightBorder");
+ return UIManager.getBorder("Table.focusCellHighlightBorder"); //$NON-NLS-1$
}
if (selected) {
return BorderFactory.createLineBorder(table.getSelectionBackground(), 1);
@@ -148,7 +148,7 @@ public class SpinnerTableCellRenderer implements TableCellEditorAdapter.Renderer
protected void setValue(Object value) {
// CR#3999318 - This null check needs to be removed once JDK bug is fixed
if (value == null) {
- value = new Integer(0);
+ value = Integer.valueOf(0);
}
this.spinner.setValue(value);
}

Back to the top