https://issues.apache.org/bugzilla/show_bug.cgi?id=46768





--- Comment #3 from Daniel Treacy <[email protected]>  2009-02-25 
22:43:38 PST ---
Hi, 

Sorry for not providing more information. I have since worked around th
potential issue that I found. The jar I am using version 3.0.2 final. 

The example code that I was trying (Not like this, but this is the same sort of
thing): 

CustomProperties customProperties = documentSummaryInformation
                    .getCustomProperties();

customProperties.put("key", "value");


\* Extraction of data by a diff class, from a different event *\

if(customProperties.containsKey("key")) {

String value = (String) customProperties.get("key");                            

}


The condition returns false resulting in the value not being extracted. 

I'm probably missing something. 

I wrote the following method as a temp work around: (I'm not a programming or
java expert, dont be too harsh on me :-))

private static boolean isCustomProperty(CustomProperties customProperties,
            String property) {
        if (logger.isDebugEnabled()) {
            logger.debug("isCustomProperty(CustomProperties, String) - start");
        }

        try {
            Set<Map.Entry<?, CustomProperty>> set =
customProperties.entrySet();

            for (Map.Entry<?, CustomProperty> me : set) {

                CustomProperty cP = (CustomProperty) me.getValue();

                String key = cP.getName();

                if (key.contains(property)) {
                    if (logger.isDebugEnabled()) {
                        logger
                                .debug("isCustomProperty(CustomProperties,
String) - end");
                    }
                    return true;
                }
            }
        } catch (Exception e) {
            logger.error("isCustomProperty(CustomProperties, String)", e);

        } 

Thanks for your assistance.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to