Skip to content

Commit

Permalink
Updated for code review of PR 2717
Browse files Browse the repository at this point in the history
  • Loading branch information
rkesters committed Jul 28, 2023
1 parent ed3bd00 commit 6099607
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 55 deletions.
1 change: 0 additions & 1 deletion cp.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
import java.io.Serializable;

/**
* User-defined key/value model for individual projects.
* User-defined key/value model for individual components.
*
* @author Steve Springett
* @since 3.0.0
* @since 4.9.0
*/
@PersistenceCapable(table = "COMPONENT_PROPERTY")
@Unique(name="COMPONENT_PROPERTY_KEYS_IDX", members={"component", "groupName", "propertyName"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
import javax.jdo.JDOObjectNotFoundException;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.json.Json;
import javax.json.JsonValue;
import org.datanucleus.exceptions.NucleusObjectNotFoundException;
import org.dependencytrack.event.IndexEvent;
import org.dependencytrack.model.Component;
Expand Down Expand Up @@ -245,7 +243,7 @@ public PaginatedResult getComponents(final Project project, final boolean includ
final PackageURL purl = component.getPurl();
if (purl != null) {
final RepositoryType type = RepositoryType.resolve(purl);
if (type != RepositoryType.UNSUPPORTED) {
if ( RepositoryType.UNSUPPORTED != type) {
final RepositoryMetaComponent repoMetaComponent = getRepositoryMetaComponent(type, purl.getNamespace(), purl.getName());
component.setRepositoryMeta(repoMetaComponent);
}
Expand Down Expand Up @@ -356,7 +354,7 @@ public PaginatedResult getComponents(final Project project, final boolean includ
final PackageURL purl = component.getPurl();
if (purl != null) {
final RepositoryType type = RepositoryType.resolve(purl);
if (type != RepositoryType.UNSUPPORTED) {
if (RepositoryType.UNSUPPORTED != type) {
final RepositoryMetaComponent repoMetaComponent = getRepositoryMetaComponent(type, purl.getNamespace(), purl.getName());
component.setRepositoryMeta(repoMetaComponent);
}
Expand Down Expand Up @@ -677,7 +675,7 @@ private void preprocessACLs(final Query<Component> query, final String inputFilt
transientComponent.setExpandDependencyGraph(entry.getValue().isExpandDependencyGraph());
if (transientComponent.getPurl() != null) {
final RepositoryType type = RepositoryType.resolve(transientComponent.getPurl());
if (type != RepositoryType.UNSUPPORTED) {
if (RepositoryType.UNSUPPORTED != type) {
final RepositoryMetaComponent repoMetaComponent = getRepositoryMetaComponent(type, transientComponent.getPurl().getNamespace(), transientComponent.getPurl().getName());
if (repoMetaComponent != null) {
RepositoryMetaComponent transientRepoMetaComponent = new RepositoryMetaComponent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
import io.swagger.annotations.Authorization;

/**
* JAX-RS resources for processing ProjectProperties
* JAX-RS resources for processing component
*
* @author Steve Springett
* @since 3.4.0
* @since 4.9.0
*/
@Path("/v1/component/{uuid}/property")
@Api(value = "componentProperty", authorizations = @Authorization(value = "X-Api-Key"))
Expand Down Expand Up @@ -104,7 +104,7 @@ public Response getProperties(
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(
value = "Creates a new project property",
value = "Creates a new component property",
response = ComponentProperty.class,
code = 201
)
Expand Down Expand Up @@ -149,7 +149,7 @@ public Response createProperty(
return Response.status(Response.Status.CONFLICT).entity("A property with the specified component/group/name combination already exists.").build();
}
} else {
return Response.status(Response.Status.FORBIDDEN).entity("Access to the specified project is forbidden").build();
return Response.status(Response.Status.FORBIDDEN).entity("Access to the specified component is forbidden").build();
}
} else {
return Response.status(Response.Status.NOT_FOUND).entity("The component could not be found.").build();
Expand Down
43 changes: 0 additions & 43 deletions src/main/java/org/dependencytrack/upgrade/v490/v490Updater.java

This file was deleted.

0 comments on commit 6099607

Please sign in to comment.