felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r618193 - in /felix/trunk/bundleplugin/src: main/java/org/apache/felix/bundleplugin/ test/java/org/apache/felix/bundleplugin/
Date Mon, 04 Feb 2008 07:57:10 GMT
Author: mcculls
Date: Sun Feb  3 23:57:09 2008
New Revision: 618193

URL: http://svn.apache.org/viewvc?rev=618193&view=rev
Log:
Cleanup minor code warnings

Modified:
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.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/ManifestPlugin.java
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java
    felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundleAllPluginTest.java

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java?rev=618193&r1=618192&r2=618193&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java
(original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java
Sun Feb  3 23:57:09 2008
@@ -226,10 +226,8 @@
                 {
                     continue;
                 }
-                else
-                {
-                    throw new MojoExecutionException( "Artifact was not found in the repo"
+ node.getArtifact(), e );
-                }
+
+                throw new MojoExecutionException( "Artifact was not found in the repo" +
node.getArtifact(), e );
             }
 
             node.getArtifact().setFile( artifact.getFile() );

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=618193&r1=618192&r2=618193&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
Sun Feb  3 23:57:09 2008
@@ -535,7 +535,7 @@
     }
 
 
-    private static Map getProperties( Model projectModel, String prefix, Object model )
+    private static Map getProperties( Model projectModel, String prefix )
     {
         Map properties = new HashMap();
         Method methods[] = Model.class.getDeclaredMethods();
@@ -760,9 +760,9 @@
 
         properties.putAll( currentProject.getProperties() );
         properties.putAll( currentProject.getModel().getProperties() );
-        properties.putAll( getProperties( currentProject.getModel(), "project.build.", currentProject.getBuild()
) );
-        properties.putAll( getProperties( currentProject.getModel(), "pom.", currentProject.getModel()
) );
-        properties.putAll( getProperties( currentProject.getModel(), "project.", currentProject
) );
+        properties.putAll( getProperties( currentProject.getModel(), "project.build." ) );
+        properties.putAll( getProperties( currentProject.getModel(), "pom." ) );
+        properties.putAll( getProperties( currentProject.getModel(), "project." ) );
         properties.put( "project.baseDir", baseDir );
         properties.put( "project.build.directory", getBuildDirectory() );
         properties.put( "project.build.outputdirectory", getOutputDirectory() );
@@ -890,10 +890,8 @@
             // includes transitive dependencies
             return project.getArtifacts();
         }
-        else
-        {
-            // only includes direct dependencies
-            return project.getDependencyArtifacts();
-        }
+
+        // only includes direct dependencies
+        return project.getDependencyArtifacts();
     }
 }

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=618193&r1=618192&r2=618193&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
Sun Feb  3 23:57:09 2008
@@ -154,14 +154,19 @@
         abstract boolean matches( Artifact dependency );
 
 
-        private boolean matches( String text )
+        boolean matches( String text )
         {
+            boolean result;
+
             if ( null == text )
             {
-                text = m_defaultValue;
+                result = m_instruction.matches( m_defaultValue );
+            }
+            else
+            {
+                result = m_instruction.matches( text );
             }
 
-            boolean result = m_instruction.matches( text );
             return m_instruction.isNegated() ? !result : result;
         }
     }

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=618193&r1=618192&r2=618193&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
Sun Feb  3 23:57:09 2008
@@ -37,7 +37,7 @@
 
 /**
  * Generate an OSGi manifest for this project
- *
+ * 
  * @goal manifest
  * @phase process-classes
  * @requiresDependencyResolution runtime
@@ -89,7 +89,7 @@
 
     public Manifest getManifest( MavenProject project, Jar[] classpath ) throws IOException
     {
-        return getManifest( project, null, null, classpath );
+        return getManifest( project, new Properties(), new Properties(), classpath );
     }
 
 
@@ -166,16 +166,13 @@
         }
         finally
         {
-            if ( os != null )
+            try
             {
-                try
-                {
-                    os.close();
-                }
-                catch ( IOException e )
-                {
-                    //nothing we can do here
-                }
+                os.close();
+            }
+            catch ( IOException e )
+            {
+                // nothing we can do here
             }
         }
     }

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java?rev=618193&r1=618192&r2=618193&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java (original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/OBRInstall.java Sun
Feb  3 23:57:09 2008
@@ -26,7 +26,6 @@
 import org.apache.felix.obr.plugin.ObrUtils;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
 
@@ -67,7 +66,7 @@
     private MavenProject project;
 
 
-    public void execute() throws MojoExecutionException
+    public void execute()
     {
         if ( "NONE".equalsIgnoreCase( obrRepository ) )
         {

Modified: felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundleAllPluginTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundleAllPluginTest.java?rev=618193&r1=618192&r2=618193&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundleAllPluginTest.java
(original)
+++ felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundleAllPluginTest.java
Sun Feb  3 23:57:09 2008
@@ -52,9 +52,9 @@
     private void init()
     {
         plugin = new BundleAllPlugin();
-        File basedir = new File( getBasedir() );
-        plugin.setBasedir( basedir );
-        File buildDirectory = new File( basedir, "target" );
+        File baseDirectory = new File( getBasedir() );
+        plugin.setBasedir( baseDirectory );
+        File buildDirectory = new File( baseDirectory, "target" );
         plugin.setBuildDirectory( buildDirectory.getPath() );
         File outputDirectory = new File( buildDirectory, "test-classes" );
         plugin.setOutputDirectory( outputDirectory );



Mime
View raw message