Content-Type: |
text/plain; charset=utf-8; format=flowed |
Date: |
Tue, 15 Mar 2016 16:41:52 +0100 |
Reply-To: |
|
Subject: |
|
MIME-Version: |
1.0 |
Message-ID: |
|
Content-Transfer-Encoding: |
7bit |
Sender: |
|
From: |
|
Parts/Attachments: |
|
|
Hi,
There is a type issue in CollectionProperties which prevents Map objects
from being edited. Making sure the types become unboxed fixed the issue
for me.
Best regards,
Christian
public Class<?> getType(int index) {
if (index < 0 || index > numProperties()) {
return null;
}
if (indexed != null) {
Class<?> type = indexed.componentType();
if (type != null) {
return type;
}
}
Object obj = getValue(index);
if (obj == null) {
return Object.class;
}
// CHANGE: must be unboxed to get accepted by setValue(int, String)
return getTypeConversion(obj.getClass());
}
public boolean isReadWrite(int index) {
if (index < 0 || index > numProperties()) {
return false;
}
if (collection != null) {
// collections are not modifiable -- they can't be referenced
return false;
}
// CHANGE: no need to unbox here, already done
Class<?> type = getType(index);
Object obj = getValue(index);
if (obj != null) {
// CHANGE: must be unboxed to be assignable to type
Class<?> objType = getTypeConversion(obj.getClass());
if (!type.isAssignableFrom(objType)) {
return false;
}
}
return !isComposite(index);
}
|
|
|