You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Hervé BOUTEMY <he...@free.fr> on 2013/05/08 09:34:15 UTC

Re: git commit: Added jsr305 annotations

I like this: could we define it as the standard way to add such annotations in 
whole Maven components? Any problem if we do it in Maven core itself?

I'm not a JSR-305 expert, any basic explanation on the 
com.google.code.findbugs:jsr305 choice is good to know

then we could add it to maven parent pom dependencyManagement section, and 
write something into "Maven Developer Centre"

Regards,

Hervé

Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> Updated Branches:
>   refs/heads/master 231773324 -> 7b330f584
> 
> 
> Added jsr305 annotations
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> Commit:
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58 Tree:
> http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58 Diff:
> http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> 
> Branch: refs/heads/master
> Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> Parents: 2317733
> Author: Kristian Rosenvold <kr...@apache.org>
> Authored: Tue May 7 18:49:15 2013 +0200
> Committer: Kristian Rosenvold <kr...@apache.org>
> Committed: Tue May 7 18:49:15 2013 +0200
> 
> ----------------------------------------------------------------------
>  maven-surefire-common/pom.xml                      |    4 ++++
>  .../plugin/surefire/AbstractSurefireMojo.java      |    7 +++++--
>  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
>  .../maven/plugin/surefire/CommonReflector.java     |    8 +++++---
>  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
>  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
>  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
>  .../maven/plugin/surefire/util/Relocator.java      |   12 ++++++++----
>  .../maven/plugin/surefire/util/ScannerUtil.java    |   10 ++++++----
>  pom.xml                                            |    6 ++++++
>  10 files changed, 46 insertions(+), 18 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/pom.xml
> ---------------------------------------------------------------------- diff
> --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml index
> 1330eec..bed467b 100644
> --- a/maven-surefire-common/pom.xml
> +++ b/maven-surefire-common/pom.xml
> @@ -91,6 +91,10 @@
>        <artifactId>commons-lang3</artifactId>
>      </dependency>
>      <dependency>
> +      <groupId>com.google.code.findbugs</groupId>
> +      <artifactId>jsr305</artifactId>
> +    </dependency>
> +    <dependency>
>        <groupId>org.apache.maven.shared</groupId>
>        <artifactId>maven-common-artifact-filters</artifactId>
>        <version>1.3</version>
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> eMojo.java
> ---------------------------------------------------------------------- diff
> --git
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> ractSurefireMojo.java
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> ---
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> ractSurefireMojo.java +++
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> org.apache.maven.surefire.util.RunOrder;
>  import org.apache.maven.toolchain.Toolchain;
>  import org.apache.maven.toolchain.ToolchainManager;
> 
> +import javax.annotation.Nonnull;
> +
>  /**
>   * Abstract base class for running tests using Surefire.
>   *
> @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
>          }
>      }
> 
> -    private List<String> getExcludeList()
> +    private @Nonnull List<String> getExcludeList()
>      {
>          List<String> excludes = null;
>          if ( isSpecificTestSpecified() )
> @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
>          return filterNulls( includes );
>      }
> 
> -    private List<String> filterNulls( List<String> toFilter )
> +    private @Nonnull List<String> filterNulls( @Nonnull List<String>
> toFilter ) {
>          List<String> result = new ArrayList<String>( toFilter.size() );
>          for ( String item : toFilter )
> @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
>              return new DynamicProviderInfo( providerName );
>          }
> 
> +        @Nonnull
>          public String getProviderName()
>          {
>              return providerName;
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> java ----------------------------------------------------------------------
> diff --git
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> spathCache.java
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> spathCache.java index 1bcb065..ea250c2 100644
> ---
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> spathCache.java +++
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> spathCache.java @@ -21,6 +21,8 @@ package org.apache.maven.plugin.surefire;
>  import java.util.concurrent.ConcurrentHashMap;
>  import org.apache.maven.surefire.booter.Classpath;
> 
> +import javax.annotation.Nonnull;
> +
>  /**
>   * @author Kristian Rosenvold
>   */
> @@ -29,12 +31,12 @@ public class ClasspathCache
>      private static final ConcurrentHashMap<String, Classpath> classpaths =
>          new ConcurrentHashMap<String, Classpath>( 4 );
> 
> -    public static Classpath getCachedClassPath( String artifactId )
> +    public static Classpath getCachedClassPath( @Nonnull String artifactId
> ) {
>          return classpaths.get( artifactId );
>      }
> 
> -    public static void setCachedClasspath( String key, Classpath classpath
> ) +    public static void setCachedClasspath( @Nonnull String key, @Nonnull
> Classpath classpath ) {
>          classpaths.put( key, classpath );
>      }
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> .java ----------------------------------------------------------------------
> diff --git
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> onReflector.java
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> onReflector.java index 538b7e0..6851539 100644
> ---
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> onReflector.java +++
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> onReflector.java @@ -25,6 +25,8 @@ import
> org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import
> org.apache.maven.surefire.util.ReflectionUtils;
>  import org.apache.maven.surefire.util.SurefireReflectionException;
> 
> +import javax.annotation.Nonnull;
> +
>  /**
>   * @author Kristian Rosenvold
>   */
> @@ -34,7 +36,7 @@ public class CommonReflector
> 
>      private final ClassLoader surefireClassLoader;
> 
> -    public CommonReflector( ClassLoader surefireClassLoader )
> +    public CommonReflector( @Nonnull ClassLoader surefireClassLoader )
>      {
>          this.surefireClassLoader = surefireClassLoader;
> 
> @@ -48,7 +50,7 @@ public class CommonReflector
>          }
>      }
> 
> -    public Object createReportingReporterFactory(
> StartupReportConfiguration startupReportConfiguration ) +    public Object
> createReportingReporterFactory( @Nonnull StartupReportConfiguration
> startupReportConfiguration ) {
>          Class<?>[] args = new Class[]{ this.startupReportConfiguration };
>          Object src = createStartupReportConfiguration(
> startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> CommonReflector
>      }
> 
> 
> -    Object createStartupReportConfiguration( StartupReportConfiguration
> reporterConfiguration ) +    Object createStartupReportConfiguration(
> @Nonnull StartupReportConfiguration reporterConfiguration ) {
>          Constructor<?> constructor = ReflectionUtils.getConstructor(
> this.startupReportConfiguration, new Class[]{ boolean.class, boolean.class,
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> va ----------------------------------------------------------------------
> diff --git
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> iderInfo.java
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> iderInfo.java index 57069d8..50de7ea 100644
> ---
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> iderInfo.java +++
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> iderInfo.java @@ -24,11 +24,14 @@ import
> org.apache.maven.artifact.resolver.ArtifactResolutionException; import
> org.apache.maven.plugin.MojoExecutionException;
>  import org.apache.maven.surefire.booter.Classpath;
> 
> +import javax.annotation.Nonnull;
> +
>  /**
>   * @author Kristian Rosenvold
>   */
>  public interface ProviderInfo
>  {
> +    @Nonnull
>      String getProviderName();
> 
>      boolean isApplicable();
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> rkConfiguration.java
> ---------------------------------------------------------------------- diff
> --git
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> erclient/ForkConfiguration.java
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> ---
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> erclient/ForkConfiguration.java +++
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> ForkConfiguration
> 
>      /**
>       * @param classPath            cla the classpath arguments
> -     * @param startupConfiguration
> +     * @param startupConfiguration The startup configuration
>       * @param threadNumber         the thread number, to be the replacement
> in the argLine   @return A commandline * @throws
> org.apache.maven.surefire.booter.SurefireBooterForkException *         
> when unable to perform the fork
> @@ -208,7 +208,7 @@ public class ForkConfiguration
>       * for all classpath elements.
>       *
>       * @param classPath      List&lt;String> of all classpath elements.
> -     * @param startClassName
> +     * @param startClassName  The classname to start (main-class)
>       * @return The file pointint to the jar
>       * @throws java.io.IOException When a file operation fails.
>       */
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> Scanner.java
> ---------------------------------------------------------------------- diff
> --git
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /DependencyScanner.java
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /DependencyScanner.java index b50f295..b2e8ab8 100644
> ---
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /DependencyScanner.java +++
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /DependencyScanner.java @@ -34,6 +34,8 @@ import
> org.apache.maven.plugin.MojoExecutionException; import
> org.apache.maven.shared.utils.io.MatchPatterns;
>  import org.apache.maven.surefire.util.DefaultScanResult;
> 
> +import javax.annotation.Nullable;
> +
>  /**
>   * Scans dependencies looking for tests.
>   *
> @@ -141,7 +143,7 @@ public class DependencyScanner {
> 
>  		private SpecificFileFilter specificTestFilter;
> 
> -		public Matcher(List<String> includes, List<String> excludes, 
List<String>
> specificTests) +		public Matcher(@Nullable List<String> includes, 
@Nullable
> List<String> excludes, @Nullable List<String> specificTests) {
>  			String[] specific = specificTests == null ? new String[0] :
> processIncludesExcludes( specificTests ); specificTestFilter = new
> SpecificFileFilter( specific );
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> java ----------------------------------------------------------------------
> diff --git
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /Relocator.java
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /Relocator.java index 31dde5d..76da9de 100644
> ---
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /Relocator.java +++
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /Relocator.java @@ -19,6 +19,10 @@ package
> org.apache.maven.plugin.surefire.util;
>   * under the License.
>   */
> 
> +import com.sun.istack.internal.NotNull;
> +
> +import javax.annotation.Nullable;
> +
>  /**
>   * Relocates class names when running with relocated provider
>   *
> @@ -26,12 +30,12 @@ package org.apache.maven.plugin.surefire.util;
>   */
>  public class Relocator
>  {
> -    private final String relocation;
> +    private final @Nullable String relocation;
> 
>      private static final String relocationBase =
> "org.apache.maven.surefire.";
> 
> 
> -    public Relocator( String relocation )
> +    public Relocator( @Nullable String relocation )
>      {
>          this.relocation = relocation;
>      }
> @@ -41,12 +45,12 @@ public class Relocator
>          relocation = "shadefire";
>      }
> 
> -    private String getRelocation()
> +    private @Nullable String getRelocation()
>      {
>          return relocation;
>      }
> 
> -    public String relocate( String className )
> +    public @NotNull String relocate( @NotNull String className )
>      {
>          if ( relocation == null )
>          {
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> l.java
> ---------------------------------------------------------------------- diff
> --git
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /ScannerUtil.java
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /ScannerUtil.java index 3498e63..8b80301 100644
> ---
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /ScannerUtil.java +++
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> 
>  import org.apache.commons.lang3.StringUtils;
> 
> +import javax.annotation.Nonnull;
> +
>  final class ScannerUtil {
> 
>  	private ScannerUtil() {}
> @@ -35,22 +37,22 @@ final class ScannerUtil {
> 
>      private static final String JAVA_CLASS_FILE_EXTENSION = ".class";
> 
> -    public static String convertToJavaClassName( String test )
> +    public static @Nonnull String convertToJavaClassName( @Nonnull String
> test ) {
>          return StringUtils.removeEnd( test, ".class" ).replace( FS, "." );
>      }
> 
> -    public static String convertJarFileResourceToJavaClassName( String test
> ) +    public static @Nonnull String convertJarFileResourceToJavaClassName(
> @Nonnull String test ) {
>          return StringUtils.removeEnd( test, ".class" ).replace( "/", "." );
> }
> 
> -    public static String stripBaseDir( String basedir, String test )
> +    public static @Nonnull String stripBaseDir( String basedir, String test
> ) {
>          return StringUtils.removeStart( test, basedir );
>      }
> 
> -    public static String[] processIncludesExcludes( List<String> list )
> +    public static @Nonnull String[] processIncludesExcludes( @Nonnull
> List<String> list ) {
>          List<String> newList = new ArrayList<String>();
>          for ( Object aList : list )
> 
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> ----------------------------------------------------------------------
> diff --git a/pom.xml b/pom.xml
> index 677b367..c60f378 100644
> --- a/pom.xml
> +++ b/pom.xml
> @@ -265,6 +265,12 @@
>          <version>3.8.1</version>
>          <scope>test</scope>
>        </dependency>
> +      <dependency>
> +        <groupId>com.google.code.findbugs</groupId>
> +        <artifactId>jsr305</artifactId>
> +        <version>2.0.1</version>
> +        <scope>provided</scope>
> +      </dependency>
>      </dependencies>
>    </dependencyManagement>
>    <dependencies>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: git commit: Added jsr305 annotations

Posted by Hervé BOUTEMY <he...@free.fr>.
ok, I started with https://issues.apache.org/jira/browse/MPOM-40

Regards,

Hervé

Le mercredi 8 mai 2013 10:06:08 Kristian Rosenvold a écrit :
> I suspect like a lot of the rest of the community, they simply gave up on
> the jcp.
> 
> I am no insider on the project but com.google.code.findbugs/jsr-305 was
> last published in a 2.0.1 version in july 2012, and
> seems to be alive and kicking. IntelliJ also supports the annotations which
> means we finally have /one/ set of annotations
> that everybody understands.
> 
> The value of both Nullable and Nonnull is just amazing once you get it all
> in place.
> 
> As for potential classloading issues, I'm sure /someone/ here would know :)
> 
> Kristian
> 
> 
> 
> 
> 2013/5/8 Stephen Connolly <st...@gmail.com>
> 
> > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr> wrote:
> > > I like this: could we define it as the standard way to add such
> > > annotations in
> > > whole Maven components? Any problem if we do it in Maven core itself?
> > > 
> > > I'm not a JSR-305 expert, any basic explanation on the
> > > com.google.code.findbugs:jsr305 choice is good to know
> > 
> > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> > 
> > In general I like those annotations, though I tend to favour the findbugs
> > annotations and jcip annotations in code I write while awaiting jsr305 to
> > finalize (given that the spec is dormant, feared dead:
> > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of the spec
> > may
> > result in signature changes and as such, given that the annotations are
> > runtime retention, when annotations finally land in the JVM there may be a
> > risk from signature change...
> > 
> > But that could be an irrational fear on my behalf...
> > 
> > In any case I have clean room ASLv2 licensed versions of the findbugs and
> > jcip annotations in my GitHub repo and published to central.
> > 
> > > then we could add it to maven parent pom dependencyManagement section,
> > 
> > and
> > 
> > > write something into "Maven Developer Centre"
> > > 
> > > Regards,
> > > 
> > > Hervé
> > > 
> > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > > Updated Branches:
> > > >   refs/heads/master 231773324 -> 7b330f584
> > > > 
> > > > Added jsr305 annotations
> > > > 
> > > > 
> > > > Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > 
> > > > Commit:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > > > 
> > > > Branch: refs/heads/master
> > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > > Parents: 2317733
> > > > Author: Kristian Rosenvold <kr...@apache.org>
> > > > Authored: Tue May 7 18:49:15 2013 +0200
> > > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > > Committed: Tue May 7 18:49:15 2013 +0200
> > > > 
> > > > ----------------------------------------------------------------------
> > > > 
> > > >  maven-surefire-common/pom.xml                      |    4 ++++
> > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7 +++++--
> > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
> > > >  .../maven/plugin/surefire/CommonReflector.java     |    8 +++++---
> > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> > > >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> > > >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
> > > >  ++++++++----
> > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10 ++++++----
> > > >  pom.xml                                            |    6 ++++++
> > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > > 
> > > > ----------------------------------------------------------------------
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su> 
> > > > refire-common/pom.xml
> > > > ----------------------------------------------------------------------
> > > 
> > > diff
> > > 
> > > > --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
> > > 
> > > index
> > > 
> > > > 1330eec..bed467b 100644
> > > > --- a/maven-surefire-common/pom.xml
> > > > +++ b/maven-surefire-common/pom.xml
> > > > @@ -91,6 +91,10 @@
> > > > 
> > > >        <artifactId>commons-lang3</artifactId>
> > > >      
> > > >      </dependency>
> > > >      <dependency>
> > > > 
> > > > +      <groupId>com.google.code.findbugs</groupId>
> > > > +      <artifactId>jsr305</artifactId>
> > > > +    </dependency>
> > > > +    <dependency>
> > > > 
> > > >        <groupId>org.apache.maven.shared</groupId>
> > > >        <artifactId>maven-common-artifact-filters</artifactId>
> > > >        <version>1.3</version>
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSuref
> > ir> 
> > > > eMojo.java
> > > > ----------------------------------------------------------------------
> > > 
> > > diff
> > > 
> > > > --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abs
> > t
> > 
> > > > ractSurefireMojo.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abs
> > t
> > 
> > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abs
> > t
> > 
> > > > ractSurefireMojo.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abs
> > t
> > 
> > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > > org.apache.maven.surefire.util.RunOrder;
> > > > 
> > > >  import org.apache.maven.toolchain.Toolchain;
> > > >  import org.apache.maven.toolchain.ToolchainManager;
> > > > 
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > > 
> > > >  /**
> > > >  
> > > >   * Abstract base class for running tests using Surefire.
> > > >   *
> > > > 
> > > > @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
> > > > 
> > > >          }
> > > >      
> > > >      }
> > > > 
> > > > -    private List<String> getExcludeList()
> > > > +    private @Nonnull List<String> getExcludeList()
> > > > 
> > > >      {
> > > >      
> > > >          List<String> excludes = null;
> > > >          if ( isSpecificTestSpecified() )
> > > > 
> > > > @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
> > > > 
> > > >          return filterNulls( includes );
> > > >      
> > > >      }
> > > > 
> > > > -    private List<String> filterNulls( List<String> toFilter )
> > > > +    private @Nonnull List<String> filterNulls( @Nonnull List<String>
> > > > toFilter ) {
> > > > 
> > > >          List<String> result = new ArrayList<String>( toFilter.size()
> > 
> > );
> > 
> > > >          for ( String item : toFilter )
> > > > 
> > > > @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
> > > > 
> > > >              return new DynamicProviderInfo( providerName );
> > > >          
> > > >          }
> > > > 
> > > > +        @Nonnull
> > > > 
> > > >          public String getProviderName()
> > > >          {
> > > >          
> > > >              return providerName;
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCach
> > e.> 
> > > > java
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > diff --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Cla
> > s
> > 
> > > > spathCache.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Cla
> > s
> > 
> > > > spathCache.java index 1bcb065..ea250c2 100644
> > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Cla
> > s
> > 
> > > > spathCache.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Cla
> > s
> > 
> > > > spathCache.java @@ -21,6 +21,8 @@ package
> > > 
> > > org.apache.maven.plugin.surefire;
> > > 
> > > >  import java.util.concurrent.ConcurrentHashMap;
> > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > 
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > > 
> > > >  /**
> > > >  
> > > >   * @author Kristian Rosenvold
> > > >   */
> > > > 
> > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > > > 
> > > >      private static final ConcurrentHashMap<String, Classpath>
> > > 
> > > classpaths =
> > > 
> > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > > > 
> > > > -    public static Classpath getCachedClassPath( String artifactId )
> > > > +    public static Classpath getCachedClassPath( @Nonnull String
> > > 
> > > artifactId
> > > 
> > > > ) {
> > > > 
> > > >          return classpaths.get( artifactId );
> > > >      
> > > >      }
> > > > 
> > > > -    public static void setCachedClasspath( String key, Classpath
> > > 
> > > classpath
> > > 
> > > > ) +    public static void setCachedClasspath( @Nonnull String key,
> > > 
> > > @Nonnull
> > > 
> > > > Classpath classpath ) {
> > > > 
> > > >          classpaths.put( key, classpath );
> > > >      
> > > >      }
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflect
> > or> 
> > > > .java
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > diff --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Com
> > m
> > 
> > > > onReflector.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Com
> > m
> > 
> > > > onReflector.java index 538b7e0..6851539 100644
> > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Com
> > m
> > 
> > > > onReflector.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Com
> > m
> > 
> > > > onReflector.java @@ -25,6 +25,8 @@ import
> > > > org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import
> > > > org.apache.maven.surefire.util.ReflectionUtils;
> > > > 
> > > >  import org.apache.maven.surefire.util.SurefireReflectionException;
> > > > 
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > > 
> > > >  /**
> > > >  
> > > >   * @author Kristian Rosenvold
> > > >   */
> > > > 
> > > > @@ -34,7 +36,7 @@ public class CommonReflector
> > > > 
> > > >      private final ClassLoader surefireClassLoader;
> > > > 
> > > > -    public CommonReflector( ClassLoader surefireClassLoader )
> > > > +    public CommonReflector( @Nonnull ClassLoader surefireClassLoader
> > > > )
> > > > 
> > > >      {
> > > >      
> > > >          this.surefireClassLoader = surefireClassLoader;
> > > > 
> > > > @@ -48,7 +50,7 @@ public class CommonReflector
> > > > 
> > > >          }
> > > >      
> > > >      }
> > > > 
> > > > -    public Object createReportingReporterFactory(
> > > > StartupReportConfiguration startupReportConfiguration ) +    public
> > > 
> > > Object
> > > 
> > > > createReportingReporterFactory( @Nonnull StartupReportConfiguration
> > > > startupReportConfiguration ) {
> > > > 
> > > >          Class<?>[] args = new Class[]{
> > > >          this.startupReportConfiguration
> > > 
> > > };
> > > 
> > > >          Object src = createStartupReportConfiguration(
> > > > 
> > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > > CommonReflector
> > > > 
> > > >      }
> > > > 
> > > > -    Object createStartupReportConfiguration(
> > 
> > StartupReportConfiguration
> > 
> > > > reporterConfiguration ) +    Object createStartupReportConfiguration(
> > > > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> > > > 
> > > >          Constructor<?> constructor = ReflectionUtils.getConstructor(
> > > > 
> > > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > > 
> > > boolean.class,
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.
> > ja> 
> > > > va
> > 
> > ----------------------------------------------------------------------
> > 
> > > > diff --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Pro
> > v
> > 
> > > > iderInfo.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Pro
> > v
> > 
> > > > iderInfo.java index 57069d8..50de7ea 100644
> > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Pro
> > v
> > 
> > > > iderInfo.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Pro
> > v
> > 
> > > > iderInfo.java @@ -24,11 +24,14 @@ import
> > > > org.apache.maven.artifact.resolver.ArtifactResolutionException; import
> > > > org.apache.maven.plugin.MojoExecutionException;
> > > > 
> > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > 
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > > 
> > > >  /**
> > > >  
> > > >   * @author Kristian Rosenvold
> > > >   */
> > > >  
> > > >  public interface ProviderInfo
> > > >  {
> > > > 
> > > > +    @Nonnull
> > > > 
> > > >      String getProviderName();
> > > >      
> > > >      boolean isApplicable();
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/
> > Fo> 
> > > > rkConfiguration.java
> > > > ----------------------------------------------------------------------
> > > 
> > > diff
> > > 
> > > > --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boo
> > t
> > 
> > > > erclient/ForkConfiguration.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boo
> > t
> > 
> > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boo
> > t
> > 
> > > > erclient/ForkConfiguration.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boo
> > t
> > 
> > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> > > > ForkConfiguration
> > > > 
> > > >      /**
> > > >      
> > > >       * @param classPath            cla the classpath arguments
> > > > 
> > > > -     * @param startupConfiguration
> > > > +     * @param startupConfiguration The startup configuration
> > > > 
> > > >       * @param threadNumber         the thread number, to be the
> > > 
> > > replacement
> > > 
> > > > in the argLine   @return A commandline * @throws
> > > > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > > > when unable to perform the fork
> > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > > > 
> > > >       * for all classpath elements.
> > > >       *
> > > >       * @param classPath      List&lt;String> of all classpath
> > 
> > elements.
> > 
> > > > -     * @param startClassName
> > > > +     * @param startClassName  The classname to start (main-class)
> > > > 
> > > >       * @return The file pointint to the jar
> > > >       * @throws java.io.IOException When a file operation fails.
> > > >       */
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependen
> > cy> 
> > > > Scanner.java
> > > > ----------------------------------------------------------------------
> > > 
> > > diff
> > > 
> > > > --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /DependencyScanner.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /DependencyScanner.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > > org.apache.maven.plugin.MojoExecutionException; import
> > > > org.apache.maven.shared.utils.io.MatchPatterns;
> > > > 
> > > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > > > 
> > > > +import javax.annotation.Nullable;
> > > > +
> > > > 
> > > >  /**
> > > >  
> > > >   * Scans dependencies looking for tests.
> > > >   *
> > > > 
> > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > > > 
> > > >               private SpecificFileFilter specificTestFilter;
> > > > 
> > > > -             public Matcher(List<String> includes, List<String>
> > > 
> > > excludes,
> > > List<String>
> > > 
> > > > specificTests) +              public Matcher(@Nullable List<String>
> > > 
> > > includes,
> > > @Nullable
> > > 
> > > > List<String> excludes, @Nullable List<String> specificTests) {
> > > > 
> > > >                       String[] specific = specificTests == null ? new
> > > 
> > > String[0] :
> > > > processIncludesExcludes( specificTests ); specificTestFilter = new
> > > > SpecificFileFilter( specific );
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocato
> > r.> 
> > > > java
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > diff --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /Relocator.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /Relocator.java index 31dde5d..76da9de 100644
> > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /Relocator.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > > org.apache.maven.plugin.surefire.util;
> > > > 
> > > >   * under the License.
> > > >   */
> > > > 
> > > > +import com.sun.istack.internal.NotNull;
> > > > +
> > > > +import javax.annotation.Nullable;
> > > > +
> > > > 
> > > >  /**
> > > >  
> > > >   * Relocates class names when running with relocated provider
> > > >   *
> > > > 
> > > > @@ -26,12 +30,12 @@ package org.apache.maven.plugin.surefire.util;
> > > > 
> > > >   */
> > > >  
> > > >  public class Relocator
> > > >  {
> > > > 
> > > > -    private final String relocation;
> > > > +    private final @Nullable String relocation;
> > > > 
> > > >      private static final String relocationBase =
> > > > 
> > > > "org.apache.maven.surefire.";
> > > > 
> > > > 
> > > > -    public Relocator( String relocation )
> > > > +    public Relocator( @Nullable String relocation )
> > > > 
> > > >      {
> > > >      
> > > >          this.relocation = relocation;
> > > >      
> > > >      }
> > > > 
> > > > @@ -41,12 +45,12 @@ public class Relocator
> > > > 
> > > >          relocation = "shadefire";
> > > >      
> > > >      }
> > > > 
> > > > -    private String getRelocation()
> > > > +    private @Nullable String getRelocation()
> > > > 
> > > >      {
> > > >      
> > > >          return relocation;
> > > >      
> > > >      }
> > > > 
> > > > -    public String relocate( String className )
> > > > +    public @NotNull String relocate( @NotNull String className )
> > > > 
> > > >      {
> > > >      
> > > >          if ( relocation == null )
> > > >          {
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerU
> > ti> 
> > > > l.java
> > > > ----------------------------------------------------------------------
> > > 
> > > diff
> > > 
> > > > --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /ScannerUtil.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /ScannerUtil.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > > > 
> > > >  import org.apache.commons.lang3.StringUtils;
> > > > 
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > > 
> > > >  final class ScannerUtil {
> > > >  
> > > >       private ScannerUtil() {}
> > > > 
> > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > > > 
> > > >      private static final String JAVA_CLASS_FILE_EXTENSION = ".class";
> > > > 
> > > > -    public static String convertToJavaClassName( String test )
> > > > +    public static @Nonnull String convertToJavaClassName( @Nonnull
> > > 
> > > String
> > > 
> > > > test ) {
> > > > 
> > > >          return StringUtils.removeEnd( test, ".class" ).replace( FS,
> > 
> > "."
> > 
> > > );
> > > 
> > > >      }
> > > > 
> > > > -    public static String convertJarFileResourceToJavaClassName(
> > > > String
> > > 
> > > test
> > > 
> > > > ) +    public static @Nonnull String
> > > 
> > > convertJarFileResourceToJavaClassName(
> > > 
> > > > @Nonnull String test ) {
> > > > 
> > > >          return StringUtils.removeEnd( test, ".class" ).replace( "/",
> > > 
> > > "." );
> > > 
> > > > }
> > > > 
> > > > -    public static String stripBaseDir( String basedir, String test )
> > > > +    public static @Nonnull String stripBaseDir( String basedir,
> > > > String
> > > 
> > > test
> > > 
> > > > ) {
> > > > 
> > > >          return StringUtils.removeStart( test, basedir );
> > > >      
> > > >      }
> > > > 
> > > > -    public static String[] processIncludesExcludes( List<String> list
> > 
> > )
> > 
> > > > +    public static @Nonnull String[] processIncludesExcludes( @Nonnull
> > > > List<String> list ) {
> > > > 
> > > >          List<String> newList = new ArrayList<String>();
> > > >          for ( Object aList : list )
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xm
> > l
> > 
> > > > ----------------------------------------------------------------------
> > > > diff --git a/pom.xml b/pom.xml
> > > > index 677b367..c60f378 100644
> > > > --- a/pom.xml
> > > > +++ b/pom.xml
> > > > @@ -265,6 +265,12 @@
> > > > 
> > > >          <version>3.8.1</version>
> > > >          <scope>test</scope>
> > > >        
> > > >        </dependency>
> > > > 
> > > > +      <dependency>
> > > > +        <groupId>com.google.code.findbugs</groupId>
> > > > +        <artifactId>jsr305</artifactId>
> > > > +        <version>2.0.1</version>
> > > > +        <scope>provided</scope>
> > > > +      </dependency>
> > > > 
> > > >      </dependencies>
> > > >    
> > > >    </dependencyManagement>
> > > >    <dependencies>
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: git commit: Added jsr305 annotations

Posted by Hervé BOUTEMY <he...@free.fr>.
notice we already have com.google.code.findbugs:jsr305 in core dependencies [1] 
through transitive dependencies from guava

given classloader isolation, I don't think this has much impact, as soon as it 
is not used in Maven public API

Regards,

Hervé

[1] http://maven.apache.org/ref/3-LATEST/apache-maven/dependencies.html#Project_Transitive_Dependencies

Le mercredi 8 mai 2013 11:16:04 Stephen Connolly a écrit :
> If you do
> 
>     <dependency>
>       <groupId>com.google.code.findbugs</groupId>
>       <artifactId>jsr305</artifactId>
>       <version>2.0.1</version>
>       <scope>provided</scope>
>     </dependency>
> 
> In one of Maven's APIs thinking that RetentionPolicy.RUNTIME or
> RetentionPolicy.COMPILE will save you as the JVM spec says missing
> annotations are to be ignored... you will be burned when compiling
> implementations of the API unless you add the dependency to *your*
> implementation.
> 
> At least some versions (I suspect all but have not confirmed) of JavaC
> needs all the annotations with COMPILE or higher retention available so
> that, at the very least, it knows whether to retain the annotation or
> not... as it may affect the method signature for @Override annotated
> methods or something like that... never really be happy about the issue.
> 
> This has bit me when I have an API with @Nonnull annotations and then try
> to implement the API class.
> 
> So in such cases using the javax.annotations carries a risk as once/if
> JSR-305 gets accepted, the accepted version of the annotations will be part
> of the core classloader and the dependency provided version will loose
> out...
> 
> Not likely a big risk for @Nonnull or @Nullable... but e.g
> @MatchesPattern(value="^\d\d\d-\d\d$",flags=0) might cause issues if in the
> reboot the "flags" parameter gets refactored to regexFlags. It is unclear
> to me what the JVM spec says in the case where the annotation class is
> present but has had a signature change from what was used when the
> annotated source was compiled.
> 
> With annotations that are not in the "special" package namespaces we can at
> least put our dependency first... but maybe I am just overly paranoid
> 
> On 8 May 2013 11:01, Kristian Rosenvold <kr...@gmail.com>wrote:
> > Linking to one of your private git repos made this only marginally
> > clearer;
> > I see the edu.umd in there though !
> > 
> > > So setting the dependency as "provided" is all well and good until you
> > 
> > need
> > 
> > > to implement an interface with the annotation applied... at which point
> > 
> > you
> > 
> > > need to add back in the "provided" dependency...
> > > 
> > > But it's still only compile-time, right ? Why would that be a problem ?
> > 
> > Having the annotation available at RUNTIME does allow for additional
> > 
> > > validations, so that would favour JSR-305, but given that you need the
> > > dependency transitive for compilation there is scope for issues if
> > 
> > JSR-305
> > 
> > > ever gets rebooted.
> > 
> > Give me this with a tiny spoon please; when would this be a problem ?
> > 
> > > On 8 May 2013 09:53, Kristian Rosenvold <kristian.rosenvold@gmail.com
> > > 
> > > >wrote:
> > > > You mean there's an older set of findbugs annoations ?
> > > > 
> > > > Kristian
> > > > 
> > > > 
> > > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> > > > 
> > > > > IntelliJ also supports the findbugs and jcip annotations too... but
> > 
> > in
> > 
> > > > any
> > > > 
> > > > > case I will hold my piece... given that these annotations do not
> > > > > have
> > > > > parameters the risk is almost non-existant for *these* but I do
> > > > > think
> > > 
> > > it
> > > 
> > > > is
> > > > 
> > > > > a more general risk
> > > > > 
> > > > > 
> > > > > On 8 May 2013 09:06, Kristian Rosenvold <
> > 
> > kristian.rosenvold@gmail.com
> > 
> > > > > >wrote:
> > > > > > I suspect like a lot of the rest of the community, they simply
> > > > > > gave
> > > 
> > > up
> > > 
> > > > on
> > > > 
> > > > > > the jcp.
> > > > > > 
> > > > > > I am no insider on the project but
> > > > > > com.google.code.findbugs/jsr-305
> > > 
> > > was
> > > 
> > > > > > last published in a 2.0.1 version in july 2012, and
> > > > > > seems to be alive and kicking. IntelliJ also supports the
> > 
> > annotations
> > 
> > > > > which
> > > > > 
> > > > > > means we finally have /one/ set of annotations
> > > > > > that everybody understands.
> > > > > > 
> > > > > > The value of both Nullable and Nonnull is just amazing once you
> > > > > > get
> > > 
> > > it
> > > 
> > > > > all
> > > > > 
> > > > > > in place.
> > > > > > 
> > > > > > As for potential classloading issues, I'm sure /someone/ here
> > > > > > would
> > > > 
> > > > know
> > > > 
> > > > > :)
> > > > > :
> > > > > > Kristian
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> > > > > > 
> > > > > > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr>
> > 
> > wrote:
> > > > > > > > I like this: could we define it as the standard way to add
> > > > > > > > such
> > > > > > > > annotations in
> > > > > > > > whole Maven components? Any problem if we do it in Maven core
> > > > 
> > > > itself?
> > > > 
> > > > > > > > I'm not a JSR-305 expert, any basic explanation on the
> > > > > > > > com.google.code.findbugs:jsr305 choice is good to know
> > > > > > > 
> > > > > > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> > > > > > > 
> > > > > > > In general I like those annotations, though I tend to favour the
> > > > > 
> > > > > findbugs
> > > > > 
> > > > > > > annotations and jcip annotations in code I write while awaiting
> > > > 
> > > > jsr305
> > > > 
> > > > > to
> > > > > 
> > > > > > > finalize (given that the spec is dormant, feared dead:
> > > > > > > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of
> > 
> > the
> > 
> > > > > spec
> > > > > 
> > > > > > > may
> > > > > > > result in signature changes and as such, given that the
> > 
> > annotations
> > 
> > > > are
> > > > 
> > > > > > > runtime retention, when annotations finally land in the JVM
> > > > > > > there
> > > 
> > > may
> > > 
> > > > > be
> > > > > 
> > > > > > a
> > > > > > 
> > > > > > > risk from signature change...
> > > > > > > 
> > > > > > > But that could be an irrational fear on my behalf...
> > > > > > > 
> > > > > > > In any case I have clean room ASLv2 licensed versions of the
> > > 
> > > findbugs
> > > 
> > > > > and
> > > > > 
> > > > > > > jcip annotations in my GitHub repo and published to central.
> > > > > > > 
> > > > > > > > then we could add it to maven parent pom dependencyManagement
> > > > > 
> > > > > section,
> > > > > 
> > > > > > > and
> > > > > > > 
> > > > > > > > write something into "Maven Developer Centre"
> > > > > > > > 
> > > > > > > > Regards,
> > > > > > > > 
> > > > > > > > Hervé
> > > > > > > > 
> > > > > > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > > > > > > > Updated Branches:
> > > > > > > > >   refs/heads/master 231773324 -> 7b330f584
> > > > > > > > > 
> > > > > > > > > Added jsr305 annotations
> > > > > 
> > > > > > > > > Project:
> > > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > > > > 
> > > > > > > > > Commit:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > > > > 
> > > > > > > > > Branch: refs/heads/master
> > > > > > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > > > > > > > Parents: 2317733
> > > > > > > > > Author: Kristian Rosenvold <kr...@apache.org>
> > > > > > > > > Authored: Tue May 7 18:49:15 2013 +0200
> > > > > > > > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > > > > > > > Committed: Tue May 7 18:49:15 2013 +0200
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > > > > > >  maven-surefire-common/pom.xml                      |    4
> > 
> > ++++
> > 
> > > > > > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7
> > > > 
> > > > +++++--
> > > > 
> > > > > > > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6
> > > 
> > > ++++--
> > > 
> > > > > > > > >  .../maven/plugin/surefire/CommonReflector.java     |    8
> > > > 
> > > > +++++---
> > > > 
> > > > > > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3
> > 
> > +++
> > 
> > > > > > > > >  .../surefire/booterclient/ForkConfiguration.java   |    4
> > 
> > ++--
> > 
> > > > > > > > >  .../plugin/surefire/util/DependencyScanner.java    |    4
> > 
> > +++-
> > 
> > > > > > > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
> > > > > > 
> > > > > > ++++++++----
> > > > > > 
> > > > > > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10
> > > > > 
> > > > > ++++++----
> > > > > 
> > > > > > > > >  pom.xml                                            |    6
> > > 
> > > ++++++
> > > 
> > > > > > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > 
> > > ----------------------------------------------------------------------
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su> 
> > > > > > > > > refire-common/pom.xml
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > > > > > diff
> > > > > > > > 
> > > > > > > > > --git a/maven-surefire-common/pom.xml
> > > > > 
> > > > > b/maven-surefire-common/pom.xml
> > > > > 
> > > > > > > > index
> > > > > > > > 
> > > > > > > > > 1330eec..bed467b 100644
> > > > > > > > > --- a/maven-surefire-common/pom.xml
> > > > > > > > > +++ b/maven-surefire-common/pom.xml
> > > > > > > > > @@ -91,6 +91,10 @@
> > > > > > > > > 
> > > > > > > > >        <artifactId>commons-lang3</artifactId>
> > > > > > > > >      
> > > > > > > > >      </dependency>
> > > > > > > > >      <dependency>
> > > > > > > > > 
> > > > > > > > > +      <groupId>com.google.code.findbugs</groupId>
> > > > > > > > > +      <artifactId>jsr305</artifactId>
> > > > > > > > > +    </dependency>
> > > > > > > > > +    <dependency>
> > > > > > > > > 
> > > > > > > > >        <groupId>org.apache.maven.shared</groupId>
> > > > > > > > >        <artifactId>maven-common-artifact-filters</artifactId
> > > > > > > > >        >
> > > > > > > > >        <version>1.3</version>
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSuref
> > ir> 
> > > > > > > > > eMojo.java
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > > > > > diff
> > > > > > > > 
> > > > > > > > > --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abs
> > t
> > 
> > > > > > > > > ractSurefireMojo.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abs
> > t
> > 
> > > > > > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > > > > > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abs
> > t
> > 
> > > > > > > > > ractSurefireMojo.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abs
> > t
> > 
> > > > > > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > > > > > > > org.apache.maven.surefire.util.RunOrder;
> > > > > > > > > 
> > > > > > > > >  import org.apache.maven.toolchain.Toolchain;
> > > > > > > > >  import org.apache.maven.toolchain.ToolchainManager;
> > > > > > > > > 
> > > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > > +
> > > > > > > > > 
> > > > > > > > >  /**
> > > > > > > > >  
> > > > > > > > >   * Abstract base class for running tests using Surefire.
> > > > > > > > >   *
> > > > > > > > > 
> > > > > > > > > @@ -1266,7 +1268,7 @@ public abstract class
> > > 
> > > AbstractSurefireMojo
> > > 
> > > > > > > > >          }
> > > > > > > > >      
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    private List<String> getExcludeList()
> > > > > > > > > +    private @Nonnull List<String> getExcludeList()
> > > > > > > > > 
> > > > > > > > >      {
> > > > > > > > >      
> > > > > > > > >          List<String> excludes = null;
> > > > > > > > >          if ( isSpecificTestSpecified() )
> > > > > > > > > 
> > > > > > > > > @@ -1339,7 +1341,7 @@ public abstract class
> > > 
> > > AbstractSurefireMojo
> > > 
> > > > > > > > >          return filterNulls( includes );
> > > > > > > > >      
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    private List<String> filterNulls( List<String> toFilter
> > 
> > )
> > 
> > > > > > > > > +    private @Nonnull List<String> filterNulls( @Nonnull
> > > > > 
> > > > > List<String>
> > > > > 
> > > > > > > > > toFilter ) {
> > > > > > > > > 
> > > > > > > > >          List<String> result = new ArrayList<String>(
> > > > > 
> > > > > toFilter.size()
> > > > > 
> > > > > > > );
> > > > > > > 
> > > > > > > > >          for ( String item : toFilter )
> > > > > > > > > 
> > > > > > > > > @@ -2130,6 +2132,7 @@ public abstract class
> > > 
> > > AbstractSurefireMojo
> > > 
> > > > > > > > >              return new DynamicProviderInfo( providerName );
> > > > > > > > >          
> > > > > > > > >          }
> > > > > > > > > 
> > > > > > > > > +        @Nonnull
> > > > > > > > > 
> > > > > > > > >          public String getProviderName()
> > > > > > > > >          {
> > > > > > > > >          
> > > > > > > > >              return providerName;
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCach
> > e.> 
> > > > > > > > > java
> > 
> > ----------------------------------------------------------------------
> > 
> > > > > > > > > diff --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Cla
> > s
> > 
> > > > > > > > > spathCache.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Cla
> > s
> > 
> > > > > > > > > spathCache.java index 1bcb065..ea250c2 100644
> > > > > > > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Cla
> > s
> > 
> > > > > > > > > spathCache.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Cla
> > s
> > 
> > > > > > > > > spathCache.java @@ -21,6 +21,8 @@ package
> > > > > > > > 
> > > > > > > > org.apache.maven.plugin.surefire;
> > > > > > > > 
> > > > > > > > >  import java.util.concurrent.ConcurrentHashMap;
> > > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > > > > > > 
> > > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > > +
> > > > > > > > > 
> > > > > > > > >  /**
> > > > > > > > >  
> > > > > > > > >   * @author Kristian Rosenvold
> > > > > > > > >   */
> > > > > > > > > 
> > > > > > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > > > > > > > > 
> > > > > > > > >      private static final ConcurrentHashMap<String,
> > 
> > Classpath>
> > 
> > > > > > > > classpaths =
> > > > > > > > 
> > > > > > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > > > > > > > > 
> > > > > > > > > -    public static Classpath getCachedClassPath( String
> > > > 
> > > > artifactId
> > > > 
> > > > > )
> > > > > 
> > > > > > > > > +    public static Classpath getCachedClassPath( @Nonnull
> > > 
> > > String
> > > 
> > > > > > > > artifactId
> > > > > > > > 
> > > > > > > > > ) {
> > > > > > > > > 
> > > > > > > > >          return classpaths.get( artifactId );
> > > > > > > > >      
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    public static void setCachedClasspath( String key,
> > > 
> > > Classpath
> > > 
> > > > > > > > classpath
> > > > > > > > 
> > > > > > > > > ) +    public static void setCachedClasspath( @Nonnull
> > > > > > > > > String
> > > > 
> > > > key,
> > > > 
> > > > > > > > @Nonnull
> > > > > > > > 
> > > > > > > > > Classpath classpath ) {
> > > > > > > > > 
> > > > > > > > >          classpaths.put( key, classpath );
> > > > > > > > >      
> > > > > > > > >      }
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflect
> > or> 
> > > > > > > > > .java
> > 
> > ----------------------------------------------------------------------
> > 
> > > > > > > > > diff --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Com
> > m
> > 
> > > > > > > > > onReflector.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Com
> > m
> > 
> > > > > > > > > onReflector.java index 538b7e0..6851539 100644
> > > > > > > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Com
> > m
> > 
> > > > > > > > > onReflector.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Com
> > m
> > 
> > > > > > > > > onReflector.java @@ -25,6 +25,8 @@ import
> > 
> > org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
> > 
> > > > > > import
> > > > > > 
> > > > > > > > > org.apache.maven.surefire.util.ReflectionUtils;
> > > > > > > > > 
> > > > > > > > >  import
> > > > 
> > > > org.apache.maven.surefire.util.SurefireReflectionException;
> > > > 
> > > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > > +
> > > > > > > > > 
> > > > > > > > >  /**
> > > > > > > > >  
> > > > > > > > >   * @author Kristian Rosenvold
> > > > > > > > >   */
> > > > > > > > > 
> > > > > > > > > @@ -34,7 +36,7 @@ public class CommonReflector
> > > > > > > > > 
> > > > > > > > >      private final ClassLoader surefireClassLoader;
> > > > > > > > > 
> > > > > > > > > -    public CommonReflector( ClassLoader surefireClassLoader
> > 
> > )
> > 
> > > > > > > > > +    public CommonReflector( @Nonnull ClassLoader
> > > > > > 
> > > > > > surefireClassLoader )
> > > > > > 
> > > > > > > > >      {
> > > > > > > > >      
> > > > > > > > >          this.surefireClassLoader = surefireClassLoader;
> > > > > > > > > 
> > > > > > > > > @@ -48,7 +50,7 @@ public class CommonReflector
> > > > > > > > > 
> > > > > > > > >          }
> > > > > > > > >      
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    public Object createReportingReporterFactory(
> > > > > > > > > StartupReportConfiguration startupReportConfiguration ) +
> > > >  
> > > >  public
> > > >  
> > > > > > > > Object
> > > > > > > > 
> > > > > > > > > createReportingReporterFactory( @Nonnull
> > > > 
> > > > StartupReportConfiguration
> > > > 
> > > > > > > > > startupReportConfiguration ) {
> > > > > > > > > 
> > > > > > > > >          Class<?>[] args = new Class[]{
> > > > > > 
> > > > > > this.startupReportConfiguration
> > > > > > 
> > > > > > > > };
> > > > > > > > 
> > > > > > > > >          Object src = createStartupReportConfiguration(
> > > > > > > > > 
> > > > > > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > > > > > > > CommonReflector
> > > > > > > > > 
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    Object createStartupReportConfiguration(
> > > > > > > 
> > > > > > > StartupReportConfiguration
> > > > > > > 
> > > > > > > > > reporterConfiguration ) +    Object
> > > > > 
> > > > > createStartupReportConfiguration(
> > > > > 
> > > > > > > > > @Nonnull StartupReportConfiguration reporterConfiguration )
> > > > > > > > > {
> > > > > > > > > 
> > > > > > > > >          Constructor<?> constructor =
> > > > > 
> > > > > ReflectionUtils.getConstructor(
> > > > > 
> > > > > > > > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > > > > > > > 
> > > > > > > > boolean.class,
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.
> > ja> 
> > > > > > > > > va
> > > > 
> > > > ----------------------------------------------------------------------
> > > > 
> > > > > > > > > diff --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Pro
> > v
> > 
> > > > > > > > > iderInfo.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Pro
> > v
> > 
> > > > > > > > > iderInfo.java index 57069d8..50de7ea 100644
> > > > > > > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Pro
> > v
> > 
> > > > > > > > > iderInfo.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Pro
> > v
> > 
> > > > > > > > > iderInfo.java @@ -24,11 +24,14 @@ import
> > 
> > org.apache.maven.artifact.resolver.ArtifactResolutionException;
> > 
> > > > > > import
> > > > > > 
> > > > > > > > > org.apache.maven.plugin.MojoExecutionException;
> > > > > > > > > 
> > > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > > > > > > 
> > > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > > +
> > > > > > > > > 
> > > > > > > > >  /**
> > > > > > > > >  
> > > > > > > > >   * @author Kristian Rosenvold
> > > > > > > > >   */
> > > > > > > > >  
> > > > > > > > >  public interface ProviderInfo
> > > > > > > > >  {
> > > > > > > > > 
> > > > > > > > > +    @Nonnull
> > > > > > > > > 
> > > > > > > > >      String getProviderName();
> > > > > > > > >      
> > > > > > > > >      boolean isApplicable();
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/
> > Fo> 
> > > > > > > > > rkConfiguration.java
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > > > > > diff
> > > > > > > > 
> > > > > > > > > --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boo
> > t
> > 
> > > > > > > > > erclient/ForkConfiguration.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boo
> > t
> > 
> > > > > > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27
> > > > > > > > > 100644
> > > > > > > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boo
> > t
> > 
> > > > > > > > > erclient/ForkConfiguration.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boo
> > t
> > 
> > > > > > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public
> > > 
> > > class
> > > 
> > > > > > > > > ForkConfiguration
> > > > > > > > > 
> > > > > > > > >      /**
> > > > > > > > >      
> > > > > > > > >       * @param classPath            cla the classpath
> > 
> > arguments
> > 
> > > > > > > > > -     * @param startupConfiguration
> > > > > > > > > +     * @param startupConfiguration The startup
> > > > > > > > > configuration
> > > > > > > > > 
> > > > > > > > >       * @param threadNumber         the thread number, to be
> > > 
> > > the
> > > 
> > > > > > > > replacement
> > > > > > > > 
> > > > > > > > > in the argLine   @return A commandline * @throws
> > > > > > > > > org.apache.maven.surefire.booter.SurefireBooterForkException
> > 
> > *
> > 
> > > > > > > > > when unable to perform the fork
> > > > > > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > > > > > > > > 
> > > > > > > > >       * for all classpath elements.
> > > > > > > > >       *
> > > > > > > > >       * @param classPath      List&lt;String> of all
> > 
> > classpath
> > 
> > > > > > > elements.
> > > > > > > 
> > > > > > > > > -     * @param startClassName
> > > > > > > > > +     * @param startClassName  The classname to start
> > > > 
> > > > (main-class)
> > > > 
> > > > > > > > >       * @return The file pointint to the jar
> > > > > > > > >       * @throws java.io.IOException When a file operation
> > > 
> > > fails.
> > > 
> > > > > > > > >       */
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependen
> > cy> 
> > > > > > > > > Scanner.java
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > > > > > diff
> > > > > > > > 
> > > > > > > > > --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /DependencyScanner.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > > > > > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /DependencyScanner.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > > > > > > > org.apache.maven.plugin.MojoExecutionException; import
> > > > > > > > > org.apache.maven.shared.utils.io.MatchPatterns;
> > > > > > > > > 
> > > > > > > > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > > > > > > > > 
> > > > > > > > > +import javax.annotation.Nullable;
> > > > > > > > > +
> > > > > > > > > 
> > > > > > > > >  /**
> > > > > > > > >  
> > > > > > > > >   * Scans dependencies looking for tests.
> > > > > > > > >   *
> > > > > > > > > 
> > > > > > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > > > > > > > > 
> > > > > > > > >               private SpecificFileFilter specificTestFilter;
> > > > > > > > > 
> > > > > > > > > -             public Matcher(List<String> includes,
> > > 
> > > List<String>
> > > 
> > > > > > > > excludes,
> > > > > > > > List<String>
> > > > > > > > 
> > > > > > > > > specificTests) +              public Matcher(@Nullable
> > > > 
> > > > List<String>
> > > > 
> > > > > > > > includes,
> > > > > > > > @Nullable
> > > > > > > > 
> > > > > > > > > List<String> excludes, @Nullable List<String> specificTests)
> > 
> > {
> > 
> > > > > > > > >                       String[] specific = specificTests ==
> > > 
> > > null ?
> > > 
> > > > > new
> > > > > 
> > > > > > > > String[0] :
> > > > > > > > > processIncludesExcludes( specificTests ); specificTestFilter
> > 
> > =
> > 
> > > > new
> > > > 
> > > > > > > > > SpecificFileFilter( specific );
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocato
> > r.> 
> > > > > > > > > java
> > 
> > ----------------------------------------------------------------------
> > 
> > > > > > > > > diff --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /Relocator.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /Relocator.java index 31dde5d..76da9de 100644
> > > > > > > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /Relocator.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > > > > > > > org.apache.maven.plugin.surefire.util;
> > > > > > > > > 
> > > > > > > > >   * under the License.
> > > > > > > > >   */
> > > > > > > > > 
> > > > > > > > > +import com.sun.istack.internal.NotNull;
> > > > > > > > > +
> > > > > > > > > +import javax.annotation.Nullable;
> > > > > > > > > +
> > > > > > > > > 
> > > > > > > > >  /**
> > > > > > > > >  
> > > > > > > > >   * Relocates class names when running with relocated
> > 
> > provider
> > 
> > > > > > > > >   *
> > > > > > > > > 
> > > > > > > > > @@ -26,12 +30,12 @@ package
> > > > 
> > > > org.apache.maven.plugin.surefire.util;
> > > > 
> > > > > > > > >   */
> > > > > > > > >  
> > > > > > > > >  public class Relocator
> > > > > > > > >  {
> > > > > > > > > 
> > > > > > > > > -    private final String relocation;
> > > > > > > > > +    private final @Nullable String relocation;
> > > > > > > > > 
> > > > > > > > >      private static final String relocationBase =
> > > > > > > > > 
> > > > > > > > > "org.apache.maven.surefire.";
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > -    public Relocator( String relocation )
> > > > > > > > > +    public Relocator( @Nullable String relocation )
> > > > > > > > > 
> > > > > > > > >      {
> > > > > > > > >      
> > > > > > > > >          this.relocation = relocation;
> > > > > > > > >      
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > @@ -41,12 +45,12 @@ public class Relocator
> > > > > > > > > 
> > > > > > > > >          relocation = "shadefire";
> > > > > > > > >      
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    private String getRelocation()
> > > > > > > > > +    private @Nullable String getRelocation()
> > > > > > > > > 
> > > > > > > > >      {
> > > > > > > > >      
> > > > > > > > >          return relocation;
> > > > > > > > >      
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    public String relocate( String className )
> > > > > > > > > +    public @NotNull String relocate( @NotNull String
> > > 
> > > className )
> > > 
> > > > > > > > >      {
> > > > > > > > >      
> > > > > > > > >          if ( relocation == null )
> > > > > > > > >          {
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-> > su
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerU
> > ti> 
> > > > > > > > > l.java
> > > 
> > > ----------------------------------------------------------------------
> > > 
> > > > > > > > diff
> > > > > > > > 
> > > > > > > > > --git
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /ScannerUtil.java
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > > > > > > > ---
> > 
> > a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /ScannerUtil.java +++
> > 
> > b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/uti
> > l
> > 
> > > > > > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > > > > > > > > 
> > > > > > > > >  import org.apache.commons.lang3.StringUtils;
> > > > > > > > > 
> > > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > > +
> > > > > > > > > 
> > > > > > > > >  final class ScannerUtil {
> > > > > > > > >  
> > > > > > > > >       private ScannerUtil() {}
> > > > > > > > > 
> > > > > > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > > > > > > > > 
> > > > > > > > >      private static final String JAVA_CLASS_FILE_EXTENSION =
> > > > > > 
> > > > > > ".class";
> > > > > > 
> > > > > > > > > -    public static String convertToJavaClassName( String
> > 
> > test )
> > 
> > > > > > > > > +    public static @Nonnull String convertToJavaClassName(
> > > > 
> > > > @Nonnull
> > > > 
> > > > > > > > String
> > > > > > > > 
> > > > > > > > > test ) {
> > > > > > > > > 
> > > > > > > > >          return StringUtils.removeEnd( test, ".class"
> > > 
> > > ).replace(
> > > 
> > > > > FS,
> > > > > 
> > > > > > > "."
> > > > > > > 
> > > > > > > > );
> > > > > > > > 
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    public static String
> > > 
> > > convertJarFileResourceToJavaClassName(
> > > 
> > > > > > String
> > > > > > 
> > > > > > > > test
> > > > > > > > 
> > > > > > > > > ) +    public static @Nonnull String
> > > > > > > > 
> > > > > > > > convertJarFileResourceToJavaClassName(
> > > > > > > > 
> > > > > > > > > @Nonnull String test ) {
> > > > > > > > > 
> > > > > > > > >          return StringUtils.removeEnd( test, ".class"
> > > 
> > > ).replace(
> > > 
> > > > > "/",
> > > > > 
> > > > > > > > "." );
> > > > > > > > 
> > > > > > > > > }
> > > > > > > > > 
> > > > > > > > > -    public static String stripBaseDir( String basedir,
> > 
> > String
> > 
> > > > > test )
> > > > > 
> > > > > > > > > +    public static @Nonnull String stripBaseDir( String
> > > 
> > > basedir,
> > > 
> > > > > > String
> > > > > > 
> > > > > > > > test
> > > > > > > > 
> > > > > > > > > ) {
> > > > > > > > > 
> > > > > > > > >          return StringUtils.removeStart( test, basedir );
> > > > > > > > >      
> > > > > > > > >      }
> > > > > > > > > 
> > > > > > > > > -    public static String[] processIncludesExcludes(
> > > 
> > > List<String>
> > > 
> > > > > > list
> > > > > > 
> > > > > > > )
> > > > > > > 
> > > > > > > > > +    public static @Nonnull String[]
> > > > > > > > > processIncludesExcludes(
> > > > > > 
> > > > > > @Nonnull
> > > > > > 
> > > > > > > > > List<String> list ) {
> > > > > > > > > 
> > > > > > > > >          List<String> newList = new ArrayList<String>();
> > > > > > > > >          for ( Object aList : list )
> > 
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xm
> > l
> > 
> > > ----------------------------------------------------------------------
> > > 
> > > > > > > > > diff --git a/pom.xml b/pom.xml
> > > > > > > > > index 677b367..c60f378 100644
> > > > > > > > > --- a/pom.xml
> > > > > > > > > +++ b/pom.xml
> > > > > > > > > @@ -265,6 +265,12 @@
> > > > > > > > > 
> > > > > > > > >          <version>3.8.1</version>
> > > > > > > > >          <scope>test</scope>
> > > > > > > > >        
> > > > > > > > >        </dependency>
> > > > > > > > > 
> > > > > > > > > +      <dependency>
> > > > > > > > > +        <groupId>com.google.code.findbugs</groupId>
> > > > > > > > > +        <artifactId>jsr305</artifactId>
> > > > > > > > > +        <version>2.0.1</version>
> > > > > > > > > +        <scope>provided</scope>
> > > > > > > > > +      </dependency>
> > > > > > > > > 
> > > > > > > > >      </dependencies>
> > > > > > > > >    
> > > > > > > > >    </dependencyManagement>
> > > > > > > > >    <dependencies>
> > > > 
> > > > ---------------------------------------------------------------------
> > > > 
> > > > > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > > > > > For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
I'll do some more digging but I now suspect it is one of the annotation
processors in the hpi lifecycle... on the versions of java on my machine I
could not reproduce this issue either... I even added some tests using
abstract classes and when the annotations are available again in a
module-c...

So sorry for the noise, better safe than sorry, and I suspect I have some
digging to in the hpi lifecycle... something I have long been promising
myself to do (time is always an issue though) ;-)


On 8 May 2013 20:01, Kristian Rosenvold <kr...@gmail.com>wrote:

> Stephen;
>
> Since I need this in with the smallest attainable spoon; I made a small
> test project:
>
> https://github.com/krosenvold/annotation-test.git
>
> In module-b there is *no* JSR whatsoever on the classpath, even though the
> interface in module A is annotated.
>
> This works on java 1.5 and 1.7.
>
> This seems to work as advertised. So when is it a problem ?
>
> Kristian
>

Re: git commit: Added jsr305 annotations

Posted by Kristian Rosenvold <kr...@gmail.com>.
Stephen;

Since I need this in with the smallest attainable spoon; I made a small
test project:

https://github.com/krosenvold/annotation-test.git

In module-b there is *no* JSR whatsoever on the classpath, even though the
interface in module A is annotated.

This works on java 1.5 and 1.7.

This seems to work as advertised. So when is it a problem ?

Kristian

Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
On 8 May 2013 11:49, Kristian Rosenvold <kr...@gmail.com>wrote:

> Just to be totally clear on this (and still using a tiny spoon); the real
> issue here is really if we want to add the annotations to core
> itself.


If you want to add these annotations onto any class that will be
implemented or extended in a different module then you need either to
always add them with "provided" scope to all implementing modules or add
them with "compile" scope on the api module.


> It would appear to me that all other use is basically fine with
> provided-scope.
>

Yeah, but too often, e.g. with Jenkins plugins that I write for my day job,
I find that you need to keep adding those annotations with "provided"
scope... I live with it for the Jenkins plugins because of some crazy
classloading issues that making them transitive would trigger within
Jenkins, but Maven has more sane classloading so having the annotations
transitive at the root of the Maven API could be a good thing... see below


> And if we decided to stick with javax.annotation.Nonnull
> and javax.annotation.Nullable, we might run into some kind
> of trouble if, at a later stage an "official" jdk comes bundled with a
> slightly /different/ javax.annotation.Nullable ?
>
> And at that point, we would be thoroughly in trouble, right ?
>

Yes.

One solution though would be to do

package org.apache.maven.annotations;

@Documented
@Target(value = {FIELD, METHOD, PARAMETER, LOCAL_VARIABLE})
@Retention(value = RUNTIME)
@javax.annotations.Nonnull(when = ALWAYS)
@javax.annotations.meta.TypeQualifierNickname
public @interface NonNull {
}

and similar for the other annotations that we deem acceptable risk to use.

The @TypeQualifierNickname means that IntelliJ and tools will treat the
annotation as equivalent to @javax.annotations.Nonnull and that makes it
clear exactly which annotations we are applying within core.... so that the
annotations more at risk of being changed *if* JSR-305 ever gets back in
the air and lands successfully in the JVM runtime the potential changes in
some of the other annotations will be less risk as we will not have used
them...

Of course we won't have the compiler to help us as doing the above will
require the jsr-305 annotations be on the compile classpath anyway
:rolleyes:

Hence I think we just do up a page saying exactly what annotations are
acceptable in Maven Core and Maven Plugins at hosted by the Maven project
at the ASF... that way we can make a judgement call on the risk for each
one we decide to approve.

My initial list is @Nonnull() and @Nullable() both without any parameter
values suppled, as I view the parameter name as a slight risk of change...
but I am not vetoing the use of the "when" parameter.

-Stephen


> Kristian
>
>
> 2013/5/8 Stephen Connolly <st...@gmail.com>
>
> > Hmmm though using the when parameter may be an issue: e.g.
> > @Nonnull(when=MAYBE)
> >
> >
> > On 8 May 2013 11:23, Stephen Connolly <stephen.alan.connolly@gmail.com
> > >wrote:
> >
> > > Hmmm I may have lost the plot somewhat, as the findbugs annotations are
> > > @TypeQualifierNickname's for @Nonnull anyway...
> > >
> > > I guess my point is that we need to decide *and document* exactly which
> > > annotations are we using. My view is the Nonnull and Nullable are
> good...
> > > ones with parameters are less good.
> > >
> > >
> > > On 8 May 2013 11:16, Stephen Connolly <stephen.alan.connolly@gmail.com
> > >wrote:
> > >
> > >> If you do
> > >>
> > >>     <dependency>
> > >>       <groupId>com.google.code.findbugs</groupId>
> > >>       <artifactId>jsr305</artifactId>
> > >>       <version>2.0.1</version>
> > >>       <scope>provided</scope>
> > >>     </dependency>
> > >>
> > >> In one of Maven's APIs thinking that RetentionPolicy.RUNTIME or
> > >> RetentionPolicy.COMPILE will save you as the JVM spec says missing
> > >> annotations are to be ignored... you will be burned when compiling
> > >> implementations of the API unless you add the dependency to *your*
> > >> implementation.
> > >>
> > >> At least some versions (I suspect all but have not confirmed) of JavaC
> > >> needs all the annotations with COMPILE or higher retention available
> so
> > >> that, at the very least, it knows whether to retain the annotation or
> > >> not... as it may affect the method signature for @Override annotated
> > >> methods or something like that... never really be happy about the
> issue.
> > >>
> > >> This has bit me when I have an API with @Nonnull annotations and then
> > try
> > >> to implement the API class.
> > >>
> > >> So in such cases using the javax.annotations carries a risk as once/if
> > >> JSR-305 gets accepted, the accepted version of the annotations will be
> > part
> > >> of the core classloader and the dependency provided version will loose
> > >> out...
> > >>
> > >> Not likely a big risk for @Nonnull or @Nullable... but e.g
> > >> @MatchesPattern(value="^\d\d\d-\d\d$",flags=0) might cause issues if
> in
> > the
> > >> reboot the "flags" parameter gets refactored to regexFlags. It is
> > unclear
> > >> to me what the JVM spec says in the case where the annotation class is
> > >> present but has had a signature change from what was used when the
> > >> annotated source was compiled.
> > >>
> > >> With annotations that are not in the "special" package namespaces we
> can
> > >> at least put our dependency first... but maybe I am just overly
> paranoid
> > >>
> > >>
> > >> On 8 May 2013 11:01, Kristian Rosenvold <kristian.rosenvold@gmail.com
> > >wrote:
> > >>
> > >>> Linking to one of your private git repos made this only marginally
> > >>> clearer;
> > >>> I see the edu.umd in there though !
> > >>>
> > >>>
> > >>>
> > >>> > So setting the dependency as "provided" is all well and good until
> > you
> > >>> need
> > >>> > to implement an interface with the annotation applied... at which
> > >>> point you
> > >>> > need to add back in the "provided" dependency...
> > >>> >
> > >>> > But it's still only compile-time, right ? Why would that be a
> > problem ?
> > >>>
> > >>>
> > >>> Having the annotation available at RUNTIME does allow for additional
> > >>> > validations, so that would favour JSR-305, but given that you need
> > the
> > >>> > dependency transitive for compilation there is scope for issues if
> > >>> JSR-305
> > >>> > ever gets rebooted.
> > >>> >
> > >>>
> > >>> Give me this with a tiny spoon please; when would this be a problem ?
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> > On 8 May 2013 09:53, Kristian Rosenvold <
> > kristian.rosenvold@gmail.com
> > >>> > >wrote:
> > >>> >
> > >>> > > You mean there's an older set of findbugs annoations ?
> > >>> > >
> > >>> > > Kristian
> > >>> > >
> > >>> > >
> > >>> > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> > >>> > >
> > >>> > > > IntelliJ also supports the findbugs and jcip annotations too...
> > >>> but in
> > >>> > > any
> > >>> > > > case I will hold my piece... given that these annotations do
> not
> > >>> have
> > >>> > > > parameters the risk is almost non-existant for *these* but I do
> > >>> think
> > >>> > it
> > >>> > > is
> > >>> > > > a more general risk
> > >>> > > >
> > >>> > > >
> > >>> > > > On 8 May 2013 09:06, Kristian Rosenvold <
> > >>> kristian.rosenvold@gmail.com
> > >>> > > > >wrote:
> > >>> > > >
> > >>> > > > > I suspect like a lot of the rest of the community, they
> simply
> > >>> gave
> > >>> > up
> > >>> > > on
> > >>> > > > > the jcp.
> > >>> > > > >
> > >>> > > > > I am no insider on the project but
> > >>> com.google.code.findbugs/jsr-305
> > >>> > was
> > >>> > > > > last published in a 2.0.1 version in july 2012, and
> > >>> > > > > seems to be alive and kicking. IntelliJ also supports the
> > >>> annotations
> > >>> > > > which
> > >>> > > > > means we finally have /one/ set of annotations
> > >>> > > > > that everybody understands.
> > >>> > > > >
> > >>> > > > > The value of both Nullable and Nonnull is just amazing once
> you
> > >>> get
> > >>> > it
> > >>> > > > all
> > >>> > > > > in place.
> > >>> > > > >
> > >>> > > > > As for potential classloading issues, I'm sure /someone/ here
> > >>> would
> > >>> > > know
> > >>> > > > :)
> > >>> > > > >
> > >>> > > > > Kristian
> > >>> > > > >
> > >>> > > > >
> > >>> > > > >
> > >>> > > > >
> > >>> > > > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> > >>> > > > >
> > >>> > > > > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr>
> > >>> wrote:
> > >>> > > > > >
> > >>> > > > > > > I like this: could we define it as the standard way to
> add
> > >>> such
> > >>> > > > > > > annotations in
> > >>> > > > > > > whole Maven components? Any problem if we do it in Maven
> > core
> > >>> > > itself?
> > >>> > > > > > >
> > >>> > > > > > > I'm not a JSR-305 expert, any basic explanation on the
> > >>> > > > > > > com.google.code.findbugs:jsr305 choice is good to know
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> > >>> > > > > >
> > >>> > > > > > In general I like those annotations, though I tend to
> favour
> > >>> the
> > >>> > > > findbugs
> > >>> > > > > > annotations and jcip annotations in code I write while
> > awaiting
> > >>> > > jsr305
> > >>> > > > to
> > >>> > > > > > finalize (given that the spec is dormant, feared dead:
> > >>> > > > > > http://jcp.org/en/jsr/detail?id=305) and I suspect a
> reboot
> > >>> of the
> > >>> > > > spec
> > >>> > > > > > may
> > >>> > > > > > result in signature changes and as such, given that the
> > >>> annotations
> > >>> > > are
> > >>> > > > > > runtime retention, when annotations finally land in the JVM
> > >>> there
> > >>> > may
> > >>> > > > be
> > >>> > > > > a
> > >>> > > > > > risk from signature change...
> > >>> > > > > >
> > >>> > > > > > But that could be an irrational fear on my behalf...
> > >>> > > > > >
> > >>> > > > > > In any case I have clean room ASLv2 licensed versions of
> the
> > >>> > findbugs
> > >>> > > > and
> > >>> > > > > > jcip annotations in my GitHub repo and published to
> central.
> > >>> > > > > >
> > >>> > > > > >
> > >>> > > > > > > then we could add it to maven parent pom
> > dependencyManagement
> > >>> > > > section,
> > >>> > > > > > and
> > >>> > > > > > > write something into "Maven Developer Centre"
> > >>> > > > > > >
> > >>> > > > > > > Regards,
> > >>> > > > > > >
> > >>> > > > > > > Hervé
> > >>> > > > > > >
> > >>> > > > > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a
> > écrit :
> > >>> > > > > > > > Updated Branches:
> > >>> > > > > > > >   refs/heads/master 231773324 -> 7b330f584
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > > > Added jsr305 annotations
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > > > Project:
> > >>> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > >>> > > > > > > > Commit:
> > >>> > > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree
> > >>> :
> > >>> > > > > > > >
> > >>> > > > > >
> > >>> > > >
> > >>> >
> > >>>
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > >>> > > > > > > >
> > >>> > > >
> > >>> http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > >>> > > > > > > >
> > >>> > > > > > > > Branch: refs/heads/master
> > >>> > > > > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > >>> > > > > > > > Parents: 2317733
> > >>> > > > > > > > Author: Kristian Rosenvold <kr...@apache.org>
> > >>> > > > > > > > Authored: Tue May 7 18:49:15 2013 +0200
> > >>> > > > > > > > Committer: Kristian Rosenvold <kr...@apache.org>
> > >>> > > > > > > > Committed: Tue May 7 18:49:15 2013 +0200
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > >
> > >>> >
> > ----------------------------------------------------------------------
> > >>> > > > > > > >  maven-surefire-common/pom.xml                      |
> >  4
> > >>> ++++
> > >>> > > > > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |
> >  7
> > >>> > > +++++--
> > >>> > > > > > > >  .../maven/plugin/surefire/ClasspathCache.java      |
> >  6
> > >>> > ++++--
> > >>> > > > > > > >  .../maven/plugin/surefire/CommonReflector.java     |
> >  8
> > >>> > > +++++---
> > >>> > > > > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |
> >  3
> > >>> +++
> > >>> > > > > > > >  .../surefire/booterclient/ForkConfiguration.java   |
> >  4
> > >>> ++--
> > >>> > > > > > > >  .../plugin/surefire/util/DependencyScanner.java    |
> >  4
> > >>> +++-
> > >>> > > > > > > >  .../maven/plugin/surefire/util/Relocator.java      |
> > 12
> > >>> > > > > ++++++++----
> > >>> > > > > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |
> > 10
> > >>> > > > ++++++----
> > >>> > > > > > > >  pom.xml                                            |
> >  6
> > >>> > ++++++
> > >>> > > > > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > >>> > > > > > > >
> > >>> > > > >
> > >>> >
> > ----------------------------------------------------------------------
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > > refire-common/pom.xml
> > >>> > > > > > > >
> > >>> > > > >
> > >>> >
> > ----------------------------------------------------------------------
> > >>> > > > > > > diff
> > >>> > > > > > > > --git a/maven-surefire-common/pom.xml
> > >>> > > > b/maven-surefire-common/pom.xml
> > >>> > > > > > > index
> > >>> > > > > > > > 1330eec..bed467b 100644
> > >>> > > > > > > > --- a/maven-surefire-common/pom.xml
> > >>> > > > > > > > +++ b/maven-surefire-common/pom.xml
> > >>> > > > > > > > @@ -91,6 +91,10 @@
> > >>> > > > > > > >        <artifactId>commons-lang3</artifactId>
> > >>> > > > > > > >      </dependency>
> > >>> > > > > > > >      <dependency>
> > >>> > > > > > > > +      <groupId>com.google.code.findbugs</groupId>
> > >>> > > > > > > > +      <artifactId>jsr305</artifactId>
> > >>> > > > > > > > +    </dependency>
> > >>> > > > > > > > +    <dependency>
> > >>> > > > > > > >        <groupId>org.apache.maven.shared</groupId>
> > >>> > > > > > > >
> > >>>  <artifactId>maven-common-artifact-filters</artifactId>
> > >>> > > > > > > >        <version>1.3</version>
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > >>> > > > > > > > eMojo.java
> > >>> > > > > > > >
> > >>> > > > >
> > >>> >
> > ----------------------------------------------------------------------
> > >>> > > > > > > diff
> > >>> > > > > > > > --git
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > >>> > > > > > > > ractSurefireMojo.java
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > >>> > > > > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > >>> > > > > > > > ---
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > >>> > > > > > > > ractSurefireMojo.java +++
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > >>> > > > > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > >>> > > > > > > > org.apache.maven.surefire.util.RunOrder;
> > >>> > > > > > > >  import org.apache.maven.toolchain.Toolchain;
> > >>> > > > > > > >  import org.apache.maven.toolchain.ToolchainManager;
> > >>> > > > > > > >
> > >>> > > > > > > > +import javax.annotation.Nonnull;
> > >>> > > > > > > > +
> > >>> > > > > > > >  /**
> > >>> > > > > > > >   * Abstract base class for running tests using
> Surefire.
> > >>> > > > > > > >   *
> > >>> > > > > > > > @@ -1266,7 +1268,7 @@ public abstract class
> > >>> > AbstractSurefireMojo
> > >>> > > > > > > >          }
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > > -    private List<String> getExcludeList()
> > >>> > > > > > > > +    private @Nonnull List<String> getExcludeList()
> > >>> > > > > > > >      {
> > >>> > > > > > > >          List<String> excludes = null;
> > >>> > > > > > > >          if ( isSpecificTestSpecified() )
> > >>> > > > > > > > @@ -1339,7 +1341,7 @@ public abstract class
> > >>> > AbstractSurefireMojo
> > >>> > > > > > > >          return filterNulls( includes );
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > > -    private List<String> filterNulls( List<String>
> > >>> toFilter )
> > >>> > > > > > > > +    private @Nonnull List<String> filterNulls(
> @Nonnull
> > >>> > > > List<String>
> > >>> > > > > > > > toFilter ) {
> > >>> > > > > > > >          List<String> result = new ArrayList<String>(
> > >>> > > > toFilter.size()
> > >>> > > > > > );
> > >>> > > > > > > >          for ( String item : toFilter )
> > >>> > > > > > > > @@ -2130,6 +2132,7 @@ public abstract class
> > >>> > AbstractSurefireMojo
> > >>> > > > > > > >              return new DynamicProviderInfo(
> providerName
> > >>> );
> > >>> > > > > > > >          }
> > >>> > > > > > > >
> > >>> > > > > > > > +        @Nonnull
> > >>> > > > > > > >          public String getProviderName()
> > >>> > > > > > > >          {
> > >>> > > > > > > >              return providerName;
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > >>> > > > > > > > java
> > >>> > > > > > >
> > >>> > > >
> > >>>
> ----------------------------------------------------------------------
> > >>> > > > > > > > diff --git
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > >>> > > > > > > > spathCache.java
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > >>> > > > > > > > spathCache.java index 1bcb065..ea250c2 100644
> > >>> > > > > > > > ---
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > >>> > > > > > > > spathCache.java +++
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > >>> > > > > > > > spathCache.java @@ -21,6 +21,8 @@ package
> > >>> > > > > > > org.apache.maven.plugin.surefire;
> > >>> > > > > > > >  import java.util.concurrent.ConcurrentHashMap;
> > >>> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > >>> > > > > > > >
> > >>> > > > > > > > +import javax.annotation.Nonnull;
> > >>> > > > > > > > +
> > >>> > > > > > > >  /**
> > >>> > > > > > > >   * @author Kristian Rosenvold
> > >>> > > > > > > >   */
> > >>> > > > > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > >>> > > > > > > >      private static final ConcurrentHashMap<String,
> > >>> Classpath>
> > >>> > > > > > > classpaths =
> > >>> > > > > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > >>> > > > > > > >
> > >>> > > > > > > > -    public static Classpath getCachedClassPath( String
> > >>> > > artifactId
> > >>> > > > )
> > >>> > > > > > > > +    public static Classpath getCachedClassPath(
> @Nonnull
> > >>> > String
> > >>> > > > > > > artifactId
> > >>> > > > > > > > ) {
> > >>> > > > > > > >          return classpaths.get( artifactId );
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > > -    public static void setCachedClasspath( String key,
> > >>> > Classpath
> > >>> > > > > > > classpath
> > >>> > > > > > > > ) +    public static void setCachedClasspath( @Nonnull
> > >>> String
> > >>> > > key,
> > >>> > > > > > > @Nonnull
> > >>> > > > > > > > Classpath classpath ) {
> > >>> > > > > > > >          classpaths.put( key, classpath );
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > >>> > > > > > > > .java
> > >>> > > > > > >
> > >>> > > >
> > >>>
> ----------------------------------------------------------------------
> > >>> > > > > > > > diff --git
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > >>> > > > > > > > onReflector.java
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > >>> > > > > > > > onReflector.java index 538b7e0..6851539 100644
> > >>> > > > > > > > ---
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > >>> > > > > > > > onReflector.java +++
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > >>> > > > > > > > onReflector.java @@ -25,6 +25,8 @@ import
> > >>> > > > > > > >
> > >>> org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
> > >>> > > > > import
> > >>> > > > > > > > org.apache.maven.surefire.util.ReflectionUtils;
> > >>> > > > > > > >  import
> > >>> > > org.apache.maven.surefire.util.SurefireReflectionException;
> > >>> > > > > > > >
> > >>> > > > > > > > +import javax.annotation.Nonnull;
> > >>> > > > > > > > +
> > >>> > > > > > > >  /**
> > >>> > > > > > > >   * @author Kristian Rosenvold
> > >>> > > > > > > >   */
> > >>> > > > > > > > @@ -34,7 +36,7 @@ public class CommonReflector
> > >>> > > > > > > >
> > >>> > > > > > > >      private final ClassLoader surefireClassLoader;
> > >>> > > > > > > >
> > >>> > > > > > > > -    public CommonReflector( ClassLoader
> > >>> surefireClassLoader )
> > >>> > > > > > > > +    public CommonReflector( @Nonnull ClassLoader
> > >>> > > > > surefireClassLoader )
> > >>> > > > > > > >      {
> > >>> > > > > > > >          this.surefireClassLoader =
> surefireClassLoader;
> > >>> > > > > > > >
> > >>> > > > > > > > @@ -48,7 +50,7 @@ public class CommonReflector
> > >>> > > > > > > >          }
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > > -    public Object createReportingReporterFactory(
> > >>> > > > > > > > StartupReportConfiguration startupReportConfiguration
> ) +
> > >>> > >  public
> > >>> > > > > > > Object
> > >>> > > > > > > > createReportingReporterFactory( @Nonnull
> > >>> > > StartupReportConfiguration
> > >>> > > > > > > > startupReportConfiguration ) {
> > >>> > > > > > > >          Class<?>[] args = new Class[]{
> > >>> > > > > this.startupReportConfiguration
> > >>> > > > > > > };
> > >>> > > > > > > >          Object src = createStartupReportConfiguration(
> > >>> > > > > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public
> > >>> class
> > >>> > > > > > > > CommonReflector
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > > > -    Object createStartupReportConfiguration(
> > >>> > > > > > StartupReportConfiguration
> > >>> > > > > > > > reporterConfiguration ) +    Object
> > >>> > > > createStartupReportConfiguration(
> > >>> > > > > > > > @Nonnull StartupReportConfiguration
> reporterConfiguration
> > >>> ) {
> > >>> > > > > > > >          Constructor<?> constructor =
> > >>> > > > ReflectionUtils.getConstructor(
> > >>> > > > > > > > this.startupReportConfiguration, new Class[]{
> > >>> boolean.class,
> > >>> > > > > > > boolean.class,
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > >>> > > > > > > > va
> > >>> > > > > >
> > >>> > >
> > >>>
> ----------------------------------------------------------------------
> > >>> > > > > > > > diff --git
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > >>> > > > > > > > iderInfo.java
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > >>> > > > > > > > iderInfo.java index 57069d8..50de7ea 100644
> > >>> > > > > > > > ---
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > >>> > > > > > > > iderInfo.java +++
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > >>> > > > > > > > iderInfo.java @@ -24,11 +24,14 @@ import
> > >>> > > > > > > >
> > >>> org.apache.maven.artifact.resolver.ArtifactResolutionException;
> > >>> > > > > import
> > >>> > > > > > > > org.apache.maven.plugin.MojoExecutionException;
> > >>> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > >>> > > > > > > >
> > >>> > > > > > > > +import javax.annotation.Nonnull;
> > >>> > > > > > > > +
> > >>> > > > > > > >  /**
> > >>> > > > > > > >   * @author Kristian Rosenvold
> > >>> > > > > > > >   */
> > >>> > > > > > > >  public interface ProviderInfo
> > >>> > > > > > > >  {
> > >>> > > > > > > > +    @Nonnull
> > >>> > > > > > > >      String getProviderName();
> > >>> > > > > > > >
> > >>> > > > > > > >      boolean isApplicable();
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > >>> > > > > > > > rkConfiguration.java
> > >>> > > > > > > >
> > >>> > > > >
> > >>> >
> > ----------------------------------------------------------------------
> > >>> > > > > > > diff
> > >>> > > > > > > > --git
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > >>> > > > > > > > erclient/ForkConfiguration.java
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > >>> > > > > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27
> > >>> 100644
> > >>> > > > > > > > ---
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > >>> > > > > > > > erclient/ForkConfiguration.java +++
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > >>> > > > > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@
> > public
> > >>> > class
> > >>> > > > > > > > ForkConfiguration
> > >>> > > > > > > >
> > >>> > > > > > > >      /**
> > >>> > > > > > > >       * @param classPath            cla the classpath
> > >>> arguments
> > >>> > > > > > > > -     * @param startupConfiguration
> > >>> > > > > > > > +     * @param startupConfiguration The startup
> > >>> configuration
> > >>> > > > > > > >       * @param threadNumber         the thread number,
> to
> > >>> be
> > >>> > the
> > >>> > > > > > > replacement
> > >>> > > > > > > > in the argLine   @return A commandline * @throws
> > >>> > > > > > > >
> > >>> org.apache.maven.surefire.booter.SurefireBooterForkException *
> > >>> > > > > > > > when unable to perform the fork
> > >>> > > > > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > >>> > > > > > > >       * for all classpath elements.
> > >>> > > > > > > >       *
> > >>> > > > > > > >       * @param classPath      List&lt;String> of all
> > >>> classpath
> > >>> > > > > > elements.
> > >>> > > > > > > > -     * @param startClassName
> > >>> > > > > > > > +     * @param startClassName  The classname to start
> > >>> > > (main-class)
> > >>> > > > > > > >       * @return The file pointint to the jar
> > >>> > > > > > > >       * @throws java.io.IOException When a file
> operation
> > >>> > fails.
> > >>> > > > > > > >       */
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > >>> > > > > > > > Scanner.java
> > >>> > > > > > > >
> > >>> > > > >
> > >>> >
> > ----------------------------------------------------------------------
> > >>> > > > > > > diff
> > >>> > > > > > > > --git
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /DependencyScanner.java
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > >>> > > > > > > > ---
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /DependencyScanner.java +++
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > >>> > > > > > > > org.apache.maven.plugin.MojoExecutionException; import
> > >>> > > > > > > > org.apache.maven.shared.utils.io.MatchPatterns;
> > >>> > > > > > > >  import
> org.apache.maven.surefire.util.DefaultScanResult;
> > >>> > > > > > > >
> > >>> > > > > > > > +import javax.annotation.Nullable;
> > >>> > > > > > > > +
> > >>> > > > > > > >  /**
> > >>> > > > > > > >   * Scans dependencies looking for tests.
> > >>> > > > > > > >   *
> > >>> > > > > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > >>> > > > > > > >
> > >>> > > > > > > >               private SpecificFileFilter
> > >>> specificTestFilter;
> > >>> > > > > > > >
> > >>> > > > > > > > -             public Matcher(List<String> includes,
> > >>> > List<String>
> > >>> > > > > > > excludes,
> > >>> > > > > > > List<String>
> > >>> > > > > > > > specificTests) +              public Matcher(@Nullable
> > >>> > > List<String>
> > >>> > > > > > > includes,
> > >>> > > > > > > @Nullable
> > >>> > > > > > > > List<String> excludes, @Nullable List<String>
> > >>> specificTests) {
> > >>> > > > > > > >                       String[] specific = specificTests
> > ==
> > >>> > null ?
> > >>> > > > new
> > >>> > > > > > > String[0] :
> > >>> > > > > > > > processIncludesExcludes( specificTests );
> > >>> specificTestFilter =
> > >>> > > new
> > >>> > > > > > > > SpecificFileFilter( specific );
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > >>> > > > > > > > java
> > >>> > > > > > >
> > >>> > > >
> > >>>
> ----------------------------------------------------------------------
> > >>> > > > > > > > diff --git
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /Relocator.java
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /Relocator.java index 31dde5d..76da9de 100644
> > >>> > > > > > > > ---
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /Relocator.java +++
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /Relocator.java @@ -19,6 +19,10 @@ package
> > >>> > > > > > > > org.apache.maven.plugin.surefire.util;
> > >>> > > > > > > >   * under the License.
> > >>> > > > > > > >   */
> > >>> > > > > > > >
> > >>> > > > > > > > +import com.sun.istack.internal.NotNull;
> > >>> > > > > > > > +
> > >>> > > > > > > > +import javax.annotation.Nullable;
> > >>> > > > > > > > +
> > >>> > > > > > > >  /**
> > >>> > > > > > > >   * Relocates class names when running with relocated
> > >>> provider
> > >>> > > > > > > >   *
> > >>> > > > > > > > @@ -26,12 +30,12 @@ package
> > >>> > > org.apache.maven.plugin.surefire.util;
> > >>> > > > > > > >   */
> > >>> > > > > > > >  public class Relocator
> > >>> > > > > > > >  {
> > >>> > > > > > > > -    private final String relocation;
> > >>> > > > > > > > +    private final @Nullable String relocation;
> > >>> > > > > > > >
> > >>> > > > > > > >      private static final String relocationBase =
> > >>> > > > > > > > "org.apache.maven.surefire.";
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > > > -    public Relocator( String relocation )
> > >>> > > > > > > > +    public Relocator( @Nullable String relocation )
> > >>> > > > > > > >      {
> > >>> > > > > > > >          this.relocation = relocation;
> > >>> > > > > > > >      }
> > >>> > > > > > > > @@ -41,12 +45,12 @@ public class Relocator
> > >>> > > > > > > >          relocation = "shadefire";
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > > -    private String getRelocation()
> > >>> > > > > > > > +    private @Nullable String getRelocation()
> > >>> > > > > > > >      {
> > >>> > > > > > > >          return relocation;
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > > -    public String relocate( String className )
> > >>> > > > > > > > +    public @NotNull String relocate( @NotNull String
> > >>> > className )
> > >>> > > > > > > >      {
> > >>> > > > > > > >          if ( relocation == null )
> > >>> > > > > > > >          {
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > >>> > > > > > > > l.java
> > >>> > > > > > > >
> > >>> > > > >
> > >>> >
> > ----------------------------------------------------------------------
> > >>> > > > > > > diff
> > >>> > > > > > > > --git
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /ScannerUtil.java
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /ScannerUtil.java index 3498e63..8b80301 100644
> > >>> > > > > > > > ---
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /ScannerUtil.java +++
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > >>> > > > > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import
> > java.util.List;
> > >>> > > > > > > >
> > >>> > > > > > > >  import org.apache.commons.lang3.StringUtils;
> > >>> > > > > > > >
> > >>> > > > > > > > +import javax.annotation.Nonnull;
> > >>> > > > > > > > +
> > >>> > > > > > > >  final class ScannerUtil {
> > >>> > > > > > > >
> > >>> > > > > > > >       private ScannerUtil() {}
> > >>> > > > > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > >>> > > > > > > >
> > >>> > > > > > > >      private static final String
> > JAVA_CLASS_FILE_EXTENSION
> > >>> =
> > >>> > > > > ".class";
> > >>> > > > > > > >
> > >>> > > > > > > > -    public static String convertToJavaClassName(
> String
> > >>> test )
> > >>> > > > > > > > +    public static @Nonnull String
> > convertToJavaClassName(
> > >>> > > @Nonnull
> > >>> > > > > > > String
> > >>> > > > > > > > test ) {
> > >>> > > > > > > >          return StringUtils.removeEnd( test, ".class"
> > >>> > ).replace(
> > >>> > > > FS,
> > >>> > > > > > "."
> > >>> > > > > > > );
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > > -    public static String
> > >>> > convertJarFileResourceToJavaClassName(
> > >>> > > > > String
> > >>> > > > > > > test
> > >>> > > > > > > > ) +    public static @Nonnull String
> > >>> > > > > > > convertJarFileResourceToJavaClassName(
> > >>> > > > > > > > @Nonnull String test ) {
> > >>> > > > > > > >          return StringUtils.removeEnd( test, ".class"
> > >>> > ).replace(
> > >>> > > > "/",
> > >>> > > > > > > "." );
> > >>> > > > > > > > }
> > >>> > > > > > > >
> > >>> > > > > > > > -    public static String stripBaseDir( String basedir,
> > >>> String
> > >>> > > > test )
> > >>> > > > > > > > +    public static @Nonnull String stripBaseDir( String
> > >>> > basedir,
> > >>> > > > > String
> > >>> > > > > > > test
> > >>> > > > > > > > ) {
> > >>> > > > > > > >          return StringUtils.removeStart( test, basedir
> );
> > >>> > > > > > > >      }
> > >>> > > > > > > >
> > >>> > > > > > > > -    public static String[] processIncludesExcludes(
> > >>> > List<String>
> > >>> > > > > list
> > >>> > > > > > )
> > >>> > > > > > > > +    public static @Nonnull String[]
> > >>> processIncludesExcludes(
> > >>> > > > > @Nonnull
> > >>> > > > > > > > List<String> list ) {
> > >>> > > > > > > >          List<String> newList = new
> ArrayList<String>();
> > >>> > > > > > > >          for ( Object aList : list )
> > >>> > > > > > > >
> > >>> > > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > >>> > > > > > > >
> > >>> > > > >
> > >>> >
> > ----------------------------------------------------------------------
> > >>> > > > > > > > diff --git a/pom.xml b/pom.xml
> > >>> > > > > > > > index 677b367..c60f378 100644
> > >>> > > > > > > > --- a/pom.xml
> > >>> > > > > > > > +++ b/pom.xml
> > >>> > > > > > > > @@ -265,6 +265,12 @@
> > >>> > > > > > > >          <version>3.8.1</version>
> > >>> > > > > > > >          <scope>test</scope>
> > >>> > > > > > > >        </dependency>
> > >>> > > > > > > > +      <dependency>
> > >>> > > > > > > > +        <groupId>com.google.code.findbugs</groupId>
> > >>> > > > > > > > +        <artifactId>jsr305</artifactId>
> > >>> > > > > > > > +        <version>2.0.1</version>
> > >>> > > > > > > > +        <scope>provided</scope>
> > >>> > > > > > > > +      </dependency>
> > >>> > > > > > > >      </dependencies>
> > >>> > > > > > > >    </dependencyManagement>
> > >>> > > > > > > >    <dependencies>
> > >>> > > > > > >
> > >>> > > > > > >
> > >>> > >
> > ---------------------------------------------------------------------
> > >>> > > > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > >>> > > > > > > For additional commands, e-mail:
> dev-help@maven.apache.org
> > >>> > > > > > >
> > >>> > > > > > >
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> > >>
> > >>
> > >
> >
>

Re: git commit: Added jsr305 annotations

Posted by Kristian Rosenvold <kr...@gmail.com>.
Just to be totally clear on this (and still using a tiny spoon); the real
issue here is really if we want to add the annotations to core
itself. It would appear to me that all other use is basically fine with
provided-scope.

And if we decided to stick with javax.annotation.Nonnull
and javax.annotation.Nullable, we might run into some kind
of trouble if, at a later stage an "official" jdk comes bundled with a
slightly /different/ javax.annotation.Nullable ?

And at that point, we would be thoroughly in trouble, right ?

Kristian


2013/5/8 Stephen Connolly <st...@gmail.com>

> Hmmm though using the when parameter may be an issue: e.g.
> @Nonnull(when=MAYBE)
>
>
> On 8 May 2013 11:23, Stephen Connolly <stephen.alan.connolly@gmail.com
> >wrote:
>
> > Hmmm I may have lost the plot somewhat, as the findbugs annotations are
> > @TypeQualifierNickname's for @Nonnull anyway...
> >
> > I guess my point is that we need to decide *and document* exactly which
> > annotations are we using. My view is the Nonnull and Nullable are good...
> > ones with parameters are less good.
> >
> >
> > On 8 May 2013 11:16, Stephen Connolly <stephen.alan.connolly@gmail.com
> >wrote:
> >
> >> If you do
> >>
> >>     <dependency>
> >>       <groupId>com.google.code.findbugs</groupId>
> >>       <artifactId>jsr305</artifactId>
> >>       <version>2.0.1</version>
> >>       <scope>provided</scope>
> >>     </dependency>
> >>
> >> In one of Maven's APIs thinking that RetentionPolicy.RUNTIME or
> >> RetentionPolicy.COMPILE will save you as the JVM spec says missing
> >> annotations are to be ignored... you will be burned when compiling
> >> implementations of the API unless you add the dependency to *your*
> >> implementation.
> >>
> >> At least some versions (I suspect all but have not confirmed) of JavaC
> >> needs all the annotations with COMPILE or higher retention available so
> >> that, at the very least, it knows whether to retain the annotation or
> >> not... as it may affect the method signature for @Override annotated
> >> methods or something like that... never really be happy about the issue.
> >>
> >> This has bit me when I have an API with @Nonnull annotations and then
> try
> >> to implement the API class.
> >>
> >> So in such cases using the javax.annotations carries a risk as once/if
> >> JSR-305 gets accepted, the accepted version of the annotations will be
> part
> >> of the core classloader and the dependency provided version will loose
> >> out...
> >>
> >> Not likely a big risk for @Nonnull or @Nullable... but e.g
> >> @MatchesPattern(value="^\d\d\d-\d\d$",flags=0) might cause issues if in
> the
> >> reboot the "flags" parameter gets refactored to regexFlags. It is
> unclear
> >> to me what the JVM spec says in the case where the annotation class is
> >> present but has had a signature change from what was used when the
> >> annotated source was compiled.
> >>
> >> With annotations that are not in the "special" package namespaces we can
> >> at least put our dependency first... but maybe I am just overly paranoid
> >>
> >>
> >> On 8 May 2013 11:01, Kristian Rosenvold <kristian.rosenvold@gmail.com
> >wrote:
> >>
> >>> Linking to one of your private git repos made this only marginally
> >>> clearer;
> >>> I see the edu.umd in there though !
> >>>
> >>>
> >>>
> >>> > So setting the dependency as "provided" is all well and good until
> you
> >>> need
> >>> > to implement an interface with the annotation applied... at which
> >>> point you
> >>> > need to add back in the "provided" dependency...
> >>> >
> >>> > But it's still only compile-time, right ? Why would that be a
> problem ?
> >>>
> >>>
> >>> Having the annotation available at RUNTIME does allow for additional
> >>> > validations, so that would favour JSR-305, but given that you need
> the
> >>> > dependency transitive for compilation there is scope for issues if
> >>> JSR-305
> >>> > ever gets rebooted.
> >>> >
> >>>
> >>> Give me this with a tiny spoon please; when would this be a problem ?
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> > On 8 May 2013 09:53, Kristian Rosenvold <
> kristian.rosenvold@gmail.com
> >>> > >wrote:
> >>> >
> >>> > > You mean there's an older set of findbugs annoations ?
> >>> > >
> >>> > > Kristian
> >>> > >
> >>> > >
> >>> > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> >>> > >
> >>> > > > IntelliJ also supports the findbugs and jcip annotations too...
> >>> but in
> >>> > > any
> >>> > > > case I will hold my piece... given that these annotations do not
> >>> have
> >>> > > > parameters the risk is almost non-existant for *these* but I do
> >>> think
> >>> > it
> >>> > > is
> >>> > > > a more general risk
> >>> > > >
> >>> > > >
> >>> > > > On 8 May 2013 09:06, Kristian Rosenvold <
> >>> kristian.rosenvold@gmail.com
> >>> > > > >wrote:
> >>> > > >
> >>> > > > > I suspect like a lot of the rest of the community, they simply
> >>> gave
> >>> > up
> >>> > > on
> >>> > > > > the jcp.
> >>> > > > >
> >>> > > > > I am no insider on the project but
> >>> com.google.code.findbugs/jsr-305
> >>> > was
> >>> > > > > last published in a 2.0.1 version in july 2012, and
> >>> > > > > seems to be alive and kicking. IntelliJ also supports the
> >>> annotations
> >>> > > > which
> >>> > > > > means we finally have /one/ set of annotations
> >>> > > > > that everybody understands.
> >>> > > > >
> >>> > > > > The value of both Nullable and Nonnull is just amazing once you
> >>> get
> >>> > it
> >>> > > > all
> >>> > > > > in place.
> >>> > > > >
> >>> > > > > As for potential classloading issues, I'm sure /someone/ here
> >>> would
> >>> > > know
> >>> > > > :)
> >>> > > > >
> >>> > > > > Kristian
> >>> > > > >
> >>> > > > >
> >>> > > > >
> >>> > > > >
> >>> > > > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> >>> > > > >
> >>> > > > > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr>
> >>> wrote:
> >>> > > > > >
> >>> > > > > > > I like this: could we define it as the standard way to add
> >>> such
> >>> > > > > > > annotations in
> >>> > > > > > > whole Maven components? Any problem if we do it in Maven
> core
> >>> > > itself?
> >>> > > > > > >
> >>> > > > > > > I'm not a JSR-305 expert, any basic explanation on the
> >>> > > > > > > com.google.code.findbugs:jsr305 choice is good to know
> >>> > > > > > >
> >>> > > > > >
> >>> > > > > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> >>> > > > > >
> >>> > > > > > In general I like those annotations, though I tend to favour
> >>> the
> >>> > > > findbugs
> >>> > > > > > annotations and jcip annotations in code I write while
> awaiting
> >>> > > jsr305
> >>> > > > to
> >>> > > > > > finalize (given that the spec is dormant, feared dead:
> >>> > > > > > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot
> >>> of the
> >>> > > > spec
> >>> > > > > > may
> >>> > > > > > result in signature changes and as such, given that the
> >>> annotations
> >>> > > are
> >>> > > > > > runtime retention, when annotations finally land in the JVM
> >>> there
> >>> > may
> >>> > > > be
> >>> > > > > a
> >>> > > > > > risk from signature change...
> >>> > > > > >
> >>> > > > > > But that could be an irrational fear on my behalf...
> >>> > > > > >
> >>> > > > > > In any case I have clean room ASLv2 licensed versions of the
> >>> > findbugs
> >>> > > > and
> >>> > > > > > jcip annotations in my GitHub repo and published to central.
> >>> > > > > >
> >>> > > > > >
> >>> > > > > > > then we could add it to maven parent pom
> dependencyManagement
> >>> > > > section,
> >>> > > > > > and
> >>> > > > > > > write something into "Maven Developer Centre"
> >>> > > > > > >
> >>> > > > > > > Regards,
> >>> > > > > > >
> >>> > > > > > > Hervé
> >>> > > > > > >
> >>> > > > > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a
> écrit :
> >>> > > > > > > > Updated Branches:
> >>> > > > > > > >   refs/heads/master 231773324 -> 7b330f584
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > > > Added jsr305 annotations
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > > > Project:
> >>> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> >>> > > > > > > > Commit:
> >>> > > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree
> >>> :
> >>> > > > > > > >
> >>> > > > > >
> >>> > > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> >>> > > > > > > >
> >>> > > >
> >>> http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> >>> > > > > > > >
> >>> > > > > > > > Branch: refs/heads/master
> >>> > > > > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> >>> > > > > > > > Parents: 2317733
> >>> > > > > > > > Author: Kristian Rosenvold <kr...@apache.org>
> >>> > > > > > > > Authored: Tue May 7 18:49:15 2013 +0200
> >>> > > > > > > > Committer: Kristian Rosenvold <kr...@apache.org>
> >>> > > > > > > > Committed: Tue May 7 18:49:15 2013 +0200
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > >
> >>> >
> ----------------------------------------------------------------------
> >>> > > > > > > >  maven-surefire-common/pom.xml                      |
>  4
> >>> ++++
> >>> > > > > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |
>  7
> >>> > > +++++--
> >>> > > > > > > >  .../maven/plugin/surefire/ClasspathCache.java      |
>  6
> >>> > ++++--
> >>> > > > > > > >  .../maven/plugin/surefire/CommonReflector.java     |
>  8
> >>> > > +++++---
> >>> > > > > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |
>  3
> >>> +++
> >>> > > > > > > >  .../surefire/booterclient/ForkConfiguration.java   |
>  4
> >>> ++--
> >>> > > > > > > >  .../plugin/surefire/util/DependencyScanner.java    |
>  4
> >>> +++-
> >>> > > > > > > >  .../maven/plugin/surefire/util/Relocator.java      |
> 12
> >>> > > > > ++++++++----
> >>> > > > > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |
> 10
> >>> > > > ++++++----
> >>> > > > > > > >  pom.xml                                            |
>  6
> >>> > ++++++
> >>> > > > > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> >>> > > > > > > >
> >>> > > > >
> >>> >
> ----------------------------------------------------------------------
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > > refire-common/pom.xml
> >>> > > > > > > >
> >>> > > > >
> >>> >
> ----------------------------------------------------------------------
> >>> > > > > > > diff
> >>> > > > > > > > --git a/maven-surefire-common/pom.xml
> >>> > > > b/maven-surefire-common/pom.xml
> >>> > > > > > > index
> >>> > > > > > > > 1330eec..bed467b 100644
> >>> > > > > > > > --- a/maven-surefire-common/pom.xml
> >>> > > > > > > > +++ b/maven-surefire-common/pom.xml
> >>> > > > > > > > @@ -91,6 +91,10 @@
> >>> > > > > > > >        <artifactId>commons-lang3</artifactId>
> >>> > > > > > > >      </dependency>
> >>> > > > > > > >      <dependency>
> >>> > > > > > > > +      <groupId>com.google.code.findbugs</groupId>
> >>> > > > > > > > +      <artifactId>jsr305</artifactId>
> >>> > > > > > > > +    </dependency>
> >>> > > > > > > > +    <dependency>
> >>> > > > > > > >        <groupId>org.apache.maven.shared</groupId>
> >>> > > > > > > >
> >>>  <artifactId>maven-common-artifact-filters</artifactId>
> >>> > > > > > > >        <version>1.3</version>
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> >>> > > > > > > > eMojo.java
> >>> > > > > > > >
> >>> > > > >
> >>> >
> ----------------------------------------------------------------------
> >>> > > > > > > diff
> >>> > > > > > > > --git
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> >>> > > > > > > > ractSurefireMojo.java
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> >>> > > > > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> >>> > > > > > > > ---
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> >>> > > > > > > > ractSurefireMojo.java +++
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> >>> > > > > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> >>> > > > > > > > org.apache.maven.surefire.util.RunOrder;
> >>> > > > > > > >  import org.apache.maven.toolchain.Toolchain;
> >>> > > > > > > >  import org.apache.maven.toolchain.ToolchainManager;
> >>> > > > > > > >
> >>> > > > > > > > +import javax.annotation.Nonnull;
> >>> > > > > > > > +
> >>> > > > > > > >  /**
> >>> > > > > > > >   * Abstract base class for running tests using Surefire.
> >>> > > > > > > >   *
> >>> > > > > > > > @@ -1266,7 +1268,7 @@ public abstract class
> >>> > AbstractSurefireMojo
> >>> > > > > > > >          }
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > > -    private List<String> getExcludeList()
> >>> > > > > > > > +    private @Nonnull List<String> getExcludeList()
> >>> > > > > > > >      {
> >>> > > > > > > >          List<String> excludes = null;
> >>> > > > > > > >          if ( isSpecificTestSpecified() )
> >>> > > > > > > > @@ -1339,7 +1341,7 @@ public abstract class
> >>> > AbstractSurefireMojo
> >>> > > > > > > >          return filterNulls( includes );
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > > -    private List<String> filterNulls( List<String>
> >>> toFilter )
> >>> > > > > > > > +    private @Nonnull List<String> filterNulls( @Nonnull
> >>> > > > List<String>
> >>> > > > > > > > toFilter ) {
> >>> > > > > > > >          List<String> result = new ArrayList<String>(
> >>> > > > toFilter.size()
> >>> > > > > > );
> >>> > > > > > > >          for ( String item : toFilter )
> >>> > > > > > > > @@ -2130,6 +2132,7 @@ public abstract class
> >>> > AbstractSurefireMojo
> >>> > > > > > > >              return new DynamicProviderInfo( providerName
> >>> );
> >>> > > > > > > >          }
> >>> > > > > > > >
> >>> > > > > > > > +        @Nonnull
> >>> > > > > > > >          public String getProviderName()
> >>> > > > > > > >          {
> >>> > > > > > > >              return providerName;
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> >>> > > > > > > > java
> >>> > > > > > >
> >>> > > >
> >>> ----------------------------------------------------------------------
> >>> > > > > > > > diff --git
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> >>> > > > > > > > spathCache.java
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> >>> > > > > > > > spathCache.java index 1bcb065..ea250c2 100644
> >>> > > > > > > > ---
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> >>> > > > > > > > spathCache.java +++
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> >>> > > > > > > > spathCache.java @@ -21,6 +21,8 @@ package
> >>> > > > > > > org.apache.maven.plugin.surefire;
> >>> > > > > > > >  import java.util.concurrent.ConcurrentHashMap;
> >>> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> >>> > > > > > > >
> >>> > > > > > > > +import javax.annotation.Nonnull;
> >>> > > > > > > > +
> >>> > > > > > > >  /**
> >>> > > > > > > >   * @author Kristian Rosenvold
> >>> > > > > > > >   */
> >>> > > > > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> >>> > > > > > > >      private static final ConcurrentHashMap<String,
> >>> Classpath>
> >>> > > > > > > classpaths =
> >>> > > > > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> >>> > > > > > > >
> >>> > > > > > > > -    public static Classpath getCachedClassPath( String
> >>> > > artifactId
> >>> > > > )
> >>> > > > > > > > +    public static Classpath getCachedClassPath( @Nonnull
> >>> > String
> >>> > > > > > > artifactId
> >>> > > > > > > > ) {
> >>> > > > > > > >          return classpaths.get( artifactId );
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > > -    public static void setCachedClasspath( String key,
> >>> > Classpath
> >>> > > > > > > classpath
> >>> > > > > > > > ) +    public static void setCachedClasspath( @Nonnull
> >>> String
> >>> > > key,
> >>> > > > > > > @Nonnull
> >>> > > > > > > > Classpath classpath ) {
> >>> > > > > > > >          classpaths.put( key, classpath );
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> >>> > > > > > > > .java
> >>> > > > > > >
> >>> > > >
> >>> ----------------------------------------------------------------------
> >>> > > > > > > > diff --git
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> >>> > > > > > > > onReflector.java
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> >>> > > > > > > > onReflector.java index 538b7e0..6851539 100644
> >>> > > > > > > > ---
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> >>> > > > > > > > onReflector.java +++
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> >>> > > > > > > > onReflector.java @@ -25,6 +25,8 @@ import
> >>> > > > > > > >
> >>> org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
> >>> > > > > import
> >>> > > > > > > > org.apache.maven.surefire.util.ReflectionUtils;
> >>> > > > > > > >  import
> >>> > > org.apache.maven.surefire.util.SurefireReflectionException;
> >>> > > > > > > >
> >>> > > > > > > > +import javax.annotation.Nonnull;
> >>> > > > > > > > +
> >>> > > > > > > >  /**
> >>> > > > > > > >   * @author Kristian Rosenvold
> >>> > > > > > > >   */
> >>> > > > > > > > @@ -34,7 +36,7 @@ public class CommonReflector
> >>> > > > > > > >
> >>> > > > > > > >      private final ClassLoader surefireClassLoader;
> >>> > > > > > > >
> >>> > > > > > > > -    public CommonReflector( ClassLoader
> >>> surefireClassLoader )
> >>> > > > > > > > +    public CommonReflector( @Nonnull ClassLoader
> >>> > > > > surefireClassLoader )
> >>> > > > > > > >      {
> >>> > > > > > > >          this.surefireClassLoader = surefireClassLoader;
> >>> > > > > > > >
> >>> > > > > > > > @@ -48,7 +50,7 @@ public class CommonReflector
> >>> > > > > > > >          }
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > > -    public Object createReportingReporterFactory(
> >>> > > > > > > > StartupReportConfiguration startupReportConfiguration ) +
> >>> > >  public
> >>> > > > > > > Object
> >>> > > > > > > > createReportingReporterFactory( @Nonnull
> >>> > > StartupReportConfiguration
> >>> > > > > > > > startupReportConfiguration ) {
> >>> > > > > > > >          Class<?>[] args = new Class[]{
> >>> > > > > this.startupReportConfiguration
> >>> > > > > > > };
> >>> > > > > > > >          Object src = createStartupReportConfiguration(
> >>> > > > > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public
> >>> class
> >>> > > > > > > > CommonReflector
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > > > -    Object createStartupReportConfiguration(
> >>> > > > > > StartupReportConfiguration
> >>> > > > > > > > reporterConfiguration ) +    Object
> >>> > > > createStartupReportConfiguration(
> >>> > > > > > > > @Nonnull StartupReportConfiguration reporterConfiguration
> >>> ) {
> >>> > > > > > > >          Constructor<?> constructor =
> >>> > > > ReflectionUtils.getConstructor(
> >>> > > > > > > > this.startupReportConfiguration, new Class[]{
> >>> boolean.class,
> >>> > > > > > > boolean.class,
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> >>> > > > > > > > va
> >>> > > > > >
> >>> > >
> >>> ----------------------------------------------------------------------
> >>> > > > > > > > diff --git
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> >>> > > > > > > > iderInfo.java
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> >>> > > > > > > > iderInfo.java index 57069d8..50de7ea 100644
> >>> > > > > > > > ---
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> >>> > > > > > > > iderInfo.java +++
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> >>> > > > > > > > iderInfo.java @@ -24,11 +24,14 @@ import
> >>> > > > > > > >
> >>> org.apache.maven.artifact.resolver.ArtifactResolutionException;
> >>> > > > > import
> >>> > > > > > > > org.apache.maven.plugin.MojoExecutionException;
> >>> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> >>> > > > > > > >
> >>> > > > > > > > +import javax.annotation.Nonnull;
> >>> > > > > > > > +
> >>> > > > > > > >  /**
> >>> > > > > > > >   * @author Kristian Rosenvold
> >>> > > > > > > >   */
> >>> > > > > > > >  public interface ProviderInfo
> >>> > > > > > > >  {
> >>> > > > > > > > +    @Nonnull
> >>> > > > > > > >      String getProviderName();
> >>> > > > > > > >
> >>> > > > > > > >      boolean isApplicable();
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> >>> > > > > > > > rkConfiguration.java
> >>> > > > > > > >
> >>> > > > >
> >>> >
> ----------------------------------------------------------------------
> >>> > > > > > > diff
> >>> > > > > > > > --git
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> >>> > > > > > > > erclient/ForkConfiguration.java
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> >>> > > > > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27
> >>> 100644
> >>> > > > > > > > ---
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> >>> > > > > > > > erclient/ForkConfiguration.java +++
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> >>> > > > > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@
> public
> >>> > class
> >>> > > > > > > > ForkConfiguration
> >>> > > > > > > >
> >>> > > > > > > >      /**
> >>> > > > > > > >       * @param classPath            cla the classpath
> >>> arguments
> >>> > > > > > > > -     * @param startupConfiguration
> >>> > > > > > > > +     * @param startupConfiguration The startup
> >>> configuration
> >>> > > > > > > >       * @param threadNumber         the thread number, to
> >>> be
> >>> > the
> >>> > > > > > > replacement
> >>> > > > > > > > in the argLine   @return A commandline * @throws
> >>> > > > > > > >
> >>> org.apache.maven.surefire.booter.SurefireBooterForkException *
> >>> > > > > > > > when unable to perform the fork
> >>> > > > > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> >>> > > > > > > >       * for all classpath elements.
> >>> > > > > > > >       *
> >>> > > > > > > >       * @param classPath      List&lt;String> of all
> >>> classpath
> >>> > > > > > elements.
> >>> > > > > > > > -     * @param startClassName
> >>> > > > > > > > +     * @param startClassName  The classname to start
> >>> > > (main-class)
> >>> > > > > > > >       * @return The file pointint to the jar
> >>> > > > > > > >       * @throws java.io.IOException When a file operation
> >>> > fails.
> >>> > > > > > > >       */
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> >>> > > > > > > > Scanner.java
> >>> > > > > > > >
> >>> > > > >
> >>> >
> ----------------------------------------------------------------------
> >>> > > > > > > diff
> >>> > > > > > > > --git
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /DependencyScanner.java
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> >>> > > > > > > > ---
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /DependencyScanner.java +++
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> >>> > > > > > > > org.apache.maven.plugin.MojoExecutionException; import
> >>> > > > > > > > org.apache.maven.shared.utils.io.MatchPatterns;
> >>> > > > > > > >  import org.apache.maven.surefire.util.DefaultScanResult;
> >>> > > > > > > >
> >>> > > > > > > > +import javax.annotation.Nullable;
> >>> > > > > > > > +
> >>> > > > > > > >  /**
> >>> > > > > > > >   * Scans dependencies looking for tests.
> >>> > > > > > > >   *
> >>> > > > > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> >>> > > > > > > >
> >>> > > > > > > >               private SpecificFileFilter
> >>> specificTestFilter;
> >>> > > > > > > >
> >>> > > > > > > > -             public Matcher(List<String> includes,
> >>> > List<String>
> >>> > > > > > > excludes,
> >>> > > > > > > List<String>
> >>> > > > > > > > specificTests) +              public Matcher(@Nullable
> >>> > > List<String>
> >>> > > > > > > includes,
> >>> > > > > > > @Nullable
> >>> > > > > > > > List<String> excludes, @Nullable List<String>
> >>> specificTests) {
> >>> > > > > > > >                       String[] specific = specificTests
> ==
> >>> > null ?
> >>> > > > new
> >>> > > > > > > String[0] :
> >>> > > > > > > > processIncludesExcludes( specificTests );
> >>> specificTestFilter =
> >>> > > new
> >>> > > > > > > > SpecificFileFilter( specific );
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> >>> > > > > > > > java
> >>> > > > > > >
> >>> > > >
> >>> ----------------------------------------------------------------------
> >>> > > > > > > > diff --git
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /Relocator.java
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /Relocator.java index 31dde5d..76da9de 100644
> >>> > > > > > > > ---
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /Relocator.java +++
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /Relocator.java @@ -19,6 +19,10 @@ package
> >>> > > > > > > > org.apache.maven.plugin.surefire.util;
> >>> > > > > > > >   * under the License.
> >>> > > > > > > >   */
> >>> > > > > > > >
> >>> > > > > > > > +import com.sun.istack.internal.NotNull;
> >>> > > > > > > > +
> >>> > > > > > > > +import javax.annotation.Nullable;
> >>> > > > > > > > +
> >>> > > > > > > >  /**
> >>> > > > > > > >   * Relocates class names when running with relocated
> >>> provider
> >>> > > > > > > >   *
> >>> > > > > > > > @@ -26,12 +30,12 @@ package
> >>> > > org.apache.maven.plugin.surefire.util;
> >>> > > > > > > >   */
> >>> > > > > > > >  public class Relocator
> >>> > > > > > > >  {
> >>> > > > > > > > -    private final String relocation;
> >>> > > > > > > > +    private final @Nullable String relocation;
> >>> > > > > > > >
> >>> > > > > > > >      private static final String relocationBase =
> >>> > > > > > > > "org.apache.maven.surefire.";
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > > > -    public Relocator( String relocation )
> >>> > > > > > > > +    public Relocator( @Nullable String relocation )
> >>> > > > > > > >      {
> >>> > > > > > > >          this.relocation = relocation;
> >>> > > > > > > >      }
> >>> > > > > > > > @@ -41,12 +45,12 @@ public class Relocator
> >>> > > > > > > >          relocation = "shadefire";
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > > -    private String getRelocation()
> >>> > > > > > > > +    private @Nullable String getRelocation()
> >>> > > > > > > >      {
> >>> > > > > > > >          return relocation;
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > > -    public String relocate( String className )
> >>> > > > > > > > +    public @NotNull String relocate( @NotNull String
> >>> > className )
> >>> > > > > > > >      {
> >>> > > > > > > >          if ( relocation == null )
> >>> > > > > > > >          {
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> >>> > > > > > > > l.java
> >>> > > > > > > >
> >>> > > > >
> >>> >
> ----------------------------------------------------------------------
> >>> > > > > > > diff
> >>> > > > > > > > --git
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /ScannerUtil.java
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /ScannerUtil.java index 3498e63..8b80301 100644
> >>> > > > > > > > ---
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /ScannerUtil.java +++
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> >>> > > > > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import
> java.util.List;
> >>> > > > > > > >
> >>> > > > > > > >  import org.apache.commons.lang3.StringUtils;
> >>> > > > > > > >
> >>> > > > > > > > +import javax.annotation.Nonnull;
> >>> > > > > > > > +
> >>> > > > > > > >  final class ScannerUtil {
> >>> > > > > > > >
> >>> > > > > > > >       private ScannerUtil() {}
> >>> > > > > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> >>> > > > > > > >
> >>> > > > > > > >      private static final String
> JAVA_CLASS_FILE_EXTENSION
> >>> =
> >>> > > > > ".class";
> >>> > > > > > > >
> >>> > > > > > > > -    public static String convertToJavaClassName( String
> >>> test )
> >>> > > > > > > > +    public static @Nonnull String
> convertToJavaClassName(
> >>> > > @Nonnull
> >>> > > > > > > String
> >>> > > > > > > > test ) {
> >>> > > > > > > >          return StringUtils.removeEnd( test, ".class"
> >>> > ).replace(
> >>> > > > FS,
> >>> > > > > > "."
> >>> > > > > > > );
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > > -    public static String
> >>> > convertJarFileResourceToJavaClassName(
> >>> > > > > String
> >>> > > > > > > test
> >>> > > > > > > > ) +    public static @Nonnull String
> >>> > > > > > > convertJarFileResourceToJavaClassName(
> >>> > > > > > > > @Nonnull String test ) {
> >>> > > > > > > >          return StringUtils.removeEnd( test, ".class"
> >>> > ).replace(
> >>> > > > "/",
> >>> > > > > > > "." );
> >>> > > > > > > > }
> >>> > > > > > > >
> >>> > > > > > > > -    public static String stripBaseDir( String basedir,
> >>> String
> >>> > > > test )
> >>> > > > > > > > +    public static @Nonnull String stripBaseDir( String
> >>> > basedir,
> >>> > > > > String
> >>> > > > > > > test
> >>> > > > > > > > ) {
> >>> > > > > > > >          return StringUtils.removeStart( test, basedir );
> >>> > > > > > > >      }
> >>> > > > > > > >
> >>> > > > > > > > -    public static String[] processIncludesExcludes(
> >>> > List<String>
> >>> > > > > list
> >>> > > > > > )
> >>> > > > > > > > +    public static @Nonnull String[]
> >>> processIncludesExcludes(
> >>> > > > > @Nonnull
> >>> > > > > > > > List<String> list ) {
> >>> > > > > > > >          List<String> newList = new ArrayList<String>();
> >>> > > > > > > >          for ( Object aList : list )
> >>> > > > > > > >
> >>> > > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> >>> > > > > > > >
> >>> > > > >
> >>> >
> ----------------------------------------------------------------------
> >>> > > > > > > > diff --git a/pom.xml b/pom.xml
> >>> > > > > > > > index 677b367..c60f378 100644
> >>> > > > > > > > --- a/pom.xml
> >>> > > > > > > > +++ b/pom.xml
> >>> > > > > > > > @@ -265,6 +265,12 @@
> >>> > > > > > > >          <version>3.8.1</version>
> >>> > > > > > > >          <scope>test</scope>
> >>> > > > > > > >        </dependency>
> >>> > > > > > > > +      <dependency>
> >>> > > > > > > > +        <groupId>com.google.code.findbugs</groupId>
> >>> > > > > > > > +        <artifactId>jsr305</artifactId>
> >>> > > > > > > > +        <version>2.0.1</version>
> >>> > > > > > > > +        <scope>provided</scope>
> >>> > > > > > > > +      </dependency>
> >>> > > > > > > >      </dependencies>
> >>> > > > > > > >    </dependencyManagement>
> >>> > > > > > > >    <dependencies>
> >>> > > > > > >
> >>> > > > > > >
> >>> > >
> ---------------------------------------------------------------------
> >>> > > > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>> > > > > > > For additional commands, e-mail: dev-help@maven.apache.org
> >>> > > > > > >
> >>> > > > > > >
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> >>
> >>
> >
>

Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
Hmmm though using the when parameter may be an issue: e.g.
@Nonnull(when=MAYBE)


On 8 May 2013 11:23, Stephen Connolly <st...@gmail.com>wrote:

> Hmmm I may have lost the plot somewhat, as the findbugs annotations are
> @TypeQualifierNickname's for @Nonnull anyway...
>
> I guess my point is that we need to decide *and document* exactly which
> annotations are we using. My view is the Nonnull and Nullable are good...
> ones with parameters are less good.
>
>
> On 8 May 2013 11:16, Stephen Connolly <st...@gmail.com>wrote:
>
>> If you do
>>
>>     <dependency>
>>       <groupId>com.google.code.findbugs</groupId>
>>       <artifactId>jsr305</artifactId>
>>       <version>2.0.1</version>
>>       <scope>provided</scope>
>>     </dependency>
>>
>> In one of Maven's APIs thinking that RetentionPolicy.RUNTIME or
>> RetentionPolicy.COMPILE will save you as the JVM spec says missing
>> annotations are to be ignored... you will be burned when compiling
>> implementations of the API unless you add the dependency to *your*
>> implementation.
>>
>> At least some versions (I suspect all but have not confirmed) of JavaC
>> needs all the annotations with COMPILE or higher retention available so
>> that, at the very least, it knows whether to retain the annotation or
>> not... as it may affect the method signature for @Override annotated
>> methods or something like that... never really be happy about the issue.
>>
>> This has bit me when I have an API with @Nonnull annotations and then try
>> to implement the API class.
>>
>> So in such cases using the javax.annotations carries a risk as once/if
>> JSR-305 gets accepted, the accepted version of the annotations will be part
>> of the core classloader and the dependency provided version will loose
>> out...
>>
>> Not likely a big risk for @Nonnull or @Nullable... but e.g
>> @MatchesPattern(value="^\d\d\d-\d\d$",flags=0) might cause issues if in the
>> reboot the "flags" parameter gets refactored to regexFlags. It is unclear
>> to me what the JVM spec says in the case where the annotation class is
>> present but has had a signature change from what was used when the
>> annotated source was compiled.
>>
>> With annotations that are not in the "special" package namespaces we can
>> at least put our dependency first... but maybe I am just overly paranoid
>>
>>
>> On 8 May 2013 11:01, Kristian Rosenvold <kr...@gmail.com>wrote:
>>
>>> Linking to one of your private git repos made this only marginally
>>> clearer;
>>> I see the edu.umd in there though !
>>>
>>>
>>>
>>> > So setting the dependency as "provided" is all well and good until you
>>> need
>>> > to implement an interface with the annotation applied... at which
>>> point you
>>> > need to add back in the "provided" dependency...
>>> >
>>> > But it's still only compile-time, right ? Why would that be a problem ?
>>>
>>>
>>> Having the annotation available at RUNTIME does allow for additional
>>> > validations, so that would favour JSR-305, but given that you need the
>>> > dependency transitive for compilation there is scope for issues if
>>> JSR-305
>>> > ever gets rebooted.
>>> >
>>>
>>> Give me this with a tiny spoon please; when would this be a problem ?
>>>
>>>
>>>
>>>
>>>
>>> > On 8 May 2013 09:53, Kristian Rosenvold <kristian.rosenvold@gmail.com
>>> > >wrote:
>>> >
>>> > > You mean there's an older set of findbugs annoations ?
>>> > >
>>> > > Kristian
>>> > >
>>> > >
>>> > > 2013/5/8 Stephen Connolly <st...@gmail.com>
>>> > >
>>> > > > IntelliJ also supports the findbugs and jcip annotations too...
>>> but in
>>> > > any
>>> > > > case I will hold my piece... given that these annotations do not
>>> have
>>> > > > parameters the risk is almost non-existant for *these* but I do
>>> think
>>> > it
>>> > > is
>>> > > > a more general risk
>>> > > >
>>> > > >
>>> > > > On 8 May 2013 09:06, Kristian Rosenvold <
>>> kristian.rosenvold@gmail.com
>>> > > > >wrote:
>>> > > >
>>> > > > > I suspect like a lot of the rest of the community, they simply
>>> gave
>>> > up
>>> > > on
>>> > > > > the jcp.
>>> > > > >
>>> > > > > I am no insider on the project but
>>> com.google.code.findbugs/jsr-305
>>> > was
>>> > > > > last published in a 2.0.1 version in july 2012, and
>>> > > > > seems to be alive and kicking. IntelliJ also supports the
>>> annotations
>>> > > > which
>>> > > > > means we finally have /one/ set of annotations
>>> > > > > that everybody understands.
>>> > > > >
>>> > > > > The value of both Nullable and Nonnull is just amazing once you
>>> get
>>> > it
>>> > > > all
>>> > > > > in place.
>>> > > > >
>>> > > > > As for potential classloading issues, I'm sure /someone/ here
>>> would
>>> > > know
>>> > > > :)
>>> > > > >
>>> > > > > Kristian
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > > 2013/5/8 Stephen Connolly <st...@gmail.com>
>>> > > > >
>>> > > > > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr>
>>> wrote:
>>> > > > > >
>>> > > > > > > I like this: could we define it as the standard way to add
>>> such
>>> > > > > > > annotations in
>>> > > > > > > whole Maven components? Any problem if we do it in Maven core
>>> > > itself?
>>> > > > > > >
>>> > > > > > > I'm not a JSR-305 expert, any basic explanation on the
>>> > > > > > > com.google.code.findbugs:jsr305 choice is good to know
>>> > > > > > >
>>> > > > > >
>>> > > > > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
>>> > > > > >
>>> > > > > > In general I like those annotations, though I tend to favour
>>> the
>>> > > > findbugs
>>> > > > > > annotations and jcip annotations in code I write while awaiting
>>> > > jsr305
>>> > > > to
>>> > > > > > finalize (given that the spec is dormant, feared dead:
>>> > > > > > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot
>>> of the
>>> > > > spec
>>> > > > > > may
>>> > > > > > result in signature changes and as such, given that the
>>> annotations
>>> > > are
>>> > > > > > runtime retention, when annotations finally land in the JVM
>>> there
>>> > may
>>> > > > be
>>> > > > > a
>>> > > > > > risk from signature change...
>>> > > > > >
>>> > > > > > But that could be an irrational fear on my behalf...
>>> > > > > >
>>> > > > > > In any case I have clean room ASLv2 licensed versions of the
>>> > findbugs
>>> > > > and
>>> > > > > > jcip annotations in my GitHub repo and published to central.
>>> > > > > >
>>> > > > > >
>>> > > > > > > then we could add it to maven parent pom dependencyManagement
>>> > > > section,
>>> > > > > > and
>>> > > > > > > write something into "Maven Developer Centre"
>>> > > > > > >
>>> > > > > > > Regards,
>>> > > > > > >
>>> > > > > > > Hervé
>>> > > > > > >
>>> > > > > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
>>> > > > > > > > Updated Branches:
>>> > > > > > > >   refs/heads/master 231773324 -> 7b330f584
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > > > Added jsr305 annotations
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > > > Project:
>>> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
>>> > > > > > > > Commit:
>>> > > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree
>>> :
>>> > > > > > > >
>>> > > > > >
>>> > > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
>>> > > > > > > >
>>> > > >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
>>> > > > > > > >
>>> > > > > > > > Branch: refs/heads/master
>>> > > > > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
>>> > > > > > > > Parents: 2317733
>>> > > > > > > > Author: Kristian Rosenvold <kr...@apache.org>
>>> > > > > > > > Authored: Tue May 7 18:49:15 2013 +0200
>>> > > > > > > > Committer: Kristian Rosenvold <kr...@apache.org>
>>> > > > > > > > Committed: Tue May 7 18:49:15 2013 +0200
>>> > > > > > > >
>>> > > > > > > >
>>> > > > >
>>> > ----------------------------------------------------------------------
>>> > > > > > > >  maven-surefire-common/pom.xml                      |    4
>>> ++++
>>> > > > > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7
>>> > > +++++--
>>> > > > > > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6
>>> > ++++--
>>> > > > > > > >  .../maven/plugin/surefire/CommonReflector.java     |    8
>>> > > +++++---
>>> > > > > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3
>>> +++
>>> > > > > > > >  .../surefire/booterclient/ForkConfiguration.java   |    4
>>> ++--
>>> > > > > > > >  .../plugin/surefire/util/DependencyScanner.java    |    4
>>> +++-
>>> > > > > > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
>>> > > > > ++++++++----
>>> > > > > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10
>>> > > > ++++++----
>>> > > > > > > >  pom.xml                                            |    6
>>> > ++++++
>>> > > > > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
>>> > > > > > > >
>>> > > > >
>>> > ----------------------------------------------------------------------
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > > refire-common/pom.xml
>>> > > > > > > >
>>> > > > >
>>> > ----------------------------------------------------------------------
>>> > > > > > > diff
>>> > > > > > > > --git a/maven-surefire-common/pom.xml
>>> > > > b/maven-surefire-common/pom.xml
>>> > > > > > > index
>>> > > > > > > > 1330eec..bed467b 100644
>>> > > > > > > > --- a/maven-surefire-common/pom.xml
>>> > > > > > > > +++ b/maven-surefire-common/pom.xml
>>> > > > > > > > @@ -91,6 +91,10 @@
>>> > > > > > > >        <artifactId>commons-lang3</artifactId>
>>> > > > > > > >      </dependency>
>>> > > > > > > >      <dependency>
>>> > > > > > > > +      <groupId>com.google.code.findbugs</groupId>
>>> > > > > > > > +      <artifactId>jsr305</artifactId>
>>> > > > > > > > +    </dependency>
>>> > > > > > > > +    <dependency>
>>> > > > > > > >        <groupId>org.apache.maven.shared</groupId>
>>> > > > > > > >
>>>  <artifactId>maven-common-artifact-filters</artifactId>
>>> > > > > > > >        <version>1.3</version>
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
>>> > > > > > > > eMojo.java
>>> > > > > > > >
>>> > > > >
>>> > ----------------------------------------------------------------------
>>> > > > > > > diff
>>> > > > > > > > --git
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
>>> > > > > > > > ractSurefireMojo.java
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
>>> > > > > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
>>> > > > > > > > ---
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
>>> > > > > > > > ractSurefireMojo.java +++
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
>>> > > > > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
>>> > > > > > > > org.apache.maven.surefire.util.RunOrder;
>>> > > > > > > >  import org.apache.maven.toolchain.Toolchain;
>>> > > > > > > >  import org.apache.maven.toolchain.ToolchainManager;
>>> > > > > > > >
>>> > > > > > > > +import javax.annotation.Nonnull;
>>> > > > > > > > +
>>> > > > > > > >  /**
>>> > > > > > > >   * Abstract base class for running tests using Surefire.
>>> > > > > > > >   *
>>> > > > > > > > @@ -1266,7 +1268,7 @@ public abstract class
>>> > AbstractSurefireMojo
>>> > > > > > > >          }
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > > -    private List<String> getExcludeList()
>>> > > > > > > > +    private @Nonnull List<String> getExcludeList()
>>> > > > > > > >      {
>>> > > > > > > >          List<String> excludes = null;
>>> > > > > > > >          if ( isSpecificTestSpecified() )
>>> > > > > > > > @@ -1339,7 +1341,7 @@ public abstract class
>>> > AbstractSurefireMojo
>>> > > > > > > >          return filterNulls( includes );
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > > -    private List<String> filterNulls( List<String>
>>> toFilter )
>>> > > > > > > > +    private @Nonnull List<String> filterNulls( @Nonnull
>>> > > > List<String>
>>> > > > > > > > toFilter ) {
>>> > > > > > > >          List<String> result = new ArrayList<String>(
>>> > > > toFilter.size()
>>> > > > > > );
>>> > > > > > > >          for ( String item : toFilter )
>>> > > > > > > > @@ -2130,6 +2132,7 @@ public abstract class
>>> > AbstractSurefireMojo
>>> > > > > > > >              return new DynamicProviderInfo( providerName
>>> );
>>> > > > > > > >          }
>>> > > > > > > >
>>> > > > > > > > +        @Nonnull
>>> > > > > > > >          public String getProviderName()
>>> > > > > > > >          {
>>> > > > > > > >              return providerName;
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
>>> > > > > > > > java
>>> > > > > > >
>>> > > >
>>> ----------------------------------------------------------------------
>>> > > > > > > > diff --git
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
>>> > > > > > > > spathCache.java
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
>>> > > > > > > > spathCache.java index 1bcb065..ea250c2 100644
>>> > > > > > > > ---
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
>>> > > > > > > > spathCache.java +++
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
>>> > > > > > > > spathCache.java @@ -21,6 +21,8 @@ package
>>> > > > > > > org.apache.maven.plugin.surefire;
>>> > > > > > > >  import java.util.concurrent.ConcurrentHashMap;
>>> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
>>> > > > > > > >
>>> > > > > > > > +import javax.annotation.Nonnull;
>>> > > > > > > > +
>>> > > > > > > >  /**
>>> > > > > > > >   * @author Kristian Rosenvold
>>> > > > > > > >   */
>>> > > > > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
>>> > > > > > > >      private static final ConcurrentHashMap<String,
>>> Classpath>
>>> > > > > > > classpaths =
>>> > > > > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
>>> > > > > > > >
>>> > > > > > > > -    public static Classpath getCachedClassPath( String
>>> > > artifactId
>>> > > > )
>>> > > > > > > > +    public static Classpath getCachedClassPath( @Nonnull
>>> > String
>>> > > > > > > artifactId
>>> > > > > > > > ) {
>>> > > > > > > >          return classpaths.get( artifactId );
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > > -    public static void setCachedClasspath( String key,
>>> > Classpath
>>> > > > > > > classpath
>>> > > > > > > > ) +    public static void setCachedClasspath( @Nonnull
>>> String
>>> > > key,
>>> > > > > > > @Nonnull
>>> > > > > > > > Classpath classpath ) {
>>> > > > > > > >          classpaths.put( key, classpath );
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
>>> > > > > > > > .java
>>> > > > > > >
>>> > > >
>>> ----------------------------------------------------------------------
>>> > > > > > > > diff --git
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
>>> > > > > > > > onReflector.java
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
>>> > > > > > > > onReflector.java index 538b7e0..6851539 100644
>>> > > > > > > > ---
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
>>> > > > > > > > onReflector.java +++
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
>>> > > > > > > > onReflector.java @@ -25,6 +25,8 @@ import
>>> > > > > > > >
>>> org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
>>> > > > > import
>>> > > > > > > > org.apache.maven.surefire.util.ReflectionUtils;
>>> > > > > > > >  import
>>> > > org.apache.maven.surefire.util.SurefireReflectionException;
>>> > > > > > > >
>>> > > > > > > > +import javax.annotation.Nonnull;
>>> > > > > > > > +
>>> > > > > > > >  /**
>>> > > > > > > >   * @author Kristian Rosenvold
>>> > > > > > > >   */
>>> > > > > > > > @@ -34,7 +36,7 @@ public class CommonReflector
>>> > > > > > > >
>>> > > > > > > >      private final ClassLoader surefireClassLoader;
>>> > > > > > > >
>>> > > > > > > > -    public CommonReflector( ClassLoader
>>> surefireClassLoader )
>>> > > > > > > > +    public CommonReflector( @Nonnull ClassLoader
>>> > > > > surefireClassLoader )
>>> > > > > > > >      {
>>> > > > > > > >          this.surefireClassLoader = surefireClassLoader;
>>> > > > > > > >
>>> > > > > > > > @@ -48,7 +50,7 @@ public class CommonReflector
>>> > > > > > > >          }
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > > -    public Object createReportingReporterFactory(
>>> > > > > > > > StartupReportConfiguration startupReportConfiguration ) +
>>> > >  public
>>> > > > > > > Object
>>> > > > > > > > createReportingReporterFactory( @Nonnull
>>> > > StartupReportConfiguration
>>> > > > > > > > startupReportConfiguration ) {
>>> > > > > > > >          Class<?>[] args = new Class[]{
>>> > > > > this.startupReportConfiguration
>>> > > > > > > };
>>> > > > > > > >          Object src = createStartupReportConfiguration(
>>> > > > > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public
>>> class
>>> > > > > > > > CommonReflector
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > > > -    Object createStartupReportConfiguration(
>>> > > > > > StartupReportConfiguration
>>> > > > > > > > reporterConfiguration ) +    Object
>>> > > > createStartupReportConfiguration(
>>> > > > > > > > @Nonnull StartupReportConfiguration reporterConfiguration
>>> ) {
>>> > > > > > > >          Constructor<?> constructor =
>>> > > > ReflectionUtils.getConstructor(
>>> > > > > > > > this.startupReportConfiguration, new Class[]{
>>> boolean.class,
>>> > > > > > > boolean.class,
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
>>> > > > > > > > va
>>> > > > > >
>>> > >
>>> ----------------------------------------------------------------------
>>> > > > > > > > diff --git
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
>>> > > > > > > > iderInfo.java
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
>>> > > > > > > > iderInfo.java index 57069d8..50de7ea 100644
>>> > > > > > > > ---
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
>>> > > > > > > > iderInfo.java +++
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
>>> > > > > > > > iderInfo.java @@ -24,11 +24,14 @@ import
>>> > > > > > > >
>>> org.apache.maven.artifact.resolver.ArtifactResolutionException;
>>> > > > > import
>>> > > > > > > > org.apache.maven.plugin.MojoExecutionException;
>>> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
>>> > > > > > > >
>>> > > > > > > > +import javax.annotation.Nonnull;
>>> > > > > > > > +
>>> > > > > > > >  /**
>>> > > > > > > >   * @author Kristian Rosenvold
>>> > > > > > > >   */
>>> > > > > > > >  public interface ProviderInfo
>>> > > > > > > >  {
>>> > > > > > > > +    @Nonnull
>>> > > > > > > >      String getProviderName();
>>> > > > > > > >
>>> > > > > > > >      boolean isApplicable();
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
>>> > > > > > > > rkConfiguration.java
>>> > > > > > > >
>>> > > > >
>>> > ----------------------------------------------------------------------
>>> > > > > > > diff
>>> > > > > > > > --git
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
>>> > > > > > > > erclient/ForkConfiguration.java
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
>>> > > > > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27
>>> 100644
>>> > > > > > > > ---
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
>>> > > > > > > > erclient/ForkConfiguration.java +++
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
>>> > > > > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public
>>> > class
>>> > > > > > > > ForkConfiguration
>>> > > > > > > >
>>> > > > > > > >      /**
>>> > > > > > > >       * @param classPath            cla the classpath
>>> arguments
>>> > > > > > > > -     * @param startupConfiguration
>>> > > > > > > > +     * @param startupConfiguration The startup
>>> configuration
>>> > > > > > > >       * @param threadNumber         the thread number, to
>>> be
>>> > the
>>> > > > > > > replacement
>>> > > > > > > > in the argLine   @return A commandline * @throws
>>> > > > > > > >
>>> org.apache.maven.surefire.booter.SurefireBooterForkException *
>>> > > > > > > > when unable to perform the fork
>>> > > > > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
>>> > > > > > > >       * for all classpath elements.
>>> > > > > > > >       *
>>> > > > > > > >       * @param classPath      List&lt;String> of all
>>> classpath
>>> > > > > > elements.
>>> > > > > > > > -     * @param startClassName
>>> > > > > > > > +     * @param startClassName  The classname to start
>>> > > (main-class)
>>> > > > > > > >       * @return The file pointint to the jar
>>> > > > > > > >       * @throws java.io.IOException When a file operation
>>> > fails.
>>> > > > > > > >       */
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
>>> > > > > > > > Scanner.java
>>> > > > > > > >
>>> > > > >
>>> > ----------------------------------------------------------------------
>>> > > > > > > diff
>>> > > > > > > > --git
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /DependencyScanner.java
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
>>> > > > > > > > ---
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /DependencyScanner.java +++
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
>>> > > > > > > > org.apache.maven.plugin.MojoExecutionException; import
>>> > > > > > > > org.apache.maven.shared.utils.io.MatchPatterns;
>>> > > > > > > >  import org.apache.maven.surefire.util.DefaultScanResult;
>>> > > > > > > >
>>> > > > > > > > +import javax.annotation.Nullable;
>>> > > > > > > > +
>>> > > > > > > >  /**
>>> > > > > > > >   * Scans dependencies looking for tests.
>>> > > > > > > >   *
>>> > > > > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
>>> > > > > > > >
>>> > > > > > > >               private SpecificFileFilter
>>> specificTestFilter;
>>> > > > > > > >
>>> > > > > > > > -             public Matcher(List<String> includes,
>>> > List<String>
>>> > > > > > > excludes,
>>> > > > > > > List<String>
>>> > > > > > > > specificTests) +              public Matcher(@Nullable
>>> > > List<String>
>>> > > > > > > includes,
>>> > > > > > > @Nullable
>>> > > > > > > > List<String> excludes, @Nullable List<String>
>>> specificTests) {
>>> > > > > > > >                       String[] specific = specificTests ==
>>> > null ?
>>> > > > new
>>> > > > > > > String[0] :
>>> > > > > > > > processIncludesExcludes( specificTests );
>>> specificTestFilter =
>>> > > new
>>> > > > > > > > SpecificFileFilter( specific );
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
>>> > > > > > > > java
>>> > > > > > >
>>> > > >
>>> ----------------------------------------------------------------------
>>> > > > > > > > diff --git
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /Relocator.java
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /Relocator.java index 31dde5d..76da9de 100644
>>> > > > > > > > ---
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /Relocator.java +++
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /Relocator.java @@ -19,6 +19,10 @@ package
>>> > > > > > > > org.apache.maven.plugin.surefire.util;
>>> > > > > > > >   * under the License.
>>> > > > > > > >   */
>>> > > > > > > >
>>> > > > > > > > +import com.sun.istack.internal.NotNull;
>>> > > > > > > > +
>>> > > > > > > > +import javax.annotation.Nullable;
>>> > > > > > > > +
>>> > > > > > > >  /**
>>> > > > > > > >   * Relocates class names when running with relocated
>>> provider
>>> > > > > > > >   *
>>> > > > > > > > @@ -26,12 +30,12 @@ package
>>> > > org.apache.maven.plugin.surefire.util;
>>> > > > > > > >   */
>>> > > > > > > >  public class Relocator
>>> > > > > > > >  {
>>> > > > > > > > -    private final String relocation;
>>> > > > > > > > +    private final @Nullable String relocation;
>>> > > > > > > >
>>> > > > > > > >      private static final String relocationBase =
>>> > > > > > > > "org.apache.maven.surefire.";
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > > > -    public Relocator( String relocation )
>>> > > > > > > > +    public Relocator( @Nullable String relocation )
>>> > > > > > > >      {
>>> > > > > > > >          this.relocation = relocation;
>>> > > > > > > >      }
>>> > > > > > > > @@ -41,12 +45,12 @@ public class Relocator
>>> > > > > > > >          relocation = "shadefire";
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > > -    private String getRelocation()
>>> > > > > > > > +    private @Nullable String getRelocation()
>>> > > > > > > >      {
>>> > > > > > > >          return relocation;
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > > -    public String relocate( String className )
>>> > > > > > > > +    public @NotNull String relocate( @NotNull String
>>> > className )
>>> > > > > > > >      {
>>> > > > > > > >          if ( relocation == null )
>>> > > > > > > >          {
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
>>> > > > > > > > l.java
>>> > > > > > > >
>>> > > > >
>>> > ----------------------------------------------------------------------
>>> > > > > > > diff
>>> > > > > > > > --git
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /ScannerUtil.java
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /ScannerUtil.java index 3498e63..8b80301 100644
>>> > > > > > > > ---
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /ScannerUtil.java +++
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>>> > > > > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
>>> > > > > > > >
>>> > > > > > > >  import org.apache.commons.lang3.StringUtils;
>>> > > > > > > >
>>> > > > > > > > +import javax.annotation.Nonnull;
>>> > > > > > > > +
>>> > > > > > > >  final class ScannerUtil {
>>> > > > > > > >
>>> > > > > > > >       private ScannerUtil() {}
>>> > > > > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
>>> > > > > > > >
>>> > > > > > > >      private static final String JAVA_CLASS_FILE_EXTENSION
>>> =
>>> > > > > ".class";
>>> > > > > > > >
>>> > > > > > > > -    public static String convertToJavaClassName( String
>>> test )
>>> > > > > > > > +    public static @Nonnull String convertToJavaClassName(
>>> > > @Nonnull
>>> > > > > > > String
>>> > > > > > > > test ) {
>>> > > > > > > >          return StringUtils.removeEnd( test, ".class"
>>> > ).replace(
>>> > > > FS,
>>> > > > > > "."
>>> > > > > > > );
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > > -    public static String
>>> > convertJarFileResourceToJavaClassName(
>>> > > > > String
>>> > > > > > > test
>>> > > > > > > > ) +    public static @Nonnull String
>>> > > > > > > convertJarFileResourceToJavaClassName(
>>> > > > > > > > @Nonnull String test ) {
>>> > > > > > > >          return StringUtils.removeEnd( test, ".class"
>>> > ).replace(
>>> > > > "/",
>>> > > > > > > "." );
>>> > > > > > > > }
>>> > > > > > > >
>>> > > > > > > > -    public static String stripBaseDir( String basedir,
>>> String
>>> > > > test )
>>> > > > > > > > +    public static @Nonnull String stripBaseDir( String
>>> > basedir,
>>> > > > > String
>>> > > > > > > test
>>> > > > > > > > ) {
>>> > > > > > > >          return StringUtils.removeStart( test, basedir );
>>> > > > > > > >      }
>>> > > > > > > >
>>> > > > > > > > -    public static String[] processIncludesExcludes(
>>> > List<String>
>>> > > > > list
>>> > > > > > )
>>> > > > > > > > +    public static @Nonnull String[]
>>> processIncludesExcludes(
>>> > > > > @Nonnull
>>> > > > > > > > List<String> list ) {
>>> > > > > > > >          List<String> newList = new ArrayList<String>();
>>> > > > > > > >          for ( Object aList : list )
>>> > > > > > > >
>>> > > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
>>> > > > > > > >
>>> > > > >
>>> > ----------------------------------------------------------------------
>>> > > > > > > > diff --git a/pom.xml b/pom.xml
>>> > > > > > > > index 677b367..c60f378 100644
>>> > > > > > > > --- a/pom.xml
>>> > > > > > > > +++ b/pom.xml
>>> > > > > > > > @@ -265,6 +265,12 @@
>>> > > > > > > >          <version>3.8.1</version>
>>> > > > > > > >          <scope>test</scope>
>>> > > > > > > >        </dependency>
>>> > > > > > > > +      <dependency>
>>> > > > > > > > +        <groupId>com.google.code.findbugs</groupId>
>>> > > > > > > > +        <artifactId>jsr305</artifactId>
>>> > > > > > > > +        <version>2.0.1</version>
>>> > > > > > > > +        <scope>provided</scope>
>>> > > > > > > > +      </dependency>
>>> > > > > > > >      </dependencies>
>>> > > > > > > >    </dependencyManagement>
>>> > > > > > > >    <dependencies>
>>> > > > > > >
>>> > > > > > >
>>> > > ---------------------------------------------------------------------
>>> > > > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> > > > > > > For additional commands, e-mail: dev-help@maven.apache.org
>>> > > > > > >
>>> > > > > > >
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>>
>>
>>
>

Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
Hmmm I may have lost the plot somewhat, as the findbugs annotations are
@TypeQualifierNickname's for @Nonnull anyway...

I guess my point is that we need to decide *and document* exactly which
annotations are we using. My view is the Nonnull and Nullable are good...
ones with parameters are less good.


On 8 May 2013 11:16, Stephen Connolly <st...@gmail.com>wrote:

> If you do
>
>     <dependency>
>       <groupId>com.google.code.findbugs</groupId>
>       <artifactId>jsr305</artifactId>
>       <version>2.0.1</version>
>       <scope>provided</scope>
>     </dependency>
>
> In one of Maven's APIs thinking that RetentionPolicy.RUNTIME or
> RetentionPolicy.COMPILE will save you as the JVM spec says missing
> annotations are to be ignored... you will be burned when compiling
> implementations of the API unless you add the dependency to *your*
> implementation.
>
> At least some versions (I suspect all but have not confirmed) of JavaC
> needs all the annotations with COMPILE or higher retention available so
> that, at the very least, it knows whether to retain the annotation or
> not... as it may affect the method signature for @Override annotated
> methods or something like that... never really be happy about the issue.
>
> This has bit me when I have an API with @Nonnull annotations and then try
> to implement the API class.
>
> So in such cases using the javax.annotations carries a risk as once/if
> JSR-305 gets accepted, the accepted version of the annotations will be part
> of the core classloader and the dependency provided version will loose
> out...
>
> Not likely a big risk for @Nonnull or @Nullable... but e.g
> @MatchesPattern(value="^\d\d\d-\d\d$",flags=0) might cause issues if in the
> reboot the "flags" parameter gets refactored to regexFlags. It is unclear
> to me what the JVM spec says in the case where the annotation class is
> present but has had a signature change from what was used when the
> annotated source was compiled.
>
> With annotations that are not in the "special" package namespaces we can
> at least put our dependency first... but maybe I am just overly paranoid
>
>
> On 8 May 2013 11:01, Kristian Rosenvold <kr...@gmail.com>wrote:
>
>> Linking to one of your private git repos made this only marginally
>> clearer;
>> I see the edu.umd in there though !
>>
>>
>>
>> > So setting the dependency as "provided" is all well and good until you
>> need
>> > to implement an interface with the annotation applied... at which point
>> you
>> > need to add back in the "provided" dependency...
>> >
>> > But it's still only compile-time, right ? Why would that be a problem ?
>>
>>
>> Having the annotation available at RUNTIME does allow for additional
>> > validations, so that would favour JSR-305, but given that you need the
>> > dependency transitive for compilation there is scope for issues if
>> JSR-305
>> > ever gets rebooted.
>> >
>>
>> Give me this with a tiny spoon please; when would this be a problem ?
>>
>>
>>
>>
>>
>> > On 8 May 2013 09:53, Kristian Rosenvold <kristian.rosenvold@gmail.com
>> > >wrote:
>> >
>> > > You mean there's an older set of findbugs annoations ?
>> > >
>> > > Kristian
>> > >
>> > >
>> > > 2013/5/8 Stephen Connolly <st...@gmail.com>
>> > >
>> > > > IntelliJ also supports the findbugs and jcip annotations too... but
>> in
>> > > any
>> > > > case I will hold my piece... given that these annotations do not
>> have
>> > > > parameters the risk is almost non-existant for *these* but I do
>> think
>> > it
>> > > is
>> > > > a more general risk
>> > > >
>> > > >
>> > > > On 8 May 2013 09:06, Kristian Rosenvold <
>> kristian.rosenvold@gmail.com
>> > > > >wrote:
>> > > >
>> > > > > I suspect like a lot of the rest of the community, they simply
>> gave
>> > up
>> > > on
>> > > > > the jcp.
>> > > > >
>> > > > > I am no insider on the project but
>> com.google.code.findbugs/jsr-305
>> > was
>> > > > > last published in a 2.0.1 version in july 2012, and
>> > > > > seems to be alive and kicking. IntelliJ also supports the
>> annotations
>> > > > which
>> > > > > means we finally have /one/ set of annotations
>> > > > > that everybody understands.
>> > > > >
>> > > > > The value of both Nullable and Nonnull is just amazing once you
>> get
>> > it
>> > > > all
>> > > > > in place.
>> > > > >
>> > > > > As for potential classloading issues, I'm sure /someone/ here
>> would
>> > > know
>> > > > :)
>> > > > >
>> > > > > Kristian
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > 2013/5/8 Stephen Connolly <st...@gmail.com>
>> > > > >
>> > > > > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr>
>> wrote:
>> > > > > >
>> > > > > > > I like this: could we define it as the standard way to add
>> such
>> > > > > > > annotations in
>> > > > > > > whole Maven components? Any problem if we do it in Maven core
>> > > itself?
>> > > > > > >
>> > > > > > > I'm not a JSR-305 expert, any basic explanation on the
>> > > > > > > com.google.code.findbugs:jsr305 choice is good to know
>> > > > > > >
>> > > > > >
>> > > > > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
>> > > > > >
>> > > > > > In general I like those annotations, though I tend to favour the
>> > > > findbugs
>> > > > > > annotations and jcip annotations in code I write while awaiting
>> > > jsr305
>> > > > to
>> > > > > > finalize (given that the spec is dormant, feared dead:
>> > > > > > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of
>> the
>> > > > spec
>> > > > > > may
>> > > > > > result in signature changes and as such, given that the
>> annotations
>> > > are
>> > > > > > runtime retention, when annotations finally land in the JVM
>> there
>> > may
>> > > > be
>> > > > > a
>> > > > > > risk from signature change...
>> > > > > >
>> > > > > > But that could be an irrational fear on my behalf...
>> > > > > >
>> > > > > > In any case I have clean room ASLv2 licensed versions of the
>> > findbugs
>> > > > and
>> > > > > > jcip annotations in my GitHub repo and published to central.
>> > > > > >
>> > > > > >
>> > > > > > > then we could add it to maven parent pom dependencyManagement
>> > > > section,
>> > > > > > and
>> > > > > > > write something into "Maven Developer Centre"
>> > > > > > >
>> > > > > > > Regards,
>> > > > > > >
>> > > > > > > Hervé
>> > > > > > >
>> > > > > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
>> > > > > > > > Updated Branches:
>> > > > > > > >   refs/heads/master 231773324 -> 7b330f584
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > Added jsr305 annotations
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > Project:
>> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
>> > > > > > > > Commit:
>> > > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree
>> :
>> > > > > > > >
>> > > > > >
>> > > >
>> > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff
>> :
>> > > > > > > >
>> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
>> > > > > > > >
>> > > > > > > > Branch: refs/heads/master
>> > > > > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
>> > > > > > > > Parents: 2317733
>> > > > > > > > Author: Kristian Rosenvold <kr...@apache.org>
>> > > > > > > > Authored: Tue May 7 18:49:15 2013 +0200
>> > > > > > > > Committer: Kristian Rosenvold <kr...@apache.org>
>> > > > > > > > Committed: Tue May 7 18:49:15 2013 +0200
>> > > > > > > >
>> > > > > > > >
>> > > > >
>> > ----------------------------------------------------------------------
>> > > > > > > >  maven-surefire-common/pom.xml                      |    4
>> ++++
>> > > > > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7
>> > > +++++--
>> > > > > > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6
>> > ++++--
>> > > > > > > >  .../maven/plugin/surefire/CommonReflector.java     |    8
>> > > +++++---
>> > > > > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3
>> +++
>> > > > > > > >  .../surefire/booterclient/ForkConfiguration.java   |    4
>> ++--
>> > > > > > > >  .../plugin/surefire/util/DependencyScanner.java    |    4
>> +++-
>> > > > > > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
>> > > > > ++++++++----
>> > > > > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10
>> > > > ++++++----
>> > > > > > > >  pom.xml                                            |    6
>> > ++++++
>> > > > > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
>> > > > > > > >
>> > > > >
>> > ----------------------------------------------------------------------
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > > refire-common/pom.xml
>> > > > > > > >
>> > > > >
>> > ----------------------------------------------------------------------
>> > > > > > > diff
>> > > > > > > > --git a/maven-surefire-common/pom.xml
>> > > > b/maven-surefire-common/pom.xml
>> > > > > > > index
>> > > > > > > > 1330eec..bed467b 100644
>> > > > > > > > --- a/maven-surefire-common/pom.xml
>> > > > > > > > +++ b/maven-surefire-common/pom.xml
>> > > > > > > > @@ -91,6 +91,10 @@
>> > > > > > > >        <artifactId>commons-lang3</artifactId>
>> > > > > > > >      </dependency>
>> > > > > > > >      <dependency>
>> > > > > > > > +      <groupId>com.google.code.findbugs</groupId>
>> > > > > > > > +      <artifactId>jsr305</artifactId>
>> > > > > > > > +    </dependency>
>> > > > > > > > +    <dependency>
>> > > > > > > >        <groupId>org.apache.maven.shared</groupId>
>> > > > > > > >
>>  <artifactId>maven-common-artifact-filters</artifactId>
>> > > > > > > >        <version>1.3</version>
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
>> > > > > > > > eMojo.java
>> > > > > > > >
>> > > > >
>> > ----------------------------------------------------------------------
>> > > > > > > diff
>> > > > > > > > --git
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
>> > > > > > > > ractSurefireMojo.java
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
>> > > > > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
>> > > > > > > > ---
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
>> > > > > > > > ractSurefireMojo.java +++
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
>> > > > > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
>> > > > > > > > org.apache.maven.surefire.util.RunOrder;
>> > > > > > > >  import org.apache.maven.toolchain.Toolchain;
>> > > > > > > >  import org.apache.maven.toolchain.ToolchainManager;
>> > > > > > > >
>> > > > > > > > +import javax.annotation.Nonnull;
>> > > > > > > > +
>> > > > > > > >  /**
>> > > > > > > >   * Abstract base class for running tests using Surefire.
>> > > > > > > >   *
>> > > > > > > > @@ -1266,7 +1268,7 @@ public abstract class
>> > AbstractSurefireMojo
>> > > > > > > >          }
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > > -    private List<String> getExcludeList()
>> > > > > > > > +    private @Nonnull List<String> getExcludeList()
>> > > > > > > >      {
>> > > > > > > >          List<String> excludes = null;
>> > > > > > > >          if ( isSpecificTestSpecified() )
>> > > > > > > > @@ -1339,7 +1341,7 @@ public abstract class
>> > AbstractSurefireMojo
>> > > > > > > >          return filterNulls( includes );
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > > -    private List<String> filterNulls( List<String>
>> toFilter )
>> > > > > > > > +    private @Nonnull List<String> filterNulls( @Nonnull
>> > > > List<String>
>> > > > > > > > toFilter ) {
>> > > > > > > >          List<String> result = new ArrayList<String>(
>> > > > toFilter.size()
>> > > > > > );
>> > > > > > > >          for ( String item : toFilter )
>> > > > > > > > @@ -2130,6 +2132,7 @@ public abstract class
>> > AbstractSurefireMojo
>> > > > > > > >              return new DynamicProviderInfo( providerName );
>> > > > > > > >          }
>> > > > > > > >
>> > > > > > > > +        @Nonnull
>> > > > > > > >          public String getProviderName()
>> > > > > > > >          {
>> > > > > > > >              return providerName;
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
>> > > > > > > > java
>> > > > > > >
>> > > >
>> ----------------------------------------------------------------------
>> > > > > > > > diff --git
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
>> > > > > > > > spathCache.java
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
>> > > > > > > > spathCache.java index 1bcb065..ea250c2 100644
>> > > > > > > > ---
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
>> > > > > > > > spathCache.java +++
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
>> > > > > > > > spathCache.java @@ -21,6 +21,8 @@ package
>> > > > > > > org.apache.maven.plugin.surefire;
>> > > > > > > >  import java.util.concurrent.ConcurrentHashMap;
>> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
>> > > > > > > >
>> > > > > > > > +import javax.annotation.Nonnull;
>> > > > > > > > +
>> > > > > > > >  /**
>> > > > > > > >   * @author Kristian Rosenvold
>> > > > > > > >   */
>> > > > > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
>> > > > > > > >      private static final ConcurrentHashMap<String,
>> Classpath>
>> > > > > > > classpaths =
>> > > > > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
>> > > > > > > >
>> > > > > > > > -    public static Classpath getCachedClassPath( String
>> > > artifactId
>> > > > )
>> > > > > > > > +    public static Classpath getCachedClassPath( @Nonnull
>> > String
>> > > > > > > artifactId
>> > > > > > > > ) {
>> > > > > > > >          return classpaths.get( artifactId );
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > > -    public static void setCachedClasspath( String key,
>> > Classpath
>> > > > > > > classpath
>> > > > > > > > ) +    public static void setCachedClasspath( @Nonnull
>> String
>> > > key,
>> > > > > > > @Nonnull
>> > > > > > > > Classpath classpath ) {
>> > > > > > > >          classpaths.put( key, classpath );
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
>> > > > > > > > .java
>> > > > > > >
>> > > >
>> ----------------------------------------------------------------------
>> > > > > > > > diff --git
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
>> > > > > > > > onReflector.java
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
>> > > > > > > > onReflector.java index 538b7e0..6851539 100644
>> > > > > > > > ---
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
>> > > > > > > > onReflector.java +++
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
>> > > > > > > > onReflector.java @@ -25,6 +25,8 @@ import
>> > > > > > > >
>> org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
>> > > > > import
>> > > > > > > > org.apache.maven.surefire.util.ReflectionUtils;
>> > > > > > > >  import
>> > > org.apache.maven.surefire.util.SurefireReflectionException;
>> > > > > > > >
>> > > > > > > > +import javax.annotation.Nonnull;
>> > > > > > > > +
>> > > > > > > >  /**
>> > > > > > > >   * @author Kristian Rosenvold
>> > > > > > > >   */
>> > > > > > > > @@ -34,7 +36,7 @@ public class CommonReflector
>> > > > > > > >
>> > > > > > > >      private final ClassLoader surefireClassLoader;
>> > > > > > > >
>> > > > > > > > -    public CommonReflector( ClassLoader
>> surefireClassLoader )
>> > > > > > > > +    public CommonReflector( @Nonnull ClassLoader
>> > > > > surefireClassLoader )
>> > > > > > > >      {
>> > > > > > > >          this.surefireClassLoader = surefireClassLoader;
>> > > > > > > >
>> > > > > > > > @@ -48,7 +50,7 @@ public class CommonReflector
>> > > > > > > >          }
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > > -    public Object createReportingReporterFactory(
>> > > > > > > > StartupReportConfiguration startupReportConfiguration ) +
>> > >  public
>> > > > > > > Object
>> > > > > > > > createReportingReporterFactory( @Nonnull
>> > > StartupReportConfiguration
>> > > > > > > > startupReportConfiguration ) {
>> > > > > > > >          Class<?>[] args = new Class[]{
>> > > > > this.startupReportConfiguration
>> > > > > > > };
>> > > > > > > >          Object src = createStartupReportConfiguration(
>> > > > > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
>> > > > > > > > CommonReflector
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > -    Object createStartupReportConfiguration(
>> > > > > > StartupReportConfiguration
>> > > > > > > > reporterConfiguration ) +    Object
>> > > > createStartupReportConfiguration(
>> > > > > > > > @Nonnull StartupReportConfiguration reporterConfiguration )
>> {
>> > > > > > > >          Constructor<?> constructor =
>> > > > ReflectionUtils.getConstructor(
>> > > > > > > > this.startupReportConfiguration, new Class[]{ boolean.class,
>> > > > > > > boolean.class,
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
>> > > > > > > > va
>> > > > > >
>> > > ----------------------------------------------------------------------
>> > > > > > > > diff --git
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
>> > > > > > > > iderInfo.java
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
>> > > > > > > > iderInfo.java index 57069d8..50de7ea 100644
>> > > > > > > > ---
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
>> > > > > > > > iderInfo.java +++
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
>> > > > > > > > iderInfo.java @@ -24,11 +24,14 @@ import
>> > > > > > > >
>> org.apache.maven.artifact.resolver.ArtifactResolutionException;
>> > > > > import
>> > > > > > > > org.apache.maven.plugin.MojoExecutionException;
>> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
>> > > > > > > >
>> > > > > > > > +import javax.annotation.Nonnull;
>> > > > > > > > +
>> > > > > > > >  /**
>> > > > > > > >   * @author Kristian Rosenvold
>> > > > > > > >   */
>> > > > > > > >  public interface ProviderInfo
>> > > > > > > >  {
>> > > > > > > > +    @Nonnull
>> > > > > > > >      String getProviderName();
>> > > > > > > >
>> > > > > > > >      boolean isApplicable();
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
>> > > > > > > > rkConfiguration.java
>> > > > > > > >
>> > > > >
>> > ----------------------------------------------------------------------
>> > > > > > > diff
>> > > > > > > > --git
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
>> > > > > > > > erclient/ForkConfiguration.java
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
>> > > > > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27
>> 100644
>> > > > > > > > ---
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
>> > > > > > > > erclient/ForkConfiguration.java +++
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
>> > > > > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public
>> > class
>> > > > > > > > ForkConfiguration
>> > > > > > > >
>> > > > > > > >      /**
>> > > > > > > >       * @param classPath            cla the classpath
>> arguments
>> > > > > > > > -     * @param startupConfiguration
>> > > > > > > > +     * @param startupConfiguration The startup
>> configuration
>> > > > > > > >       * @param threadNumber         the thread number, to be
>> > the
>> > > > > > > replacement
>> > > > > > > > in the argLine   @return A commandline * @throws
>> > > > > > > >
>> org.apache.maven.surefire.booter.SurefireBooterForkException *
>> > > > > > > > when unable to perform the fork
>> > > > > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
>> > > > > > > >       * for all classpath elements.
>> > > > > > > >       *
>> > > > > > > >       * @param classPath      List&lt;String> of all
>> classpath
>> > > > > > elements.
>> > > > > > > > -     * @param startClassName
>> > > > > > > > +     * @param startClassName  The classname to start
>> > > (main-class)
>> > > > > > > >       * @return The file pointint to the jar
>> > > > > > > >       * @throws java.io.IOException When a file operation
>> > fails.
>> > > > > > > >       */
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
>> > > > > > > > Scanner.java
>> > > > > > > >
>> > > > >
>> > ----------------------------------------------------------------------
>> > > > > > > diff
>> > > > > > > > --git
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /DependencyScanner.java
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
>> > > > > > > > ---
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /DependencyScanner.java +++
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
>> > > > > > > > org.apache.maven.plugin.MojoExecutionException; import
>> > > > > > > > org.apache.maven.shared.utils.io.MatchPatterns;
>> > > > > > > >  import org.apache.maven.surefire.util.DefaultScanResult;
>> > > > > > > >
>> > > > > > > > +import javax.annotation.Nullable;
>> > > > > > > > +
>> > > > > > > >  /**
>> > > > > > > >   * Scans dependencies looking for tests.
>> > > > > > > >   *
>> > > > > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
>> > > > > > > >
>> > > > > > > >               private SpecificFileFilter specificTestFilter;
>> > > > > > > >
>> > > > > > > > -             public Matcher(List<String> includes,
>> > List<String>
>> > > > > > > excludes,
>> > > > > > > List<String>
>> > > > > > > > specificTests) +              public Matcher(@Nullable
>> > > List<String>
>> > > > > > > includes,
>> > > > > > > @Nullable
>> > > > > > > > List<String> excludes, @Nullable List<String>
>> specificTests) {
>> > > > > > > >                       String[] specific = specificTests ==
>> > null ?
>> > > > new
>> > > > > > > String[0] :
>> > > > > > > > processIncludesExcludes( specificTests );
>> specificTestFilter =
>> > > new
>> > > > > > > > SpecificFileFilter( specific );
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
>> > > > > > > > java
>> > > > > > >
>> > > >
>> ----------------------------------------------------------------------
>> > > > > > > > diff --git
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /Relocator.java
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /Relocator.java index 31dde5d..76da9de 100644
>> > > > > > > > ---
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /Relocator.java +++
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /Relocator.java @@ -19,6 +19,10 @@ package
>> > > > > > > > org.apache.maven.plugin.surefire.util;
>> > > > > > > >   * under the License.
>> > > > > > > >   */
>> > > > > > > >
>> > > > > > > > +import com.sun.istack.internal.NotNull;
>> > > > > > > > +
>> > > > > > > > +import javax.annotation.Nullable;
>> > > > > > > > +
>> > > > > > > >  /**
>> > > > > > > >   * Relocates class names when running with relocated
>> provider
>> > > > > > > >   *
>> > > > > > > > @@ -26,12 +30,12 @@ package
>> > > org.apache.maven.plugin.surefire.util;
>> > > > > > > >   */
>> > > > > > > >  public class Relocator
>> > > > > > > >  {
>> > > > > > > > -    private final String relocation;
>> > > > > > > > +    private final @Nullable String relocation;
>> > > > > > > >
>> > > > > > > >      private static final String relocationBase =
>> > > > > > > > "org.apache.maven.surefire.";
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > -    public Relocator( String relocation )
>> > > > > > > > +    public Relocator( @Nullable String relocation )
>> > > > > > > >      {
>> > > > > > > >          this.relocation = relocation;
>> > > > > > > >      }
>> > > > > > > > @@ -41,12 +45,12 @@ public class Relocator
>> > > > > > > >          relocation = "shadefire";
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > > -    private String getRelocation()
>> > > > > > > > +    private @Nullable String getRelocation()
>> > > > > > > >      {
>> > > > > > > >          return relocation;
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > > -    public String relocate( String className )
>> > > > > > > > +    public @NotNull String relocate( @NotNull String
>> > className )
>> > > > > > > >      {
>> > > > > > > >          if ( relocation == null )
>> > > > > > > >          {
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
>> > > > > > > > l.java
>> > > > > > > >
>> > > > >
>> > ----------------------------------------------------------------------
>> > > > > > > diff
>> > > > > > > > --git
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /ScannerUtil.java
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /ScannerUtil.java index 3498e63..8b80301 100644
>> > > > > > > > ---
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /ScannerUtil.java +++
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
>> > > > > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
>> > > > > > > >
>> > > > > > > >  import org.apache.commons.lang3.StringUtils;
>> > > > > > > >
>> > > > > > > > +import javax.annotation.Nonnull;
>> > > > > > > > +
>> > > > > > > >  final class ScannerUtil {
>> > > > > > > >
>> > > > > > > >       private ScannerUtil() {}
>> > > > > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
>> > > > > > > >
>> > > > > > > >      private static final String JAVA_CLASS_FILE_EXTENSION =
>> > > > > ".class";
>> > > > > > > >
>> > > > > > > > -    public static String convertToJavaClassName( String
>> test )
>> > > > > > > > +    public static @Nonnull String convertToJavaClassName(
>> > > @Nonnull
>> > > > > > > String
>> > > > > > > > test ) {
>> > > > > > > >          return StringUtils.removeEnd( test, ".class"
>> > ).replace(
>> > > > FS,
>> > > > > > "."
>> > > > > > > );
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > > -    public static String
>> > convertJarFileResourceToJavaClassName(
>> > > > > String
>> > > > > > > test
>> > > > > > > > ) +    public static @Nonnull String
>> > > > > > > convertJarFileResourceToJavaClassName(
>> > > > > > > > @Nonnull String test ) {
>> > > > > > > >          return StringUtils.removeEnd( test, ".class"
>> > ).replace(
>> > > > "/",
>> > > > > > > "." );
>> > > > > > > > }
>> > > > > > > >
>> > > > > > > > -    public static String stripBaseDir( String basedir,
>> String
>> > > > test )
>> > > > > > > > +    public static @Nonnull String stripBaseDir( String
>> > basedir,
>> > > > > String
>> > > > > > > test
>> > > > > > > > ) {
>> > > > > > > >          return StringUtils.removeStart( test, basedir );
>> > > > > > > >      }
>> > > > > > > >
>> > > > > > > > -    public static String[] processIncludesExcludes(
>> > List<String>
>> > > > > list
>> > > > > > )
>> > > > > > > > +    public static @Nonnull String[]
>> processIncludesExcludes(
>> > > > > @Nonnull
>> > > > > > > > List<String> list ) {
>> > > > > > > >          List<String> newList = new ArrayList<String>();
>> > > > > > > >          for ( Object aList : list )
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
>> > > > > > > >
>> > > > >
>> > ----------------------------------------------------------------------
>> > > > > > > > diff --git a/pom.xml b/pom.xml
>> > > > > > > > index 677b367..c60f378 100644
>> > > > > > > > --- a/pom.xml
>> > > > > > > > +++ b/pom.xml
>> > > > > > > > @@ -265,6 +265,12 @@
>> > > > > > > >          <version>3.8.1</version>
>> > > > > > > >          <scope>test</scope>
>> > > > > > > >        </dependency>
>> > > > > > > > +      <dependency>
>> > > > > > > > +        <groupId>com.google.code.findbugs</groupId>
>> > > > > > > > +        <artifactId>jsr305</artifactId>
>> > > > > > > > +        <version>2.0.1</version>
>> > > > > > > > +        <scope>provided</scope>
>> > > > > > > > +      </dependency>
>> > > > > > > >      </dependencies>
>> > > > > > > >    </dependencyManagement>
>> > > > > > > >    <dependencies>
>> > > > > > >
>> > > > > > >
>> > > ---------------------------------------------------------------------
>> > > > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> > > > > > > For additional commands, e-mail: dev-help@maven.apache.org
>> > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
If you do

    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>2.0.1</version>
      <scope>provided</scope>
    </dependency>

In one of Maven's APIs thinking that RetentionPolicy.RUNTIME or
RetentionPolicy.COMPILE will save you as the JVM spec says missing
annotations are to be ignored... you will be burned when compiling
implementations of the API unless you add the dependency to *your*
implementation.

At least some versions (I suspect all but have not confirmed) of JavaC
needs all the annotations with COMPILE or higher retention available so
that, at the very least, it knows whether to retain the annotation or
not... as it may affect the method signature for @Override annotated
methods or something like that... never really be happy about the issue.

This has bit me when I have an API with @Nonnull annotations and then try
to implement the API class.

So in such cases using the javax.annotations carries a risk as once/if
JSR-305 gets accepted, the accepted version of the annotations will be part
of the core classloader and the dependency provided version will loose
out...

Not likely a big risk for @Nonnull or @Nullable... but e.g
@MatchesPattern(value="^\d\d\d-\d\d$",flags=0) might cause issues if in the
reboot the "flags" parameter gets refactored to regexFlags. It is unclear
to me what the JVM spec says in the case where the annotation class is
present but has had a signature change from what was used when the
annotated source was compiled.

With annotations that are not in the "special" package namespaces we can at
least put our dependency first... but maybe I am just overly paranoid


On 8 May 2013 11:01, Kristian Rosenvold <kr...@gmail.com>wrote:

> Linking to one of your private git repos made this only marginally clearer;
> I see the edu.umd in there though !
>
>
>
> > So setting the dependency as "provided" is all well and good until you
> need
> > to implement an interface with the annotation applied... at which point
> you
> > need to add back in the "provided" dependency...
> >
> > But it's still only compile-time, right ? Why would that be a problem ?
>
>
> Having the annotation available at RUNTIME does allow for additional
> > validations, so that would favour JSR-305, but given that you need the
> > dependency transitive for compilation there is scope for issues if
> JSR-305
> > ever gets rebooted.
> >
>
> Give me this with a tiny spoon please; when would this be a problem ?
>
>
>
>
>
> > On 8 May 2013 09:53, Kristian Rosenvold <kristian.rosenvold@gmail.com
> > >wrote:
> >
> > > You mean there's an older set of findbugs annoations ?
> > >
> > > Kristian
> > >
> > >
> > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> > >
> > > > IntelliJ also supports the findbugs and jcip annotations too... but
> in
> > > any
> > > > case I will hold my piece... given that these annotations do not have
> > > > parameters the risk is almost non-existant for *these* but I do think
> > it
> > > is
> > > > a more general risk
> > > >
> > > >
> > > > On 8 May 2013 09:06, Kristian Rosenvold <
> kristian.rosenvold@gmail.com
> > > > >wrote:
> > > >
> > > > > I suspect like a lot of the rest of the community, they simply gave
> > up
> > > on
> > > > > the jcp.
> > > > >
> > > > > I am no insider on the project but com.google.code.findbugs/jsr-305
> > was
> > > > > last published in a 2.0.1 version in july 2012, and
> > > > > seems to be alive and kicking. IntelliJ also supports the
> annotations
> > > > which
> > > > > means we finally have /one/ set of annotations
> > > > > that everybody understands.
> > > > >
> > > > > The value of both Nullable and Nonnull is just amazing once you get
> > it
> > > > all
> > > > > in place.
> > > > >
> > > > > As for potential classloading issues, I'm sure /someone/ here would
> > > know
> > > > :)
> > > > >
> > > > > Kristian
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> > > > >
> > > > > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr>
> wrote:
> > > > > >
> > > > > > > I like this: could we define it as the standard way to add such
> > > > > > > annotations in
> > > > > > > whole Maven components? Any problem if we do it in Maven core
> > > itself?
> > > > > > >
> > > > > > > I'm not a JSR-305 expert, any basic explanation on the
> > > > > > > com.google.code.findbugs:jsr305 choice is good to know
> > > > > > >
> > > > > >
> > > > > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> > > > > >
> > > > > > In general I like those annotations, though I tend to favour the
> > > > findbugs
> > > > > > annotations and jcip annotations in code I write while awaiting
> > > jsr305
> > > > to
> > > > > > finalize (given that the spec is dormant, feared dead:
> > > > > > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of
> the
> > > > spec
> > > > > > may
> > > > > > result in signature changes and as such, given that the
> annotations
> > > are
> > > > > > runtime retention, when annotations finally land in the JVM there
> > may
> > > > be
> > > > > a
> > > > > > risk from signature change...
> > > > > >
> > > > > > But that could be an irrational fear on my behalf...
> > > > > >
> > > > > > In any case I have clean room ASLv2 licensed versions of the
> > findbugs
> > > > and
> > > > > > jcip annotations in my GitHub repo and published to central.
> > > > > >
> > > > > >
> > > > > > > then we could add it to maven parent pom dependencyManagement
> > > > section,
> > > > > > and
> > > > > > > write something into "Maven Developer Centre"
> > > > > > >
> > > > > > > Regards,
> > > > > > >
> > > > > > > Hervé
> > > > > > >
> > > > > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > > > > > > Updated Branches:
> > > > > > > >   refs/heads/master 231773324 -> 7b330f584
> > > > > > > >
> > > > > > > >
> > > > > > > > Added jsr305 annotations
> > > > > > > >
> > > > > > > >
> > > > > > > > Project:
> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > > > > > > > Commit:
> > > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > > > > > > >
> > > > > >
> > > >
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > > > > > >
> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > > > > > > >
> > > > > > > > Branch: refs/heads/master
> > > > > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > > > > > > Parents: 2317733
> > > > > > > > Author: Kristian Rosenvold <kr...@apache.org>
> > > > > > > > Authored: Tue May 7 18:49:15 2013 +0200
> > > > > > > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > > > > > > Committed: Tue May 7 18:49:15 2013 +0200
> > > > > > > >
> > > > > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > >  maven-surefire-common/pom.xml                      |    4
> ++++
> > > > > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7
> > > +++++--
> > > > > > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6
> > ++++--
> > > > > > > >  .../maven/plugin/surefire/CommonReflector.java     |    8
> > > +++++---
> > > > > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3
> +++
> > > > > > > >  .../surefire/booterclient/ForkConfiguration.java   |    4
> ++--
> > > > > > > >  .../plugin/surefire/util/DependencyScanner.java    |    4
> +++-
> > > > > > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
> > > > > ++++++++----
> > > > > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10
> > > > ++++++----
> > > > > > > >  pom.xml                                            |    6
> > ++++++
> > > > > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > > > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > > refire-common/pom.xml
> > > > > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > diff
> > > > > > > > --git a/maven-surefire-common/pom.xml
> > > > b/maven-surefire-common/pom.xml
> > > > > > > index
> > > > > > > > 1330eec..bed467b 100644
> > > > > > > > --- a/maven-surefire-common/pom.xml
> > > > > > > > +++ b/maven-surefire-common/pom.xml
> > > > > > > > @@ -91,6 +91,10 @@
> > > > > > > >        <artifactId>commons-lang3</artifactId>
> > > > > > > >      </dependency>
> > > > > > > >      <dependency>
> > > > > > > > +      <groupId>com.google.code.findbugs</groupId>
> > > > > > > > +      <artifactId>jsr305</artifactId>
> > > > > > > > +    </dependency>
> > > > > > > > +    <dependency>
> > > > > > > >        <groupId>org.apache.maven.shared</groupId>
> > > > > > > >        <artifactId>maven-common-artifact-filters</artifactId>
> > > > > > > >        <version>1.3</version>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > > > > > > > eMojo.java
> > > > > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > diff
> > > > > > > > --git
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > > > ractSurefireMojo.java
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > > > > > > ---
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > > > ractSurefireMojo.java +++
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > > > > > > org.apache.maven.surefire.util.RunOrder;
> > > > > > > >  import org.apache.maven.toolchain.Toolchain;
> > > > > > > >  import org.apache.maven.toolchain.ToolchainManager;
> > > > > > > >
> > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > +
> > > > > > > >  /**
> > > > > > > >   * Abstract base class for running tests using Surefire.
> > > > > > > >   *
> > > > > > > > @@ -1266,7 +1268,7 @@ public abstract class
> > AbstractSurefireMojo
> > > > > > > >          }
> > > > > > > >      }
> > > > > > > >
> > > > > > > > -    private List<String> getExcludeList()
> > > > > > > > +    private @Nonnull List<String> getExcludeList()
> > > > > > > >      {
> > > > > > > >          List<String> excludes = null;
> > > > > > > >          if ( isSpecificTestSpecified() )
> > > > > > > > @@ -1339,7 +1341,7 @@ public abstract class
> > AbstractSurefireMojo
> > > > > > > >          return filterNulls( includes );
> > > > > > > >      }
> > > > > > > >
> > > > > > > > -    private List<String> filterNulls( List<String> toFilter
> )
> > > > > > > > +    private @Nonnull List<String> filterNulls( @Nonnull
> > > > List<String>
> > > > > > > > toFilter ) {
> > > > > > > >          List<String> result = new ArrayList<String>(
> > > > toFilter.size()
> > > > > > );
> > > > > > > >          for ( String item : toFilter )
> > > > > > > > @@ -2130,6 +2132,7 @@ public abstract class
> > AbstractSurefireMojo
> > > > > > > >              return new DynamicProviderInfo( providerName );
> > > > > > > >          }
> > > > > > > >
> > > > > > > > +        @Nonnull
> > > > > > > >          public String getProviderName()
> > > > > > > >          {
> > > > > > > >              return providerName;
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > > > > > > > java
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > > > diff --git
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > > > spathCache.java
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > > > spathCache.java index 1bcb065..ea250c2 100644
> > > > > > > > ---
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > > > spathCache.java +++
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > > > spathCache.java @@ -21,6 +21,8 @@ package
> > > > > > > org.apache.maven.plugin.surefire;
> > > > > > > >  import java.util.concurrent.ConcurrentHashMap;
> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > > > > >
> > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > +
> > > > > > > >  /**
> > > > > > > >   * @author Kristian Rosenvold
> > > > > > > >   */
> > > > > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > > > > > > >      private static final ConcurrentHashMap<String,
> Classpath>
> > > > > > > classpaths =
> > > > > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > > > > > > >
> > > > > > > > -    public static Classpath getCachedClassPath( String
> > > artifactId
> > > > )
> > > > > > > > +    public static Classpath getCachedClassPath( @Nonnull
> > String
> > > > > > > artifactId
> > > > > > > > ) {
> > > > > > > >          return classpaths.get( artifactId );
> > > > > > > >      }
> > > > > > > >
> > > > > > > > -    public static void setCachedClasspath( String key,
> > Classpath
> > > > > > > classpath
> > > > > > > > ) +    public static void setCachedClasspath( @Nonnull String
> > > key,
> > > > > > > @Nonnull
> > > > > > > > Classpath classpath ) {
> > > > > > > >          classpaths.put( key, classpath );
> > > > > > > >      }
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > > > > > > > .java
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > > > diff --git
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > > > onReflector.java
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > > > onReflector.java index 538b7e0..6851539 100644
> > > > > > > > ---
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > > > onReflector.java +++
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > > > onReflector.java @@ -25,6 +25,8 @@ import
> > > > > > > >
> org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
> > > > > import
> > > > > > > > org.apache.maven.surefire.util.ReflectionUtils;
> > > > > > > >  import
> > > org.apache.maven.surefire.util.SurefireReflectionException;
> > > > > > > >
> > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > +
> > > > > > > >  /**
> > > > > > > >   * @author Kristian Rosenvold
> > > > > > > >   */
> > > > > > > > @@ -34,7 +36,7 @@ public class CommonReflector
> > > > > > > >
> > > > > > > >      private final ClassLoader surefireClassLoader;
> > > > > > > >
> > > > > > > > -    public CommonReflector( ClassLoader surefireClassLoader
> )
> > > > > > > > +    public CommonReflector( @Nonnull ClassLoader
> > > > > surefireClassLoader )
> > > > > > > >      {
> > > > > > > >          this.surefireClassLoader = surefireClassLoader;
> > > > > > > >
> > > > > > > > @@ -48,7 +50,7 @@ public class CommonReflector
> > > > > > > >          }
> > > > > > > >      }
> > > > > > > >
> > > > > > > > -    public Object createReportingReporterFactory(
> > > > > > > > StartupReportConfiguration startupReportConfiguration ) +
> > >  public
> > > > > > > Object
> > > > > > > > createReportingReporterFactory( @Nonnull
> > > StartupReportConfiguration
> > > > > > > > startupReportConfiguration ) {
> > > > > > > >          Class<?>[] args = new Class[]{
> > > > > this.startupReportConfiguration
> > > > > > > };
> > > > > > > >          Object src = createStartupReportConfiguration(
> > > > > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > > > > > > CommonReflector
> > > > > > > >      }
> > > > > > > >
> > > > > > > >
> > > > > > > > -    Object createStartupReportConfiguration(
> > > > > > StartupReportConfiguration
> > > > > > > > reporterConfiguration ) +    Object
> > > > createStartupReportConfiguration(
> > > > > > > > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> > > > > > > >          Constructor<?> constructor =
> > > > ReflectionUtils.getConstructor(
> > > > > > > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > > > > > > boolean.class,
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > > > > > > > va
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > > > > diff --git
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > > > iderInfo.java
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > > > iderInfo.java index 57069d8..50de7ea 100644
> > > > > > > > ---
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > > > iderInfo.java +++
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > > > iderInfo.java @@ -24,11 +24,14 @@ import
> > > > > > > >
> org.apache.maven.artifact.resolver.ArtifactResolutionException;
> > > > > import
> > > > > > > > org.apache.maven.plugin.MojoExecutionException;
> > > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > > > > >
> > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > +
> > > > > > > >  /**
> > > > > > > >   * @author Kristian Rosenvold
> > > > > > > >   */
> > > > > > > >  public interface ProviderInfo
> > > > > > > >  {
> > > > > > > > +    @Nonnull
> > > > > > > >      String getProviderName();
> > > > > > > >
> > > > > > > >      boolean isApplicable();
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > > > > > > > rkConfiguration.java
> > > > > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > diff
> > > > > > > > --git
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > > > erclient/ForkConfiguration.java
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > > > > > > > ---
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > > > erclient/ForkConfiguration.java +++
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public
> > class
> > > > > > > > ForkConfiguration
> > > > > > > >
> > > > > > > >      /**
> > > > > > > >       * @param classPath            cla the classpath
> arguments
> > > > > > > > -     * @param startupConfiguration
> > > > > > > > +     * @param startupConfiguration The startup configuration
> > > > > > > >       * @param threadNumber         the thread number, to be
> > the
> > > > > > > replacement
> > > > > > > > in the argLine   @return A commandline * @throws
> > > > > > > > org.apache.maven.surefire.booter.SurefireBooterForkException
> *
> > > > > > > > when unable to perform the fork
> > > > > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > > > > > > >       * for all classpath elements.
> > > > > > > >       *
> > > > > > > >       * @param classPath      List&lt;String> of all
> classpath
> > > > > > elements.
> > > > > > > > -     * @param startClassName
> > > > > > > > +     * @param startClassName  The classname to start
> > > (main-class)
> > > > > > > >       * @return The file pointint to the jar
> > > > > > > >       * @throws java.io.IOException When a file operation
> > fails.
> > > > > > > >       */
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > > > > > > > Scanner.java
> > > > > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > diff
> > > > > > > > --git
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /DependencyScanner.java
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > > > > > > ---
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /DependencyScanner.java +++
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > > > > > > org.apache.maven.plugin.MojoExecutionException; import
> > > > > > > > org.apache.maven.shared.utils.io.MatchPatterns;
> > > > > > > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > > > > > > >
> > > > > > > > +import javax.annotation.Nullable;
> > > > > > > > +
> > > > > > > >  /**
> > > > > > > >   * Scans dependencies looking for tests.
> > > > > > > >   *
> > > > > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > > > > > > >
> > > > > > > >               private SpecificFileFilter specificTestFilter;
> > > > > > > >
> > > > > > > > -             public Matcher(List<String> includes,
> > List<String>
> > > > > > > excludes,
> > > > > > > List<String>
> > > > > > > > specificTests) +              public Matcher(@Nullable
> > > List<String>
> > > > > > > includes,
> > > > > > > @Nullable
> > > > > > > > List<String> excludes, @Nullable List<String> specificTests)
> {
> > > > > > > >                       String[] specific = specificTests ==
> > null ?
> > > > new
> > > > > > > String[0] :
> > > > > > > > processIncludesExcludes( specificTests ); specificTestFilter
> =
> > > new
> > > > > > > > SpecificFileFilter( specific );
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > > > > > > > java
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > > > diff --git
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /Relocator.java
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /Relocator.java index 31dde5d..76da9de 100644
> > > > > > > > ---
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /Relocator.java +++
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > > > > > > org.apache.maven.plugin.surefire.util;
> > > > > > > >   * under the License.
> > > > > > > >   */
> > > > > > > >
> > > > > > > > +import com.sun.istack.internal.NotNull;
> > > > > > > > +
> > > > > > > > +import javax.annotation.Nullable;
> > > > > > > > +
> > > > > > > >  /**
> > > > > > > >   * Relocates class names when running with relocated
> provider
> > > > > > > >   *
> > > > > > > > @@ -26,12 +30,12 @@ package
> > > org.apache.maven.plugin.surefire.util;
> > > > > > > >   */
> > > > > > > >  public class Relocator
> > > > > > > >  {
> > > > > > > > -    private final String relocation;
> > > > > > > > +    private final @Nullable String relocation;
> > > > > > > >
> > > > > > > >      private static final String relocationBase =
> > > > > > > > "org.apache.maven.surefire.";
> > > > > > > >
> > > > > > > >
> > > > > > > > -    public Relocator( String relocation )
> > > > > > > > +    public Relocator( @Nullable String relocation )
> > > > > > > >      {
> > > > > > > >          this.relocation = relocation;
> > > > > > > >      }
> > > > > > > > @@ -41,12 +45,12 @@ public class Relocator
> > > > > > > >          relocation = "shadefire";
> > > > > > > >      }
> > > > > > > >
> > > > > > > > -    private String getRelocation()
> > > > > > > > +    private @Nullable String getRelocation()
> > > > > > > >      {
> > > > > > > >          return relocation;
> > > > > > > >      }
> > > > > > > >
> > > > > > > > -    public String relocate( String className )
> > > > > > > > +    public @NotNull String relocate( @NotNull String
> > className )
> > > > > > > >      {
> > > > > > > >          if ( relocation == null )
> > > > > > > >          {
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > > > > > > > l.java
> > > > > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > diff
> > > > > > > > --git
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /ScannerUtil.java
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > > > > > > ---
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /ScannerUtil.java +++
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > > > > > > >
> > > > > > > >  import org.apache.commons.lang3.StringUtils;
> > > > > > > >
> > > > > > > > +import javax.annotation.Nonnull;
> > > > > > > > +
> > > > > > > >  final class ScannerUtil {
> > > > > > > >
> > > > > > > >       private ScannerUtil() {}
> > > > > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > > > > > > >
> > > > > > > >      private static final String JAVA_CLASS_FILE_EXTENSION =
> > > > > ".class";
> > > > > > > >
> > > > > > > > -    public static String convertToJavaClassName( String
> test )
> > > > > > > > +    public static @Nonnull String convertToJavaClassName(
> > > @Nonnull
> > > > > > > String
> > > > > > > > test ) {
> > > > > > > >          return StringUtils.removeEnd( test, ".class"
> > ).replace(
> > > > FS,
> > > > > > "."
> > > > > > > );
> > > > > > > >      }
> > > > > > > >
> > > > > > > > -    public static String
> > convertJarFileResourceToJavaClassName(
> > > > > String
> > > > > > > test
> > > > > > > > ) +    public static @Nonnull String
> > > > > > > convertJarFileResourceToJavaClassName(
> > > > > > > > @Nonnull String test ) {
> > > > > > > >          return StringUtils.removeEnd( test, ".class"
> > ).replace(
> > > > "/",
> > > > > > > "." );
> > > > > > > > }
> > > > > > > >
> > > > > > > > -    public static String stripBaseDir( String basedir,
> String
> > > > test )
> > > > > > > > +    public static @Nonnull String stripBaseDir( String
> > basedir,
> > > > > String
> > > > > > > test
> > > > > > > > ) {
> > > > > > > >          return StringUtils.removeStart( test, basedir );
> > > > > > > >      }
> > > > > > > >
> > > > > > > > -    public static String[] processIncludesExcludes(
> > List<String>
> > > > > list
> > > > > > )
> > > > > > > > +    public static @Nonnull String[] processIncludesExcludes(
> > > > > @Nonnull
> > > > > > > > List<String> list ) {
> > > > > > > >          List<String> newList = new ArrayList<String>();
> > > > > > > >          for ( Object aList : list )
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > > > > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > > diff --git a/pom.xml b/pom.xml
> > > > > > > > index 677b367..c60f378 100644
> > > > > > > > --- a/pom.xml
> > > > > > > > +++ b/pom.xml
> > > > > > > > @@ -265,6 +265,12 @@
> > > > > > > >          <version>3.8.1</version>
> > > > > > > >          <scope>test</scope>
> > > > > > > >        </dependency>
> > > > > > > > +      <dependency>
> > > > > > > > +        <groupId>com.google.code.findbugs</groupId>
> > > > > > > > +        <artifactId>jsr305</artifactId>
> > > > > > > > +        <version>2.0.1</version>
> > > > > > > > +        <scope>provided</scope>
> > > > > > > > +      </dependency>
> > > > > > > >      </dependencies>
> > > > > > > >    </dependencyManagement>
> > > > > > > >    <dependencies>
> > > > > > >
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > > > > For additional commands, e-mail: dev-help@maven.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: git commit: Added jsr305 annotations

Posted by Kristian Rosenvold <kr...@gmail.com>.
Linking to one of your private git repos made this only marginally clearer;
I see the edu.umd in there though !



> So setting the dependency as "provided" is all well and good until you need
> to implement an interface with the annotation applied... at which point you
> need to add back in the "provided" dependency...
>
> But it's still only compile-time, right ? Why would that be a problem ?


Having the annotation available at RUNTIME does allow for additional
> validations, so that would favour JSR-305, but given that you need the
> dependency transitive for compilation there is scope for issues if JSR-305
> ever gets rebooted.
>

Give me this with a tiny spoon please; when would this be a problem ?





> On 8 May 2013 09:53, Kristian Rosenvold <kristian.rosenvold@gmail.com
> >wrote:
>
> > You mean there's an older set of findbugs annoations ?
> >
> > Kristian
> >
> >
> > 2013/5/8 Stephen Connolly <st...@gmail.com>
> >
> > > IntelliJ also supports the findbugs and jcip annotations too... but in
> > any
> > > case I will hold my piece... given that these annotations do not have
> > > parameters the risk is almost non-existant for *these* but I do think
> it
> > is
> > > a more general risk
> > >
> > >
> > > On 8 May 2013 09:06, Kristian Rosenvold <kristian.rosenvold@gmail.com
> > > >wrote:
> > >
> > > > I suspect like a lot of the rest of the community, they simply gave
> up
> > on
> > > > the jcp.
> > > >
> > > > I am no insider on the project but com.google.code.findbugs/jsr-305
> was
> > > > last published in a 2.0.1 version in july 2012, and
> > > > seems to be alive and kicking. IntelliJ also supports the annotations
> > > which
> > > > means we finally have /one/ set of annotations
> > > > that everybody understands.
> > > >
> > > > The value of both Nullable and Nonnull is just amazing once you get
> it
> > > all
> > > > in place.
> > > >
> > > > As for potential classloading issues, I'm sure /someone/ here would
> > know
> > > :)
> > > >
> > > > Kristian
> > > >
> > > >
> > > >
> > > >
> > > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> > > >
> > > > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr> wrote:
> > > > >
> > > > > > I like this: could we define it as the standard way to add such
> > > > > > annotations in
> > > > > > whole Maven components? Any problem if we do it in Maven core
> > itself?
> > > > > >
> > > > > > I'm not a JSR-305 expert, any basic explanation on the
> > > > > > com.google.code.findbugs:jsr305 choice is good to know
> > > > > >
> > > > >
> > > > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> > > > >
> > > > > In general I like those annotations, though I tend to favour the
> > > findbugs
> > > > > annotations and jcip annotations in code I write while awaiting
> > jsr305
> > > to
> > > > > finalize (given that the spec is dormant, feared dead:
> > > > > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of the
> > > spec
> > > > > may
> > > > > result in signature changes and as such, given that the annotations
> > are
> > > > > runtime retention, when annotations finally land in the JVM there
> may
> > > be
> > > > a
> > > > > risk from signature change...
> > > > >
> > > > > But that could be an irrational fear on my behalf...
> > > > >
> > > > > In any case I have clean room ASLv2 licensed versions of the
> findbugs
> > > and
> > > > > jcip annotations in my GitHub repo and published to central.
> > > > >
> > > > >
> > > > > > then we could add it to maven parent pom dependencyManagement
> > > section,
> > > > > and
> > > > > > write something into "Maven Developer Centre"
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > Hervé
> > > > > >
> > > > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > > > > > Updated Branches:
> > > > > > >   refs/heads/master 231773324 -> 7b330f584
> > > > > > >
> > > > > > >
> > > > > > > Added jsr305 annotations
> > > > > > >
> > > > > > >
> > > > > > > Project:
> > > http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > > > > > > Commit:
> > > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > > > > > >
> > > > >
> > >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > > > > >
> > > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > > > > > >
> > > > > > > Branch: refs/heads/master
> > > > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > > > > > Parents: 2317733
> > > > > > > Author: Kristian Rosenvold <kr...@apache.org>
> > > > > > > Authored: Tue May 7 18:49:15 2013 +0200
> > > > > > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > > > > > Committed: Tue May 7 18:49:15 2013 +0200
> > > > > > >
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > >  maven-surefire-common/pom.xml                      |    4 ++++
> > > > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7
> > +++++--
> > > > > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6
> ++++--
> > > > > > >  .../maven/plugin/surefire/CommonReflector.java     |    8
> > +++++---
> > > > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> > > > > > >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> > > > > > >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> > > > > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
> > > > ++++++++----
> > > > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10
> > > ++++++----
> > > > > > >  pom.xml                                            |    6
> ++++++
> > > > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > > refire-common/pom.xml
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > diff
> > > > > > > --git a/maven-surefire-common/pom.xml
> > > b/maven-surefire-common/pom.xml
> > > > > > index
> > > > > > > 1330eec..bed467b 100644
> > > > > > > --- a/maven-surefire-common/pom.xml
> > > > > > > +++ b/maven-surefire-common/pom.xml
> > > > > > > @@ -91,6 +91,10 @@
> > > > > > >        <artifactId>commons-lang3</artifactId>
> > > > > > >      </dependency>
> > > > > > >      <dependency>
> > > > > > > +      <groupId>com.google.code.findbugs</groupId>
> > > > > > > +      <artifactId>jsr305</artifactId>
> > > > > > > +    </dependency>
> > > > > > > +    <dependency>
> > > > > > >        <groupId>org.apache.maven.shared</groupId>
> > > > > > >        <artifactId>maven-common-artifact-filters</artifactId>
> > > > > > >        <version>1.3</version>
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > > > > > > eMojo.java
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > diff
> > > > > > > --git
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > > ractSurefireMojo.java
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > > > > > ---
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > > ractSurefireMojo.java +++
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > > > > > org.apache.maven.surefire.util.RunOrder;
> > > > > > >  import org.apache.maven.toolchain.Toolchain;
> > > > > > >  import org.apache.maven.toolchain.ToolchainManager;
> > > > > > >
> > > > > > > +import javax.annotation.Nonnull;
> > > > > > > +
> > > > > > >  /**
> > > > > > >   * Abstract base class for running tests using Surefire.
> > > > > > >   *
> > > > > > > @@ -1266,7 +1268,7 @@ public abstract class
> AbstractSurefireMojo
> > > > > > >          }
> > > > > > >      }
> > > > > > >
> > > > > > > -    private List<String> getExcludeList()
> > > > > > > +    private @Nonnull List<String> getExcludeList()
> > > > > > >      {
> > > > > > >          List<String> excludes = null;
> > > > > > >          if ( isSpecificTestSpecified() )
> > > > > > > @@ -1339,7 +1341,7 @@ public abstract class
> AbstractSurefireMojo
> > > > > > >          return filterNulls( includes );
> > > > > > >      }
> > > > > > >
> > > > > > > -    private List<String> filterNulls( List<String> toFilter )
> > > > > > > +    private @Nonnull List<String> filterNulls( @Nonnull
> > > List<String>
> > > > > > > toFilter ) {
> > > > > > >          List<String> result = new ArrayList<String>(
> > > toFilter.size()
> > > > > );
> > > > > > >          for ( String item : toFilter )
> > > > > > > @@ -2130,6 +2132,7 @@ public abstract class
> AbstractSurefireMojo
> > > > > > >              return new DynamicProviderInfo( providerName );
> > > > > > >          }
> > > > > > >
> > > > > > > +        @Nonnull
> > > > > > >          public String getProviderName()
> > > > > > >          {
> > > > > > >              return providerName;
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > > > > > > java
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > > > diff --git
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > > spathCache.java
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > > spathCache.java index 1bcb065..ea250c2 100644
> > > > > > > ---
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > > spathCache.java +++
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > > spathCache.java @@ -21,6 +21,8 @@ package
> > > > > > org.apache.maven.plugin.surefire;
> > > > > > >  import java.util.concurrent.ConcurrentHashMap;
> > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > > > >
> > > > > > > +import javax.annotation.Nonnull;
> > > > > > > +
> > > > > > >  /**
> > > > > > >   * @author Kristian Rosenvold
> > > > > > >   */
> > > > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > > > > > >      private static final ConcurrentHashMap<String, Classpath>
> > > > > > classpaths =
> > > > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > > > > > >
> > > > > > > -    public static Classpath getCachedClassPath( String
> > artifactId
> > > )
> > > > > > > +    public static Classpath getCachedClassPath( @Nonnull
> String
> > > > > > artifactId
> > > > > > > ) {
> > > > > > >          return classpaths.get( artifactId );
> > > > > > >      }
> > > > > > >
> > > > > > > -    public static void setCachedClasspath( String key,
> Classpath
> > > > > > classpath
> > > > > > > ) +    public static void setCachedClasspath( @Nonnull String
> > key,
> > > > > > @Nonnull
> > > > > > > Classpath classpath ) {
> > > > > > >          classpaths.put( key, classpath );
> > > > > > >      }
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > > > > > > .java
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > > > diff --git
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > > onReflector.java
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > > onReflector.java index 538b7e0..6851539 100644
> > > > > > > ---
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > > onReflector.java +++
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > > onReflector.java @@ -25,6 +25,8 @@ import
> > > > > > > org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
> > > > import
> > > > > > > org.apache.maven.surefire.util.ReflectionUtils;
> > > > > > >  import
> > org.apache.maven.surefire.util.SurefireReflectionException;
> > > > > > >
> > > > > > > +import javax.annotation.Nonnull;
> > > > > > > +
> > > > > > >  /**
> > > > > > >   * @author Kristian Rosenvold
> > > > > > >   */
> > > > > > > @@ -34,7 +36,7 @@ public class CommonReflector
> > > > > > >
> > > > > > >      private final ClassLoader surefireClassLoader;
> > > > > > >
> > > > > > > -    public CommonReflector( ClassLoader surefireClassLoader )
> > > > > > > +    public CommonReflector( @Nonnull ClassLoader
> > > > surefireClassLoader )
> > > > > > >      {
> > > > > > >          this.surefireClassLoader = surefireClassLoader;
> > > > > > >
> > > > > > > @@ -48,7 +50,7 @@ public class CommonReflector
> > > > > > >          }
> > > > > > >      }
> > > > > > >
> > > > > > > -    public Object createReportingReporterFactory(
> > > > > > > StartupReportConfiguration startupReportConfiguration ) +
> >  public
> > > > > > Object
> > > > > > > createReportingReporterFactory( @Nonnull
> > StartupReportConfiguration
> > > > > > > startupReportConfiguration ) {
> > > > > > >          Class<?>[] args = new Class[]{
> > > > this.startupReportConfiguration
> > > > > > };
> > > > > > >          Object src = createStartupReportConfiguration(
> > > > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > > > > > CommonReflector
> > > > > > >      }
> > > > > > >
> > > > > > >
> > > > > > > -    Object createStartupReportConfiguration(
> > > > > StartupReportConfiguration
> > > > > > > reporterConfiguration ) +    Object
> > > createStartupReportConfiguration(
> > > > > > > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> > > > > > >          Constructor<?> constructor =
> > > ReflectionUtils.getConstructor(
> > > > > > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > > > > > boolean.class,
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > > > > > > va
> > > > >
> > ----------------------------------------------------------------------
> > > > > > > diff --git
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > > iderInfo.java
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > > iderInfo.java index 57069d8..50de7ea 100644
> > > > > > > ---
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > > iderInfo.java +++
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > > iderInfo.java @@ -24,11 +24,14 @@ import
> > > > > > > org.apache.maven.artifact.resolver.ArtifactResolutionException;
> > > > import
> > > > > > > org.apache.maven.plugin.MojoExecutionException;
> > > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > > > >
> > > > > > > +import javax.annotation.Nonnull;
> > > > > > > +
> > > > > > >  /**
> > > > > > >   * @author Kristian Rosenvold
> > > > > > >   */
> > > > > > >  public interface ProviderInfo
> > > > > > >  {
> > > > > > > +    @Nonnull
> > > > > > >      String getProviderName();
> > > > > > >
> > > > > > >      boolean isApplicable();
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > > > > > > rkConfiguration.java
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > diff
> > > > > > > --git
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > > erclient/ForkConfiguration.java
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > > > > > > ---
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > > erclient/ForkConfiguration.java +++
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public
> class
> > > > > > > ForkConfiguration
> > > > > > >
> > > > > > >      /**
> > > > > > >       * @param classPath            cla the classpath arguments
> > > > > > > -     * @param startupConfiguration
> > > > > > > +     * @param startupConfiguration The startup configuration
> > > > > > >       * @param threadNumber         the thread number, to be
> the
> > > > > > replacement
> > > > > > > in the argLine   @return A commandline * @throws
> > > > > > > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > > > > > > when unable to perform the fork
> > > > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > > > > > >       * for all classpath elements.
> > > > > > >       *
> > > > > > >       * @param classPath      List&lt;String> of all classpath
> > > > > elements.
> > > > > > > -     * @param startClassName
> > > > > > > +     * @param startClassName  The classname to start
> > (main-class)
> > > > > > >       * @return The file pointint to the jar
> > > > > > >       * @throws java.io.IOException When a file operation
> fails.
> > > > > > >       */
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > > > > > > Scanner.java
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > diff
> > > > > > > --git
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /DependencyScanner.java
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > > > > > ---
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /DependencyScanner.java +++
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > > > > > org.apache.maven.plugin.MojoExecutionException; import
> > > > > > > org.apache.maven.shared.utils.io.MatchPatterns;
> > > > > > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > > > > > >
> > > > > > > +import javax.annotation.Nullable;
> > > > > > > +
> > > > > > >  /**
> > > > > > >   * Scans dependencies looking for tests.
> > > > > > >   *
> > > > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > > > > > >
> > > > > > >               private SpecificFileFilter specificTestFilter;
> > > > > > >
> > > > > > > -             public Matcher(List<String> includes,
> List<String>
> > > > > > excludes,
> > > > > > List<String>
> > > > > > > specificTests) +              public Matcher(@Nullable
> > List<String>
> > > > > > includes,
> > > > > > @Nullable
> > > > > > > List<String> excludes, @Nullable List<String> specificTests) {
> > > > > > >                       String[] specific = specificTests ==
> null ?
> > > new
> > > > > > String[0] :
> > > > > > > processIncludesExcludes( specificTests ); specificTestFilter =
> > new
> > > > > > > SpecificFileFilter( specific );
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > > > > > > java
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > > > diff --git
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /Relocator.java
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /Relocator.java index 31dde5d..76da9de 100644
> > > > > > > ---
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /Relocator.java +++
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > > > > > org.apache.maven.plugin.surefire.util;
> > > > > > >   * under the License.
> > > > > > >   */
> > > > > > >
> > > > > > > +import com.sun.istack.internal.NotNull;
> > > > > > > +
> > > > > > > +import javax.annotation.Nullable;
> > > > > > > +
> > > > > > >  /**
> > > > > > >   * Relocates class names when running with relocated provider
> > > > > > >   *
> > > > > > > @@ -26,12 +30,12 @@ package
> > org.apache.maven.plugin.surefire.util;
> > > > > > >   */
> > > > > > >  public class Relocator
> > > > > > >  {
> > > > > > > -    private final String relocation;
> > > > > > > +    private final @Nullable String relocation;
> > > > > > >
> > > > > > >      private static final String relocationBase =
> > > > > > > "org.apache.maven.surefire.";
> > > > > > >
> > > > > > >
> > > > > > > -    public Relocator( String relocation )
> > > > > > > +    public Relocator( @Nullable String relocation )
> > > > > > >      {
> > > > > > >          this.relocation = relocation;
> > > > > > >      }
> > > > > > > @@ -41,12 +45,12 @@ public class Relocator
> > > > > > >          relocation = "shadefire";
> > > > > > >      }
> > > > > > >
> > > > > > > -    private String getRelocation()
> > > > > > > +    private @Nullable String getRelocation()
> > > > > > >      {
> > > > > > >          return relocation;
> > > > > > >      }
> > > > > > >
> > > > > > > -    public String relocate( String className )
> > > > > > > +    public @NotNull String relocate( @NotNull String
> className )
> > > > > > >      {
> > > > > > >          if ( relocation == null )
> > > > > > >          {
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > > > > > > l.java
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > diff
> > > > > > > --git
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /ScannerUtil.java
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > > > > > ---
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /ScannerUtil.java +++
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > > > > > >
> > > > > > >  import org.apache.commons.lang3.StringUtils;
> > > > > > >
> > > > > > > +import javax.annotation.Nonnull;
> > > > > > > +
> > > > > > >  final class ScannerUtil {
> > > > > > >
> > > > > > >       private ScannerUtil() {}
> > > > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > > > > > >
> > > > > > >      private static final String JAVA_CLASS_FILE_EXTENSION =
> > > > ".class";
> > > > > > >
> > > > > > > -    public static String convertToJavaClassName( String test )
> > > > > > > +    public static @Nonnull String convertToJavaClassName(
> > @Nonnull
> > > > > > String
> > > > > > > test ) {
> > > > > > >          return StringUtils.removeEnd( test, ".class"
> ).replace(
> > > FS,
> > > > > "."
> > > > > > );
> > > > > > >      }
> > > > > > >
> > > > > > > -    public static String
> convertJarFileResourceToJavaClassName(
> > > > String
> > > > > > test
> > > > > > > ) +    public static @Nonnull String
> > > > > > convertJarFileResourceToJavaClassName(
> > > > > > > @Nonnull String test ) {
> > > > > > >          return StringUtils.removeEnd( test, ".class"
> ).replace(
> > > "/",
> > > > > > "." );
> > > > > > > }
> > > > > > >
> > > > > > > -    public static String stripBaseDir( String basedir, String
> > > test )
> > > > > > > +    public static @Nonnull String stripBaseDir( String
> basedir,
> > > > String
> > > > > > test
> > > > > > > ) {
> > > > > > >          return StringUtils.removeStart( test, basedir );
> > > > > > >      }
> > > > > > >
> > > > > > > -    public static String[] processIncludesExcludes(
> List<String>
> > > > list
> > > > > )
> > > > > > > +    public static @Nonnull String[] processIncludesExcludes(
> > > > @Nonnull
> > > > > > > List<String> list ) {
> > > > > > >          List<String> newList = new ArrayList<String>();
> > > > > > >          for ( Object aList : list )
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > > > > > >
> > > >
> ----------------------------------------------------------------------
> > > > > > > diff --git a/pom.xml b/pom.xml
> > > > > > > index 677b367..c60f378 100644
> > > > > > > --- a/pom.xml
> > > > > > > +++ b/pom.xml
> > > > > > > @@ -265,6 +265,12 @@
> > > > > > >          <version>3.8.1</version>
> > > > > > >          <scope>test</scope>
> > > > > > >        </dependency>
> > > > > > > +      <dependency>
> > > > > > > +        <groupId>com.google.code.findbugs</groupId>
> > > > > > > +        <artifactId>jsr305</artifactId>
> > > > > > > +        <version>2.0.1</version>
> > > > > > > +        <scope>provided</scope>
> > > > > > > +      </dependency>
> > > > > > >      </dependencies>
> > > > > > >    </dependencyManagement>
> > > > > > >    <dependencies>
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > > > For additional commands, e-mail: dev-help@maven.apache.org
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
https://github.com/stephenc/findbugs-annotations which has the following
annotations:

https://github.com/stephenc/findbugs-annotations/blob/master/src/main/java/edu/umd/cs/findbugs/annotations/NonNull.java
https://github.com/stephenc/findbugs-annotations/blob/master/src/main/java/edu/umd/cs/findbugs/annotations/Nullable.java

Among others.

Main difference is that the annotation retention is CLASS not RUNTIME...

IntelliJ respects both sets of annotations. The RUNTIME retention on the
JSR-305 has some advantages, but the critical issue from my PoV is that
both CLASS and RUNTIME are annotations that are *required at compile time*
if you extend or implement an interface.

So setting the dependency as "provided" is all well and good until you need
to implement an interface with the annotation applied... at which point you
need to add back in the "provided" dependency...

Having the annotation available at RUNTIME does allow for additional
validations, so that would favour JSR-305, but given that you need the
dependency transitive for compilation there is scope for issues if JSR-305
ever gets rebooted.

On 8 May 2013 09:53, Kristian Rosenvold <kr...@gmail.com>wrote:

> You mean there's an older set of findbugs annoations ?
>
> Kristian
>
>
> 2013/5/8 Stephen Connolly <st...@gmail.com>
>
> > IntelliJ also supports the findbugs and jcip annotations too... but in
> any
> > case I will hold my piece... given that these annotations do not have
> > parameters the risk is almost non-existant for *these* but I do think it
> is
> > a more general risk
> >
> >
> > On 8 May 2013 09:06, Kristian Rosenvold <kristian.rosenvold@gmail.com
> > >wrote:
> >
> > > I suspect like a lot of the rest of the community, they simply gave up
> on
> > > the jcp.
> > >
> > > I am no insider on the project but com.google.code.findbugs/jsr-305 was
> > > last published in a 2.0.1 version in july 2012, and
> > > seems to be alive and kicking. IntelliJ also supports the annotations
> > which
> > > means we finally have /one/ set of annotations
> > > that everybody understands.
> > >
> > > The value of both Nullable and Nonnull is just amazing once you get it
> > all
> > > in place.
> > >
> > > As for potential classloading issues, I'm sure /someone/ here would
> know
> > :)
> > >
> > > Kristian
> > >
> > >
> > >
> > >
> > > 2013/5/8 Stephen Connolly <st...@gmail.com>
> > >
> > > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr> wrote:
> > > >
> > > > > I like this: could we define it as the standard way to add such
> > > > > annotations in
> > > > > whole Maven components? Any problem if we do it in Maven core
> itself?
> > > > >
> > > > > I'm not a JSR-305 expert, any basic explanation on the
> > > > > com.google.code.findbugs:jsr305 choice is good to know
> > > > >
> > > >
> > > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> > > >
> > > > In general I like those annotations, though I tend to favour the
> > findbugs
> > > > annotations and jcip annotations in code I write while awaiting
> jsr305
> > to
> > > > finalize (given that the spec is dormant, feared dead:
> > > > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of the
> > spec
> > > > may
> > > > result in signature changes and as such, given that the annotations
> are
> > > > runtime retention, when annotations finally land in the JVM there may
> > be
> > > a
> > > > risk from signature change...
> > > >
> > > > But that could be an irrational fear on my behalf...
> > > >
> > > > In any case I have clean room ASLv2 licensed versions of the findbugs
> > and
> > > > jcip annotations in my GitHub repo and published to central.
> > > >
> > > >
> > > > > then we could add it to maven parent pom dependencyManagement
> > section,
> > > > and
> > > > > write something into "Maven Developer Centre"
> > > > >
> > > > > Regards,
> > > > >
> > > > > Hervé
> > > > >
> > > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > > > > Updated Branches:
> > > > > >   refs/heads/master 231773324 -> 7b330f584
> > > > > >
> > > > > >
> > > > > > Added jsr305 annotations
> > > > > >
> > > > > >
> > > > > > Project:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > > > > > Commit:
> > > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > > > > >
> > > >
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > > > >
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > > > > >
> > > > > > Branch: refs/heads/master
> > > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > > > > Parents: 2317733
> > > > > > Author: Kristian Rosenvold <kr...@apache.org>
> > > > > > Authored: Tue May 7 18:49:15 2013 +0200
> > > > > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > > > > Committed: Tue May 7 18:49:15 2013 +0200
> > > > > >
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > >  maven-surefire-common/pom.xml                      |    4 ++++
> > > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7
> +++++--
> > > > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
> > > > > >  .../maven/plugin/surefire/CommonReflector.java     |    8
> +++++---
> > > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> > > > > >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> > > > > >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> > > > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
> > > ++++++++----
> > > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10
> > ++++++----
> > > > > >  pom.xml                                            |    6 ++++++
> > > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > > refire-common/pom.xml
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > diff
> > > > > > --git a/maven-surefire-common/pom.xml
> > b/maven-surefire-common/pom.xml
> > > > > index
> > > > > > 1330eec..bed467b 100644
> > > > > > --- a/maven-surefire-common/pom.xml
> > > > > > +++ b/maven-surefire-common/pom.xml
> > > > > > @@ -91,6 +91,10 @@
> > > > > >        <artifactId>commons-lang3</artifactId>
> > > > > >      </dependency>
> > > > > >      <dependency>
> > > > > > +      <groupId>com.google.code.findbugs</groupId>
> > > > > > +      <artifactId>jsr305</artifactId>
> > > > > > +    </dependency>
> > > > > > +    <dependency>
> > > > > >        <groupId>org.apache.maven.shared</groupId>
> > > > > >        <artifactId>maven-common-artifact-filters</artifactId>
> > > > > >        <version>1.3</version>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > > > > > eMojo.java
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > diff
> > > > > > --git
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > ractSurefireMojo.java
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > > > > ---
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > ractSurefireMojo.java +++
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > > > > org.apache.maven.surefire.util.RunOrder;
> > > > > >  import org.apache.maven.toolchain.Toolchain;
> > > > > >  import org.apache.maven.toolchain.ToolchainManager;
> > > > > >
> > > > > > +import javax.annotation.Nonnull;
> > > > > > +
> > > > > >  /**
> > > > > >   * Abstract base class for running tests using Surefire.
> > > > > >   *
> > > > > > @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
> > > > > >          }
> > > > > >      }
> > > > > >
> > > > > > -    private List<String> getExcludeList()
> > > > > > +    private @Nonnull List<String> getExcludeList()
> > > > > >      {
> > > > > >          List<String> excludes = null;
> > > > > >          if ( isSpecificTestSpecified() )
> > > > > > @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
> > > > > >          return filterNulls( includes );
> > > > > >      }
> > > > > >
> > > > > > -    private List<String> filterNulls( List<String> toFilter )
> > > > > > +    private @Nonnull List<String> filterNulls( @Nonnull
> > List<String>
> > > > > > toFilter ) {
> > > > > >          List<String> result = new ArrayList<String>(
> > toFilter.size()
> > > > );
> > > > > >          for ( String item : toFilter )
> > > > > > @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
> > > > > >              return new DynamicProviderInfo( providerName );
> > > > > >          }
> > > > > >
> > > > > > +        @Nonnull
> > > > > >          public String getProviderName()
> > > > > >          {
> > > > > >              return providerName;
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > > > > > java
> > > > >
> > ----------------------------------------------------------------------
> > > > > > diff --git
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > spathCache.java
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > spathCache.java index 1bcb065..ea250c2 100644
> > > > > > ---
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > spathCache.java +++
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > > spathCache.java @@ -21,6 +21,8 @@ package
> > > > > org.apache.maven.plugin.surefire;
> > > > > >  import java.util.concurrent.ConcurrentHashMap;
> > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > > >
> > > > > > +import javax.annotation.Nonnull;
> > > > > > +
> > > > > >  /**
> > > > > >   * @author Kristian Rosenvold
> > > > > >   */
> > > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > > > > >      private static final ConcurrentHashMap<String, Classpath>
> > > > > classpaths =
> > > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > > > > >
> > > > > > -    public static Classpath getCachedClassPath( String
> artifactId
> > )
> > > > > > +    public static Classpath getCachedClassPath( @Nonnull String
> > > > > artifactId
> > > > > > ) {
> > > > > >          return classpaths.get( artifactId );
> > > > > >      }
> > > > > >
> > > > > > -    public static void setCachedClasspath( String key, Classpath
> > > > > classpath
> > > > > > ) +    public static void setCachedClasspath( @Nonnull String
> key,
> > > > > @Nonnull
> > > > > > Classpath classpath ) {
> > > > > >          classpaths.put( key, classpath );
> > > > > >      }
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > > > > > .java
> > > > >
> > ----------------------------------------------------------------------
> > > > > > diff --git
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > onReflector.java
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > onReflector.java index 538b7e0..6851539 100644
> > > > > > ---
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > onReflector.java +++
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > > onReflector.java @@ -25,6 +25,8 @@ import
> > > > > > org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
> > > import
> > > > > > org.apache.maven.surefire.util.ReflectionUtils;
> > > > > >  import
> org.apache.maven.surefire.util.SurefireReflectionException;
> > > > > >
> > > > > > +import javax.annotation.Nonnull;
> > > > > > +
> > > > > >  /**
> > > > > >   * @author Kristian Rosenvold
> > > > > >   */
> > > > > > @@ -34,7 +36,7 @@ public class CommonReflector
> > > > > >
> > > > > >      private final ClassLoader surefireClassLoader;
> > > > > >
> > > > > > -    public CommonReflector( ClassLoader surefireClassLoader )
> > > > > > +    public CommonReflector( @Nonnull ClassLoader
> > > surefireClassLoader )
> > > > > >      {
> > > > > >          this.surefireClassLoader = surefireClassLoader;
> > > > > >
> > > > > > @@ -48,7 +50,7 @@ public class CommonReflector
> > > > > >          }
> > > > > >      }
> > > > > >
> > > > > > -    public Object createReportingReporterFactory(
> > > > > > StartupReportConfiguration startupReportConfiguration ) +
>  public
> > > > > Object
> > > > > > createReportingReporterFactory( @Nonnull
> StartupReportConfiguration
> > > > > > startupReportConfiguration ) {
> > > > > >          Class<?>[] args = new Class[]{
> > > this.startupReportConfiguration
> > > > > };
> > > > > >          Object src = createStartupReportConfiguration(
> > > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > > > > CommonReflector
> > > > > >      }
> > > > > >
> > > > > >
> > > > > > -    Object createStartupReportConfiguration(
> > > > StartupReportConfiguration
> > > > > > reporterConfiguration ) +    Object
> > createStartupReportConfiguration(
> > > > > > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> > > > > >          Constructor<?> constructor =
> > ReflectionUtils.getConstructor(
> > > > > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > > > > boolean.class,
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > > > > > va
> > > >
> ----------------------------------------------------------------------
> > > > > > diff --git
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > iderInfo.java
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > iderInfo.java index 57069d8..50de7ea 100644
> > > > > > ---
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > iderInfo.java +++
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > > iderInfo.java @@ -24,11 +24,14 @@ import
> > > > > > org.apache.maven.artifact.resolver.ArtifactResolutionException;
> > > import
> > > > > > org.apache.maven.plugin.MojoExecutionException;
> > > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > > >
> > > > > > +import javax.annotation.Nonnull;
> > > > > > +
> > > > > >  /**
> > > > > >   * @author Kristian Rosenvold
> > > > > >   */
> > > > > >  public interface ProviderInfo
> > > > > >  {
> > > > > > +    @Nonnull
> > > > > >      String getProviderName();
> > > > > >
> > > > > >      boolean isApplicable();
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > > > > > rkConfiguration.java
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > diff
> > > > > > --git
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > erclient/ForkConfiguration.java
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > > > > > ---
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > erclient/ForkConfiguration.java +++
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> > > > > > ForkConfiguration
> > > > > >
> > > > > >      /**
> > > > > >       * @param classPath            cla the classpath arguments
> > > > > > -     * @param startupConfiguration
> > > > > > +     * @param startupConfiguration The startup configuration
> > > > > >       * @param threadNumber         the thread number, to be the
> > > > > replacement
> > > > > > in the argLine   @return A commandline * @throws
> > > > > > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > > > > > when unable to perform the fork
> > > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > > > > >       * for all classpath elements.
> > > > > >       *
> > > > > >       * @param classPath      List&lt;String> of all classpath
> > > > elements.
> > > > > > -     * @param startClassName
> > > > > > +     * @param startClassName  The classname to start
> (main-class)
> > > > > >       * @return The file pointint to the jar
> > > > > >       * @throws java.io.IOException When a file operation fails.
> > > > > >       */
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > > > > > Scanner.java
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > diff
> > > > > > --git
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /DependencyScanner.java
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > > > > ---
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /DependencyScanner.java +++
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > > > > org.apache.maven.plugin.MojoExecutionException; import
> > > > > > org.apache.maven.shared.utils.io.MatchPatterns;
> > > > > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > > > > >
> > > > > > +import javax.annotation.Nullable;
> > > > > > +
> > > > > >  /**
> > > > > >   * Scans dependencies looking for tests.
> > > > > >   *
> > > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > > > > >
> > > > > >               private SpecificFileFilter specificTestFilter;
> > > > > >
> > > > > > -             public Matcher(List<String> includes, List<String>
> > > > > excludes,
> > > > > List<String>
> > > > > > specificTests) +              public Matcher(@Nullable
> List<String>
> > > > > includes,
> > > > > @Nullable
> > > > > > List<String> excludes, @Nullable List<String> specificTests) {
> > > > > >                       String[] specific = specificTests == null ?
> > new
> > > > > String[0] :
> > > > > > processIncludesExcludes( specificTests ); specificTestFilter =
> new
> > > > > > SpecificFileFilter( specific );
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > > > > > java
> > > > >
> > ----------------------------------------------------------------------
> > > > > > diff --git
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /Relocator.java
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /Relocator.java index 31dde5d..76da9de 100644
> > > > > > ---
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /Relocator.java +++
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > > > > org.apache.maven.plugin.surefire.util;
> > > > > >   * under the License.
> > > > > >   */
> > > > > >
> > > > > > +import com.sun.istack.internal.NotNull;
> > > > > > +
> > > > > > +import javax.annotation.Nullable;
> > > > > > +
> > > > > >  /**
> > > > > >   * Relocates class names when running with relocated provider
> > > > > >   *
> > > > > > @@ -26,12 +30,12 @@ package
> org.apache.maven.plugin.surefire.util;
> > > > > >   */
> > > > > >  public class Relocator
> > > > > >  {
> > > > > > -    private final String relocation;
> > > > > > +    private final @Nullable String relocation;
> > > > > >
> > > > > >      private static final String relocationBase =
> > > > > > "org.apache.maven.surefire.";
> > > > > >
> > > > > >
> > > > > > -    public Relocator( String relocation )
> > > > > > +    public Relocator( @Nullable String relocation )
> > > > > >      {
> > > > > >          this.relocation = relocation;
> > > > > >      }
> > > > > > @@ -41,12 +45,12 @@ public class Relocator
> > > > > >          relocation = "shadefire";
> > > > > >      }
> > > > > >
> > > > > > -    private String getRelocation()
> > > > > > +    private @Nullable String getRelocation()
> > > > > >      {
> > > > > >          return relocation;
> > > > > >      }
> > > > > >
> > > > > > -    public String relocate( String className )
> > > > > > +    public @NotNull String relocate( @NotNull String className )
> > > > > >      {
> > > > > >          if ( relocation == null )
> > > > > >          {
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > >
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > > > > > l.java
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > diff
> > > > > > --git
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /ScannerUtil.java
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > > > > ---
> > > > > >
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /ScannerUtil.java +++
> > > > > >
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > > > > >
> > > > > >  import org.apache.commons.lang3.StringUtils;
> > > > > >
> > > > > > +import javax.annotation.Nonnull;
> > > > > > +
> > > > > >  final class ScannerUtil {
> > > > > >
> > > > > >       private ScannerUtil() {}
> > > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > > > > >
> > > > > >      private static final String JAVA_CLASS_FILE_EXTENSION =
> > > ".class";
> > > > > >
> > > > > > -    public static String convertToJavaClassName( String test )
> > > > > > +    public static @Nonnull String convertToJavaClassName(
> @Nonnull
> > > > > String
> > > > > > test ) {
> > > > > >          return StringUtils.removeEnd( test, ".class" ).replace(
> > FS,
> > > > "."
> > > > > );
> > > > > >      }
> > > > > >
> > > > > > -    public static String convertJarFileResourceToJavaClassName(
> > > String
> > > > > test
> > > > > > ) +    public static @Nonnull String
> > > > > convertJarFileResourceToJavaClassName(
> > > > > > @Nonnull String test ) {
> > > > > >          return StringUtils.removeEnd( test, ".class" ).replace(
> > "/",
> > > > > "." );
> > > > > > }
> > > > > >
> > > > > > -    public static String stripBaseDir( String basedir, String
> > test )
> > > > > > +    public static @Nonnull String stripBaseDir( String basedir,
> > > String
> > > > > test
> > > > > > ) {
> > > > > >          return StringUtils.removeStart( test, basedir );
> > > > > >      }
> > > > > >
> > > > > > -    public static String[] processIncludesExcludes( List<String>
> > > list
> > > > )
> > > > > > +    public static @Nonnull String[] processIncludesExcludes(
> > > @Nonnull
> > > > > > List<String> list ) {
> > > > > >          List<String> newList = new ArrayList<String>();
> > > > > >          for ( Object aList : list )
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > > > > >
> > > ----------------------------------------------------------------------
> > > > > > diff --git a/pom.xml b/pom.xml
> > > > > > index 677b367..c60f378 100644
> > > > > > --- a/pom.xml
> > > > > > +++ b/pom.xml
> > > > > > @@ -265,6 +265,12 @@
> > > > > >          <version>3.8.1</version>
> > > > > >          <scope>test</scope>
> > > > > >        </dependency>
> > > > > > +      <dependency>
> > > > > > +        <groupId>com.google.code.findbugs</groupId>
> > > > > > +        <artifactId>jsr305</artifactId>
> > > > > > +        <version>2.0.1</version>
> > > > > > +        <scope>provided</scope>
> > > > > > +      </dependency>
> > > > > >      </dependencies>
> > > > > >    </dependencyManagement>
> > > > > >    <dependencies>
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: dev-help@maven.apache.org
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: git commit: Added jsr305 annotations

Posted by Kristian Rosenvold <kr...@gmail.com>.
You mean there's an older set of findbugs annoations ?

Kristian


2013/5/8 Stephen Connolly <st...@gmail.com>

> IntelliJ also supports the findbugs and jcip annotations too... but in any
> case I will hold my piece... given that these annotations do not have
> parameters the risk is almost non-existant for *these* but I do think it is
> a more general risk
>
>
> On 8 May 2013 09:06, Kristian Rosenvold <kristian.rosenvold@gmail.com
> >wrote:
>
> > I suspect like a lot of the rest of the community, they simply gave up on
> > the jcp.
> >
> > I am no insider on the project but com.google.code.findbugs/jsr-305 was
> > last published in a 2.0.1 version in july 2012, and
> > seems to be alive and kicking. IntelliJ also supports the annotations
> which
> > means we finally have /one/ set of annotations
> > that everybody understands.
> >
> > The value of both Nullable and Nonnull is just amazing once you get it
> all
> > in place.
> >
> > As for potential classloading issues, I'm sure /someone/ here would know
> :)
> >
> > Kristian
> >
> >
> >
> >
> > 2013/5/8 Stephen Connolly <st...@gmail.com>
> >
> > > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr> wrote:
> > >
> > > > I like this: could we define it as the standard way to add such
> > > > annotations in
> > > > whole Maven components? Any problem if we do it in Maven core itself?
> > > >
> > > > I'm not a JSR-305 expert, any basic explanation on the
> > > > com.google.code.findbugs:jsr305 choice is good to know
> > > >
> > >
> > > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> > >
> > > In general I like those annotations, though I tend to favour the
> findbugs
> > > annotations and jcip annotations in code I write while awaiting jsr305
> to
> > > finalize (given that the spec is dormant, feared dead:
> > > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of the
> spec
> > > may
> > > result in signature changes and as such, given that the annotations are
> > > runtime retention, when annotations finally land in the JVM there may
> be
> > a
> > > risk from signature change...
> > >
> > > But that could be an irrational fear on my behalf...
> > >
> > > In any case I have clean room ASLv2 licensed versions of the findbugs
> and
> > > jcip annotations in my GitHub repo and published to central.
> > >
> > >
> > > > then we could add it to maven parent pom dependencyManagement
> section,
> > > and
> > > > write something into "Maven Developer Centre"
> > > >
> > > > Regards,
> > > >
> > > > Hervé
> > > >
> > > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > > > Updated Branches:
> > > > >   refs/heads/master 231773324 -> 7b330f584
> > > > >
> > > > >
> > > > > Added jsr305 annotations
> > > > >
> > > > >
> > > > > Project:
> http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > > > > Commit:
> > > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > > > >
> > >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > > >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > > > >
> > > > > Branch: refs/heads/master
> > > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > > > Parents: 2317733
> > > > > Author: Kristian Rosenvold <kr...@apache.org>
> > > > > Authored: Tue May 7 18:49:15 2013 +0200
> > > > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > > > Committed: Tue May 7 18:49:15 2013 +0200
> > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > >  maven-surefire-common/pom.xml                      |    4 ++++
> > > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7 +++++--
> > > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
> > > > >  .../maven/plugin/surefire/CommonReflector.java     |    8 +++++---
> > > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> > > > >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> > > > >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> > > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
> > ++++++++----
> > > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10
> ++++++----
> > > > >  pom.xml                                            |    6 ++++++
> > > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > > >
> > ----------------------------------------------------------------------
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > > refire-common/pom.xml
> > > > >
> > ----------------------------------------------------------------------
> > > > diff
> > > > > --git a/maven-surefire-common/pom.xml
> b/maven-surefire-common/pom.xml
> > > > index
> > > > > 1330eec..bed467b 100644
> > > > > --- a/maven-surefire-common/pom.xml
> > > > > +++ b/maven-surefire-common/pom.xml
> > > > > @@ -91,6 +91,10 @@
> > > > >        <artifactId>commons-lang3</artifactId>
> > > > >      </dependency>
> > > > >      <dependency>
> > > > > +      <groupId>com.google.code.findbugs</groupId>
> > > > > +      <artifactId>jsr305</artifactId>
> > > > > +    </dependency>
> > > > > +    <dependency>
> > > > >        <groupId>org.apache.maven.shared</groupId>
> > > > >        <artifactId>maven-common-artifact-filters</artifactId>
> > > > >        <version>1.3</version>
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > > > > eMojo.java
> > > > >
> > ----------------------------------------------------------------------
> > > > diff
> > > > > --git
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > ractSurefireMojo.java
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > ractSurefireMojo.java +++
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > > > org.apache.maven.surefire.util.RunOrder;
> > > > >  import org.apache.maven.toolchain.Toolchain;
> > > > >  import org.apache.maven.toolchain.ToolchainManager;
> > > > >
> > > > > +import javax.annotation.Nonnull;
> > > > > +
> > > > >  /**
> > > > >   * Abstract base class for running tests using Surefire.
> > > > >   *
> > > > > @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
> > > > >          }
> > > > >      }
> > > > >
> > > > > -    private List<String> getExcludeList()
> > > > > +    private @Nonnull List<String> getExcludeList()
> > > > >      {
> > > > >          List<String> excludes = null;
> > > > >          if ( isSpecificTestSpecified() )
> > > > > @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
> > > > >          return filterNulls( includes );
> > > > >      }
> > > > >
> > > > > -    private List<String> filterNulls( List<String> toFilter )
> > > > > +    private @Nonnull List<String> filterNulls( @Nonnull
> List<String>
> > > > > toFilter ) {
> > > > >          List<String> result = new ArrayList<String>(
> toFilter.size()
> > > );
> > > > >          for ( String item : toFilter )
> > > > > @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
> > > > >              return new DynamicProviderInfo( providerName );
> > > > >          }
> > > > >
> > > > > +        @Nonnull
> > > > >          public String getProviderName()
> > > > >          {
> > > > >              return providerName;
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > > > > java
> > > >
> ----------------------------------------------------------------------
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > spathCache.java
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > spathCache.java index 1bcb065..ea250c2 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > spathCache.java +++
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > > spathCache.java @@ -21,6 +21,8 @@ package
> > > > org.apache.maven.plugin.surefire;
> > > > >  import java.util.concurrent.ConcurrentHashMap;
> > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > >
> > > > > +import javax.annotation.Nonnull;
> > > > > +
> > > > >  /**
> > > > >   * @author Kristian Rosenvold
> > > > >   */
> > > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > > > >      private static final ConcurrentHashMap<String, Classpath>
> > > > classpaths =
> > > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > > > >
> > > > > -    public static Classpath getCachedClassPath( String artifactId
> )
> > > > > +    public static Classpath getCachedClassPath( @Nonnull String
> > > > artifactId
> > > > > ) {
> > > > >          return classpaths.get( artifactId );
> > > > >      }
> > > > >
> > > > > -    public static void setCachedClasspath( String key, Classpath
> > > > classpath
> > > > > ) +    public static void setCachedClasspath( @Nonnull String key,
> > > > @Nonnull
> > > > > Classpath classpath ) {
> > > > >          classpaths.put( key, classpath );
> > > > >      }
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > > > > .java
> > > >
> ----------------------------------------------------------------------
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > onReflector.java
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > onReflector.java index 538b7e0..6851539 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > onReflector.java +++
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > > onReflector.java @@ -25,6 +25,8 @@ import
> > > > > org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
> > import
> > > > > org.apache.maven.surefire.util.ReflectionUtils;
> > > > >  import org.apache.maven.surefire.util.SurefireReflectionException;
> > > > >
> > > > > +import javax.annotation.Nonnull;
> > > > > +
> > > > >  /**
> > > > >   * @author Kristian Rosenvold
> > > > >   */
> > > > > @@ -34,7 +36,7 @@ public class CommonReflector
> > > > >
> > > > >      private final ClassLoader surefireClassLoader;
> > > > >
> > > > > -    public CommonReflector( ClassLoader surefireClassLoader )
> > > > > +    public CommonReflector( @Nonnull ClassLoader
> > surefireClassLoader )
> > > > >      {
> > > > >          this.surefireClassLoader = surefireClassLoader;
> > > > >
> > > > > @@ -48,7 +50,7 @@ public class CommonReflector
> > > > >          }
> > > > >      }
> > > > >
> > > > > -    public Object createReportingReporterFactory(
> > > > > StartupReportConfiguration startupReportConfiguration ) +    public
> > > > Object
> > > > > createReportingReporterFactory( @Nonnull StartupReportConfiguration
> > > > > startupReportConfiguration ) {
> > > > >          Class<?>[] args = new Class[]{
> > this.startupReportConfiguration
> > > > };
> > > > >          Object src = createStartupReportConfiguration(
> > > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > > > CommonReflector
> > > > >      }
> > > > >
> > > > >
> > > > > -    Object createStartupReportConfiguration(
> > > StartupReportConfiguration
> > > > > reporterConfiguration ) +    Object
> createStartupReportConfiguration(
> > > > > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> > > > >          Constructor<?> constructor =
> ReflectionUtils.getConstructor(
> > > > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > > > boolean.class,
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > > > > va
> > > ----------------------------------------------------------------------
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > iderInfo.java
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > iderInfo.java index 57069d8..50de7ea 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > iderInfo.java +++
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > > iderInfo.java @@ -24,11 +24,14 @@ import
> > > > > org.apache.maven.artifact.resolver.ArtifactResolutionException;
> > import
> > > > > org.apache.maven.plugin.MojoExecutionException;
> > > > >  import org.apache.maven.surefire.booter.Classpath;
> > > > >
> > > > > +import javax.annotation.Nonnull;
> > > > > +
> > > > >  /**
> > > > >   * @author Kristian Rosenvold
> > > > >   */
> > > > >  public interface ProviderInfo
> > > > >  {
> > > > > +    @Nonnull
> > > > >      String getProviderName();
> > > > >
> > > > >      boolean isApplicable();
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > > > > rkConfiguration.java
> > > > >
> > ----------------------------------------------------------------------
> > > > diff
> > > > > --git
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > erclient/ForkConfiguration.java
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > erclient/ForkConfiguration.java +++
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> > > > > ForkConfiguration
> > > > >
> > > > >      /**
> > > > >       * @param classPath            cla the classpath arguments
> > > > > -     * @param startupConfiguration
> > > > > +     * @param startupConfiguration The startup configuration
> > > > >       * @param threadNumber         the thread number, to be the
> > > > replacement
> > > > > in the argLine   @return A commandline * @throws
> > > > > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > > > > when unable to perform the fork
> > > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > > > >       * for all classpath elements.
> > > > >       *
> > > > >       * @param classPath      List&lt;String> of all classpath
> > > elements.
> > > > > -     * @param startClassName
> > > > > +     * @param startClassName  The classname to start (main-class)
> > > > >       * @return The file pointint to the jar
> > > > >       * @throws java.io.IOException When a file operation fails.
> > > > >       */
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > > > > Scanner.java
> > > > >
> > ----------------------------------------------------------------------
> > > > diff
> > > > > --git
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /DependencyScanner.java
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /DependencyScanner.java +++
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > > > org.apache.maven.plugin.MojoExecutionException; import
> > > > > org.apache.maven.shared.utils.io.MatchPatterns;
> > > > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > > > >
> > > > > +import javax.annotation.Nullable;
> > > > > +
> > > > >  /**
> > > > >   * Scans dependencies looking for tests.
> > > > >   *
> > > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > > > >
> > > > >               private SpecificFileFilter specificTestFilter;
> > > > >
> > > > > -             public Matcher(List<String> includes, List<String>
> > > > excludes,
> > > > List<String>
> > > > > specificTests) +              public Matcher(@Nullable List<String>
> > > > includes,
> > > > @Nullable
> > > > > List<String> excludes, @Nullable List<String> specificTests) {
> > > > >                       String[] specific = specificTests == null ?
> new
> > > > String[0] :
> > > > > processIncludesExcludes( specificTests ); specificTestFilter = new
> > > > > SpecificFileFilter( specific );
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > > > > java
> > > >
> ----------------------------------------------------------------------
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /Relocator.java
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /Relocator.java index 31dde5d..76da9de 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /Relocator.java +++
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > > > org.apache.maven.plugin.surefire.util;
> > > > >   * under the License.
> > > > >   */
> > > > >
> > > > > +import com.sun.istack.internal.NotNull;
> > > > > +
> > > > > +import javax.annotation.Nullable;
> > > > > +
> > > > >  /**
> > > > >   * Relocates class names when running with relocated provider
> > > > >   *
> > > > > @@ -26,12 +30,12 @@ package org.apache.maven.plugin.surefire.util;
> > > > >   */
> > > > >  public class Relocator
> > > > >  {
> > > > > -    private final String relocation;
> > > > > +    private final @Nullable String relocation;
> > > > >
> > > > >      private static final String relocationBase =
> > > > > "org.apache.maven.surefire.";
> > > > >
> > > > >
> > > > > -    public Relocator( String relocation )
> > > > > +    public Relocator( @Nullable String relocation )
> > > > >      {
> > > > >          this.relocation = relocation;
> > > > >      }
> > > > > @@ -41,12 +45,12 @@ public class Relocator
> > > > >          relocation = "shadefire";
> > > > >      }
> > > > >
> > > > > -    private String getRelocation()
> > > > > +    private @Nullable String getRelocation()
> > > > >      {
> > > > >          return relocation;
> > > > >      }
> > > > >
> > > > > -    public String relocate( String className )
> > > > > +    public @NotNull String relocate( @NotNull String className )
> > > > >      {
> > > > >          if ( relocation == null )
> > > > >          {
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > >
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > > > > l.java
> > > > >
> > ----------------------------------------------------------------------
> > > > diff
> > > > > --git
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /ScannerUtil.java
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /ScannerUtil.java +++
> > > > >
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > > > >
> > > > >  import org.apache.commons.lang3.StringUtils;
> > > > >
> > > > > +import javax.annotation.Nonnull;
> > > > > +
> > > > >  final class ScannerUtil {
> > > > >
> > > > >       private ScannerUtil() {}
> > > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > > > >
> > > > >      private static final String JAVA_CLASS_FILE_EXTENSION =
> > ".class";
> > > > >
> > > > > -    public static String convertToJavaClassName( String test )
> > > > > +    public static @Nonnull String convertToJavaClassName( @Nonnull
> > > > String
> > > > > test ) {
> > > > >          return StringUtils.removeEnd( test, ".class" ).replace(
> FS,
> > > "."
> > > > );
> > > > >      }
> > > > >
> > > > > -    public static String convertJarFileResourceToJavaClassName(
> > String
> > > > test
> > > > > ) +    public static @Nonnull String
> > > > convertJarFileResourceToJavaClassName(
> > > > > @Nonnull String test ) {
> > > > >          return StringUtils.removeEnd( test, ".class" ).replace(
> "/",
> > > > "." );
> > > > > }
> > > > >
> > > > > -    public static String stripBaseDir( String basedir, String
> test )
> > > > > +    public static @Nonnull String stripBaseDir( String basedir,
> > String
> > > > test
> > > > > ) {
> > > > >          return StringUtils.removeStart( test, basedir );
> > > > >      }
> > > > >
> > > > > -    public static String[] processIncludesExcludes( List<String>
> > list
> > > )
> > > > > +    public static @Nonnull String[] processIncludesExcludes(
> > @Nonnull
> > > > > List<String> list ) {
> > > > >          List<String> newList = new ArrayList<String>();
> > > > >          for ( Object aList : list )
> > > > >
> > > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > > > >
> > ----------------------------------------------------------------------
> > > > > diff --git a/pom.xml b/pom.xml
> > > > > index 677b367..c60f378 100644
> > > > > --- a/pom.xml
> > > > > +++ b/pom.xml
> > > > > @@ -265,6 +265,12 @@
> > > > >          <version>3.8.1</version>
> > > > >          <scope>test</scope>
> > > > >        </dependency>
> > > > > +      <dependency>
> > > > > +        <groupId>com.google.code.findbugs</groupId>
> > > > > +        <artifactId>jsr305</artifactId>
> > > > > +        <version>2.0.1</version>
> > > > > +        <scope>provided</scope>
> > > > > +      </dependency>
> > > > >      </dependencies>
> > > > >    </dependencyManagement>
> > > > >    <dependencies>
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: dev-help@maven.apache.org
> > > >
> > > >
> > >
> >
>

Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
IntelliJ also supports the findbugs and jcip annotations too... but in any
case I will hold my piece... given that these annotations do not have
parameters the risk is almost non-existant for *these* but I do think it is
a more general risk


On 8 May 2013 09:06, Kristian Rosenvold <kr...@gmail.com>wrote:

> I suspect like a lot of the rest of the community, they simply gave up on
> the jcp.
>
> I am no insider on the project but com.google.code.findbugs/jsr-305 was
> last published in a 2.0.1 version in july 2012, and
> seems to be alive and kicking. IntelliJ also supports the annotations which
> means we finally have /one/ set of annotations
> that everybody understands.
>
> The value of both Nullable and Nonnull is just amazing once you get it all
> in place.
>
> As for potential classloading issues, I'm sure /someone/ here would know :)
>
> Kristian
>
>
>
>
> 2013/5/8 Stephen Connolly <st...@gmail.com>
>
> > On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr> wrote:
> >
> > > I like this: could we define it as the standard way to add such
> > > annotations in
> > > whole Maven components? Any problem if we do it in Maven core itself?
> > >
> > > I'm not a JSR-305 expert, any basic explanation on the
> > > com.google.code.findbugs:jsr305 choice is good to know
> > >
> >
> > Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
> >
> > In general I like those annotations, though I tend to favour the findbugs
> > annotations and jcip annotations in code I write while awaiting jsr305 to
> > finalize (given that the spec is dormant, feared dead:
> > http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of the spec
> > may
> > result in signature changes and as such, given that the annotations are
> > runtime retention, when annotations finally land in the JVM there may be
> a
> > risk from signature change...
> >
> > But that could be an irrational fear on my behalf...
> >
> > In any case I have clean room ASLv2 licensed versions of the findbugs and
> > jcip annotations in my GitHub repo and published to central.
> >
> >
> > > then we could add it to maven parent pom dependencyManagement section,
> > and
> > > write something into "Maven Developer Centre"
> > >
> > > Regards,
> > >
> > > Hervé
> > >
> > > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > > Updated Branches:
> > > >   refs/heads/master 231773324 -> 7b330f584
> > > >
> > > >
> > > > Added jsr305 annotations
> > > >
> > > >
> > > > Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > > > Commit:
> > > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > > >
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > > >
> > > > Branch: refs/heads/master
> > > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > > Parents: 2317733
> > > > Author: Kristian Rosenvold <kr...@apache.org>
> > > > Authored: Tue May 7 18:49:15 2013 +0200
> > > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > > Committed: Tue May 7 18:49:15 2013 +0200
> > > >
> > > >
> ----------------------------------------------------------------------
> > > >  maven-surefire-common/pom.xml                      |    4 ++++
> > > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7 +++++--
> > > >  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
> > > >  .../maven/plugin/surefire/CommonReflector.java     |    8 +++++---
> > > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> > > >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> > > >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> > > >  .../maven/plugin/surefire/util/Relocator.java      |   12
> ++++++++----
> > > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10 ++++++----
> > > >  pom.xml                                            |    6 ++++++
> > > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > >
> ----------------------------------------------------------------------
> > > >
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > > refire-common/pom.xml
> > > >
> ----------------------------------------------------------------------
> > > diff
> > > > --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
> > > index
> > > > 1330eec..bed467b 100644
> > > > --- a/maven-surefire-common/pom.xml
> > > > +++ b/maven-surefire-common/pom.xml
> > > > @@ -91,6 +91,10 @@
> > > >        <artifactId>commons-lang3</artifactId>
> > > >      </dependency>
> > > >      <dependency>
> > > > +      <groupId>com.google.code.findbugs</groupId>
> > > > +      <artifactId>jsr305</artifactId>
> > > > +    </dependency>
> > > > +    <dependency>
> > > >        <groupId>org.apache.maven.shared</groupId>
> > > >        <artifactId>maven-common-artifact-filters</artifactId>
> > > >        <version>1.3</version>
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > > > eMojo.java
> > > >
> ----------------------------------------------------------------------
> > > diff
> > > > --git
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > ractSurefireMojo.java
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > > ---
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > ractSurefireMojo.java +++
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > > org.apache.maven.surefire.util.RunOrder;
> > > >  import org.apache.maven.toolchain.Toolchain;
> > > >  import org.apache.maven.toolchain.ToolchainManager;
> > > >
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > >  /**
> > > >   * Abstract base class for running tests using Surefire.
> > > >   *
> > > > @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
> > > >          }
> > > >      }
> > > >
> > > > -    private List<String> getExcludeList()
> > > > +    private @Nonnull List<String> getExcludeList()
> > > >      {
> > > >          List<String> excludes = null;
> > > >          if ( isSpecificTestSpecified() )
> > > > @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
> > > >          return filterNulls( includes );
> > > >      }
> > > >
> > > > -    private List<String> filterNulls( List<String> toFilter )
> > > > +    private @Nonnull List<String> filterNulls( @Nonnull List<String>
> > > > toFilter ) {
> > > >          List<String> result = new ArrayList<String>( toFilter.size()
> > );
> > > >          for ( String item : toFilter )
> > > > @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
> > > >              return new DynamicProviderInfo( providerName );
> > > >          }
> > > >
> > > > +        @Nonnull
> > > >          public String getProviderName()
> > > >          {
> > > >              return providerName;
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > > > java
> > > ----------------------------------------------------------------------
> > > > diff --git
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > spathCache.java
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > spathCache.java index 1bcb065..ea250c2 100644
> > > > ---
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > spathCache.java +++
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > > spathCache.java @@ -21,6 +21,8 @@ package
> > > org.apache.maven.plugin.surefire;
> > > >  import java.util.concurrent.ConcurrentHashMap;
> > > >  import org.apache.maven.surefire.booter.Classpath;
> > > >
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > >  /**
> > > >   * @author Kristian Rosenvold
> > > >   */
> > > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > > >      private static final ConcurrentHashMap<String, Classpath>
> > > classpaths =
> > > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > > >
> > > > -    public static Classpath getCachedClassPath( String artifactId )
> > > > +    public static Classpath getCachedClassPath( @Nonnull String
> > > artifactId
> > > > ) {
> > > >          return classpaths.get( artifactId );
> > > >      }
> > > >
> > > > -    public static void setCachedClasspath( String key, Classpath
> > > classpath
> > > > ) +    public static void setCachedClasspath( @Nonnull String key,
> > > @Nonnull
> > > > Classpath classpath ) {
> > > >          classpaths.put( key, classpath );
> > > >      }
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > > > .java
> > > ----------------------------------------------------------------------
> > > > diff --git
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > onReflector.java
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > onReflector.java index 538b7e0..6851539 100644
> > > > ---
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > onReflector.java +++
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > > onReflector.java @@ -25,6 +25,8 @@ import
> > > > org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
> import
> > > > org.apache.maven.surefire.util.ReflectionUtils;
> > > >  import org.apache.maven.surefire.util.SurefireReflectionException;
> > > >
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > >  /**
> > > >   * @author Kristian Rosenvold
> > > >   */
> > > > @@ -34,7 +36,7 @@ public class CommonReflector
> > > >
> > > >      private final ClassLoader surefireClassLoader;
> > > >
> > > > -    public CommonReflector( ClassLoader surefireClassLoader )
> > > > +    public CommonReflector( @Nonnull ClassLoader
> surefireClassLoader )
> > > >      {
> > > >          this.surefireClassLoader = surefireClassLoader;
> > > >
> > > > @@ -48,7 +50,7 @@ public class CommonReflector
> > > >          }
> > > >      }
> > > >
> > > > -    public Object createReportingReporterFactory(
> > > > StartupReportConfiguration startupReportConfiguration ) +    public
> > > Object
> > > > createReportingReporterFactory( @Nonnull StartupReportConfiguration
> > > > startupReportConfiguration ) {
> > > >          Class<?>[] args = new Class[]{
> this.startupReportConfiguration
> > > };
> > > >          Object src = createStartupReportConfiguration(
> > > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > > CommonReflector
> > > >      }
> > > >
> > > >
> > > > -    Object createStartupReportConfiguration(
> > StartupReportConfiguration
> > > > reporterConfiguration ) +    Object createStartupReportConfiguration(
> > > > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> > > >          Constructor<?> constructor = ReflectionUtils.getConstructor(
> > > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > > boolean.class,
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > > > va
> > ----------------------------------------------------------------------
> > > > diff --git
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > iderInfo.java
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > iderInfo.java index 57069d8..50de7ea 100644
> > > > ---
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > iderInfo.java +++
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > > iderInfo.java @@ -24,11 +24,14 @@ import
> > > > org.apache.maven.artifact.resolver.ArtifactResolutionException;
> import
> > > > org.apache.maven.plugin.MojoExecutionException;
> > > >  import org.apache.maven.surefire.booter.Classpath;
> > > >
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > >  /**
> > > >   * @author Kristian Rosenvold
> > > >   */
> > > >  public interface ProviderInfo
> > > >  {
> > > > +    @Nonnull
> > > >      String getProviderName();
> > > >
> > > >      boolean isApplicable();
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > > > rkConfiguration.java
> > > >
> ----------------------------------------------------------------------
> > > diff
> > > > --git
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > erclient/ForkConfiguration.java
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > > > ---
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > erclient/ForkConfiguration.java +++
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> > > > ForkConfiguration
> > > >
> > > >      /**
> > > >       * @param classPath            cla the classpath arguments
> > > > -     * @param startupConfiguration
> > > > +     * @param startupConfiguration The startup configuration
> > > >       * @param threadNumber         the thread number, to be the
> > > replacement
> > > > in the argLine   @return A commandline * @throws
> > > > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > > > when unable to perform the fork
> > > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > > >       * for all classpath elements.
> > > >       *
> > > >       * @param classPath      List&lt;String> of all classpath
> > elements.
> > > > -     * @param startClassName
> > > > +     * @param startClassName  The classname to start (main-class)
> > > >       * @return The file pointint to the jar
> > > >       * @throws java.io.IOException When a file operation fails.
> > > >       */
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > > > Scanner.java
> > > >
> ----------------------------------------------------------------------
> > > diff
> > > > --git
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /DependencyScanner.java
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > > ---
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /DependencyScanner.java +++
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > > org.apache.maven.plugin.MojoExecutionException; import
> > > > org.apache.maven.shared.utils.io.MatchPatterns;
> > > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > > >
> > > > +import javax.annotation.Nullable;
> > > > +
> > > >  /**
> > > >   * Scans dependencies looking for tests.
> > > >   *
> > > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > > >
> > > >               private SpecificFileFilter specificTestFilter;
> > > >
> > > > -             public Matcher(List<String> includes, List<String>
> > > excludes,
> > > List<String>
> > > > specificTests) +              public Matcher(@Nullable List<String>
> > > includes,
> > > @Nullable
> > > > List<String> excludes, @Nullable List<String> specificTests) {
> > > >                       String[] specific = specificTests == null ? new
> > > String[0] :
> > > > processIncludesExcludes( specificTests ); specificTestFilter = new
> > > > SpecificFileFilter( specific );
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > > > java
> > > ----------------------------------------------------------------------
> > > > diff --git
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /Relocator.java
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /Relocator.java index 31dde5d..76da9de 100644
> > > > ---
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /Relocator.java +++
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > > org.apache.maven.plugin.surefire.util;
> > > >   * under the License.
> > > >   */
> > > >
> > > > +import com.sun.istack.internal.NotNull;
> > > > +
> > > > +import javax.annotation.Nullable;
> > > > +
> > > >  /**
> > > >   * Relocates class names when running with relocated provider
> > > >   *
> > > > @@ -26,12 +30,12 @@ package org.apache.maven.plugin.surefire.util;
> > > >   */
> > > >  public class Relocator
> > > >  {
> > > > -    private final String relocation;
> > > > +    private final @Nullable String relocation;
> > > >
> > > >      private static final String relocationBase =
> > > > "org.apache.maven.surefire.";
> > > >
> > > >
> > > > -    public Relocator( String relocation )
> > > > +    public Relocator( @Nullable String relocation )
> > > >      {
> > > >          this.relocation = relocation;
> > > >      }
> > > > @@ -41,12 +45,12 @@ public class Relocator
> > > >          relocation = "shadefire";
> > > >      }
> > > >
> > > > -    private String getRelocation()
> > > > +    private @Nullable String getRelocation()
> > > >      {
> > > >          return relocation;
> > > >      }
> > > >
> > > > -    public String relocate( String className )
> > > > +    public @NotNull String relocate( @NotNull String className )
> > > >      {
> > > >          if ( relocation == null )
> > > >          {
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > >
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > > > l.java
> > > >
> ----------------------------------------------------------------------
> > > diff
> > > > --git
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /ScannerUtil.java
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > > ---
> > > >
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /ScannerUtil.java +++
> > > >
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > > >
> > > >  import org.apache.commons.lang3.StringUtils;
> > > >
> > > > +import javax.annotation.Nonnull;
> > > > +
> > > >  final class ScannerUtil {
> > > >
> > > >       private ScannerUtil() {}
> > > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > > >
> > > >      private static final String JAVA_CLASS_FILE_EXTENSION =
> ".class";
> > > >
> > > > -    public static String convertToJavaClassName( String test )
> > > > +    public static @Nonnull String convertToJavaClassName( @Nonnull
> > > String
> > > > test ) {
> > > >          return StringUtils.removeEnd( test, ".class" ).replace( FS,
> > "."
> > > );
> > > >      }
> > > >
> > > > -    public static String convertJarFileResourceToJavaClassName(
> String
> > > test
> > > > ) +    public static @Nonnull String
> > > convertJarFileResourceToJavaClassName(
> > > > @Nonnull String test ) {
> > > >          return StringUtils.removeEnd( test, ".class" ).replace( "/",
> > > "." );
> > > > }
> > > >
> > > > -    public static String stripBaseDir( String basedir, String test )
> > > > +    public static @Nonnull String stripBaseDir( String basedir,
> String
> > > test
> > > > ) {
> > > >          return StringUtils.removeStart( test, basedir );
> > > >      }
> > > >
> > > > -    public static String[] processIncludesExcludes( List<String>
> list
> > )
> > > > +    public static @Nonnull String[] processIncludesExcludes(
> @Nonnull
> > > > List<String> list ) {
> > > >          List<String> newList = new ArrayList<String>();
> > > >          for ( Object aList : list )
> > > >
> > > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > > >
> ----------------------------------------------------------------------
> > > > diff --git a/pom.xml b/pom.xml
> > > > index 677b367..c60f378 100644
> > > > --- a/pom.xml
> > > > +++ b/pom.xml
> > > > @@ -265,6 +265,12 @@
> > > >          <version>3.8.1</version>
> > > >          <scope>test</scope>
> > > >        </dependency>
> > > > +      <dependency>
> > > > +        <groupId>com.google.code.findbugs</groupId>
> > > > +        <artifactId>jsr305</artifactId>
> > > > +        <version>2.0.1</version>
> > > > +        <scope>provided</scope>
> > > > +      </dependency>
> > > >      </dependencies>
> > > >    </dependencyManagement>
> > > >    <dependencies>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> >
>

Re: git commit: Added jsr305 annotations

Posted by Kristian Rosenvold <kr...@gmail.com>.
I suspect like a lot of the rest of the community, they simply gave up on
the jcp.

I am no insider on the project but com.google.code.findbugs/jsr-305 was
last published in a 2.0.1 version in july 2012, and
seems to be alive and kicking. IntelliJ also supports the annotations which
means we finally have /one/ set of annotations
that everybody understands.

The value of both Nullable and Nonnull is just amazing once you get it all
in place.

As for potential classloading issues, I'm sure /someone/ here would know :)

Kristian




2013/5/8 Stephen Connolly <st...@gmail.com>

> On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr> wrote:
>
> > I like this: could we define it as the standard way to add such
> > annotations in
> > whole Maven components? Any problem if we do it in Maven core itself?
> >
> > I'm not a JSR-305 expert, any basic explanation on the
> > com.google.code.findbugs:jsr305 choice is good to know
> >
>
> Well as of 1.3.8 it's ASL whereas previous ones were LGPL.
>
> In general I like those annotations, though I tend to favour the findbugs
> annotations and jcip annotations in code I write while awaiting jsr305 to
> finalize (given that the spec is dormant, feared dead:
> http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of the spec
> may
> result in signature changes and as such, given that the annotations are
> runtime retention, when annotations finally land in the JVM there may be a
> risk from signature change...
>
> But that could be an irrational fear on my behalf...
>
> In any case I have clean room ASLv2 licensed versions of the findbugs and
> jcip annotations in my GitHub repo and published to central.
>
>
> > then we could add it to maven parent pom dependencyManagement section,
> and
> > write something into "Maven Developer Centre"
> >
> > Regards,
> >
> > Hervé
> >
> > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > Updated Branches:
> > >   refs/heads/master 231773324 -> 7b330f584
> > >
> > >
> > > Added jsr305 annotations
> > >
> > >
> > > Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > > Commit:
> > >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > >
> > > Branch: refs/heads/master
> > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > Parents: 2317733
> > > Author: Kristian Rosenvold <kr...@apache.org>
> > > Authored: Tue May 7 18:49:15 2013 +0200
> > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > Committed: Tue May 7 18:49:15 2013 +0200
> > >
> > > ----------------------------------------------------------------------
> > >  maven-surefire-common/pom.xml                      |    4 ++++
> > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7 +++++--
> > >  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
> > >  .../maven/plugin/surefire/CommonReflector.java     |    8 +++++---
> > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> > >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> > >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> > >  .../maven/plugin/surefire/util/Relocator.java      |   12 ++++++++----
> > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10 ++++++----
> > >  pom.xml                                            |    6 ++++++
> > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > ----------------------------------------------------------------------
> > >
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > refire-common/pom.xml
> > > ----------------------------------------------------------------------
> > diff
> > > --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
> > index
> > > 1330eec..bed467b 100644
> > > --- a/maven-surefire-common/pom.xml
> > > +++ b/maven-surefire-common/pom.xml
> > > @@ -91,6 +91,10 @@
> > >        <artifactId>commons-lang3</artifactId>
> > >      </dependency>
> > >      <dependency>
> > > +      <groupId>com.google.code.findbugs</groupId>
> > > +      <artifactId>jsr305</artifactId>
> > > +    </dependency>
> > > +    <dependency>
> > >        <groupId>org.apache.maven.shared</groupId>
> > >        <artifactId>maven-common-artifact-filters</artifactId>
> > >        <version>1.3</version>
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > > eMojo.java
> > > ----------------------------------------------------------------------
> > diff
> > > --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > ractSurefireMojo.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > ractSurefireMojo.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > org.apache.maven.surefire.util.RunOrder;
> > >  import org.apache.maven.toolchain.Toolchain;
> > >  import org.apache.maven.toolchain.ToolchainManager;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  /**
> > >   * Abstract base class for running tests using Surefire.
> > >   *
> > > @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
> > >          }
> > >      }
> > >
> > > -    private List<String> getExcludeList()
> > > +    private @Nonnull List<String> getExcludeList()
> > >      {
> > >          List<String> excludes = null;
> > >          if ( isSpecificTestSpecified() )
> > > @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
> > >          return filterNulls( includes );
> > >      }
> > >
> > > -    private List<String> filterNulls( List<String> toFilter )
> > > +    private @Nonnull List<String> filterNulls( @Nonnull List<String>
> > > toFilter ) {
> > >          List<String> result = new ArrayList<String>( toFilter.size()
> );
> > >          for ( String item : toFilter )
> > > @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
> > >              return new DynamicProviderInfo( providerName );
> > >          }
> > >
> > > +        @Nonnull
> > >          public String getProviderName()
> > >          {
> > >              return providerName;
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > > java
> > ----------------------------------------------------------------------
> > > diff --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > spathCache.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > spathCache.java index 1bcb065..ea250c2 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > spathCache.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > spathCache.java @@ -21,6 +21,8 @@ package
> > org.apache.maven.plugin.surefire;
> > >  import java.util.concurrent.ConcurrentHashMap;
> > >  import org.apache.maven.surefire.booter.Classpath;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  /**
> > >   * @author Kristian Rosenvold
> > >   */
> > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > >      private static final ConcurrentHashMap<String, Classpath>
> > classpaths =
> > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > >
> > > -    public static Classpath getCachedClassPath( String artifactId )
> > > +    public static Classpath getCachedClassPath( @Nonnull String
> > artifactId
> > > ) {
> > >          return classpaths.get( artifactId );
> > >      }
> > >
> > > -    public static void setCachedClasspath( String key, Classpath
> > classpath
> > > ) +    public static void setCachedClasspath( @Nonnull String key,
> > @Nonnull
> > > Classpath classpath ) {
> > >          classpaths.put( key, classpath );
> > >      }
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > > .java
> > ----------------------------------------------------------------------
> > > diff --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > onReflector.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > onReflector.java index 538b7e0..6851539 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > onReflector.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > onReflector.java @@ -25,6 +25,8 @@ import
> > > org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import
> > > org.apache.maven.surefire.util.ReflectionUtils;
> > >  import org.apache.maven.surefire.util.SurefireReflectionException;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  /**
> > >   * @author Kristian Rosenvold
> > >   */
> > > @@ -34,7 +36,7 @@ public class CommonReflector
> > >
> > >      private final ClassLoader surefireClassLoader;
> > >
> > > -    public CommonReflector( ClassLoader surefireClassLoader )
> > > +    public CommonReflector( @Nonnull ClassLoader surefireClassLoader )
> > >      {
> > >          this.surefireClassLoader = surefireClassLoader;
> > >
> > > @@ -48,7 +50,7 @@ public class CommonReflector
> > >          }
> > >      }
> > >
> > > -    public Object createReportingReporterFactory(
> > > StartupReportConfiguration startupReportConfiguration ) +    public
> > Object
> > > createReportingReporterFactory( @Nonnull StartupReportConfiguration
> > > startupReportConfiguration ) {
> > >          Class<?>[] args = new Class[]{ this.startupReportConfiguration
> > };
> > >          Object src = createStartupReportConfiguration(
> > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > CommonReflector
> > >      }
> > >
> > >
> > > -    Object createStartupReportConfiguration(
> StartupReportConfiguration
> > > reporterConfiguration ) +    Object createStartupReportConfiguration(
> > > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> > >          Constructor<?> constructor = ReflectionUtils.getConstructor(
> > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > boolean.class,
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > > va
> ----------------------------------------------------------------------
> > > diff --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > iderInfo.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > iderInfo.java index 57069d8..50de7ea 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > iderInfo.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > iderInfo.java @@ -24,11 +24,14 @@ import
> > > org.apache.maven.artifact.resolver.ArtifactResolutionException; import
> > > org.apache.maven.plugin.MojoExecutionException;
> > >  import org.apache.maven.surefire.booter.Classpath;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  /**
> > >   * @author Kristian Rosenvold
> > >   */
> > >  public interface ProviderInfo
> > >  {
> > > +    @Nonnull
> > >      String getProviderName();
> > >
> > >      boolean isApplicable();
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > > rkConfiguration.java
> > > ----------------------------------------------------------------------
> > diff
> > > --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > erclient/ForkConfiguration.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > erclient/ForkConfiguration.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> > > ForkConfiguration
> > >
> > >      /**
> > >       * @param classPath            cla the classpath arguments
> > > -     * @param startupConfiguration
> > > +     * @param startupConfiguration The startup configuration
> > >       * @param threadNumber         the thread number, to be the
> > replacement
> > > in the argLine   @return A commandline * @throws
> > > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > > when unable to perform the fork
> > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > >       * for all classpath elements.
> > >       *
> > >       * @param classPath      List&lt;String> of all classpath
> elements.
> > > -     * @param startClassName
> > > +     * @param startClassName  The classname to start (main-class)
> > >       * @return The file pointint to the jar
> > >       * @throws java.io.IOException When a file operation fails.
> > >       */
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > > Scanner.java
> > > ----------------------------------------------------------------------
> > diff
> > > --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /DependencyScanner.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /DependencyScanner.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > org.apache.maven.plugin.MojoExecutionException; import
> > > org.apache.maven.shared.utils.io.MatchPatterns;
> > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > >
> > > +import javax.annotation.Nullable;
> > > +
> > >  /**
> > >   * Scans dependencies looking for tests.
> > >   *
> > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > >
> > >               private SpecificFileFilter specificTestFilter;
> > >
> > > -             public Matcher(List<String> includes, List<String>
> > excludes,
> > List<String>
> > > specificTests) +              public Matcher(@Nullable List<String>
> > includes,
> > @Nullable
> > > List<String> excludes, @Nullable List<String> specificTests) {
> > >                       String[] specific = specificTests == null ? new
> > String[0] :
> > > processIncludesExcludes( specificTests ); specificTestFilter = new
> > > SpecificFileFilter( specific );
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > > java
> > ----------------------------------------------------------------------
> > > diff --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /Relocator.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /Relocator.java index 31dde5d..76da9de 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /Relocator.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > org.apache.maven.plugin.surefire.util;
> > >   * under the License.
> > >   */
> > >
> > > +import com.sun.istack.internal.NotNull;
> > > +
> > > +import javax.annotation.Nullable;
> > > +
> > >  /**
> > >   * Relocates class names when running with relocated provider
> > >   *
> > > @@ -26,12 +30,12 @@ package org.apache.maven.plugin.surefire.util;
> > >   */
> > >  public class Relocator
> > >  {
> > > -    private final String relocation;
> > > +    private final @Nullable String relocation;
> > >
> > >      private static final String relocationBase =
> > > "org.apache.maven.surefire.";
> > >
> > >
> > > -    public Relocator( String relocation )
> > > +    public Relocator( @Nullable String relocation )
> > >      {
> > >          this.relocation = relocation;
> > >      }
> > > @@ -41,12 +45,12 @@ public class Relocator
> > >          relocation = "shadefire";
> > >      }
> > >
> > > -    private String getRelocation()
> > > +    private @Nullable String getRelocation()
> > >      {
> > >          return relocation;
> > >      }
> > >
> > > -    public String relocate( String className )
> > > +    public @NotNull String relocate( @NotNull String className )
> > >      {
> > >          if ( relocation == null )
> > >          {
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > > l.java
> > > ----------------------------------------------------------------------
> > diff
> > > --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /ScannerUtil.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /ScannerUtil.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > >
> > >  import org.apache.commons.lang3.StringUtils;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  final class ScannerUtil {
> > >
> > >       private ScannerUtil() {}
> > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > >
> > >      private static final String JAVA_CLASS_FILE_EXTENSION = ".class";
> > >
> > > -    public static String convertToJavaClassName( String test )
> > > +    public static @Nonnull String convertToJavaClassName( @Nonnull
> > String
> > > test ) {
> > >          return StringUtils.removeEnd( test, ".class" ).replace( FS,
> "."
> > );
> > >      }
> > >
> > > -    public static String convertJarFileResourceToJavaClassName( String
> > test
> > > ) +    public static @Nonnull String
> > convertJarFileResourceToJavaClassName(
> > > @Nonnull String test ) {
> > >          return StringUtils.removeEnd( test, ".class" ).replace( "/",
> > "." );
> > > }
> > >
> > > -    public static String stripBaseDir( String basedir, String test )
> > > +    public static @Nonnull String stripBaseDir( String basedir, String
> > test
> > > ) {
> > >          return StringUtils.removeStart( test, basedir );
> > >      }
> > >
> > > -    public static String[] processIncludesExcludes( List<String> list
> )
> > > +    public static @Nonnull String[] processIncludesExcludes( @Nonnull
> > > List<String> list ) {
> > >          List<String> newList = new ArrayList<String>();
> > >          for ( Object aList : list )
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > > ----------------------------------------------------------------------
> > > diff --git a/pom.xml b/pom.xml
> > > index 677b367..c60f378 100644
> > > --- a/pom.xml
> > > +++ b/pom.xml
> > > @@ -265,6 +265,12 @@
> > >          <version>3.8.1</version>
> > >          <scope>test</scope>
> > >        </dependency>
> > > +      <dependency>
> > > +        <groupId>com.google.code.findbugs</groupId>
> > > +        <artifactId>jsr305</artifactId>
> > > +        <version>2.0.1</version>
> > > +        <scope>provided</scope>
> > > +      </dependency>
> > >      </dependencies>
> > >    </dependencyManagement>
> > >    <dependencies>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>

Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
On 8 May 2013 08:34, Hervé BOUTEMY <he...@free.fr> wrote:

> I like this: could we define it as the standard way to add such
> annotations in
> whole Maven components? Any problem if we do it in Maven core itself?
>
> I'm not a JSR-305 expert, any basic explanation on the
> com.google.code.findbugs:jsr305 choice is good to know
>

Well as of 1.3.8 it's ASL whereas previous ones were LGPL.

In general I like those annotations, though I tend to favour the findbugs
annotations and jcip annotations in code I write while awaiting jsr305 to
finalize (given that the spec is dormant, feared dead:
http://jcp.org/en/jsr/detail?id=305) and I suspect a reboot of the spec may
result in signature changes and as such, given that the annotations are
runtime retention, when annotations finally land in the JVM there may be a
risk from signature change...

But that could be an irrational fear on my behalf...

In any case I have clean room ASLv2 licensed versions of the findbugs and
jcip annotations in my GitHub repo and published to central.


> then we could add it to maven parent pom dependencyManagement section, and
> write something into "Maven Developer Centre"
>
> Regards,
>
> Hervé
>
> Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > Updated Branches:
> >   refs/heads/master 231773324 -> 7b330f584
> >
> >
> > Added jsr305 annotations
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > Commit:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> >
> > Branch: refs/heads/master
> > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > Parents: 2317733
> > Author: Kristian Rosenvold <kr...@apache.org>
> > Authored: Tue May 7 18:49:15 2013 +0200
> > Committer: Kristian Rosenvold <kr...@apache.org>
> > Committed: Tue May 7 18:49:15 2013 +0200
> >
> > ----------------------------------------------------------------------
> >  maven-surefire-common/pom.xml                      |    4 ++++
> >  .../plugin/surefire/AbstractSurefireMojo.java      |    7 +++++--
> >  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
> >  .../maven/plugin/surefire/CommonReflector.java     |    8 +++++---
> >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> >  .../maven/plugin/surefire/util/Relocator.java      |   12 ++++++++----
> >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10 ++++++----
> >  pom.xml                                            |    6 ++++++
> >  10 files changed, 46 insertions(+), 18 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > refire-common/pom.xml
> > ----------------------------------------------------------------------
> diff
> > --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
> index
> > 1330eec..bed467b 100644
> > --- a/maven-surefire-common/pom.xml
> > +++ b/maven-surefire-common/pom.xml
> > @@ -91,6 +91,10 @@
> >        <artifactId>commons-lang3</artifactId>
> >      </dependency>
> >      <dependency>
> > +      <groupId>com.google.code.findbugs</groupId>
> > +      <artifactId>jsr305</artifactId>
> > +    </dependency>
> > +    <dependency>
> >        <groupId>org.apache.maven.shared</groupId>
> >        <artifactId>maven-common-artifact-filters</artifactId>
> >        <version>1.3</version>
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > eMojo.java
> > ----------------------------------------------------------------------
> diff
> > --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > ractSurefireMojo.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > ractSurefireMojo.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > org.apache.maven.surefire.util.RunOrder;
> >  import org.apache.maven.toolchain.Toolchain;
> >  import org.apache.maven.toolchain.ToolchainManager;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  /**
> >   * Abstract base class for running tests using Surefire.
> >   *
> > @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
> >          }
> >      }
> >
> > -    private List<String> getExcludeList()
> > +    private @Nonnull List<String> getExcludeList()
> >      {
> >          List<String> excludes = null;
> >          if ( isSpecificTestSpecified() )
> > @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
> >          return filterNulls( includes );
> >      }
> >
> > -    private List<String> filterNulls( List<String> toFilter )
> > +    private @Nonnull List<String> filterNulls( @Nonnull List<String>
> > toFilter ) {
> >          List<String> result = new ArrayList<String>( toFilter.size() );
> >          for ( String item : toFilter )
> > @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
> >              return new DynamicProviderInfo( providerName );
> >          }
> >
> > +        @Nonnull
> >          public String getProviderName()
> >          {
> >              return providerName;
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > java
> ----------------------------------------------------------------------
> > diff --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > spathCache.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > spathCache.java index 1bcb065..ea250c2 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > spathCache.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > spathCache.java @@ -21,6 +21,8 @@ package
> org.apache.maven.plugin.surefire;
> >  import java.util.concurrent.ConcurrentHashMap;
> >  import org.apache.maven.surefire.booter.Classpath;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  /**
> >   * @author Kristian Rosenvold
> >   */
> > @@ -29,12 +31,12 @@ public class ClasspathCache
> >      private static final ConcurrentHashMap<String, Classpath>
> classpaths =
> >          new ConcurrentHashMap<String, Classpath>( 4 );
> >
> > -    public static Classpath getCachedClassPath( String artifactId )
> > +    public static Classpath getCachedClassPath( @Nonnull String
> artifactId
> > ) {
> >          return classpaths.get( artifactId );
> >      }
> >
> > -    public static void setCachedClasspath( String key, Classpath
> classpath
> > ) +    public static void setCachedClasspath( @Nonnull String key,
> @Nonnull
> > Classpath classpath ) {
> >          classpaths.put( key, classpath );
> >      }
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > .java
> ----------------------------------------------------------------------
> > diff --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > onReflector.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > onReflector.java index 538b7e0..6851539 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > onReflector.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > onReflector.java @@ -25,6 +25,8 @@ import
> > org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import
> > org.apache.maven.surefire.util.ReflectionUtils;
> >  import org.apache.maven.surefire.util.SurefireReflectionException;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  /**
> >   * @author Kristian Rosenvold
> >   */
> > @@ -34,7 +36,7 @@ public class CommonReflector
> >
> >      private final ClassLoader surefireClassLoader;
> >
> > -    public CommonReflector( ClassLoader surefireClassLoader )
> > +    public CommonReflector( @Nonnull ClassLoader surefireClassLoader )
> >      {
> >          this.surefireClassLoader = surefireClassLoader;
> >
> > @@ -48,7 +50,7 @@ public class CommonReflector
> >          }
> >      }
> >
> > -    public Object createReportingReporterFactory(
> > StartupReportConfiguration startupReportConfiguration ) +    public
> Object
> > createReportingReporterFactory( @Nonnull StartupReportConfiguration
> > startupReportConfiguration ) {
> >          Class<?>[] args = new Class[]{ this.startupReportConfiguration
> };
> >          Object src = createStartupReportConfiguration(
> > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > CommonReflector
> >      }
> >
> >
> > -    Object createStartupReportConfiguration( StartupReportConfiguration
> > reporterConfiguration ) +    Object createStartupReportConfiguration(
> > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> >          Constructor<?> constructor = ReflectionUtils.getConstructor(
> > this.startupReportConfiguration, new Class[]{ boolean.class,
> boolean.class,
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > va ----------------------------------------------------------------------
> > diff --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > iderInfo.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > iderInfo.java index 57069d8..50de7ea 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > iderInfo.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > iderInfo.java @@ -24,11 +24,14 @@ import
> > org.apache.maven.artifact.resolver.ArtifactResolutionException; import
> > org.apache.maven.plugin.MojoExecutionException;
> >  import org.apache.maven.surefire.booter.Classpath;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  /**
> >   * @author Kristian Rosenvold
> >   */
> >  public interface ProviderInfo
> >  {
> > +    @Nonnull
> >      String getProviderName();
> >
> >      boolean isApplicable();
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > rkConfiguration.java
> > ----------------------------------------------------------------------
> diff
> > --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > erclient/ForkConfiguration.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > erclient/ForkConfiguration.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> > ForkConfiguration
> >
> >      /**
> >       * @param classPath            cla the classpath arguments
> > -     * @param startupConfiguration
> > +     * @param startupConfiguration The startup configuration
> >       * @param threadNumber         the thread number, to be the
> replacement
> > in the argLine   @return A commandline * @throws
> > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > when unable to perform the fork
> > @@ -208,7 +208,7 @@ public class ForkConfiguration
> >       * for all classpath elements.
> >       *
> >       * @param classPath      List&lt;String> of all classpath elements.
> > -     * @param startClassName
> > +     * @param startClassName  The classname to start (main-class)
> >       * @return The file pointint to the jar
> >       * @throws java.io.IOException When a file operation fails.
> >       */
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > Scanner.java
> > ----------------------------------------------------------------------
> diff
> > --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /DependencyScanner.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /DependencyScanner.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > org.apache.maven.plugin.MojoExecutionException; import
> > org.apache.maven.shared.utils.io.MatchPatterns;
> >  import org.apache.maven.surefire.util.DefaultScanResult;
> >
> > +import javax.annotation.Nullable;
> > +
> >  /**
> >   * Scans dependencies looking for tests.
> >   *
> > @@ -141,7 +143,7 @@ public class DependencyScanner {
> >
> >               private SpecificFileFilter specificTestFilter;
> >
> > -             public Matcher(List<String> includes, List<String>
> excludes,
> List<String>
> > specificTests) +              public Matcher(@Nullable List<String>
> includes,
> @Nullable
> > List<String> excludes, @Nullable List<String> specificTests) {
> >                       String[] specific = specificTests == null ? new
> String[0] :
> > processIncludesExcludes( specificTests ); specificTestFilter = new
> > SpecificFileFilter( specific );
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > java
> ----------------------------------------------------------------------
> > diff --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /Relocator.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /Relocator.java index 31dde5d..76da9de 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /Relocator.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /Relocator.java @@ -19,6 +19,10 @@ package
> > org.apache.maven.plugin.surefire.util;
> >   * under the License.
> >   */
> >
> > +import com.sun.istack.internal.NotNull;
> > +
> > +import javax.annotation.Nullable;
> > +
> >  /**
> >   * Relocates class names when running with relocated provider
> >   *
> > @@ -26,12 +30,12 @@ package org.apache.maven.plugin.surefire.util;
> >   */
> >  public class Relocator
> >  {
> > -    private final String relocation;
> > +    private final @Nullable String relocation;
> >
> >      private static final String relocationBase =
> > "org.apache.maven.surefire.";
> >
> >
> > -    public Relocator( String relocation )
> > +    public Relocator( @Nullable String relocation )
> >      {
> >          this.relocation = relocation;
> >      }
> > @@ -41,12 +45,12 @@ public class Relocator
> >          relocation = "shadefire";
> >      }
> >
> > -    private String getRelocation()
> > +    private @Nullable String getRelocation()
> >      {
> >          return relocation;
> >      }
> >
> > -    public String relocate( String className )
> > +    public @NotNull String relocate( @NotNull String className )
> >      {
> >          if ( relocation == null )
> >          {
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > l.java
> > ----------------------------------------------------------------------
> diff
> > --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /ScannerUtil.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /ScannerUtil.java index 3498e63..8b80301 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /ScannerUtil.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> >
> >  import org.apache.commons.lang3.StringUtils;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  final class ScannerUtil {
> >
> >       private ScannerUtil() {}
> > @@ -35,22 +37,22 @@ final class ScannerUtil {
> >
> >      private static final String JAVA_CLASS_FILE_EXTENSION = ".class";
> >
> > -    public static String convertToJavaClassName( String test )
> > +    public static @Nonnull String convertToJavaClassName( @Nonnull
> String
> > test ) {
> >          return StringUtils.removeEnd( test, ".class" ).replace( FS, "."
> );
> >      }
> >
> > -    public static String convertJarFileResourceToJavaClassName( String
> test
> > ) +    public static @Nonnull String
> convertJarFileResourceToJavaClassName(
> > @Nonnull String test ) {
> >          return StringUtils.removeEnd( test, ".class" ).replace( "/",
> "." );
> > }
> >
> > -    public static String stripBaseDir( String basedir, String test )
> > +    public static @Nonnull String stripBaseDir( String basedir, String
> test
> > ) {
> >          return StringUtils.removeStart( test, basedir );
> >      }
> >
> > -    public static String[] processIncludesExcludes( List<String> list )
> > +    public static @Nonnull String[] processIncludesExcludes( @Nonnull
> > List<String> list ) {
> >          List<String> newList = new ArrayList<String>();
> >          for ( Object aList : list )
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > ----------------------------------------------------------------------
> > diff --git a/pom.xml b/pom.xml
> > index 677b367..c60f378 100644
> > --- a/pom.xml
> > +++ b/pom.xml
> > @@ -265,6 +265,12 @@
> >          <version>3.8.1</version>
> >          <scope>test</scope>
> >        </dependency>
> > +      <dependency>
> > +        <groupId>com.google.code.findbugs</groupId>
> > +        <artifactId>jsr305</artifactId>
> > +        <version>2.0.1</version>
> > +        <scope>provided</scope>
> > +      </dependency>
> >      </dependencies>
> >    </dependencyManagement>
> >    <dependencies>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: git commit: Added jsr305 annotations

Posted by Stephen Connolly <st...@gmail.com>.
+1 for having some set of @NonNull annotation and picking it. I have raised
my concerns about potential signature change causing classloading issues.
Somebody could do an experiment and prove my concerns to be a pile of
rubbish... in any case, let's pick a set of annotations and use them.


On 8 May 2013 08:57, Kristian Rosenvold <kr...@gmail.com>wrote:

> +1 for making this standard all over the place. As long as we use
> "provided" scope we
> don't have to worry about conflicts either (to my understanding annotations
> don't need to
> be present in the runtime).
>
> The tool support gathered is simply /immense/; at least in IntelliJ idea.
> It tends to
> get a bit viral, so adding it at one level tends to propagate through the
> levels.
>
> Kristian
>
>
> 2013/5/8 Hervé BOUTEMY <he...@free.fr>
>
> > I like this: could we define it as the standard way to add such
> > annotations in
> > whole Maven components? Any problem if we do it in Maven core itself?
> >
> > I'm not a JSR-305 expert, any basic explanation on the
> > com.google.code.findbugs:jsr305 choice is good to know
> >
> > then we could add it to maven parent pom dependencyManagement section,
> and
> > write something into "Maven Developer Centre"
> >
> > Regards,
> >
> > Hervé
> >
> > Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > > Updated Branches:
> > >   refs/heads/master 231773324 -> 7b330f584
> > >
> > >
> > > Added jsr305 annotations
> > >
> > >
> > > Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > > Commit:
> > >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> > >
> > > Branch: refs/heads/master
> > > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > > Parents: 2317733
> > > Author: Kristian Rosenvold <kr...@apache.org>
> > > Authored: Tue May 7 18:49:15 2013 +0200
> > > Committer: Kristian Rosenvold <kr...@apache.org>
> > > Committed: Tue May 7 18:49:15 2013 +0200
> > >
> > > ----------------------------------------------------------------------
> > >  maven-surefire-common/pom.xml                      |    4 ++++
> > >  .../plugin/surefire/AbstractSurefireMojo.java      |    7 +++++--
> > >  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
> > >  .../maven/plugin/surefire/CommonReflector.java     |    8 +++++---
> > >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> > >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> > >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> > >  .../maven/plugin/surefire/util/Relocator.java      |   12 ++++++++----
> > >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10 ++++++----
> > >  pom.xml                                            |    6 ++++++
> > >  10 files changed, 46 insertions(+), 18 deletions(-)
> > > ----------------------------------------------------------------------
> > >
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > > refire-common/pom.xml
> > > ----------------------------------------------------------------------
> > diff
> > > --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
> > index
> > > 1330eec..bed467b 100644
> > > --- a/maven-surefire-common/pom.xml
> > > +++ b/maven-surefire-common/pom.xml
> > > @@ -91,6 +91,10 @@
> > >        <artifactId>commons-lang3</artifactId>
> > >      </dependency>
> > >      <dependency>
> > > +      <groupId>com.google.code.findbugs</groupId>
> > > +      <artifactId>jsr305</artifactId>
> > > +    </dependency>
> > > +    <dependency>
> > >        <groupId>org.apache.maven.shared</groupId>
> > >        <artifactId>maven-common-artifact-filters</artifactId>
> > >        <version>1.3</version>
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > > eMojo.java
> > > ----------------------------------------------------------------------
> > diff
> > > --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > ractSurefireMojo.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > ractSurefireMojo.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > > org.apache.maven.surefire.util.RunOrder;
> > >  import org.apache.maven.toolchain.Toolchain;
> > >  import org.apache.maven.toolchain.ToolchainManager;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  /**
> > >   * Abstract base class for running tests using Surefire.
> > >   *
> > > @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
> > >          }
> > >      }
> > >
> > > -    private List<String> getExcludeList()
> > > +    private @Nonnull List<String> getExcludeList()
> > >      {
> > >          List<String> excludes = null;
> > >          if ( isSpecificTestSpecified() )
> > > @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
> > >          return filterNulls( includes );
> > >      }
> > >
> > > -    private List<String> filterNulls( List<String> toFilter )
> > > +    private @Nonnull List<String> filterNulls( @Nonnull List<String>
> > > toFilter ) {
> > >          List<String> result = new ArrayList<String>( toFilter.size()
> );
> > >          for ( String item : toFilter )
> > > @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
> > >              return new DynamicProviderInfo( providerName );
> > >          }
> > >
> > > +        @Nonnull
> > >          public String getProviderName()
> > >          {
> > >              return providerName;
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > > java
> > ----------------------------------------------------------------------
> > > diff --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > spathCache.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > spathCache.java index 1bcb065..ea250c2 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > spathCache.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > > spathCache.java @@ -21,6 +21,8 @@ package
> > org.apache.maven.plugin.surefire;
> > >  import java.util.concurrent.ConcurrentHashMap;
> > >  import org.apache.maven.surefire.booter.Classpath;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  /**
> > >   * @author Kristian Rosenvold
> > >   */
> > > @@ -29,12 +31,12 @@ public class ClasspathCache
> > >      private static final ConcurrentHashMap<String, Classpath>
> > classpaths =
> > >          new ConcurrentHashMap<String, Classpath>( 4 );
> > >
> > > -    public static Classpath getCachedClassPath( String artifactId )
> > > +    public static Classpath getCachedClassPath( @Nonnull String
> > artifactId
> > > ) {
> > >          return classpaths.get( artifactId );
> > >      }
> > >
> > > -    public static void setCachedClasspath( String key, Classpath
> > classpath
> > > ) +    public static void setCachedClasspath( @Nonnull String key,
> > @Nonnull
> > > Classpath classpath ) {
> > >          classpaths.put( key, classpath );
> > >      }
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > > .java
> > ----------------------------------------------------------------------
> > > diff --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > onReflector.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > onReflector.java index 538b7e0..6851539 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > onReflector.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > > onReflector.java @@ -25,6 +25,8 @@ import
> > > org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import
> > > org.apache.maven.surefire.util.ReflectionUtils;
> > >  import org.apache.maven.surefire.util.SurefireReflectionException;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  /**
> > >   * @author Kristian Rosenvold
> > >   */
> > > @@ -34,7 +36,7 @@ public class CommonReflector
> > >
> > >      private final ClassLoader surefireClassLoader;
> > >
> > > -    public CommonReflector( ClassLoader surefireClassLoader )
> > > +    public CommonReflector( @Nonnull ClassLoader surefireClassLoader )
> > >      {
> > >          this.surefireClassLoader = surefireClassLoader;
> > >
> > > @@ -48,7 +50,7 @@ public class CommonReflector
> > >          }
> > >      }
> > >
> > > -    public Object createReportingReporterFactory(
> > > StartupReportConfiguration startupReportConfiguration ) +    public
> > Object
> > > createReportingReporterFactory( @Nonnull StartupReportConfiguration
> > > startupReportConfiguration ) {
> > >          Class<?>[] args = new Class[]{ this.startupReportConfiguration
> > };
> > >          Object src = createStartupReportConfiguration(
> > > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > > CommonReflector
> > >      }
> > >
> > >
> > > -    Object createStartupReportConfiguration(
> StartupReportConfiguration
> > > reporterConfiguration ) +    Object createStartupReportConfiguration(
> > > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> > >          Constructor<?> constructor = ReflectionUtils.getConstructor(
> > > this.startupReportConfiguration, new Class[]{ boolean.class,
> > boolean.class,
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > > va
> ----------------------------------------------------------------------
> > > diff --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > iderInfo.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > iderInfo.java index 57069d8..50de7ea 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > iderInfo.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > > iderInfo.java @@ -24,11 +24,14 @@ import
> > > org.apache.maven.artifact.resolver.ArtifactResolutionException; import
> > > org.apache.maven.plugin.MojoExecutionException;
> > >  import org.apache.maven.surefire.booter.Classpath;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  /**
> > >   * @author Kristian Rosenvold
> > >   */
> > >  public interface ProviderInfo
> > >  {
> > > +    @Nonnull
> > >      String getProviderName();
> > >
> > >      boolean isApplicable();
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > > rkConfiguration.java
> > > ----------------------------------------------------------------------
> > diff
> > > --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > erclient/ForkConfiguration.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > erclient/ForkConfiguration.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> > > ForkConfiguration
> > >
> > >      /**
> > >       * @param classPath            cla the classpath arguments
> > > -     * @param startupConfiguration
> > > +     * @param startupConfiguration The startup configuration
> > >       * @param threadNumber         the thread number, to be the
> > replacement
> > > in the argLine   @return A commandline * @throws
> > > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > > when unable to perform the fork
> > > @@ -208,7 +208,7 @@ public class ForkConfiguration
> > >       * for all classpath elements.
> > >       *
> > >       * @param classPath      List&lt;String> of all classpath
> elements.
> > > -     * @param startClassName
> > > +     * @param startClassName  The classname to start (main-class)
> > >       * @return The file pointint to the jar
> > >       * @throws java.io.IOException When a file operation fails.
> > >       */
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > > Scanner.java
> > > ----------------------------------------------------------------------
> > diff
> > > --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /DependencyScanner.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /DependencyScanner.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > > org.apache.maven.plugin.MojoExecutionException; import
> > > org.apache.maven.shared.utils.io.MatchPatterns;
> > >  import org.apache.maven.surefire.util.DefaultScanResult;
> > >
> > > +import javax.annotation.Nullable;
> > > +
> > >  /**
> > >   * Scans dependencies looking for tests.
> > >   *
> > > @@ -141,7 +143,7 @@ public class DependencyScanner {
> > >
> > >               private SpecificFileFilter specificTestFilter;
> > >
> > > -             public Matcher(List<String> includes, List<String>
> > excludes,
> > List<String>
> > > specificTests) +              public Matcher(@Nullable List<String>
> > includes,
> > @Nullable
> > > List<String> excludes, @Nullable List<String> specificTests) {
> > >                       String[] specific = specificTests == null ? new
> > String[0] :
> > > processIncludesExcludes( specificTests ); specificTestFilter = new
> > > SpecificFileFilter( specific );
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > > java
> > ----------------------------------------------------------------------
> > > diff --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /Relocator.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /Relocator.java index 31dde5d..76da9de 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /Relocator.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /Relocator.java @@ -19,6 +19,10 @@ package
> > > org.apache.maven.plugin.surefire.util;
> > >   * under the License.
> > >   */
> > >
> > > +import com.sun.istack.internal.NotNull;
> > > +
> > > +import javax.annotation.Nullable;
> > > +
> > >  /**
> > >   * Relocates class names when running with relocated provider
> > >   *
> > > @@ -26,12 +30,12 @@ package org.apache.maven.plugin.surefire.util;
> > >   */
> > >  public class Relocator
> > >  {
> > > -    private final String relocation;
> > > +    private final @Nullable String relocation;
> > >
> > >      private static final String relocationBase =
> > > "org.apache.maven.surefire.";
> > >
> > >
> > > -    public Relocator( String relocation )
> > > +    public Relocator( @Nullable String relocation )
> > >      {
> > >          this.relocation = relocation;
> > >      }
> > > @@ -41,12 +45,12 @@ public class Relocator
> > >          relocation = "shadefire";
> > >      }
> > >
> > > -    private String getRelocation()
> > > +    private @Nullable String getRelocation()
> > >      {
> > >          return relocation;
> > >      }
> > >
> > > -    public String relocate( String className )
> > > +    public @NotNull String relocate( @NotNull String className )
> > >      {
> > >          if ( relocation == null )
> > >          {
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > >
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > > l.java
> > > ----------------------------------------------------------------------
> > diff
> > > --git
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /ScannerUtil.java
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /ScannerUtil.java index 3498e63..8b80301 100644
> > > ---
> > >
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /ScannerUtil.java +++
> > >
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> > >
> > >  import org.apache.commons.lang3.StringUtils;
> > >
> > > +import javax.annotation.Nonnull;
> > > +
> > >  final class ScannerUtil {
> > >
> > >       private ScannerUtil() {}
> > > @@ -35,22 +37,22 @@ final class ScannerUtil {
> > >
> > >      private static final String JAVA_CLASS_FILE_EXTENSION = ".class";
> > >
> > > -    public static String convertToJavaClassName( String test )
> > > +    public static @Nonnull String convertToJavaClassName( @Nonnull
> > String
> > > test ) {
> > >          return StringUtils.removeEnd( test, ".class" ).replace( FS,
> "."
> > );
> > >      }
> > >
> > > -    public static String convertJarFileResourceToJavaClassName( String
> > test
> > > ) +    public static @Nonnull String
> > convertJarFileResourceToJavaClassName(
> > > @Nonnull String test ) {
> > >          return StringUtils.removeEnd( test, ".class" ).replace( "/",
> > "." );
> > > }
> > >
> > > -    public static String stripBaseDir( String basedir, String test )
> > > +    public static @Nonnull String stripBaseDir( String basedir, String
> > test
> > > ) {
> > >          return StringUtils.removeStart( test, basedir );
> > >      }
> > >
> > > -    public static String[] processIncludesExcludes( List<String> list
> )
> > > +    public static @Nonnull String[] processIncludesExcludes( @Nonnull
> > > List<String> list ) {
> > >          List<String> newList = new ArrayList<String>();
> > >          for ( Object aList : list )
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > > ----------------------------------------------------------------------
> > > diff --git a/pom.xml b/pom.xml
> > > index 677b367..c60f378 100644
> > > --- a/pom.xml
> > > +++ b/pom.xml
> > > @@ -265,6 +265,12 @@
> > >          <version>3.8.1</version>
> > >          <scope>test</scope>
> > >        </dependency>
> > > +      <dependency>
> > > +        <groupId>com.google.code.findbugs</groupId>
> > > +        <artifactId>jsr305</artifactId>
> > > +        <version>2.0.1</version>
> > > +        <scope>provided</scope>
> > > +      </dependency>
> > >      </dependencies>
> > >    </dependencyManagement>
> > >    <dependencies>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>

Re: git commit: Added jsr305 annotations

Posted by Kristian Rosenvold <kr...@gmail.com>.
+1 for making this standard all over the place. As long as we use
"provided" scope we
don't have to worry about conflicts either (to my understanding annotations
don't need to
be present in the runtime).

The tool support gathered is simply /immense/; at least in IntelliJ idea.
It tends to
get a bit viral, so adding it at one level tends to propagate through the
levels.

Kristian


2013/5/8 Hervé BOUTEMY <he...@free.fr>

> I like this: could we define it as the standard way to add such
> annotations in
> whole Maven components? Any problem if we do it in Maven core itself?
>
> I'm not a JSR-305 expert, any basic explanation on the
> com.google.code.findbugs:jsr305 choice is good to know
>
> then we could add it to maven parent pom dependencyManagement section, and
> write something into "Maven Developer Centre"
>
> Regards,
>
> Hervé
>
> Le mardi 7 mai 2013 16:49:25 krosenvold@apache.org a écrit :
> > Updated Branches:
> >   refs/heads/master 231773324 -> 7b330f584
> >
> >
> > Added jsr305 annotations
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
> > Commit:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7b330f58Tree:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7b330f58Diff:
> > http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7b330f58
> >
> > Branch: refs/heads/master
> > Commit: 7b330f5845d9952a75ff5949d5f46fa913254308
> > Parents: 2317733
> > Author: Kristian Rosenvold <kr...@apache.org>
> > Authored: Tue May 7 18:49:15 2013 +0200
> > Committer: Kristian Rosenvold <kr...@apache.org>
> > Committed: Tue May 7 18:49:15 2013 +0200
> >
> > ----------------------------------------------------------------------
> >  maven-surefire-common/pom.xml                      |    4 ++++
> >  .../plugin/surefire/AbstractSurefireMojo.java      |    7 +++++--
> >  .../maven/plugin/surefire/ClasspathCache.java      |    6 ++++--
> >  .../maven/plugin/surefire/CommonReflector.java     |    8 +++++---
> >  .../apache/maven/plugin/surefire/ProviderInfo.java |    3 +++
> >  .../surefire/booterclient/ForkConfiguration.java   |    4 ++--
> >  .../plugin/surefire/util/DependencyScanner.java    |    4 +++-
> >  .../maven/plugin/surefire/util/Relocator.java      |   12 ++++++++----
> >  .../maven/plugin/surefire/util/ScannerUtil.java    |   10 ++++++----
> >  pom.xml                                            |    6 ++++++
> >  10 files changed, 46 insertions(+), 18 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> > refire-common/pom.xml
> > ----------------------------------------------------------------------
> diff
> > --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
> index
> > 1330eec..bed467b 100644
> > --- a/maven-surefire-common/pom.xml
> > +++ b/maven-surefire-common/pom.xml
> > @@ -91,6 +91,10 @@
> >        <artifactId>commons-lang3</artifactId>
> >      </dependency>
> >      <dependency>
> > +      <groupId>com.google.code.findbugs</groupId>
> > +      <artifactId>jsr305</artifactId>
> > +    </dependency>
> > +    <dependency>
> >        <groupId>org.apache.maven.shared</groupId>
> >        <artifactId>maven-common-artifact-filters</artifactId>
> >        <version>1.3</version>
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefir
> > eMojo.java
> > ----------------------------------------------------------------------
> diff
> > --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > ractSurefireMojo.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > ractSurefireMojo.java index bcd5737..bb1f6ff 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > ractSurefireMojo.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Abst
> > ractSurefireMojo.java @@ -88,6 +88,8 @@ import
> > org.apache.maven.surefire.util.RunOrder;
> >  import org.apache.maven.toolchain.Toolchain;
> >  import org.apache.maven.toolchain.ToolchainManager;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  /**
> >   * Abstract base class for running tests using Surefire.
> >   *
> > @@ -1266,7 +1268,7 @@ public abstract class AbstractSurefireMojo
> >          }
> >      }
> >
> > -    private List<String> getExcludeList()
> > +    private @Nonnull List<String> getExcludeList()
> >      {
> >          List<String> excludes = null;
> >          if ( isSpecificTestSpecified() )
> > @@ -1339,7 +1341,7 @@ public abstract class AbstractSurefireMojo
> >          return filterNulls( includes );
> >      }
> >
> > -    private List<String> filterNulls( List<String> toFilter )
> > +    private @Nonnull List<String> filterNulls( @Nonnull List<String>
> > toFilter ) {
> >          List<String> result = new ArrayList<String>( toFilter.size() );
> >          for ( String item : toFilter )
> > @@ -2130,6 +2132,7 @@ public abstract class AbstractSurefireMojo
> >              return new DynamicProviderInfo( providerName );
> >          }
> >
> > +        @Nonnull
> >          public String getProviderName()
> >          {
> >              return providerName;
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.
> > java
> ----------------------------------------------------------------------
> > diff --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > spathCache.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > spathCache.java index 1bcb065..ea250c2 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > spathCache.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Clas
> > spathCache.java @@ -21,6 +21,8 @@ package
> org.apache.maven.plugin.surefire;
> >  import java.util.concurrent.ConcurrentHashMap;
> >  import org.apache.maven.surefire.booter.Classpath;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  /**
> >   * @author Kristian Rosenvold
> >   */
> > @@ -29,12 +31,12 @@ public class ClasspathCache
> >      private static final ConcurrentHashMap<String, Classpath>
> classpaths =
> >          new ConcurrentHashMap<String, Classpath>( 4 );
> >
> > -    public static Classpath getCachedClassPath( String artifactId )
> > +    public static Classpath getCachedClassPath( @Nonnull String
> artifactId
> > ) {
> >          return classpaths.get( artifactId );
> >      }
> >
> > -    public static void setCachedClasspath( String key, Classpath
> classpath
> > ) +    public static void setCachedClasspath( @Nonnull String key,
> @Nonnull
> > Classpath classpath ) {
> >          classpaths.put( key, classpath );
> >      }
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector
> > .java
> ----------------------------------------------------------------------
> > diff --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > onReflector.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > onReflector.java index 538b7e0..6851539 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > onReflector.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Comm
> > onReflector.java @@ -25,6 +25,8 @@ import
> > org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import
> > org.apache.maven.surefire.util.ReflectionUtils;
> >  import org.apache.maven.surefire.util.SurefireReflectionException;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  /**
> >   * @author Kristian Rosenvold
> >   */
> > @@ -34,7 +36,7 @@ public class CommonReflector
> >
> >      private final ClassLoader surefireClassLoader;
> >
> > -    public CommonReflector( ClassLoader surefireClassLoader )
> > +    public CommonReflector( @Nonnull ClassLoader surefireClassLoader )
> >      {
> >          this.surefireClassLoader = surefireClassLoader;
> >
> > @@ -48,7 +50,7 @@ public class CommonReflector
> >          }
> >      }
> >
> > -    public Object createReportingReporterFactory(
> > StartupReportConfiguration startupReportConfiguration ) +    public
> Object
> > createReportingReporterFactory( @Nonnull StartupReportConfiguration
> > startupReportConfiguration ) {
> >          Class<?>[] args = new Class[]{ this.startupReportConfiguration
> };
> >          Object src = createStartupReportConfiguration(
> > startupReportConfiguration ); @@ -58,7 +60,7 @@ public class
> > CommonReflector
> >      }
> >
> >
> > -    Object createStartupReportConfiguration( StartupReportConfiguration
> > reporterConfiguration ) +    Object createStartupReportConfiguration(
> > @Nonnull StartupReportConfiguration reporterConfiguration ) {
> >          Constructor<?> constructor = ReflectionUtils.getConstructor(
> > this.startupReportConfiguration, new Class[]{ boolean.class,
> boolean.class,
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.ja
> > va ----------------------------------------------------------------------
> > diff --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > iderInfo.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > iderInfo.java index 57069d8..50de7ea 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > iderInfo.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/Prov
> > iderInfo.java @@ -24,11 +24,14 @@ import
> > org.apache.maven.artifact.resolver.ArtifactResolutionException; import
> > org.apache.maven.plugin.MojoExecutionException;
> >  import org.apache.maven.surefire.booter.Classpath;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  /**
> >   * @author Kristian Rosenvold
> >   */
> >  public interface ProviderInfo
> >  {
> > +    @Nonnull
> >      String getProviderName();
> >
> >      boolean isApplicable();
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/Fo
> > rkConfiguration.java
> > ----------------------------------------------------------------------
> diff
> > --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > erclient/ForkConfiguration.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > erclient/ForkConfiguration.java index 8f6f3c9..ba1aa27 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > erclient/ForkConfiguration.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/boot
> > erclient/ForkConfiguration.java @@ -119,7 +119,7 @@ public class
> > ForkConfiguration
> >
> >      /**
> >       * @param classPath            cla the classpath arguments
> > -     * @param startupConfiguration
> > +     * @param startupConfiguration The startup configuration
> >       * @param threadNumber         the thread number, to be the
> replacement
> > in the argLine   @return A commandline * @throws
> > org.apache.maven.surefire.booter.SurefireBooterForkException *
> > when unable to perform the fork
> > @@ -208,7 +208,7 @@ public class ForkConfiguration
> >       * for all classpath elements.
> >       *
> >       * @param classPath      List&lt;String> of all classpath elements.
> > -     * @param startClassName
> > +     * @param startClassName  The classname to start (main-class)
> >       * @return The file pointint to the jar
> >       * @throws java.io.IOException When a file operation fails.
> >       */
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Dependency
> > Scanner.java
> > ----------------------------------------------------------------------
> diff
> > --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /DependencyScanner.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /DependencyScanner.java index b50f295..b2e8ab8 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /DependencyScanner.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /DependencyScanner.java @@ -34,6 +34,8 @@ import
> > org.apache.maven.plugin.MojoExecutionException; import
> > org.apache.maven.shared.utils.io.MatchPatterns;
> >  import org.apache.maven.surefire.util.DefaultScanResult;
> >
> > +import javax.annotation.Nullable;
> > +
> >  /**
> >   * Scans dependencies looking for tests.
> >   *
> > @@ -141,7 +143,7 @@ public class DependencyScanner {
> >
> >               private SpecificFileFilter specificTestFilter;
> >
> > -             public Matcher(List<String> includes, List<String>
> excludes,
> List<String>
> > specificTests) +              public Matcher(@Nullable List<String>
> includes,
> @Nullable
> > List<String> excludes, @Nullable List<String> specificTests) {
> >                       String[] specific = specificTests == null ? new
> String[0] :
> > processIncludesExcludes( specificTests ); specificTestFilter = new
> > SpecificFileFilter( specific );
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/Relocator.
> > java
> ----------------------------------------------------------------------
> > diff --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /Relocator.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /Relocator.java index 31dde5d..76da9de 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /Relocator.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /Relocator.java @@ -19,6 +19,10 @@ package
> > org.apache.maven.plugin.surefire.util;
> >   * under the License.
> >   */
> >
> > +import com.sun.istack.internal.NotNull;
> > +
> > +import javax.annotation.Nullable;
> > +
> >  /**
> >   * Relocates class names when running with relocated provider
> >   *
> > @@ -26,12 +30,12 @@ package org.apache.maven.plugin.surefire.util;
> >   */
> >  public class Relocator
> >  {
> > -    private final String relocation;
> > +    private final @Nullable String relocation;
> >
> >      private static final String relocationBase =
> > "org.apache.maven.surefire.";
> >
> >
> > -    public Relocator( String relocation )
> > +    public Relocator( @Nullable String relocation )
> >      {
> >          this.relocation = relocation;
> >      }
> > @@ -41,12 +45,12 @@ public class Relocator
> >          relocation = "shadefire";
> >      }
> >
> > -    private String getRelocation()
> > +    private @Nullable String getRelocation()
> >      {
> >          return relocation;
> >      }
> >
> > -    public String relocate( String className )
> > +    public @NotNull String relocate( @NotNull String className )
> >      {
> >          if ( relocation == null )
> >          {
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/maven-su
> >
> refire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUti
> > l.java
> > ----------------------------------------------------------------------
> diff
> > --git
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /ScannerUtil.java
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /ScannerUtil.java index 3498e63..8b80301 100644
> > ---
> >
> a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /ScannerUtil.java +++
> >
> b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util
> > /ScannerUtil.java @@ -25,6 +25,8 @@ import java.util.List;
> >
> >  import org.apache.commons.lang3.StringUtils;
> >
> > +import javax.annotation.Nonnull;
> > +
> >  final class ScannerUtil {
> >
> >       private ScannerUtil() {}
> > @@ -35,22 +37,22 @@ final class ScannerUtil {
> >
> >      private static final String JAVA_CLASS_FILE_EXTENSION = ".class";
> >
> > -    public static String convertToJavaClassName( String test )
> > +    public static @Nonnull String convertToJavaClassName( @Nonnull
> String
> > test ) {
> >          return StringUtils.removeEnd( test, ".class" ).replace( FS, "."
> );
> >      }
> >
> > -    public static String convertJarFileResourceToJavaClassName( String
> test
> > ) +    public static @Nonnull String
> convertJarFileResourceToJavaClassName(
> > @Nonnull String test ) {
> >          return StringUtils.removeEnd( test, ".class" ).replace( "/",
> "." );
> > }
> >
> > -    public static String stripBaseDir( String basedir, String test )
> > +    public static @Nonnull String stripBaseDir( String basedir, String
> test
> > ) {
> >          return StringUtils.removeStart( test, basedir );
> >      }
> >
> > -    public static String[] processIncludesExcludes( List<String> list )
> > +    public static @Nonnull String[] processIncludesExcludes( @Nonnull
> > List<String> list ) {
> >          List<String> newList = new ArrayList<String>();
> >          for ( Object aList : list )
> >
> >
> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7b330f58/pom.xml
> > ----------------------------------------------------------------------
> > diff --git a/pom.xml b/pom.xml
> > index 677b367..c60f378 100644
> > --- a/pom.xml
> > +++ b/pom.xml
> > @@ -265,6 +265,12 @@
> >          <version>3.8.1</version>
> >          <scope>test</scope>
> >        </dependency>
> > +      <dependency>
> > +        <groupId>com.google.code.findbugs</groupId>
> > +        <artifactId>jsr305</artifactId>
> > +        <version>2.0.1</version>
> > +        <scope>provided</scope>
> > +      </dependency>
> >      </dependencies>
> >    </dependencyManagement>
> >    <dependencies>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>