Stick to Java 1.4 methods or earlier.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@943262 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java b/framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java
index f17acb6..198e546 100644
--- a/framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java
@@ -412,7 +412,7 @@
public List<Directive> getDirectives()
{
- return Collections.emptyList();
+ return Util.m_emptyList;
}
public Attribute getAttribute(String name)
@@ -423,12 +423,12 @@
public List<Attribute> getAttributes()
{
- return Collections.emptyList();
+ return Util.m_emptyList;
}
public List<String> getUses()
{
- return Collections.emptyList();
+ return Util.m_emptyList;
}
public Object getProperty(String s)
diff --git a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
index 0e730c6..c351fc2 100644
--- a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
@@ -35,6 +35,7 @@
import org.apache.felix.framework.capabilityset.CapabilitySet;
import org.apache.felix.framework.capabilityset.Directive;
import org.apache.felix.framework.capabilityset.Requirement;
+import org.apache.felix.framework.util.Util;
import org.apache.felix.framework.util.manifestparser.RequirementImpl;
import org.osgi.framework.Constants;
@@ -47,7 +48,7 @@
private static boolean m_isInvokeCount = false;
// Reusable empty array.
- private static final List<Wire> m_emptyWires = Collections.emptyList();
+ private static final List<Wire> m_emptyWires = Util.m_emptyList;
// Holds candidate permutations based on permutating "uses" chains.
// These permutations are given higher priority.
@@ -1317,7 +1318,7 @@
return sources;
}
- return Collections.emptyList();
+ return Util.m_emptyList;
}
private static List<Capability> getPackageSourcesInternal(
diff --git a/framework/src/main/java/org/apache/felix/framework/util/Util.java b/framework/src/main/java/org/apache/felix/framework/util/Util.java
index deb96c7..5c625dd 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/Util.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/Util.java
@@ -21,6 +21,7 @@
import java.io.*;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -37,6 +38,8 @@
public class Util
{
+ public static final List m_emptyList = Collections.unmodifiableList(new ArrayList());
+
/**
* Converts a module identifier to a bundle identifier. Module IDs
* are typically <tt><bundle-id>.<revision></tt>; this