blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractTracked.java [248:292]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void trackAdding(final S item, final R related) {
        if (DEBUG) {
            System.out.println("AbstractTracked.trackAdding: " + item); //$NON-NLS-1$
        }
        T object = null;
        boolean becameUntracked = false;
		/* Call customizer outside of synchronized region */
        try {
            object = customizerAdding(item, related);
			/*
			 * If the customizer throws an unchecked exception, it will
			 * propagate after the finally
			 */
        } finally {
            synchronized (this) {
                if (adding.remove(item) && !closed) {
					/*
					 * if the item was not untracked during the customizer
					 * callback
					 */
                    if (object != null) {
                        tracked.put(item, object);
                        modified(); /* increment modification count */
                        notifyAll(); /* notify any waiters */
                    }
                } else {
                    becameUntracked = true;
                }
            }
        }
		/*
		 * The item became untracked during the customizer callback.
		 */
        if (becameUntracked && (object != null)) {
            if (DEBUG) {
                System.out.println("AbstractTracked.trackAdding[removed]: " + item); //$NON-NLS-1$
            }
			/* Call customizer outside of synchronized region */
            customizerRemoved(item, related, object);
			/*
			 * If the customizer throws an unchecked exception, it is safe to
			 * let it propagate
			 */
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



util/src/main/java/org/apache/aries/util/tracker/hook/BundleHookBundleTracker.java [742:786]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        private void trackAdding(final S item, final R related) {
            if (DEBUG) {
                System.out.println("AbstractTracked.trackAdding: " + item); //$NON-NLS-1$
            }
            T object = null;
            boolean becameUntracked = false;
            /* Call customizer outside of synchronized region */
            try {
                object = customizerAdding(item, related);
                /*
                 * If the customizer throws an unchecked exception, it will
                 * propagate after the finally
                 */
            } finally {
                synchronized (this) {
                    if (adding.remove(item) && !closed) {
                        /*
                         * if the item was not untracked during the customizer
                         * callback
                         */
                        if (object != null) {
                            tracked.put(item, object);
                            modified(); /* increment modification count */
                            notifyAll(); /* notify any waiters */
                        }
                    } else {
                        becameUntracked = true;
                    }
                }
            }
            /*
             * The item became untracked during the customizer callback.
             */
            if (becameUntracked && (object != null)) {
                if (DEBUG) {
                    System.out.println("AbstractTracked.trackAdding[removed]: " + item); //$NON-NLS-1$
                }
                /* Call customizer outside of synchronized region */
                customizerRemoved(item, related, object);
                /*
                 * If the customizer throws an unchecked exception, it is safe to
                 * let it propagate
                 */
            }
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



