Source:
<code>private void mergeManifests() throws MojoExecutionException { getLog().debug( "mergeManifests: " + mergeManifests ); if ( !mergeManifests ) { getLog().info( "Manifest merging disabled. Using project manifest only" ); return; } getLog().info( "Getting manifests of dependent apklibs" ); List<File> libManifests = new ArrayList<File>(); for ( Artifact artifact : getAllRelevantDependencyArtifacts() ) { if ( artifact.getType().equals( APKLIB ) ) { File apklibManifeset = new File( getLibraryUnpackDirectory( artifact ), "AndroidManifest.xml" ); if ( !apklibManifeset.exists() ) { throw new MojoExecutionException( artifact.getArtifactId() + " is missing AndroidManifest.xml" ); } libManifests.add( apklibManifeset ); } } <START> if ( libManifests.size() > 0 ) <END> { File mergedManifest = new File( androidManifestFile.getParent(), "AndroidManifest-merged.xml" ); File sdkLibs = getAndroidSdk().getSDKLibJar(); File mergerLib = getAndroidSdk().getManifmergerJar(); ManifestMerger.initialize( getLog(), sdkLibs, mergerLib ); ManifestMerger mm = new ManifestMerger(); getLog().info( "Merging manifests of dependent apklibs" ); if ( mm.process( mergedManifest, androidManifestFile, libManifests.toArray( new File[libManifests.size()] ) ) ) { androidManifestFile.delete(); mergedManifest.renameTo( androidManifestFile ); getLog().info( "Done Merging Manifests of APKLIBs" ); } else { getLog().error( "Manifests were not merged!" ); throw new MojoExecutionException( "Manifests were not merged!" ); } } else { getLog().info( "No APKLIB manifests found. Using project manifest only." ); } }</code><technical_language>!isEmpty() is easier read</technical_language>

Target:
private void mergeManifests() throws MojoExecutionException { getLog().debug( "mergeManifests: " + mergeManifests ); if ( !mergeManifests ) { getLog().info( "Manifest merging disabled. Using project manifest only" ); return; } getLog().info( "Getting manifests of dependent apklibs" ); List<File> libManifests = new ArrayList<File>(); for ( Artifact artifact : getAllRelevantDependencyArtifacts() ) { if ( artifact.getType().equals( APKLIB ) ) { File apklibManifeset = new File( getLibraryUnpackDirectory( artifact ), "AndroidManifest.xml" ); if ( !apklibManifeset.exists() ) { throw new MojoExecutionException( artifact.getArtifactId() + " is missing AndroidManifest.xml" ); } libManifests.add( apklibManifeset ); } } if ( !libManifests.isEmpty() ) { File mergedManifest = new File( androidManifestFile.getParent(), "AndroidManifest-merged.xml" ); File sdkLibs = getAndroidSdk().getSDKLibJar(); File mergerLib = getAndroidSdk().getManifmergerJar(); ManifestMerger mm = new ManifestMerger( getLog(), sdkLibs, mergerLib ); getLog().info( "Merging manifests of dependent apklibs" ); if ( mm.process( mergedManifest, androidManifestFile, libManifests.toArray( new File[libManifests.size()] ) ) ) { androidManifestFile.delete(); mergedManifest.renameTo( androidManifestFile ); getLog().info( "Done Merging Manifests of APKLIBs" ); } else { getLog().error( "Manifests were not merged!" ); throw new MojoExecutionException( "Manifests were not merged!" ); } } else { getLog().info( "No APKLIB manifests found. Using project manifest only." ); } }