summaryrefslogtreecommitdiffstats
path: root/archiva-modules/metadata
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2009-11-25 15:18:54 +0000
committerBrett Porter <brett@apache.org>2009-11-25 15:18:54 +0000
commit91cb91a8a2120cc8ed5f8c01c8cf263b6e5e2cef (patch)
treea7a013981e4651e3c09e6db1b8c6792396b5cfda /archiva-modules/metadata
parentb6cf0bf5fa8f2ebcbba0aa96d8c178a5ab871bd1 (diff)
downloadarchiva-91cb91a8a2120cc8ed5f8c01c8cf263b6e5e2cef.tar.gz
archiva-91cb91a8a2120cc8ed5f8c01c8cf263b6e5e2cef.zip
[MRM-1282] fix some problems with the metadata repository
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@884134 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata')
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java2
-rw-r--r--archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java17
2 files changed, 13 insertions, 6 deletions
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
index c2add5b4f..08f4b5a9c 100644
--- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
+++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
@@ -156,6 +156,6 @@ public class ProjectVersionMetadata
public ProjectVersionFacet getFacet( String facetId )
{
- return this.facets.get( facetId );
+ return this.facets != null ? this.facets.get( facetId ) : null;
}
}
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java
index e058ca22d..7a2c5f268 100644
--- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java
+++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java
@@ -37,7 +37,8 @@ public class DefaultMetadataResolver
/**
* FIXME: this needs to be configurable based on storage type, and availability of proxy module
- * ... could be a different type since we need methods to modify the storage metadata
+ * ... could be a different type since we need methods to modify the storage metadata
+ *
* @plexus.requirement role-hint="maven2"
*/
private MetadataResolver storageResolver;
@@ -48,21 +49,27 @@ public class DefaultMetadataResolver
return metadataRepository.getProject( repoId, namespace, projectId );
}
- public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
+ public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolverException
{
- ProjectVersionMetadata metadata = metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion );
+ ProjectVersionMetadata metadata =
+ metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion );
// TODO: do we want to detect changes as well by comparing timestamps? isProjectVersionNewerThan(updated)
// in such cases we might also remove/update stale metadata, including adjusting plugin-based facets
if ( metadata == null )
{
metadata = storageResolver.getProjectVersion( repoId, namespace, projectId, projectVersion );
- metadataRepository.updateProjectVersion( repoId, namespace, projectId, metadata );
+ if ( metadata != null )
+ {
+ metadataRepository.updateProjectVersion( repoId, namespace, projectId, metadata );
+ }
}
return metadata;
}
- public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion )
+ public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
+ String projectVersion )
{
// TODO: intercept
return metadataRepository.getArtifactVersions( repoId, namespace, projectId, projectVersion );