Skip to content

Commit 6f7acda

Browse files
committed
WidgetModel: rename converted objects collection
convertedObjectPool > convertedObjects, to simplify and avoid confusion with "objectPool".
1 parent e8079cb commit 6f7acda

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/org/scijava/widget/WidgetModel.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class WidgetModel extends AbstractContextual {
6262
private final Module module;
6363
private final ModuleItem<?> item;
6464
private final List<?> objectPool;
65-
private final Map<Object, Object> convertedObjectPool;
65+
private final Map<Object, Object> convertedObjects;
6666

6767
@Parameter
6868
private ThreadService threadService;
@@ -83,7 +83,7 @@ public WidgetModel(final Context context, final InputPanel<?, ?> inputPanel,
8383
this.module = module;
8484
this.item = item;
8585
this.objectPool = objectPool;
86-
convertedObjectPool = new WeakHashMap<Object, Object>();
86+
convertedObjects = new WeakHashMap<Object, Object>();
8787
}
8888

8989
/** Gets the input panel intended to house the widget. */
@@ -169,7 +169,7 @@ public void setValue(final Object value) {
169169
if (MiscUtils.equal(item.getValue(module), value)) return; // no change
170170

171171
// Check if a converted value is present
172-
Object convertedInput = convertedObjectPool.get(value);
172+
Object convertedInput = convertedObjects.get(value);
173173
if (convertedInput != null &&
174174
MiscUtils.equal(item.getValue(module), convertedInput))
175175
{
@@ -181,7 +181,7 @@ public void setValue(final Object value) {
181181

182182
// If we get a different (covnerted) value back, cache it weakly.
183183
if (convertedInput != value) {
184-
convertedObjectPool.put(value, convertedInput);
184+
convertedObjects.put(value, convertedInput);
185185
}
186186

187187
module.setInput(name, convertedInput);
@@ -390,7 +390,7 @@ private Object ensureValid(final Object value, final List<?> list) {
390390
for (final Object o : list) {
391391
if (o.equals(value)) return value; // value is valid
392392
// check if value was converted and cached
393-
final Object convertedValue = convertedObjectPool.get(o);
393+
final Object convertedValue = convertedObjects.get(o);
394394
if (convertedValue != null && value.equals(convertedValue)) {
395395
return convertedValue;
396396
}

0 commit comments

Comments
 (0)