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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to