Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2875

Heavily Broken Caching in Injector

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      current trunk version

      Description

      The caching implementation in org.apache.wicket.injection.Injector is heavily broken. for each component, a ConcurrentHashMap is created and findFields(..) get called. This happens as a new container is created for every yet unknown class instead of yet unknown ClassLoaders.

      this is the erroneous code:

      // try cache
      ConcurrentHashMap<String, Field[]> container = cache.get(clazz.getClassLoader());
      if (container != null)
      {
      fields = container.get(clazz.getName());
      }

      if (fields == null)
      {
      fields = findFields(clazz, factory);

      // write to cache
      container = new ConcurrentHashMap<String, Field[]>();
      container.put(clazz.getName(), fields);
      cache.put(clazz.getClassLoader(), container);
      }

      By the way: This bug was introduced with the fix of WICKET-625 in revision 830070 dated 0ct 27, 2009

        Attachments

        1. wicket-2875.patch
          1 kB
          Stefan Fussenegger

          Issue Links

            Activity

              People

              • Assignee:
                ivaynberg Igor Vaynberg
                Reporter:
                sfussenegger Stefan Fussenegger
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: