Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 12727 invoked from network); 4 Feb 2008 07:57:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2008 07:57:35 -0000 Received: (qmail 59884 invoked by uid 500); 4 Feb 2008 07:57:27 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 59858 invoked by uid 500); 4 Feb 2008 07:57:27 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 59849 invoked by uid 99); 4 Feb 2008 07:57:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2008 23:57:27 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2008 07:57:19 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A51DD1A9832; Sun, 3 Feb 2008 23:57:11 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@felix.apache.org From: mcculls@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080204075711.A51DD1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 );