Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5EEAE9D90 for ; Sun, 3 Jun 2012 13:49:09 +0000 (UTC) Received: (qmail 39942 invoked by uid 500); 3 Jun 2012 13:49:09 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 39877 invoked by uid 500); 3 Jun 2012 13:49:09 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 39870 invoked by uid 99); 3 Jun 2012 13:49:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jun 2012 13:49:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jun 2012 13:49:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 25D2E238890B; Sun, 3 Jun 2012 13:48:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1345673 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java Date: Sun, 03 Jun 2012 13:48:46 -0000 To: commits@sling.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120603134846.25D2E238890B@eris.apache.org> Author: cziegeler Date: Sun Jun 3 13:48:45 2012 New Revision: 1345673 URL: http://svn.apache.org/viewvc?rev=1345673&view=rev Log: SLING-2500 : NPE in SortingServiceTracker#getSortedServices Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java?rev=1345673&r1=1345672&r2=1345673&view=diff ============================================================================== --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java (original) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java Sun Jun 3 13:48:45 2012 @@ -118,19 +118,21 @@ public class SortingServiceTracker * Return a sorted list of the services references. */ public List getSortedServiceReferences() { + List result = this.sortedReferences; if ( this.sortedReferences == null || this.lastRefCount < this.getTrackingCount() ) { this.lastRefCount = this.getTrackingCount(); final ServiceReference[] references = this.getServiceReferences(); if ( references == null || references.length == 0 ) { - this.sortedReferences = Collections.emptyList(); + result = Collections.emptyList(); } else { Arrays.sort(references); - this.sortedReferences = new ArrayList(); + result = new ArrayList(); for(int i=0;i