You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by David Gilliland <dg...@users.sourceforge.net> on 2005/09/06 18:22:10 UTC
Bug in JMControllerImpl.setProperty()
Hello,
I am using a recent cvs version of JaxME, and I seem to have encountered a bug. I am setting the JAXME_FORMAT_DATETIME property and getting a "unknown property" exception. On previous versions of JaxME this worked fine.
I isolated the problem to JMControllerImpl.setProperty():
public void setProperty(String pProperty, Object pValue)
throws PropertyException {
if (pProperty.startsWith(JAXME_PRIVATE)) {
if (privateMap == null) {
privateMap = new HashMap();
}
privateMap.put(pProperty, pValue);
return;
} else if (pProperty.equals(JAXME_DATATYPE_CONVERTER)) {
datatypeConverter = (DatatypeConverterInterface) pValue;
return;
} else if (JAXME_FORMAT_DATETIME.equals(pProperty)) {
setDateTimeFormat((Format) pValue);
} else if (JAXME_FORMAT_DATE.equals(pProperty)) {
setDateFormat((Format) pValue);
} else if (JAXME_FORMAT_TIME.equals(pProperty)) {
setTimeFormat((Format) pValue);
}
throw new PropertyException("Unknown property: " + pProperty);
}
If you attempt to set any of the JAXME_FORMAT_* properties, it will set the property and then throw an "Unknown property" exception. I changed the method as follows:
public void setProperty(String pProperty, Object pValue)
throws PropertyException {
if (pProperty.startsWith(JAXME_PRIVATE)) {
if (privateMap == null) {
privateMap = new HashMap();
}
privateMap.put(pProperty, pValue);
return;
} else if (pProperty.equals(JAXME_DATATYPE_CONVERTER)) {
datatypeConverter = (DatatypeConverterInterface) pValue;
return;
} else if (JAXME_FORMAT_DATETIME.equals(pProperty)) {
setDateTimeFormat((Format) pValue);
return;
} else if (JAXME_FORMAT_DATE.equals(pProperty)) {
setDateFormat((Format) pValue);
return;
} else if (JAXME_FORMAT_TIME.equals(pProperty)) {
setTimeFormat((Format) pValue);
return;
}
throw new PropertyException("Unknown property: " + pProperty);
}
and now it seems to work as before.
--David
________________________________________________________________
Sent via the WebMail system at logictrends.com
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org
Re: Bug in JMControllerImpl.setProperty()
Posted by Jochen Wiedmann <jo...@gmail.com>.
Thanks, patch applied to the MAVEN (upcoming 0.6) and to the 0.5
(current stable) branches.
Jochen
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org