FELIX-3708 update to java 5 for type safety during development
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1397394 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/pom.xml b/scr/pom.xml
index 4fc4edc..5deeafa 100644
--- a/scr/pom.xml
+++ b/scr/pom.xml
@@ -77,7 +77,7 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
- <version>4.1.0</version>
+ <version>4.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -330,6 +330,7 @@
- for now touch base on Java 1.4
- Ignore some known Java 5 classes (used in JLock)
-->
+<!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
@@ -360,6 +361,7 @@
</execution>
</executions>
</plugin>
+-->
<!--
Configure default compilation for Java 1.3 and integration
@@ -370,47 +372,49 @@
-->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <id>compile-java5</id>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <excludes>
- <exclude>dummy-to-overwrite-global-config</exclude>
- </excludes>
- <includes>
- <include>**/ScrGogoCommand.java</include>
- </includes>
- </configuration>
- </execution>
- <execution>
- <id>test-compile-java5</id>
- <goals>
- <goal>testCompile</goal>
- </goals>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <testIncludes>
- <testInclude>**/integration/**</testInclude>
- </testIncludes>
- <testExcludes>
- <testExclude>**/impl/**</testExclude>
- </testExcludes>
- </configuration>
- </execution>
- </executions>
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<id>compile-java5</id>-->
+ <!--<goals>-->
+ <!--<goal>compile</goal>-->
+ <!--</goals>-->
+ <!--<configuration>-->
+ <!--<source>1.5</source>-->
+ <!--<target>1.5</target>-->
+ <!--<excludes>-->
+ <!--<exclude>dummy-to-overwrite-global-config</exclude>-->
+ <!--</excludes>-->
+ <!--<includes>-->
+ <!--<include>**/ScrGogoCommand.java</include>-->
+ <!--</includes>-->
+ <!--</configuration>-->
+ <!--</execution>-->
+ <!--<execution>-->
+ <!--<id>test-compile-java5</id>-->
+ <!--<goals>-->
+ <!--<goal>testCompile</goal>-->
+ <!--</goals>-->
+ <!--<configuration>-->
+ <!--<source>1.5</source>-->
+ <!--<target>1.5</target>-->
+ <!--<testIncludes>-->
+ <!--<testInclude>**/integration/**</testInclude>-->
+ <!--</testIncludes>-->
+ <!--<testExcludes>-->
+ <!--<testExclude>**/impl/**</testExclude>-->
+ <!--</testExcludes>-->
+ <!--</configuration>-->
+ <!--</execution>-->
+ <!--</executions>-->
<configuration>
- <testExcludes>
- <testExclude>**/integration/**</testExclude>
- </testExcludes>
- <excludes>
- <exclude>**/ScrGogoCommand.java</exclude>
- </excludes>
+ <source>1.5</source>
+ <target>1.5</target>
+ <!--<testExcludes>-->
+ <!--<testExclude>**/integration/**</testExclude>-->
+ <!--</testExcludes>-->
+ <!--<excludes>-->
+ <!--<exclude>**/ScrGogoCommand.java</exclude>-->
+ <!--</excludes>-->
</configuration>
</plugin>
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java b/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
index 4d07515..f9b3ade 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
@@ -126,7 +126,7 @@
// ---------- ServiceListener
- public void configureComponentHolders(final ServiceReference configurationAdminReference,
+ public void configureComponentHolders(final ServiceReference<ConfigurationAdmin> configurationAdminReference,
final Object configurationAdmin)
{
if (configurationAdmin instanceof ConfigurationAdmin)
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/MockBundle.java b/scr/src/test/java/org/apache/felix/scr/impl/MockBundle.java
index 814893d..3f23f37 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/MockBundle.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/MockBundle.java
@@ -19,14 +19,19 @@
package org.apache.felix.scr.impl;
+import java.io.File;
import java.io.InputStream;
import java.net.URL;
+import java.security.cert.X509Certificate;
import java.util.Dictionary;
import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
public class MockBundle implements Bundle
@@ -43,6 +48,26 @@
return null;
}
+ public Map<X509Certificate, List<X509Certificate>> getSignerCertificates( int i )
+ {
+ return null;
+ }
+
+ public Version getVersion()
+ {
+ return null;
+ }
+
+ public <A> A adapt( Class<A> aClass )
+ {
+ return null;
+ }
+
+ public File getDataFile( String s )
+ {
+ return null;
+ }
+
public long getBundleId()
{
@@ -175,4 +200,8 @@
}
+ public int compareTo( Bundle bundle )
+ {
+ return 0;
+ }
}
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleService2Impl.java b/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleService2Impl.java
index 3f64104..c485d5c 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleService2Impl.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleService2Impl.java
@@ -19,6 +19,8 @@
package org.apache.felix.scr.integration.components;
+import java.util.Dictionary;
+import java.util.Hashtable;
import java.util.Properties;
import org.osgi.framework.BundleContext;
@@ -47,7 +49,7 @@
public static SimpleService2Impl create( BundleContext bundleContext, String value, int ranking )
{
SimpleService2Impl instance = new SimpleService2Impl( value, ranking );
- Properties props = instance.getProperties();
+ Dictionary<String,?> props = instance.getProperties();
instance.setRegistration( bundleContext.registerService( SimpleService2.class.getName(), instance, props ) );
return instance;
}
@@ -61,9 +63,9 @@
}
- private Properties getProperties()
+ private Dictionary<String,?> getProperties()
{
- final Properties props = new Properties();
+ final Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put( "value", m_value );
props.put( "filterprop", m_filterProp );
if ( m_ranking != 0 )
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleServiceImpl.java b/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleServiceImpl.java
index 49ac37d..090902b 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleServiceImpl.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleServiceImpl.java
@@ -19,6 +19,8 @@
package org.apache.felix.scr.integration.components;
+import java.util.Dictionary;
+import java.util.Hashtable;
import java.util.Properties;
import org.osgi.framework.BundleContext;
@@ -47,7 +49,7 @@
public static SimpleServiceImpl create( BundleContext bundleContext, String value, int ranking )
{
SimpleServiceImpl instance = new SimpleServiceImpl( value, ranking );
- Properties props = instance.getProperties();
+ Dictionary<String,?> props = instance.getProperties();
instance.setRegistration( bundleContext.registerService( SimpleService.class.getName(), instance, props ) );
return instance;
}
@@ -65,9 +67,9 @@
}
- private Properties getProperties()
+ private Dictionary<String,?> getProperties()
{
- final Properties props = new Properties();
+ final Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put( "value", m_value );
props.put( "filterprop", m_filterProp );
if ( m_ranking != 0 )