Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-4850

Performance issue: 8 String concatenation in log.trace() on inject()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EAP_EWP 5.1.1
    • None
    • EJB
    • None
    • Not Required

      Typical logging issue, String concatenation in JndiPropertyInjector in EJB.

      Snippet from
      http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/tags/jboss-ejb3-core-1.3.4/src/main/java/org/jboss/injection/JndiPropertyInjector.java

      ...
      58861 wolfc public void inject(Object instance)
      58861 wolfc {
      58861 wolfc Object value = lookup(jndiName);
      64345 wolfc log.trace("injecting " + value + " from " + jndiName + " into " + property + " of " + instance);
      73107 wolfc try
      73107 wolfc

      { 73107 wolfc property.set(instance, value); 73107 wolfc }

      73107 wolfc catch(IllegalArgumentException e)
      73107 wolfc {
      ...

      We should rather be using isTraceEnabled before doing such expensive (and often "useless" operation.

            rhn-engineering-cdewolf Carlo de Wolf
            rhn-engineering-rhusar Radoslav Husar
            Rebecca Newton Rebecca Newton (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: