-
Bug
-
Resolution: Done
-
Major
-
EAP_EWP 5.1.0_CR2
-
None
-
Not Required
Typical logging issue, String concatenation in ProxyObjectFactory in jboss-ejb3-proxy-impl project.
We should rather be using isTraceEnabled before doing such expensive operation.
85763 ALRubinger private Map<String, List<String>> getReferenceAddresses(Reference ref)
85763 ALRubinger {
85763 ALRubinger
85763 ALRubinger // Initialize and instanciate a more reasonable object for handling Reference Addresses
85763 ALRubinger Map<String, List<String>> referenceAddresses = new HashMap<String, List<String>>();
85763 ALRubinger
85763 ALRubinger // For all Reference Addresses
85763 ALRubinger int count = 0;
85763 ALRubinger Enumeration<RefAddr> refAddrs = ref.getAll();
85763 ALRubinger while (refAddrs.hasMoreElements())
85763 ALRubinger {
85763 ALRubinger // Get the current Reference Address information
85763 ALRubinger RefAddr refAddr = refAddrs.nextElement();
85763 ALRubinger String type = refAddr.getType();
85763 ALRubinger Class<?> expectedContentsType = String.class;
85763 ALRubinger Object refAddrContent = refAddr.getContent();
85763 ALRubinger assert (refAddrContent != null) : "Encountered Reference Address of type " + type + " but with null Content";
85763 ALRubinger assert (expectedContentsType.isAssignableFrom(refAddrContent.getClass())) : "Content of Reference Address of type \""
85763 ALRubinger + type + "\" at index " + count + " was not of expected Java type " + expectedContentsType.getName();
85763 ALRubinger String content = (String) refAddr.getContent();
85763 ALRubinger
85763 ALRubinger // If our map doesn't yet contain an entry for this type
85763 ALRubinger if (!referenceAddresses.containsKey(type))
85763 ALRubinger
85763 ALRubinger
85763 ALRubinger // Place an entry for the contents at index "type"
85763 ALRubinger referenceAddresses.get(type).add(content);
85763 ALRubinger log.trace("Found reference type \"" + type + "\" with content \"" + content + "\"");
85763 ALRubinger
- relates to
-
JBPAPP-4850 Performance issue: 8 String concatenation in log.trace() on inject()
- Closed