You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2009/11/14 00:49:14 UTC
svn commit: r836062 - in
/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus:
DefaultPlexusMercury.java PlexusMercury.java PlexusMercuryException.java
Author: olamy
Date: Fri Nov 13 23:49:13 2009
New Revision: 836062
URL: http://svn.apache.org/viewvc?rev=836062&view=rev
Log:
apply some formatting
Modified:
maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java
maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java
Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java?rev=836062&r1=836061&r2=836062&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java (original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/DefaultPlexusMercury.java Fri Nov 13 23:49:13 2009
@@ -96,11 +96,13 @@
DependencyProcessor dp = null;
if ( _dependencyProcessors != null )
+ {
dp = _dependencyProcessors.get( hint );
-
+ }
if ( dp == null )
+ {
throw new RepositoryException( LANG.getMessage( "no.dep.processor.injected", hint ) );
-
+ }
return dp;
}
@@ -201,8 +203,9 @@
throws RepositoryException
{
if ( repo == null )
+ {
throw new RepositoryException( LANG.getMessage( "null.repo" ) );
-
+ }
RepositoryWriter wr = repo.getWriter();
wr.writeArtifacts( artifacts );
@@ -215,27 +218,36 @@
throws RepositoryException
{
if ( Util.isEmpty( repos ) )
+ {
throw new RepositoryException( LANG.getMessage( "null.repo" ) );
-
+ }
VirtualRepositoryReader vr = new VirtualRepositoryReader( repos );
ArtifactResults ar = vr.readArtifacts( artifacts );
if ( ar == null || !ar.hasResults() )
+ {
return null;
-
+ }
+
if ( ar.hasExceptions() && LOG.isWarnEnabled() )
+ {
LOG.info( ar.getExceptions().toString() );
-
+ }
+
if ( !ar.hasResults() )
+ {
return null;
-
+ }
+
Map<ArtifactMetadata, List<Artifact>> am = ar.getResults();
List<Artifact> al = new ArrayList<Artifact>();
for ( Map.Entry<ArtifactMetadata, List<Artifact>> e : am.entrySet() )
+ {
al.addAll( e.getValue() );
-
+ }
+
return al;
}
@@ -285,8 +297,10 @@
throws RepositoryException
{
if ( Util.isEmpty( artifacts ) || artifacts.isEmpty() )
+ {
throw new IllegalArgumentException( LANG.getMessage( "no.artifacts" ) );
-
+ }
+
try
{
DependencyBuilder depBuilder =
@@ -319,8 +333,10 @@
throws RepositoryException
{
if ( Util.isEmpty( artifacts ) || artifacts.isEmpty() )
+ {
throw new IllegalArgumentException( LANG.getMessage( "no.artifacts" ) );
-
+ }
+
try
{
DependencyBuilder depBuilder =
@@ -375,11 +391,15 @@
MetadataResults res = vr.readVersions( q );
if ( res == null )
+ {
return null;
-
+ }
+
if ( res.hasExceptions() && LOG.isWarnEnabled() )
+ {
LOG.warn( res.getExceptions().toString() );
-
+ }
+
return res.getResult( query );
}
@@ -400,13 +420,15 @@
repos.add( lr );
if ( nRemote > 0 )
+ {
for ( String url : urls )
{
RemoteRepositoryM2 rr = new RemoteRepositoryM2( url, dp );
repos.add( rr );
}
-
+ }
+
return repos;
}
Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java?rev=836062&r1=836061&r2=836062&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java (original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercury.java Fri Nov 13 23:49:13 2009
@@ -54,7 +54,7 @@
* @return the dependency processor
* @throws RepositoryException
*/
- public DependencyProcessor findDependencyProcessor()
+ DependencyProcessor findDependencyProcessor()
throws RepositoryException;
/**
@@ -64,7 +64,7 @@
* @return the dependency processor
* @throws RepositoryException
*/
- public DependencyProcessor findDependencyProcessor( String hint )
+ DependencyProcessor findDependencyProcessor( String hint )
throws RepositoryException;
/**
@@ -76,7 +76,7 @@
* @return pgp verifier factory to be sent to Repository
* @throws PlexusMercuryException
*/
- public PgpStreamVerifierFactory createPgpReaderFactory( boolean lenient, boolean sufficient, InputStream pubRing )
+ PgpStreamVerifierFactory createPgpReaderFactory( boolean lenient, boolean sufficient, InputStream pubRing )
throws StreamVerifierException;
/**
@@ -90,7 +90,7 @@
* @return pgp verifier factory to be sent to Repository
* @throws PlexusMercuryException
*/
- public PgpStreamVerifierFactory createPgpWriterFactory( boolean lenient, boolean sufficient, InputStream secRing,
+ PgpStreamVerifierFactory createPgpWriterFactory( boolean lenient, boolean sufficient, InputStream secRing,
String keyId, String keyPass )
throws StreamVerifierException;
@@ -111,7 +111,7 @@
* @return repository instance
* @throws PlexusMercuryException
*/
- public RemoteRepositoryM2 constructRemoteRepositoryM2( String id, URL serverUrl, String serverUser,
+ RemoteRepositoryM2 constructRemoteRepositoryM2( String id, URL serverUrl, String serverUser,
String serverPass, URL proxyUrl, String proxyUser,
String proxyPass,
Set<StreamObserverFactory> readerStreamObservers,
@@ -132,7 +132,7 @@
* @return repository instance
* @throws PlexusMercuryException
*/
- public LocalRepositoryM2 constructLocalRepositoryM2( String id, File rootDir,
+ LocalRepositoryM2 constructLocalRepositoryM2( String id, File rootDir,
Set<StreamObserverFactory> readerStreamObservers,
Set<StreamVerifierFactory> readerStreamVerifiers,
Set<StreamObserverFactory> writerStreamObservers,
@@ -147,7 +147,7 @@
* @return repository list
* @throws PlexusMercuryException
*/
- public List<Repository> constructRepositories( String localDir, String... urls )
+ List<Repository> constructRepositories( String localDir, String... urls )
throws RepositoryException;
/**
@@ -158,10 +158,10 @@
* @return
* @throws PlexusMercuryException
*/
- public void write( Repository repo, Artifact... artifacts )
+ void write( Repository repo, Artifact... artifacts )
throws RepositoryException;
- public void write( Repository repo, Collection<Artifact> artifacts )
+ void write( Repository repo, Collection<Artifact> artifacts )
throws RepositoryException;
/**
@@ -172,10 +172,10 @@
* @return
* @throws PlexusMercuryException
*/
- public List<Artifact> read( List<Repository> repo, List<? extends ArtifactMetadata> artifacts )
+ List<Artifact> read( List<Repository> repo, List<? extends ArtifactMetadata> artifacts )
throws RepositoryException;
- public List<Artifact> read( List<Repository> repo, ArtifactMetadata... artifacts )
+ List<Artifact> read( List<Repository> repo, ArtifactMetadata... artifacts )
throws RepositoryException;
/**
@@ -189,27 +189,27 @@
* @return
* @throws PlexusMercuryException
*/
- public List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum scope,
+ List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum scope,
ArtifactQueryList artifacts, ArtifactInclusionList inclusions,
ArtifactExclusionList exclusions )
throws RepositoryException;
- public List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum scope,
+ List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum scope,
ArtifactQueryList artifacts, ArtifactInclusionList inclusions,
ArtifactExclusionList exclusions, Map<String, ?> config )
throws RepositoryException;
- public MetadataTreeNode resolveAsTree( List<Repository> repos, ArtifactScopeEnum scope,
+ MetadataTreeNode resolveAsTree( List<Repository> repos, ArtifactScopeEnum scope,
ArtifactQueryList artifacts, ArtifactInclusionList inclusions,
ArtifactExclusionList exclusions )
throws RepositoryException;
- public MetadataTreeNode resolveAsTree( List<Repository> repos, ArtifactScopeEnum scope,
+ MetadataTreeNode resolveAsTree( List<Repository> repos, ArtifactScopeEnum scope,
ArtifactQueryList artifacts, ArtifactInclusionList inclusions,
ArtifactExclusionList exclusions, Map<String, ?> config )
throws RepositoryException;
- public List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum scope, ArtifactMetadata metadata )
+ List<ArtifactMetadata> resolve( List<Repository> repos, ArtifactScopeEnum scope, ArtifactMetadata metadata )
throws RepositoryException;
/**
@@ -220,6 +220,6 @@
* @return list of found version metadatas
* @throws PlexusMercuryException
*/
- public List<ArtifactMetadata> readVersions( List<Repository> repos, ArtifactMetadata query )
+ List<ArtifactMetadata> readVersions( List<Repository> repos, ArtifactMetadata query )
throws RepositoryException;
}
Modified: maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java?rev=836062&r1=836061&r2=836062&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java (original)
+++ maven/mercury/trunk/mercury-plexus/src/main/java/org/apache/maven/mercury/plexus/PlexusMercuryException.java Fri Nov 13 23:49:13 2009
@@ -24,6 +24,7 @@
public PlexusMercuryException()
{
+ // nothing
}
public PlexusMercuryException( String message )