diff options
author | BJ Hargrave | 2014-11-14 13:42:49 +0000 |
---|---|---|
committer | BJ Hargrave | 2014-11-14 13:43:04 +0000 |
commit | ffe31fb5accd301714ff3f0fb7a93b37c98d2ffb (patch) | |
tree | bb458d1780ed1492213f590a9c28488e6400db1a | |
parent | ecca59a8bd7a8e822420236d2cd370b465066a5c (diff) | |
download | rt.equinox.framework-ffe31fb5accd301714ff3f0fb7a93b37c98d2ffb.tar.gz rt.equinox.framework-ffe31fb5accd301714ff3f0fb7a93b37c98d2ffb.tar.xz rt.equinox.framework-ffe31fb5accd301714ff3f0fb7a93b37c98d2ffb.zip |
Bug 451543: Adapt stopped bundle to ServiceReferenceDTO[] must return null
Signed-off-by: BJ Hargrave <hargrave@us.ibm.com>
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java index bc2bc8086..a6a3f920d 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 IBM Corporation and others. + * Copyright (c) 2012, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,19 +11,18 @@ package org.eclipse.osgi.internal.framework; -import org.osgi.framework.dto.*; - -import org.osgi.framework.startlevel.dto.BundleStartLevelDTO; -import org.osgi.framework.startlevel.dto.FrameworkStartLevelDTO; -import org.osgi.framework.wiring.dto.*; -import org.osgi.resource.dto.*; import java.lang.reflect.Array; import java.util.*; import org.osgi.dto.DTO; import org.osgi.framework.*; +import org.osgi.framework.dto.*; import org.osgi.framework.startlevel.BundleStartLevel; import org.osgi.framework.startlevel.FrameworkStartLevel; +import org.osgi.framework.startlevel.dto.BundleStartLevelDTO; +import org.osgi.framework.startlevel.dto.FrameworkStartLevelDTO; import org.osgi.framework.wiring.*; +import org.osgi.framework.wiring.dto.*; +import org.osgi.resource.dto.*; public class DTOBuilder { private final Map<BundleRevision, BundleRevisionDTO> resources; @@ -364,7 +363,10 @@ public class DTOBuilder { } public static ServiceReferenceDTO[] newArrayServiceReferenceDTO(ServiceReference<?>[] references) { - final int length = (references == null) ? 0 : references.length; + if (references == null) { + return null; + } + final int length = references.length; List<ServiceReferenceDTO> refDTOs = new ArrayList<ServiceReferenceDTO>(length); for (int i = 0; i < length; i++) { ServiceReferenceDTO dto = getServiceReferenceDTO(references[i]); |