Author: cziegeler
Date: Wed Mar  4 13:26:21 2015
New Revision: 1663988

URL: http://svn.apache.org/r1663988
Log:
Code cleanup / improvement : add generics information

Modified:
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BlueprintPlugin.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleInfo.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyExcluder.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ScrPlugin.java
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
 Wed Mar  4 13:26:21 2015
@@ -28,13 +28,14 @@ import java.util.regex.Pattern;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 
-import aQute.bnd.osgi.Instruction;
+import aQute.bnd.header.Attrs;
 import aQute.bnd.header.OSGiHeader;
+import aQute.bnd.osgi.Instruction;
 
 
 /**
  * Apply clause-based filter over given dependencies
- * 
+ *
  * @author <a href="mailto:[email protected]";>Felix Project Team</a>
  */
 public abstract class AbstractDependencyFilter
@@ -44,10 +45,10 @@ public abstract class AbstractDependency
     /**
      * Dependency artifacts.
      */
-    private final Collection m_dependencyArtifacts;
+    private final Collection<Artifact> m_dependencyArtifacts;
 
 
-    public AbstractDependencyFilter( Collection dependencyArtifacts )
+    public AbstractDependencyFilter( Collection<Artifact> dependencyArtifacts )
     {
         m_dependencyArtifacts = dependencyArtifacts;
     }
@@ -71,11 +72,11 @@ public abstract class AbstractDependency
         }
 
 
-        public void filter( Collection dependencies )
+        public void filter( Collection<Artifact> dependencies )
         {
-            for ( Iterator i = dependencies.iterator(); i.hasNext(); )
+            for ( Iterator<Artifact> i = dependencies.iterator(); i.hasNext(); 
)
             {
-                if ( false == matches( ( Artifact ) i.next() ) )
+                if ( false == matches( i.next() ) )
                 {
                     i.remove();
                 }
@@ -106,21 +107,21 @@ public abstract class AbstractDependency
 
     protected final void processInstructions( String header ) throws 
MojoExecutionException
     {
-        Map instructions = OSGiHeader.parseHeader( 
MISSING_KEY_PATTERN.matcher( header ).replaceAll( "$1$2*;$3" ) );
+        Map<String,Attrs> instructions = OSGiHeader.parseHeader( 
MISSING_KEY_PATTERN.matcher( header ).replaceAll( "$1$2*;$3" ) );
 
-        Collection availableDependencies = new LinkedHashSet( 
m_dependencyArtifacts );
+        Collection<Artifact> availableDependencies = new 
LinkedHashSet<Artifact>( m_dependencyArtifacts );
 
         DependencyFilter filter;
-        for ( Iterator clauseIterator = instructions.entrySet().iterator(); 
clauseIterator.hasNext(); )
+        for ( Iterator<Map.Entry<String,Attrs>> clauseIterator = 
instructions.entrySet().iterator(); clauseIterator.hasNext(); )
         {
             String inline = "false";
 
             // always start with a fresh *modifiable* collection for each 
unique clause
-            Collection filteredDependencies = new LinkedHashSet( 
availableDependencies );
+            Collection<Artifact> filteredDependencies = new 
LinkedHashSet<Artifact>( availableDependencies );
 
             // CLAUSE: REGEXP --> { ATTRIBUTE MAP }
-            Map.Entry clause = ( Map.Entry ) clauseIterator.next();
-            String primaryKey = ( ( String ) clause.getKey() ).replaceFirst( 
"~+$", "" );
+            Map.Entry<String,Attrs> clause = clauseIterator.next();
+            String primaryKey = clause.getKey().replaceFirst( "~+$", "" );
             boolean isNegative = primaryKey.startsWith( "!" );
             if ( isNegative )
             {
@@ -131,6 +132,7 @@ public abstract class AbstractDependency
             {
                 filter = new DependencyFilter( primaryKey )
                 {
+                    @Override
                     boolean matches( Artifact dependency )
                     {
                         return super.matches( dependency.getArtifactId() );
@@ -140,14 +142,15 @@ public abstract class AbstractDependency
                 filter.filter( filteredDependencies );
             }
 
-            for ( Iterator attrIterator = ( ( Map ) clause.getValue() 
).entrySet().iterator(); attrIterator.hasNext(); )
+            for ( Iterator<Map.Entry<String,String>> attrIterator = 
clause.getValue().entrySet().iterator(); attrIterator.hasNext(); )
             {
                 // ATTRIBUTE: KEY --> REGEXP
-                Map.Entry attr = ( Map.Entry ) attrIterator.next();
+                Map.Entry<String,String> attr = attrIterator.next();
                 if ( "groupId".equals( attr.getKey() ) )
                 {
-                    filter = new DependencyFilter( ( String ) attr.getValue() )
+                    filter = new DependencyFilter( attr.getValue() )
                     {
+                        @Override
                         boolean matches( Artifact dependency )
                         {
                             return super.matches( dependency.getGroupId() );
@@ -156,8 +159,9 @@ public abstract class AbstractDependency
                 }
                 else if ( "artifactId".equals( attr.getKey() ) )
                 {
-                    filter = new DependencyFilter( ( String ) attr.getValue() )
+                    filter = new DependencyFilter( attr.getValue() )
                     {
+                        @Override
                         boolean matches( Artifact dependency )
                         {
                             return super.matches( dependency.getArtifactId() );
@@ -166,8 +170,9 @@ public abstract class AbstractDependency
                 }
                 else if ( "version".equals( attr.getKey() ) )
                 {
-                    filter = new DependencyFilter( ( String ) attr.getValue() )
+                    filter = new DependencyFilter( attr.getValue() )
                     {
+                        @Override
                         boolean matches( Artifact dependency )
                         {
                             try
@@ -184,8 +189,9 @@ public abstract class AbstractDependency
                 }
                 else if ( "scope".equals( attr.getKey() ) )
                 {
-                    filter = new DependencyFilter( ( String ) attr.getValue(), 
"compile" )
+                    filter = new DependencyFilter( attr.getValue(), "compile" )
                     {
+                        @Override
                         boolean matches( Artifact dependency )
                         {
                             return super.matches( dependency.getScope() );
@@ -194,8 +200,9 @@ public abstract class AbstractDependency
                 }
                 else if ( "type".equals( attr.getKey() ) )
                 {
-                    filter = new DependencyFilter( ( String ) attr.getValue(), 
"jar" )
+                    filter = new DependencyFilter( attr.getValue(), "jar" )
                     {
+                        @Override
                         boolean matches( Artifact dependency )
                         {
                             return super.matches( dependency.getType() );
@@ -204,8 +211,9 @@ public abstract class AbstractDependency
                 }
                 else if ( "classifier".equals( attr.getKey() ) )
                 {
-                    filter = new DependencyFilter( ( String ) attr.getValue() )
+                    filter = new DependencyFilter( attr.getValue() )
                     {
+                        @Override
                         boolean matches( Artifact dependency )
                         {
                             return super.matches( dependency.getClassifier() );
@@ -214,8 +222,9 @@ public abstract class AbstractDependency
                 }
                 else if ( "optional".equals( attr.getKey() ) )
                 {
-                    filter = new DependencyFilter( ( String ) attr.getValue(), 
"false" )
+                    filter = new DependencyFilter( attr.getValue(), "false" )
                     {
+                        @Override
                         boolean matches( Artifact dependency )
                         {
                             return super.matches( "" + dependency.isOptional() 
);
@@ -224,7 +233,7 @@ public abstract class AbstractDependency
                 }
                 else if ( "inline".equals( attr.getKey() ) )
                 {
-                    inline = ( String ) attr.getValue();
+                    inline = attr.getValue();
                     continue;
                 }
                 else
@@ -255,5 +264,5 @@ public abstract class AbstractDependency
     }
 
 
-    protected abstract void processDependencies( Collection dependencies, 
String inline );
+    protected abstract void processDependencies( Collection<Artifact> 
dependencies, String inline );
 }

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AntPlugin.java
 Wed Mar  4 13:26:21 2015
@@ -48,7 +48,8 @@ public class AntPlugin extends BundlePlu
     static final String BUILD_BND = "/maven-build.bnd";
 
 
-    protected void execute( MavenProject currentProject, Map 
originalInstructions, Properties properties,
+    @Override
+    protected void execute( MavenProject currentProject, Map<String, String> 
originalInstructions, Properties properties,
         Jar[] classpath ) throws MojoExecutionException
     {
         final String artifactId = getProject().getArtifactId();

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BlueprintPlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BlueprintPlugin.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BlueprintPlugin.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BlueprintPlugin.java
 Wed Mar  4 13:26:21 2015
@@ -19,6 +19,8 @@
 package org.apache.felix.bundleplugin;
 
 
+import static org.apache.felix.utils.manifest.Parser.parseHeader;
+
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -26,15 +28,10 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.URL;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.TreeSet;
 import java.util.regex.Pattern;
 
 import javax.xml.transform.Transformer;
@@ -42,22 +39,18 @@ import javax.xml.transform.TransformerFa
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
+import org.apache.felix.utils.manifest.Attribute;
+import org.apache.felix.utils.manifest.Clause;
+import org.osgi.framework.Constants;
+
 import aQute.bnd.header.Attrs;
-import aQute.bnd.service.AnalyzerPlugin;
 import aQute.bnd.osgi.Analyzer;
 import aQute.bnd.osgi.Descriptors.PackageRef;
 import aQute.bnd.osgi.Jar;
 import aQute.bnd.osgi.Processor;
 import aQute.bnd.osgi.Resource;
+import aQute.bnd.service.AnalyzerPlugin;
 import aQute.libg.generics.Create;
-import aQute.libg.qtokens.QuotedTokenizer;
-import aQute.service.reporter.Reporter;
-import org.apache.felix.utils.manifest.Attribute;
-import org.apache.felix.utils.manifest.Clause;
-import org.apache.felix.utils.manifest.Directive;
-import org.osgi.framework.Constants;
-
-import static org.apache.felix.utils.manifest.Parser.parseHeader;
 
 
 public class BlueprintPlugin implements AnalyzerPlugin
@@ -99,7 +92,7 @@ public class BlueprintPlugin implements
             if ( dir == null || dir.isEmpty() )
             {
                 Resource resource = jar.getResource( root );
-                if ( resource != null ) 
+                if ( resource != null )
                                {
                     process( analyzer, root, resource, headers );
                                        if (bpHeader.length() > 0) {
@@ -113,7 +106,7 @@ public class BlueprintPlugin implements
             {
                 String path = entry.getKey();
                 Resource resource = entry.getValue();
-                if ( PATHS.matcher( path ).matches() ) 
+                if ( PATHS.matcher( path ).matches() )
                                {
                     process( analyzer, path, resource, headers );
                                        if (bpHeader.length() > 0) {
@@ -123,7 +116,7 @@ public class BlueprintPlugin implements
                                }
             }
         }
-               if( !map.isEmpty() ) 
+               if( !map.isEmpty() )
                {
                        analyzer.setProperty("Bundle-Blueprint", bpHeader);
                }

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleInfo.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleInfo.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleInfo.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleInfo.java
 Wed Mar  4 13:26:21 2015
@@ -4,9 +4,9 @@
  * copyright ownership. The ASF licenses this file to you under the Apache 
License, Version 2.0 (the
  * "License"); you may not use this file except in compliance with the 
License. You may obtain a
  * copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software 
distributed under the License
  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
  * or implied. See the License for the specific language governing permissions 
and limitations under
@@ -15,7 +15,6 @@
 package org.apache.felix.bundleplugin;
 
 
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -26,8 +25,8 @@ import org.apache.maven.artifact.Artifac
 
 
 /**
- * Information result of the bundling process 
- * 
+ * Information result of the bundling process
+ *
  * @author <a href="mailto:[email protected]";>Carlos Sanchez</a>
  * @version $Id$
  */
@@ -37,22 +36,22 @@ public class BundleInfo
      * {@link Map} &lt; {@link String}, {@link Set} &lt; {@link Artifact} > >
      * Used to check for duplicated exports. Key is package name and value 
list of artifacts where it's exported.
      */
-    private Map m_exportedPackages = new HashMap();
+    private Map<String, Set<Artifact>> m_exportedPackages = new 
HashMap<String, Set<Artifact>>();
 
 
     public void addExportedPackage( String packageName, Artifact artifact )
     {
-        Set artifacts = ( Set ) getExportedPackages().get( packageName );
+        Set<Artifact> artifacts = getExportedPackages().get( packageName );
         if ( artifacts == null )
         {
-            artifacts = new HashSet();
+            artifacts = new HashSet<Artifact>();
             m_exportedPackages.put( packageName, artifacts );
         }
         artifacts.add( artifact );
     }
 
 
-    protected Map getExportedPackages()
+    protected Map<String, Set<Artifact>> getExportedPackages()
     {
         return m_exportedPackages;
     }
@@ -63,23 +62,23 @@ public class BundleInfo
      * Key is package name and value list of artifacts where it's exported.
      * @return {@link Map} &lt; {@link String}, {@link Set} &lt; {@link 
Artifact} > >
      */
-    public Map getDuplicatedExports()
+    public Map<String, Set<Artifact>> getDuplicatedExports()
     {
-        Map duplicatedExports = new HashMap();
+        Map<String, Set<Artifact>> duplicatedExports = new HashMap<String, 
Set<Artifact>>();
 
-        for ( Iterator it = getExportedPackages().entrySet().iterator(); 
it.hasNext(); )
+        for ( Iterator<Map.Entry<String, Set<Artifact>>> it = 
getExportedPackages().entrySet().iterator(); it.hasNext(); )
         {
-            Map.Entry entry = ( Map.Entry ) it.next();
-            Set artifacts = ( Set ) entry.getValue();
+            Map.Entry<String, Set<Artifact>> entry = it.next();
+            Set<Artifact> artifacts = entry.getValue();
             if ( artifacts.size() > 1 )
             {
                 /* remove warnings caused by different versions of same 
artifact */
-                Set artifactKeys = new HashSet();
+                Set<String> artifactKeys = new HashSet<String>();
 
-                String packageName = ( String ) entry.getKey();
-                for ( Iterator it2 = artifacts.iterator(); it2.hasNext(); )
+                String packageName = entry.getKey();
+                for ( Iterator<Artifact> it2 = artifacts.iterator(); 
it2.hasNext(); )
                 {
-                    Artifact artifact = ( Artifact ) it2.next();
+                    Artifact artifact = it2.next();
                     artifactKeys.add( artifact.getGroupId() + "." + 
artifact.getArtifactId() );
                 }
 
@@ -96,16 +95,16 @@ public class BundleInfo
 
     public void merge( BundleInfo bundleInfo )
     {
-        for ( Iterator it = 
bundleInfo.getExportedPackages().entrySet().iterator(); it.hasNext(); )
+        for ( Iterator<Map.Entry<String, Set<Artifact>>> it = 
bundleInfo.getExportedPackages().entrySet().iterator(); it.hasNext(); )
         {
-            Map.Entry entry = ( Map.Entry ) it.next();
-            String packageName = ( String ) entry.getKey();
-            Collection artifacts = ( Collection ) entry.getValue();
+            Map.Entry<String, Set<Artifact>> entry = it.next();
+            String packageName = entry.getKey();
+            Set<Artifact> artifacts = entry.getValue();
 
-            Collection artifactsWithPackage = ( Collection ) 
getExportedPackages().get( packageName );
+            Set<Artifact> artifactsWithPackage = getExportedPackages().get( 
packageName );
             if ( artifactsWithPackage == null )
             {
-                artifactsWithPackage = new HashSet();
+                artifactsWithPackage = new HashSet<Artifact>();
                 getExportedPackages().put( packageName, artifactsWithPackage );
             }
             artifactsWithPackage.addAll( artifacts );

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
 Wed Mar  4 13:26:21 2015
@@ -39,7 +39,6 @@ import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
 import java.util.jar.Attributes;
@@ -178,7 +177,7 @@ public class BundlePlugin extends Abstra
      *
      * @parameter
      */
-    protected List supportedProjectTypes = Arrays.asList( new String[]
+    protected List<String> supportedProjectTypes = Arrays.asList( new String[]
         { "jar", "bundle" } );
 
     /**
@@ -211,7 +210,7 @@ public class BundlePlugin extends Abstra
      *
      * @parameter
      */
-    private Map instructions = new LinkedHashMap();
+    private Map<String, String> instructions = new LinkedHashMap<String, 
String>();
 
     /**
      * Use locally patched version for now.
@@ -287,7 +286,7 @@ public class BundlePlugin extends Abstra
     }
 
 
-    protected void execute( MavenProject currentProject, Map 
originalInstructions, Properties properties )
+    protected void execute( MavenProject currentProject, Map<String, String> 
originalInstructions, Properties properties )
         throws MojoExecutionException
     {
         try
@@ -302,20 +301,20 @@ public class BundlePlugin extends Abstra
 
 
     /* transform directives from their XML form to the expected BND syntax 
(eg. _include becomes -include) */
-    protected static Map transformDirectives( Map originalInstructions )
+    protected static Map<String, String> transformDirectives( Map<String, 
String> originalInstructions )
     {
-        Map transformedInstructions = new LinkedHashMap();
-        for ( Iterator i = originalInstructions.entrySet().iterator(); 
i.hasNext(); )
+        Map<String, String> transformedInstructions = new 
LinkedHashMap<String, String>();
+        for ( Iterator<Map.Entry<String, String>> i = 
originalInstructions.entrySet().iterator(); i.hasNext(); )
         {
-            Map.Entry e = ( Map.Entry ) i.next();
+            Map.Entry<String, String> e = i.next();
 
-            String key = ( String ) e.getKey();
+            String key = e.getKey();
             if ( key.startsWith( "_" ) )
             {
                 key = "-" + key.substring( 1 );
             }
 
-            String value = ( String ) e.getValue();
+            String value = e.getValue();
             if ( null == value )
             {
                 value = "";
@@ -339,20 +338,20 @@ public class BundlePlugin extends Abstra
 
     protected boolean reportErrors( String prefix, Analyzer analyzer )
     {
-        List errors = analyzer.getErrors();
-        List warnings = analyzer.getWarnings();
+        List<String> errors = analyzer.getErrors();
+        List<String> warnings = analyzer.getWarnings();
 
-        for ( Iterator w = warnings.iterator(); w.hasNext(); )
+        for ( Iterator<String> w = warnings.iterator(); w.hasNext(); )
         {
-            String msg = ( String ) w.next();
+            String msg = w.next();
             getLog().warn( prefix + " : " + msg );
         }
 
         boolean hasErrors = false;
         String fileNotFound = "Input file does not exist: ";
-        for ( Iterator e = errors.iterator(); e.hasNext(); )
+        for ( Iterator<String> e = errors.iterator(); e.hasNext(); )
         {
-            String msg = ( String ) e.next();
+            String msg = e.next();
             if ( msg.startsWith( fileNotFound ) && msg.endsWith( "~" ) )
             {
                 // treat as warning; this error happens when you have 
duplicate entries in Include-Resource
@@ -369,7 +368,7 @@ public class BundlePlugin extends Abstra
     }
 
 
-    protected void execute( MavenProject currentProject, Map 
originalInstructions, Properties properties,
+    protected void execute( MavenProject currentProject, Map<String, String> 
originalInstructions, Properties properties,
         Jar[] classpath ) throws MojoExecutionException
     {
         try
@@ -456,18 +455,18 @@ public class BundlePlugin extends Abstra
     }
 
 
-    protected Builder getOSGiBuilder( MavenProject currentProject, Map 
originalInstructions, Properties properties,
+    protected Builder getOSGiBuilder( MavenProject currentProject, Map<String, 
String> originalInstructions, Properties properties,
         Jar[] classpath ) throws Exception
     {
         properties.putAll( getDefaultProperties( currentProject ) );
         properties.putAll( transformDirectives( originalInstructions ) );
 
         // process overrides from project
-        final Map addProps = new HashMap();
-        final Iterator iter = 
currentProject.getProperties().entrySet().iterator();
+        final Map<String, String> addProps = new HashMap<String, String>();
+        final Iterator<Map.Entry<Object, Object>> iter = 
currentProject.getProperties().entrySet().iterator();
         while ( iter.hasNext() )
         {
-            final Map.Entry entry = (Entry) iter.next();
+            final Map.Entry<Object, Object> entry = iter.next();
             final String key = entry.getKey().toString();
             if ( key.startsWith(BUNDLE_PLUGIN_EXTENSION) )
             {
@@ -475,7 +474,7 @@ public class BundlePlugin extends Abstra
                 final String currentValue = properties.getProperty(oKey);
                 if ( currentValue == null )
                 {
-                    addProps.put(oKey, entry.getValue());
+                    addProps.put(oKey, entry.getValue().toString());
                 }
                 else
                 {
@@ -488,7 +487,7 @@ public class BundlePlugin extends Abstra
                 final String currentValue = properties.getProperty(oKey);
                 if ( currentValue == null )
                 {
-                    addProps.put(oKey, entry.getValue());
+                    addProps.put(oKey, entry.getValue().toString());
                 }
                 else
                 {
@@ -497,7 +496,7 @@ public class BundlePlugin extends Abstra
             }
         }
         properties.putAll( addProps );
-        final Iterator keyIter = addProps.keySet().iterator();
+        final Iterator<String> keyIter = addProps.keySet().iterator();
         while ( keyIter.hasNext() )
         {
             Object key = keyIter.next();
@@ -548,9 +547,9 @@ public class BundlePlugin extends Abstra
     {
         // convert any non-String keys/values to Strings
         Properties sanitizedEntries = new Properties();
-        for ( Iterator itr = properties.entrySet().iterator(); itr.hasNext(); )
+        for ( Iterator<Map.Entry<Object,Object>> itr = 
properties.entrySet().iterator(); itr.hasNext(); )
         {
-            Map.Entry entry = ( Map.Entry ) itr.next();
+            Map.Entry<Object,Object> entry = itr.next();
             if ( entry.getKey() instanceof String == false )
             {
                 String key = sanitize( entry.getKey() );
@@ -620,7 +619,7 @@ public class BundlePlugin extends Abstra
         }
 
         // update BND instructions to embed selected Maven dependencies
-        Collection embeddableArtifacts = getEmbeddableArtifacts( 
currentProject, builder );
+        Collection<Artifact> embeddableArtifacts = getEmbeddableArtifacts( 
currentProject, builder );
         new DependencyEmbedder( getLog(), embeddableArtifacts 
).processHeaders( builder );
 
         if ( dumpInstructions != null || getLog().isDebugEnabled() )
@@ -649,7 +648,7 @@ public class BundlePlugin extends Abstra
     }
 
 
-    protected Builder buildOSGiBundle( MavenProject currentProject, Map 
originalInstructions, Properties properties,
+    protected Builder buildOSGiBundle( MavenProject currentProject, 
Map<String, String> originalInstructions, Properties properties,
         Jar[] classpath ) throws Exception
     {
         Builder builder = getOSGiBuilder( currentProject, 
originalInstructions, properties, classpath );
@@ -670,10 +669,10 @@ public class BundlePlugin extends Abstra
         {
             buf.append( 
"#-----------------------------------------------------------------------" + NL 
);
             Properties stringProperties = new Properties();
-            for ( Enumeration e = properties.propertyNames(); 
e.hasMoreElements(); )
+            for ( Enumeration<String> e = (Enumeration<String>) 
properties.propertyNames(); e.hasMoreElements(); )
             {
                 // we can only store String properties
-                String key = ( String ) e.nextElement();
+                String key = e.nextElement();
                 String value = properties.getProperty( key );
                 if ( value != null )
                 {
@@ -693,15 +692,15 @@ public class BundlePlugin extends Abstra
     }
 
 
-    protected static StringBuilder dumpClasspath( List classpath, 
StringBuilder buf )
+    protected static StringBuilder dumpClasspath( List<Jar> classpath, 
StringBuilder buf )
     {
         try
         {
             buf.append( 
"#-----------------------------------------------------------------------" + NL 
);
             buf.append( "-classpath:\\" + NL );
-            for ( Iterator i = classpath.iterator(); i.hasNext(); )
+            for ( Iterator<Jar> i = classpath.iterator(); i.hasNext(); )
             {
-                File path = ( ( Jar ) i.next() ).getSource();
+                File path = i.next().getSource();
                 if ( path != null )
                 {
                     buf.append( ' ' + path.toString() + ( i.hasNext() ? ",\\" 
: "" ) + NL );
@@ -815,19 +814,19 @@ public class BundlePlugin extends Abstra
                 /*
                  * Add customized manifest sections (for some reason 
MavenArchiver doesn't do this for us)
                  */
-                List sections = archiveConfig.getManifestSections();
-                for ( Iterator i = sections.iterator(); i.hasNext(); )
+                List<ManifestSection> sections = 
archiveConfig.getManifestSections();
+                for ( Iterator<ManifestSection> i = sections.iterator(); 
i.hasNext(); )
                 {
-                    ManifestSection section = ( ManifestSection ) i.next();
+                    ManifestSection section = i.next();
                     Attributes attributes = new Attributes();
 
                     if ( !section.isManifestEntriesEmpty() )
                     {
-                        Map entries = section.getManifestEntries();
-                        for ( Iterator j = entries.entrySet().iterator(); 
j.hasNext(); )
+                        Map<String, String> entries = 
section.getManifestEntries();
+                        for ( Iterator<Map.Entry<String, String>> j = 
entries.entrySet().iterator(); j.hasNext(); )
                         {
-                            Map.Entry entry = ( Map.Entry ) j.next();
-                            attributes.putValue( ( String ) entry.getKey(), ( 
String ) entry.getValue() );
+                            Map.Entry<String, String> entry = j.next();
+                            attributes.putValue( entry.getKey(), 
entry.getValue() );
                         }
                     }
 
@@ -843,7 +842,7 @@ public class BundlePlugin extends Abstra
             // apply -removeheaders to the custom manifest
             for ( int i = 0; i < removeHeaders.length; i++ )
             {
-                for ( Iterator j = mainMavenAttributes.keySet().iterator(); 
j.hasNext(); )
+                for ( Iterator<Object> j = 
mainMavenAttributes.keySet().iterator(); j.hasNext(); )
                 {
                     if ( j.next().toString().matches( removeHeaders[i].trim() 
) )
                     {
@@ -901,13 +900,13 @@ public class BundlePlugin extends Abstra
     }
 
 
-    protected Set getOptionalPackages( MavenProject currentProject ) throws 
IOException, MojoExecutionException
+    protected Set<String> getOptionalPackages( MavenProject currentProject ) 
throws IOException, MojoExecutionException
     {
-        ArrayList inscope = new ArrayList();
-        final Collection artifacts = getSelectedDependencies( 
currentProject.getArtifacts() );
-        for ( Iterator it = artifacts.iterator(); it.hasNext(); )
+        ArrayList<Artifact> inscope = new ArrayList<Artifact>();
+        final Collection<Artifact> artifacts = getSelectedDependencies( 
currentProject.getArtifacts() );
+        for ( Iterator<Artifact> it = artifacts.iterator(); it.hasNext(); )
         {
-            Artifact artifact = ( Artifact ) it.next();
+            Artifact artifact = it.next();
             if ( artifact.getArtifactHandler().isAddedToClasspath() )
             {
                 if ( !Artifact.SCOPE_TEST.equals( artifact.getScope() ) )
@@ -917,10 +916,10 @@ public class BundlePlugin extends Abstra
             }
         }
 
-        HashSet optionalArtifactIds = new HashSet();
-        for ( Iterator it = inscope.iterator(); it.hasNext(); )
+        HashSet<String> optionalArtifactIds = new HashSet<String>();
+        for ( Iterator<Artifact> it = inscope.iterator(); it.hasNext(); )
         {
-            Artifact artifact = ( Artifact ) it.next();
+            Artifact artifact = it.next();
             if ( artifact.isOptional() )
             {
                 String id = artifact.toString();
@@ -934,11 +933,11 @@ public class BundlePlugin extends Abstra
 
         }
 
-        HashSet required = new HashSet();
-        HashSet optional = new HashSet();
-        for ( Iterator it = inscope.iterator(); it.hasNext(); )
+        HashSet<String> required = new HashSet<String>();
+        HashSet<String> optional = new HashSet<String>();
+        for ( Iterator<Artifact> it = inscope.iterator(); it.hasNext(); )
         {
-            Artifact artifact = ( Artifact ) it.next();
+            Artifact artifact = it.next();
             File file = getFile( artifact );
             if ( file == null )
             {
@@ -968,12 +967,12 @@ public class BundlePlugin extends Abstra
      *
      * @param artifact
      */
-    protected boolean isTransitivelyOptional( HashSet optionalArtifactIds, 
Artifact artifact )
+    protected boolean isTransitivelyOptional( HashSet<String> 
optionalArtifactIds, Artifact artifact )
     {
-        List trail = artifact.getDependencyTrail();
-        for ( Iterator iterator = trail.iterator(); iterator.hasNext(); )
+        List<String> trail = artifact.getDependencyTrail();
+        for ( Iterator<String> iterator = trail.iterator(); 
iterator.hasNext(); )
         {
-            String next = ( String ) iterator.next();
+            String next = iterator.next();
             if ( optionalArtifactIds.contains( next ) )
             {
                 return true;
@@ -1036,9 +1035,9 @@ public class BundlePlugin extends Abstra
     }
 
 
-    private static Map getProperties( Model projectModel, String prefix )
+    private static Map<String, String> getProperties( Model projectModel, 
String prefix )
     {
-        Map properties = new LinkedHashMap();
+        Map<String, String> properties = new LinkedHashMap<String, String>();
         Method methods[] = Model.class.getDeclaredMethods();
         for ( int i = 0; i < methods.length; i++ )
         {
@@ -1054,7 +1053,7 @@ public class BundlePlugin extends Abstra
                         if ( v.getClass().isArray() )
                             properties.put( name, Arrays.asList( ( Object[] ) 
v ).toString() );
                         else
-                            properties.put( name, v );
+                            properties.put( name, v.toString() );
 
                     }
                 }
@@ -1068,15 +1067,15 @@ public class BundlePlugin extends Abstra
     }
 
 
-    private static StringBuffer printLicenses( List licenses )
+    private static StringBuffer printLicenses( List<License> licenses )
     {
         if ( licenses == null || licenses.size() == 0 )
             return null;
         StringBuffer sb = new StringBuffer();
         String del = "";
-        for ( Iterator i = licenses.iterator(); i.hasNext(); )
+        for ( Iterator<License> i = licenses.iterator(); i.hasNext(); )
         {
-            License l = ( License ) i.next();
+            License l = i.next();
             String url = l.getUrl();
             if ( url == null )
                 continue;
@@ -1112,17 +1111,17 @@ public class BundlePlugin extends Abstra
 
     protected Jar[] getClasspath( MavenProject currentProject ) throws 
IOException, MojoExecutionException
     {
-        List list = new ArrayList();
+        List<Jar> list = new ArrayList<Jar>();
 
         if ( getOutputDirectory() != null && getOutputDirectory().exists() )
         {
             list.add( new Jar( ".", getOutputDirectory() ) );
         }
 
-        final Collection artifacts = getSelectedDependencies( 
currentProject.getArtifacts() );
-        for ( Iterator it = artifacts.iterator(); it.hasNext(); )
+        final Collection<Artifact> artifacts = getSelectedDependencies( 
currentProject.getArtifacts() );
+        for ( Iterator<Artifact> it = artifacts.iterator(); it.hasNext(); )
         {
-            Artifact artifact = ( Artifact ) it.next();
+            Artifact artifact = it.next();
             if ( artifact.getArtifactHandler().isAddedToClasspath() )
             {
                 if ( !Artifact.SCOPE_TEST.equals( artifact.getScope() ) )
@@ -1146,7 +1145,7 @@ public class BundlePlugin extends Abstra
     }
 
 
-    private Collection getSelectedDependencies( Collection artifacts ) throws 
MojoExecutionException
+    private Collection<Artifact> getSelectedDependencies( Collection<Artifact> 
artifacts ) throws MojoExecutionException
     {
         if ( null == excludeDependencies || excludeDependencies.length() == 0 )
         {
@@ -1154,10 +1153,10 @@ public class BundlePlugin extends Abstra
         }
         else if ( "true".equalsIgnoreCase( excludeDependencies ) )
         {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
 
-        Collection selectedDependencies = new LinkedHashSet( artifacts );
+        Collection<Artifact> selectedDependencies = new 
LinkedHashSet<Artifact>( artifacts );
         DependencyExcluder excluder = new DependencyExcluder( artifacts );
         excluder.processHeaders( excludeDependencies );
         selectedDependencies.removeAll( excluder.getExcludedArtifacts() );
@@ -1291,9 +1290,9 @@ public class BundlePlugin extends Abstra
         properties.putAll( currentProject.getProperties() );
         properties.putAll( currentProject.getModel().getProperties() );
 
-        for ( Iterator i = currentProject.getFilters().iterator(); 
i.hasNext(); )
+        for ( Iterator<String> i = currentProject.getFilters().iterator(); 
i.hasNext(); )
         {
-            File filterFile = new File( ( String ) i.next() );
+            File filterFile = new File( i.next() );
             if ( filterFile.isFile() )
             {
                 properties.putAll( PropertyUtils.loadProperties( filterFile ) 
);
@@ -1306,9 +1305,9 @@ public class BundlePlugin extends Abstra
             {
                 // don't pass upper-case session settings to bnd as they end 
up in the manifest
                 Properties sessionProperties = 
m_mavenSession.getExecutionProperties();
-                for ( Enumeration e = sessionProperties.propertyNames(); 
e.hasMoreElements(); )
+                for ( Enumeration<String> e = (Enumeration<String>) 
sessionProperties.propertyNames(); e.hasMoreElements(); )
                 {
-                    String key = ( String ) e.nextElement();
+                    String key = e.nextElement();
                     if ( key.length() > 0 && !Character.isUpperCase( 
key.charAt( 0 ) ) )
                     {
                         properties.put( key, sessionProperties.getProperty( 
key ) );
@@ -1455,17 +1454,17 @@ public class BundlePlugin extends Abstra
     }
 
 
-    private static List getMavenResources( MavenProject currentProject, 
boolean test )
+    private static List<Resource> getMavenResources( MavenProject 
currentProject, boolean test )
     {
-        List resources = new ArrayList( test ? 
currentProject.getTestResources() : currentProject.getResources() );
+        List<Resource> resources = new ArrayList<Resource>( test ? 
currentProject.getTestResources() : currentProject.getResources() );
 
         if ( currentProject.getCompileSourceRoots() != null )
         {
             // also scan for any "packageinfo" files lurking in the source 
folders
-            List packageInfoIncludes = Collections.singletonList( 
"**/packageinfo" );
-            for ( Iterator i = 
currentProject.getCompileSourceRoots().iterator(); i.hasNext(); )
+            final List<String> packageInfoIncludes = 
Collections.singletonList( "**/packageinfo" );
+            for ( Iterator<String> i = 
currentProject.getCompileSourceRoots().iterator(); i.hasNext(); )
             {
-                String sourceRoot = ( String ) i.next();
+                String sourceRoot = i.next();
                 Resource packageInfoResource = new Resource();
                 packageInfoResource.setDirectory( sourceRoot );
                 packageInfoResource.setIncludes( packageInfoIncludes );
@@ -1481,10 +1480,10 @@ public class BundlePlugin extends Abstra
     {
         final String basePath = currentProject.getBasedir().getAbsolutePath();
 
-        Set pathSet = new LinkedHashSet();
-        for ( Iterator i = getMavenResources( currentProject, test 
).iterator(); i.hasNext(); )
+        Set<String> pathSet = new LinkedHashSet<String>();
+        for ( Iterator<Resource> i = getMavenResources( currentProject, test 
).iterator(); i.hasNext(); )
         {
-            Resource resource = ( Resource ) i.next();
+            Resource resource = i.next();
 
             final String sourcePath = resource.getDirectory();
             final String targetPath = resource.getTargetPath();
@@ -1512,11 +1511,11 @@ public class BundlePlugin extends Abstra
                 scanner.addDefaultExcludes();
                 scanner.scan();
 
-                List includedFiles = Arrays.asList( scanner.getIncludedFiles() 
);
+                List<String> includedFiles = Arrays.asList( 
scanner.getIncludedFiles() );
 
-                for ( Iterator j = includedFiles.iterator(); j.hasNext(); )
+                for ( Iterator<String> j = includedFiles.iterator(); 
j.hasNext(); )
                 {
-                    String name = ( String ) j.next();
+                    String name = j.next();
                     String path = sourcePath + '/' + name;
 
                     // make relative to project
@@ -1559,7 +1558,7 @@ public class BundlePlugin extends Abstra
         }
 
         StringBuffer resourcePaths = new StringBuffer();
-        for ( Iterator i = pathSet.iterator(); i.hasNext(); )
+        for ( Iterator<String> i = pathSet.iterator(); i.hasNext(); )
         {
             resourcePaths.append( i.next() );
             if ( i.hasNext() )
@@ -1572,10 +1571,10 @@ public class BundlePlugin extends Abstra
     }
 
 
-    protected Collection getEmbeddableArtifacts( MavenProject currentProject, 
Analyzer analyzer )
+    protected Collection<Artifact> getEmbeddableArtifacts( MavenProject 
currentProject, Analyzer analyzer )
         throws MojoExecutionException
     {
-        final Collection artifacts;
+        final Collection<Artifact> artifacts;
 
         String embedTransitive = analyzer.getProperty( 
DependencyEmbedder.EMBED_TRANSITIVE );
         if ( Boolean.valueOf( embedTransitive ).booleanValue() )
@@ -1598,22 +1597,22 @@ public class BundlePlugin extends Abstra
         // pass maven source paths onto BND analyzer
         StringBuilder mavenSourcePaths = new StringBuilder();
         StringBuilder mavenTestSourcePaths = new StringBuilder();
-        Map<StringBuilder, List<?>> map = new HashMap<StringBuilder, 
List<?>>(2);
+        Map<StringBuilder, List<String>> map = new HashMap<StringBuilder, 
List<String>>(2);
         map.put(mavenSourcePaths, currentProject.getCompileSourceRoots() );
         map.put(mavenTestSourcePaths, 
currentProject.getTestCompileSourceRoots() );
-        for ( Map.Entry<StringBuilder, List<?>> entry : map.entrySet() )
+        for ( Map.Entry<StringBuilder, List<String>> entry : map.entrySet() )
         {
-            List<?> compileSourceRoots = entry.getValue();
+            List<String> compileSourceRoots = entry.getValue();
             if ( compileSourceRoots != null )
             {
                 StringBuilder sourcePaths = entry.getKey();
-                for ( Iterator i = compileSourceRoots.iterator(); i.hasNext(); 
)
+                for ( Iterator<String> i = compileSourceRoots.iterator(); 
i.hasNext(); )
                 {
                     if ( sourcePaths.length() > 0 )
                     {
                         sourcePaths.append( ',' );
                     }
-                    sourcePaths.append( ( String ) i.next() );
+                    sourcePaths.append( i.next() );
                 }
             }
         }

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
 Wed Mar  4 13:26:21 2015
@@ -34,7 +34,7 @@ import aQute.bnd.osgi.Analyzer;
 
 /**
  * Add BND directives to embed selected dependencies inside a bundle
- * 
+ *
  * @author <a href="mailto:[email protected]";>Felix Project Team</a>
  */
 public final class DependencyEmbedder extends AbstractDependencyFilter
@@ -54,29 +54,22 @@ public final class DependencyEmbedder ex
     private String m_embedStripVersion;
 
     /**
-     * Maven logger.
-     */
-    private final Log m_log;
-
-    /**
      * Inlined paths.
      */
-    private final Collection m_inlinedPaths;
+    private final Collection<String> m_inlinedPaths;
 
     /**
      * Embedded artifacts.
      */
-    private final Collection m_embeddedArtifacts;
+    private final Collection<Artifact> m_embeddedArtifacts;
 
 
-    public DependencyEmbedder( Log log, Collection dependencyArtifacts )
+    public DependencyEmbedder( Log log, Collection<Artifact> 
dependencyArtifacts )
     {
         super( dependencyArtifacts );
 
-        m_log = log;
-
-        m_inlinedPaths = new LinkedHashSet();
-        m_embeddedArtifacts = new LinkedHashSet();
+        m_inlinedPaths = new LinkedHashSet<String>();
+        m_embeddedArtifacts = new LinkedHashSet<Artifact>();
     }
 
 
@@ -98,13 +91,13 @@ public final class DependencyEmbedder ex
 
             processInstructions( embedDependencyHeader );
 
-            for ( Iterator i = m_inlinedPaths.iterator(); i.hasNext(); )
+            for ( Iterator<String> i = m_inlinedPaths.iterator(); i.hasNext(); 
)
             {
-                inlineDependency( ( String ) i.next(), includeResource );
+                inlineDependency( i.next(), includeResource );
             }
-            for ( Iterator i = m_embeddedArtifacts.iterator(); i.hasNext(); )
+            for ( Iterator<Artifact> i = m_embeddedArtifacts.iterator(); 
i.hasNext(); )
             {
-                embedDependency( ( Artifact ) i.next(), includeResource, 
bundleClassPath, embeddedArtifacts );
+                embedDependency( i.next(), includeResource, bundleClassPath, 
embeddedArtifacts );
             }
         }
 
@@ -124,7 +117,7 @@ public final class DependencyEmbedder ex
 
 
     @Override
-    protected void processDependencies( Collection dependencies, String inline 
)
+    protected void processDependencies( Collection<Artifact> dependencies, 
String inline )
     {
         if ( null == inline || "false".equalsIgnoreCase( inline ) )
         {
@@ -132,15 +125,15 @@ public final class DependencyEmbedder ex
         }
         else
         {
-            for ( Iterator i = dependencies.iterator(); i.hasNext(); )
+            for ( Iterator<Artifact> i = dependencies.iterator(); i.hasNext(); 
)
             {
-                addInlinedPaths( ( Artifact ) i.next(), inline, m_inlinedPaths 
);
+                addInlinedPaths( i.next(), inline, m_inlinedPaths );
             }
         }
     }
 
 
-    private static void addInlinedPaths( Artifact dependency, String inline, 
Collection inlinedPaths )
+    private static void addInlinedPaths( Artifact dependency, String inline, 
Collection<String> inlinedPaths )
     {
         File path = dependency.getFile();
         if ( null != path && path.exists() )
@@ -252,13 +245,13 @@ public final class DependencyEmbedder ex
     }
 
 
-    public Collection getInlinedPaths()
+    public Collection<String> getInlinedPaths()
     {
         return m_inlinedPaths;
     }
 
 
-    public Collection getEmbeddedArtifacts()
+    public Collection<Artifact> getEmbeddedArtifacts()
     {
         return m_embeddedArtifacts;
     }

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyExcluder.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyExcluder.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyExcluder.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyExcluder.java
 Wed Mar  4 13:26:21 2015
@@ -22,12 +22,13 @@ package org.apache.felix.bundleplugin;
 import java.util.Collection;
 import java.util.HashSet;
 
+import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 
 
 /**
  * Exclude selected dependencies from the classpath passed to BND.
- * 
+ *
  * @author <a href="mailto:[email protected]";>Felix Project Team</a>
  */
 public final class DependencyExcluder extends AbstractDependencyFilter
@@ -35,14 +36,14 @@ public final class DependencyExcluder ex
     /**
      * Excluded artifacts.
      */
-    private final Collection m_excludedArtifacts;
+    private final Collection<Artifact> m_excludedArtifacts;
 
 
-    public DependencyExcluder( Collection dependencyArtifacts )
+    public DependencyExcluder( Collection<Artifact> dependencyArtifacts )
     {
         super( dependencyArtifacts );
 
-        m_excludedArtifacts = new HashSet();
+        m_excludedArtifacts = new HashSet<Artifact>();
     }
 
 
@@ -58,13 +59,13 @@ public final class DependencyExcluder ex
 
 
     @Override
-    protected void processDependencies( Collection dependencies, String inline 
)
+    protected void processDependencies( Collection<Artifact> dependencies, 
String inline )
     {
         m_excludedArtifacts.addAll( dependencies );
     }
 
 
-    public Collection getExcludedArtifacts()
+    public Collection<Artifact> getExcludedArtifacts()
     {
         return m_excludedArtifacts;
     }

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/InstructionsPlugin.java
 Wed Mar  4 13:26:21 2015
@@ -34,14 +34,15 @@ import aQute.bnd.osgi.Jar;
 
 /**
  * Generate BND instructions for this project
- * 
+ *
  * @goal instructions
  * @requiresDependencyResolution test
  * @threadSafe
  */
 public class InstructionsPlugin extends BundlePlugin
 {
-    protected void execute( MavenProject project, Map instructions, Properties 
properties, Jar[] classpath )
+    @Override
+    protected void execute( MavenProject project, Map<String, String> 
instructions, Properties properties, Jar[] classpath )
         throws MojoExecutionException
     {
         if ( dumpInstructions == null )

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
 Wed Mar  4 13:26:21 2015
@@ -43,7 +43,7 @@ import aQute.bnd.osgi.Resource;
 
 /**
  * Generate an OSGi manifest for this project
- * 
+ *
  * @goal manifest
  * @phase process-classes
  * @requiresDependencyResolution test
@@ -52,7 +52,7 @@ import aQute.bnd.osgi.Resource;
 public class ManifestPlugin extends BundlePlugin
 {
     /**
-     * When true, generate the manifest by rebuilding the full bundle in 
memory 
+     * When true, generate the manifest by rebuilding the full bundle in memory
      *
      * @parameter expression="${rebuildBundle}"
      */
@@ -60,7 +60,7 @@ public class ManifestPlugin extends Bund
 
 
     @Override
-    protected void execute( MavenProject project, Map instructions, Properties 
properties, Jar[] classpath )
+    protected void execute( MavenProject project, Map<String, String> 
instructions, Properties properties, Jar[] classpath )
         throws MojoExecutionException
     {
         Manifest manifest;
@@ -104,11 +104,11 @@ public class ManifestPlugin extends Bund
     public Manifest getManifest( MavenProject project, Jar[] classpath ) 
throws IOException, MojoFailureException,
         MojoExecutionException, Exception
     {
-        return getManifest( project, new LinkedHashMap(), new Properties(), 
classpath );
+        return getManifest( project, new LinkedHashMap<String, String>(), new 
Properties(), classpath );
     }
 
 
-    public Manifest getManifest( MavenProject project, Map instructions, 
Properties properties, Jar[] classpath )
+    public Manifest getManifest( MavenProject project, Map<String, String> 
instructions, Properties properties, Jar[] classpath )
         throws IOException, MojoFailureException, MojoExecutionException, 
Exception
     {
         Analyzer analyzer = getAnalyzer( project, instructions, properties, 
classpath );
@@ -152,11 +152,11 @@ public class ManifestPlugin extends Bund
     protected Analyzer getAnalyzer( MavenProject project, Jar[] classpath ) 
throws IOException, MojoExecutionException,
         Exception
     {
-        return getAnalyzer( project, new LinkedHashMap(), new Properties(), 
classpath );
+        return getAnalyzer( project, new LinkedHashMap<String, String>(), new 
Properties(), classpath );
     }
 
 
-    protected Analyzer getAnalyzer( MavenProject project, Map instructions, 
Properties properties, Jar[] classpath )
+    protected Analyzer getAnalyzer( MavenProject project, Map<String, String> 
instructions, Properties properties, Jar[] classpath )
         throws IOException, MojoExecutionException, Exception
     {
         if ( rebuildBundle && supportedProjectTypes.contains( 
project.getArtifact().getType() ) )

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java
 Wed Mar  4 13:26:21 2015
@@ -196,55 +196,4 @@ public class ManifestWriter {
             writeEntry(out, entry.getKey(), entry.getValue(), nice);
         }
     }
-
-    private static Manifest clean(Manifest org) {
-
-        Manifest result = new Manifest();
-        for (Map.Entry< ? , ? > entry : org.getMainAttributes().entrySet()) {
-            String nice = clean((String) entry.getValue());
-            result.getMainAttributes().put(entry.getKey(), nice);
-        }
-        for (String name : org.getEntries().keySet()) {
-            Attributes attrs = result.getAttributes(name);
-            if (attrs == null) {
-                attrs = new Attributes();
-                result.getEntries().put(name, attrs);
-            }
-
-            for (Map.Entry< ? , ? > entry : 
org.getAttributes(name).entrySet()) {
-                String nice = clean((String) entry.getValue());
-                attrs.put(entry.getKey(), nice);
-            }
-        }
-        return result;
-    }
-
-    private static String clean(String s) {
-        StringBuilder sb = new StringBuilder(s);
-        boolean changed = false;
-        boolean replacedPrev = false;
-        for ( int i=0; i<sb.length(); i++) {
-            char c = s.charAt(i);
-            switch(c) {
-            case 0:
-            case '\n':
-            case '\r':
-                changed = true;
-                if ( !replacedPrev ) {
-                    sb.replace(i, i+1, " ");
-                    replacedPrev= true;
-                } else
-                    sb.delete(i, i+1);
-                break;
-            default:
-                replacedPrev = false;
-                break;
-            }
-        }
-        if ( changed)
-            return sb.toString();
-        else
-            return s;
-    }
-
 }

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ScrPlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ScrPlugin.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ScrPlugin.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ScrPlugin.java
 Wed Mar  4 13:26:21 2015
@@ -26,15 +26,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Pattern;
 
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
@@ -42,17 +36,10 @@ import javax.xml.transform.stream.Stream
 import javax.xml.transform.stream.StreamSource;
 
 import aQute.bnd.osgi.Analyzer;
-import aQute.bnd.osgi.Descriptors.PackageRef;
-import aQute.bnd.osgi.Jar;
 import aQute.bnd.osgi.Processor;
 import aQute.bnd.osgi.Resource;
 import aQute.bnd.service.AnalyzerPlugin;
 import aQute.libg.generics.Create;
-import org.apache.felix.utils.manifest.Attribute;
-import org.apache.felix.utils.manifest.Clause;
-import org.osgi.framework.Constants;
-
-import static org.apache.felix.utils.manifest.Parser.parseHeader;
 
 
 public class ScrPlugin implements AnalyzerPlugin

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java?rev=1663988&r1=1663987&r2=1663988&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/VersionCleanerPlugin.java
 Wed Mar  4 13:26:21 2015
@@ -45,7 +45,7 @@ public class VersionCleanerPlugin extend
      *
      * @parameter
      */
-    private Map versions = new LinkedHashMap();
+    private Map<String, String> versions = new LinkedHashMap<String, String>();
 
     /**
      * The Maven project.
@@ -73,10 +73,9 @@ public class VersionCleanerPlugin extend
 
     public void execute() throws MojoExecutionException, MojoFailureException
     {
-        for ( Object key : versions.keySet() )
+        for ( String name : versions.keySet() )
         {
-            String name = ( String ) key;
-            String version = ( String ) versions.get( key );
+            String version = versions.get( name );
             String osgi = maven2OsgiConverter.getVersion( version );
             project.getProperties().put( name, osgi );
         }


Reply via email to