felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1854548 - in /felix/trunk/tools/maven-bundle-plugin/src: main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java test/java/org/apache/felix/bundleplugin/ArtifactStubFactory.java
Date Thu, 28 Feb 2019 21:15:06 GMT
Author: gnodet
Date: Thu Feb 28 21:15:06 2019
New Revision: 1854548

URL: http://svn.apache.org/viewvc?rev=1854548&view=rev
Log:
[FELIX-6075] Upgrade to JDK 8

Modified:
    felix/trunk/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
    felix/trunk/tools/maven-bundle-plugin/src/test/java/org/apache/felix/bundleplugin/ArtifactStubFactory.java

Modified: felix/trunk/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
URL: http://svn.apache.org/viewvc/felix/trunk/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java?rev=1854548&r1=1854547&r2=1854548&view=diff
==============================================================================
--- felix/trunk/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
(original)
+++ felix/trunk/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
Thu Feb 28 21:15:06 2019
@@ -21,7 +21,6 @@ package org.apache.felix.bundleplugin;
 
 import java.io.File;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.LinkedHashSet;
 
 import org.apache.maven.artifact.Artifact;
@@ -91,13 +90,13 @@ public final class DependencyEmbedder ex
 
             processInstructions( embedDependencyHeader );
 
-            for ( Iterator<String> i = m_inlinedPaths.iterator(); i.hasNext(); )
+            for ( String path : m_inlinedPaths )
             {
-                inlineDependency( i.next(), includeResource );
+                inlineDependency( path, includeResource );
             }
-            for ( Iterator<Artifact> i = m_embeddedArtifacts.iterator(); i.hasNext();
)
+            for ( Artifact artifact : m_embeddedArtifacts )
             {
-                embedDependency( i.next(), includeResource, bundleClassPath, embeddedArtifacts
);
+                embedDependency( artifact, includeResource, bundleClassPath, embeddedArtifacts
);
             }
         }
 
@@ -125,9 +124,9 @@ public final class DependencyEmbedder ex
         }
         else
         {
-            for ( Iterator<Artifact> i = dependencies.iterator(); i.hasNext(); )
+            for ( Artifact dependency : dependencies )
             {
-                addInlinedPaths( i.next(), inline, m_inlinedPaths );
+                addInlinedPaths( dependency, inline, m_inlinedPaths );
             }
         }
     }
@@ -145,11 +144,11 @@ public final class DependencyEmbedder ex
             else
             {
                 String[] filters = inline.split( "\\|" );
-                for ( int i = 0; i < filters.length; i++ )
+                for ( String filter : filters )
                 {
-                    if ( filters[i].length() > 0 )
+                    if ( filter.length() > 0 )
                     {
-                        inlinedPaths.add( path + "!/" + filters[i] );
+                        inlinedPaths.add( path + "!/" + filter );
                     }
                 }
             }
@@ -169,14 +168,14 @@ public final class DependencyEmbedder ex
                 embedDirectory = null;
             }
 
-            if ( false == Boolean.valueOf( m_embedStripGroup ).booleanValue() )
+            if ( !Boolean.valueOf( m_embedStripGroup ) )
             {
                 embedDirectory = new File( embedDirectory, dependency.getGroupId() ).getPath();
             }
 
-            StringBuffer targetFileName = new StringBuffer();
+            StringBuilder targetFileName = new StringBuilder();
             targetFileName.append( dependency.getArtifactId() );
-            if ( false == Boolean.valueOf( m_embedStripVersion ).booleanValue() )
+            if ( !Boolean.valueOf( m_embedStripVersion ) )
             {
                 targetFileName.append( '-' ).append( dependency.getVersion() );
                 if ( StringUtils.isNotEmpty( dependency.getClassifier() ) )
@@ -265,7 +264,7 @@ public final class DependencyEmbedder ex
         final String instruction = analyzer.getProperty( directiveName );
         if ( StringUtils.isNotEmpty( instruction ) )
         {
-            if ( instruction.indexOf( MAVEN_DEPENDENCIES ) >= 0 )
+            if ( instruction.contains( MAVEN_DEPENDENCIES ) )
             {
                 // if there are no embeddded dependencies, we do a special treatment and
replace
                 // every occurance of MAVEN_DEPENDENCIES and a following comma with an empty
string

Modified: felix/trunk/tools/maven-bundle-plugin/src/test/java/org/apache/felix/bundleplugin/ArtifactStubFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/tools/maven-bundle-plugin/src/test/java/org/apache/felix/bundleplugin/ArtifactStubFactory.java?rev=1854548&r1=1854547&r2=1854548&view=diff
==============================================================================
--- felix/trunk/tools/maven-bundle-plugin/src/test/java/org/apache/felix/bundleplugin/ArtifactStubFactory.java
(original)
+++ felix/trunk/tools/maven-bundle-plugin/src/test/java/org/apache/felix/bundleplugin/ArtifactStubFactory.java
Thu Feb 28 21:15:06 2019
@@ -29,7 +29,6 @@ import org.apache.maven.artifact.Artifac
 /**
  * Fixed version of class that uses stable set ordering for reliable testing.
  */
-@SuppressWarnings( { "rawtypes", "unchecked" } )
 class ArtifactStubFactory extends org.apache.maven.plugin.testing.ArtifactStubFactory
 {
 
@@ -39,9 +38,9 @@ class ArtifactStubFactory extends org.ap
     }
 
     @Override
-    public Set getClassifiedArtifacts() throws IOException
+    public Set<Artifact> getClassifiedArtifacts() throws IOException
     {
-        Set set = new LinkedHashSet();
+        Set<Artifact> set = new LinkedHashSet<>();
         set.add( createArtifact( "g", "a", "1.0", Artifact.SCOPE_COMPILE, "jar", "one" )
);
         set.add( createArtifact( "g", "b", "1.0", Artifact.SCOPE_COMPILE, "jar", "two" )
);
         set.add( createArtifact( "g", "c", "1.0", Artifact.SCOPE_COMPILE, "jar", "three"
) );
@@ -50,9 +49,9 @@ class ArtifactStubFactory extends org.ap
     }
 
     @Override
-    public Set getScopedArtifacts() throws IOException
+    public Set<Artifact> getScopedArtifacts() throws IOException
     {
-        Set set = new LinkedHashSet();
+        Set<Artifact> set = new LinkedHashSet<>();
         set.add( createArtifact( "g", "compile", "1.0", Artifact.SCOPE_COMPILE ) );
         set.add( createArtifact( "g", "provided", "1.0", Artifact.SCOPE_PROVIDED ) );
         set.add( createArtifact( "g", "test", "1.0", Artifact.SCOPE_TEST ) );
@@ -62,9 +61,9 @@ class ArtifactStubFactory extends org.ap
     }
 
     @Override
-    public Set getTypedArtifacts() throws IOException
+    public Set<Artifact> getTypedArtifacts() throws IOException
     {
-        Set set = new LinkedHashSet();
+        Set<Artifact> set = new LinkedHashSet<>();
         set.add( createArtifact( "g", "a", "1.0", Artifact.SCOPE_COMPILE, "war", null ) );
         set.add( createArtifact( "g", "b", "1.0", Artifact.SCOPE_COMPILE, "jar", null ) );
         set.add( createArtifact( "g", "c", "1.0", Artifact.SCOPE_COMPILE, "sources", null
) );



Mime
View raw message