Format code using Apache coding style
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@682125 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index cdc7623..b5bf8b2 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -210,8 +210,8 @@
// ignore unsupported project types, useful when bundleplugin is configured in parent pom
if ( !supportedProjectTypes.contains( projectType ) )
{
- getLog().warn( "Ignoring project type " + projectType +
- " - supportedProjectTypes = " + supportedProjectTypes );
+ getLog().warn(
+ "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes );
return;
}
@@ -362,8 +362,7 @@
// update BND instructions to add included Maven resources
includeMavenResources( currentProject, properties, getLog() );
- if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) &&
- !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
+ if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) && !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
{
if ( properties.containsKey( Analyzer.EXPORT_CONTENTS ) )
{
@@ -423,7 +422,8 @@
}
else
{
- String combinedResource = StringUtils.replace( includeResource, MAVEN_RESOURCES, mavenResourcePaths );
+ String combinedResource = StringUtils
+ .replace( includeResource, MAVEN_RESOURCES, mavenResourcePaths );
properties.put( Analyzer.INCLUDE_RESOURCE, combinedResource );
}
}
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
index d35d02b..3a89d4e 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
@@ -301,7 +301,7 @@
{
for ( Iterator i = filteredDependencies.iterator(); i.hasNext(); )
{
- addInlinedPaths( (Artifact) i.next(), inline, m_inlinedPaths );
+ addInlinedPaths( ( Artifact ) i.next(), inline, m_inlinedPaths );
}
}
}
@@ -319,7 +319,7 @@
}
else
{
- String[] filters = inline.split("\\|");
+ String[] filters = inline.split( "\\|" );
for ( int i = 0; i < filters.length; i++ )
{
if ( filters[i].length() > 0 )
@@ -447,7 +447,8 @@
// dependencies should be prepended so they can be overwritten by local resources
properties.setProperty( directiveName, mavenDependencies + ',' + instruction );
}
- else // Analyzer.BUNDLE_CLASSPATH
+ else
+ // Analyzer.BUNDLE_CLASSPATH
{
// for the classpath we want dependencies to be appended after local entries
properties.setProperty( directiveName, instruction + ',' + mavenDependencies );
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
index b461d83..94bbdcb 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
@@ -96,8 +96,8 @@
}
- public Manifest getManifest( MavenProject project, Jar[] classpath )
- throws IOException, MojoFailureException, MojoExecutionException
+ public Manifest getManifest( MavenProject project, Jar[] classpath ) throws IOException, MojoFailureException,
+ MojoExecutionException
{
return getManifest( project, new Properties(), new Properties(), classpath );
}
@@ -135,8 +135,7 @@
}
- protected Analyzer getAnalyzer( MavenProject project, Jar[] classpath )
- throws IOException, MojoExecutionException
+ protected Analyzer getAnalyzer( MavenProject project, Jar[] classpath ) throws IOException, MojoExecutionException
{
return getAnalyzer( project, new HashMap(), new Properties(), classpath );
}
@@ -170,9 +169,8 @@
analyzer.setJar( file );
- if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) &&
- !properties.containsKey( Analyzer.EXPORT_CONTENTS ) &&
- !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
+ if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) && !properties.containsKey( Analyzer.EXPORT_CONTENTS )
+ && !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
{
String export = analyzer.calculateExportsFromContents( analyzer.getJar() );
analyzer.setProperty( Analyzer.EXPORT_PACKAGE, export );
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
index bf25f00..14b426d 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeploy.java
@@ -170,8 +170,8 @@
// ignore unsupported project types, useful when bundleplugin is configured in parent pom
if ( !supportedProjectTypes.contains( projectType ) )
{
- getLog().warn( "Ignoring project type " + projectType +
- " - supportedProjectTypes = " + supportedProjectTypes );
+ getLog().warn(
+ "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes );
return;
}
else if ( "NONE".equalsIgnoreCase( remoteOBR ) || "false".equalsIgnoreCase( remoteOBR ) )
@@ -227,7 +227,7 @@
Config userConfig = new Config();
userConfig.setRemoteFile( true );
-
+
if ( bundleUrl != null )
{
// public URL differs from the bundle file location
@@ -237,7 +237,8 @@
{
// support absolute bundle URLs based on given prefix
URI bundleJar = ObrUtils.getArtifactURI( localRepository, project.getArtifact() );
- String relative = ObrUtils.getRelativeURI( ObrUtils.toFileURI( mavenRepository ), bundleJar).toASCIIString();
+ String relative = ObrUtils.getRelativeURI( ObrUtils.toFileURI( mavenRepository ), bundleJar )
+ .toASCIIString();
URL resourceURL = new URL( new URL( prefixUrl + '/' ), relative );
userConfig.setRemoteBundle( URI.create( resourceURL.toString() ) );
}
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
index ae3e07b..c7bb273 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrDeployFile.java
@@ -129,8 +129,8 @@
// ignore unsupported project types, useful when bundleplugin is configured in parent pom
if ( !supportedProjectTypes.contains( projectType ) )
{
- getLog().warn( "Ignoring project type " + projectType +
- " - supportedProjectTypes = " + supportedProjectTypes );
+ getLog().warn(
+ "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes );
return;
}
else if ( "NONE".equalsIgnoreCase( remoteOBR ) || "false".equalsIgnoreCase( remoteOBR ) )
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
index b8bd97d..a2b1566 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstall.java
@@ -100,8 +100,8 @@
// ignore unsupported project types, useful when bundleplugin is configured in parent pom
if ( !supportedProjectTypes.contains( projectType ) )
{
- getLog().warn( "Ignoring project type " + projectType +
- " - supportedProjectTypes = " + supportedProjectTypes );
+ getLog().warn(
+ "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes );
return;
}
else if ( "NONE".equalsIgnoreCase( obrRepository ) || "false".equalsIgnoreCase( obrRepository ) )
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
index 02e167c..92ca6e0 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrInstallFile.java
@@ -73,8 +73,8 @@
// ignore unsupported project types, useful when bundleplugin is configured in parent pom
if ( !supportedProjectTypes.contains( projectType ) )
{
- getLog().warn( "Ignoring project type " + projectType +
- " - supportedProjectTypes = " + supportedProjectTypes );
+ getLog().warn(
+ "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes );
return;
}
else if ( "NONE".equalsIgnoreCase( obrRepository ) || "false".equalsIgnoreCase( obrRepository ) )
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
index 868a380..86e840f 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
@@ -80,7 +80,7 @@
* @parameter expression="${ignoreLock}"
*/
private boolean ignoreLock;
-
+
/**
* Optional public URL prefix for the remote repository.
*
@@ -163,8 +163,8 @@
// ignore unsupported project types, useful when bundleplugin is configured in parent pom
if ( !supportedProjectTypes.contains( projectType ) )
{
- getLog().warn( "Ignoring project type " + projectType +
- " - supportedProjectTypes = " + supportedProjectTypes );
+ getLog().warn(
+ "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes );
return;
}
else if ( "NONE".equalsIgnoreCase( remoteOBR ) || "false".equalsIgnoreCase( remoteOBR ) )
@@ -203,17 +203,17 @@
downloadedRepositoryXml = remoteFile.get( repositoryName, ".xml" );
URI repositoryXml = downloadedRepositoryXml.toURI();
-
+
Config userConfig = new Config();
userConfig.setRemoteFile( true );
// Clean the downloaded file.
- Document doc = parseFile(new File(repositoryXml), initConstructor());
- Node finalDocument = cleanDocument(doc.getDocumentElement());
-
+ Document doc = parseFile( new File( repositoryXml ), initConstructor() );
+ Node finalDocument = cleanDocument( doc.getDocumentElement() );
+
if ( finalDocument == null )
{
- getLog().info( "Nothing to clean in " + repositoryName);
+ getLog().info( "Nothing to clean in " + repositoryName );
}
else
{
@@ -279,7 +279,8 @@
remoteFile.connect( deploymentRepository.getId(), deploymentRepository.getUrl() );
}
}
-
+
+
/**
* Analyze the given XML tree (DOM of the repository file) and remove missing resources.
* This method ask the user before deleting the resources from the repository.
@@ -298,38 +299,48 @@
String value = n.getAttribute( "uri" );
URL url;
- try {
- url = new URL( new URL( prefixUrl + '/' ), value);
- } catch (MalformedURLException e) {
- getLog().error("Malformed URL when creating the resource absolute URI : " + e.getMessage());
+ try
+ {
+ url = new URL( new URL( prefixUrl + '/' ), value );
+ }
+ catch ( MalformedURLException e )
+ {
+ getLog().error( "Malformed URL when creating the resource absolute URI : " + e.getMessage() );
return null;
}
-
- try {
+
+ try
+ {
url.openConnection().getContent();
- } catch (IOException e) {
+ }
+ catch ( IOException e )
+ {
getLog().info(
- "The bundle " + n.getAttribute( "presentationname" ) + " - " + n.getAttribute( "version" )
- + " will be removed : " + e.getMessage() );
- toRemove.add( n );
+ "The bundle " + n.getAttribute( "presentationname" ) + " - " + n.getAttribute( "version" )
+ + " will be removed : " + e.getMessage() );
+ toRemove.add( n );
}
}
Date d = new Date();
if ( toRemove.size() > 0 )
{
- System.out.println("Do you want to remove these bundles from the repository file [y/N]:");
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
+ System.out.println( "Do you want to remove these bundles from the repository file [y/N]:" );
+ BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
String answer = null;
- try {
- answer = br.readLine();
- } catch (IOException ioe) {
- getLog().error("IO error trying to read the user confirmation");
- return null;
+ try
+ {
+ answer = br.readLine();
}
-
- if (answer != null && answer.trim().equalsIgnoreCase("y")) {
+ catch ( IOException ioe )
+ {
+ getLog().error( "IO error trying to read the user confirmation" );
+ return null;
+ }
+
+ if ( answer != null && answer.trim().equalsIgnoreCase( "y" ) )
+ {
// Then remove missing resources.
for ( int i = 0; i < toRemove.size(); i++ )
{
@@ -341,7 +352,9 @@
d.setTime( System.currentTimeMillis() );
elem.setAttribute( "lastmodified", format.format( d ) );
return elem;
- } else {
+ }
+ else
+ {
return null;
}
}