Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-2559

Correct WeakReference handling in ConfigObservable to remove cleared WeakReferences

XMLWordPrintable

      The implementation currently has: -

      private List<WeakReference<Observer>> observer = new ArrayList<WeakReference<Observer>>();

      However there is nothing to remove the WeakReference as it looses it's reference.

      Secondly notifyOberservers has: -

      for (WeakReference<Observer> w : observer)

      { Observer tmp = w.get(); tmp.update(this, arg); }

      As w is a WeakReference the value from get should be checked to ensure it is not null.

              darran.lofthouse@redhat.com Darran Lofthouse
              darran.lofthouse@redhat.com Darran Lofthouse
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: