You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sk...@apache.org on 2019/05/24 14:51:28 UTC
[netbeans-mavenutils-nbm-shared] branch master updated: Reduce
Checkstyle issues
This is an automated email from the ASF dual-hosted git repository.
skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-mavenutils-nbm-shared.git
The following commit(s) were added to refs/heads/master by this push:
new dae0773 Reduce Checkstyle issues
dae0773 is described below
commit dae07730830b9e2fe6d8a4a61db99d367a069e2b
Author: Eric Barboni <sk...@apache.org>
AuthorDate: Fri May 24 16:51:09 2019 +0200
Reduce Checkstyle issues
---
.../netbeans/nbm/utils/AbstractNetbeansMojo.java | 6 +++-
.../apache/netbeans/nbm/utils/ExamineManifest.java | 40 ++++++++++++++--------
.../netbeans/nbm/utils/ExamineManifestTest.java | 3 +-
3 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/src/main/java/org/apache/netbeans/nbm/utils/AbstractNetbeansMojo.java b/src/main/java/org/apache/netbeans/nbm/utils/AbstractNetbeansMojo.java
index 87ff296..36f9fcb 100644
--- a/src/main/java/org/apache/netbeans/nbm/utils/AbstractNetbeansMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/utils/AbstractNetbeansMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm.utils;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,7 +19,6 @@
* under the License.
*/
-package org.apache.netbeans.nbm.utils;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.tools.ant.BuildEvent;
@@ -25,6 +26,9 @@ import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Taskdef;
+/**
+ * Abstract goal intended for nbm-maven-plugin and nb-repository.
+ */
public abstract class AbstractNetbeansMojo
extends AbstractMojo
{
diff --git a/src/main/java/org/apache/netbeans/nbm/utils/ExamineManifest.java b/src/main/java/org/apache/netbeans/nbm/utils/ExamineManifest.java
index 59dc458..a993206 100644
--- a/src/main/java/org/apache/netbeans/nbm/utils/ExamineManifest.java
+++ b/src/main/java/org/apache/netbeans/nbm/utils/ExamineManifest.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm.utils;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,7 +19,6 @@
* under the License.
*/
-package org.apache.netbeans.nbm.utils;
import java.io.File;
import java.io.FileInputStream;
@@ -221,7 +222,7 @@ public class ExamineManifest
String tok = tokens.nextToken();
//we are just interested in specification and loose dependencies.
int spec = tok.indexOf( '>' );
- int impl = tok.indexOf( '=');
+ int impl = tok.indexOf( '=' );
if ( spec > 0 )
{
tok = tok.substring( 0, spec );
@@ -242,16 +243,20 @@ public class ExamineManifest
String req = attrs.getValue( "OpenIDE-Module-Requires" );
String prov = attrs.getValue( "OpenIDE-Module-Provides" );
String needs = attrs.getValue( "OpenIDE-Module-Needs" );
- if (prov != null) {
- provides = Arrays.asList( StringUtils.stripAll( StringUtils.split( prov, "," ) ));
+ if ( prov != null )
+ {
+ provides = Arrays.asList( StringUtils.stripAll( StringUtils.split( prov, "," ) ) );
}
- if (req != null || needs != null) {
+ if ( req != null || needs != null )
+ {
requires = new ArrayList<String>();
- if (req != null) {
- requires.addAll(Arrays.asList( StringUtils.stripAll( StringUtils.split( req, "," ) )));
+ if ( req != null )
+ {
+ requires.addAll( Arrays.asList( StringUtils.stripAll( StringUtils.split( req, "," ) ) ) );
}
- if (needs != null) {
- requires.addAll(Arrays.asList( StringUtils.stripAll( StringUtils.split( needs, "," ) )));
+ if ( needs != null )
+ {
+ requires.addAll( Arrays.asList( StringUtils.stripAll( StringUtils.split( needs, "," ) ) ) );
}
}
}
@@ -269,19 +274,22 @@ public class ExamineManifest
bndName./* MNBMODULE-125 */replaceFirst( " *;.+", "" )./* MNBMODULE-96 */replace( '-', '_' );
this.specVersion = attrs.getValue( "Bundle-Version" );
String exp = attrs.getValue( "Export-Package" );
- String autoload = attrs.getValue( "Nbm-Maven-Plugin-Autoload");
- if (autoload != null) {
+ String autoload = attrs.getValue( "Nbm-Maven-Plugin-Autoload" );
+ if ( autoload != null )
+ {
bundleAutoload = Boolean.parseBoolean( autoload );
}
this.publicPackages = exp != null;
if ( populateDependencies )
{
- //well, this doesn't appear to cover the major way of declation dependencies in osgi - Import-Package
+ //well, this doesn't appear to cover
+ //the major way of declation dependencies in osgi - Import-Package
String deps = attrs.getValue( "Require-Bundle" );
if ( deps != null )
{
List<String> depList = new ArrayList<String>();
- // http://stackoverflow.com/questions/1757065/java-splitting-a-comma-separated-string-but-ignoring-commas-in-quotes
+ // https://stackoverflow.com/questions/1757065
+ // java-splitting-a-comma-separated-string-but-ignoring-commas-in-quotes
for ( String piece : deps.split( ",(?=([^\"]*\"[^\"]*\")*[^\"]*$)" ) )
{
depList.add( piece.replaceFirst( ";.+", "" ).trim().intern() );
@@ -292,7 +300,8 @@ public class ExamineManifest
if ( imps != null )
{
Set<String> depList = new HashSet<String>();
- // http://stackoverflow.com/questions/1757065/java-splitting-a-comma-separated-string-but-ignoring-commas-in-quotes
+ // https://stackoverflow.com/questions/1757065
+ // java-splitting-a-comma-separated-string-but-ignoring-commas-in-quotes
for ( String piece : imps.split( ",(?=([^\"]*\"[^\"]*\")*[^\"]*$)" ) )
{
depList.add( piece.replaceFirst( ";.+", "" ).trim().intern() );
@@ -303,7 +312,8 @@ public class ExamineManifest
if ( exps != null )
{
Set<String> depList = new HashSet<String>();
- // http://stackoverflow.com/questions/1757065/java-splitting-a-comma-separated-string-but-ignoring-commas-in-quotes
+ // https://stackoverflow.com/questions/1757065
+ // java-splitting-a-comma-separated-string-but-ignoring-commas-in-quotes
for ( String piece : exps.split( ",(?=([^\"]*\"[^\"]*\")*[^\"]*$)" ) )
{
depList.add( piece.replaceFirst( ";.+", "" ).trim().intern() );
diff --git a/src/test/java/org/apache/netbeans/nbm/utils/ExamineManifestTest.java b/src/test/java/org/apache/netbeans/nbm/utils/ExamineManifestTest.java
index 1d8377c..7552856 100644
--- a/src/test/java/org/apache/netbeans/nbm/utils/ExamineManifestTest.java
+++ b/src/test/java/org/apache/netbeans/nbm/utils/ExamineManifestTest.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm.utils;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,7 +19,6 @@
* under the License.
*/
-package org.apache.netbeans.nbm.utils;
import java.io.File;
import java.io.PrintWriter;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists