FELIX-3978 - Check that we don't use java 6+ API

Configure animal sniffer.
Fix one occurrence of a java 6 API use


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1458704 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/api/pom.xml b/ipojo/runtime/api/pom.xml
index e54a585..53d90cc 100644
--- a/ipojo/runtime/api/pom.xml
+++ b/ipojo/runtime/api/pom.xml
@@ -72,6 +72,26 @@
                     <source>1.5</source>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>animal-sniffer-maven-plugin</artifactId>
+                <version>1.7</version>
+                <configuration>
+                    <signature>
+                        <groupId>org.codehaus.mojo.signature</groupId>
+                        <artifactId>java15</artifactId>
+                        <version>1.0</version>
+                    </signature>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
     <dependencies>
diff --git a/ipojo/runtime/composite/pom.xml b/ipojo/runtime/composite/pom.xml
index 2f71b7a..95392d1 100644
--- a/ipojo/runtime/composite/pom.xml
+++ b/ipojo/runtime/composite/pom.xml
@@ -153,6 +153,26 @@
                     <source>1.5</source>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>animal-sniffer-maven-plugin</artifactId>
+                <version>1.7</version>
+                <configuration>
+                    <signature>
+                        <groupId>org.codehaus.mojo.signature</groupId>
+                        <artifactId>java15</artifactId>
+                        <version>1.0</version>
+                    </signature>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>
diff --git a/ipojo/runtime/core/pom.xml b/ipojo/runtime/core/pom.xml
index 7501a8c..e4276bb 100644
--- a/ipojo/runtime/core/pom.xml
+++ b/ipojo/runtime/core/pom.xml
@@ -197,6 +197,26 @@
                     </excludes>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>animal-sniffer-maven-plugin</artifactId>
+                <version>1.7</version>
+                <configuration>
+                    <signature>
+                        <groupId>org.codehaus.mojo.signature</groupId>
+                        <artifactId>java15</artifactId>
+                        <version>1.0</version>
+                    </signature>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>
diff --git a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ReverseBundleProcessor.java b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ReverseBundleProcessor.java
index 90d0ec0..92dea17 100644
--- a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ReverseBundleProcessor.java
+++ b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ReverseBundleProcessor.java
@@ -89,7 +89,7 @@
     public void stop() {
         // deactivate in reverse order
         while (!m_bundles.isEmpty()) {
-            super.deactivate(m_bundles.pollLast());
+            super.deactivate(m_bundles.removeLast());
         }
         super.stop();
     }