From b6952ca22f8907383dabe8356585ddd0d585ffd4 Mon Sep 17 00:00:00 2001 From: nscuro Date: Mon, 27 Nov 2023 20:09:50 +0100 Subject: [PATCH] Remove unused `ProjectQueryManager#updateProject` method Signed-off-by: nscuro --- .../persistence/ProjectQueryManager.java | 34 ------------------- .../persistence/QueryManager.java | 4 --- 2 files changed, 38 deletions(-) diff --git a/src/main/java/org/dependencytrack/persistence/ProjectQueryManager.java b/src/main/java/org/dependencytrack/persistence/ProjectQueryManager.java index 9aa6aad106..07a077643c 100644 --- a/src/main/java/org/dependencytrack/persistence/ProjectQueryManager.java +++ b/src/main/java/org/dependencytrack/persistence/ProjectQueryManager.java @@ -508,40 +508,6 @@ public Project createProject(final Project project, List tags, boolean comm return result; } - /** - * Updates an existing Project. - * @param uuid the uuid of the project to update - * @param name the name of the project - * @param description a description of the project - * @param version the project version - * @param tags a List of Tags - these will be resolved if necessary - * @param purl an optional Package URL - * @param active specified if the project is active - * @param commitIndex specifies if the search index should be committed (an expensive operation) - * @return the updated Project - */ - @Override - public Project updateProject(UUID uuid, String name, String description, String version, List tags, PackageURL purl, boolean active, boolean commitIndex) { - final Project project = getObjectByUuid(Project.class, uuid); - project.setName(name); - project.setDescription(description); - project.setVersion(version); - project.setPurl(purl); - - if (!active && Boolean.TRUE.equals(project.isActive()) && hasActiveChild(project)){ - throw new IllegalArgumentException("Project cannot be set to inactive, if active children are present."); - } - project.setActive(active); - - final List resolvedTags = resolveTags(tags); - bind(project, resolvedTags); - - final Project result = persist(project); - Event.dispatch(new IndexEvent(IndexEvent.Action.UPDATE, result)); - commitSearchIndex(commitIndex, Project.class); - return result; - } - /** * Updates an existing Project. * @param transientProject the project to update diff --git a/src/main/java/org/dependencytrack/persistence/QueryManager.java b/src/main/java/org/dependencytrack/persistence/QueryManager.java index e44d74ff4a..3df1f76761 100644 --- a/src/main/java/org/dependencytrack/persistence/QueryManager.java +++ b/src/main/java/org/dependencytrack/persistence/QueryManager.java @@ -431,10 +431,6 @@ public Project createProject(final Project project, List tags, boolean comm return getProjectQueryManager().createProject(project, tags, commitIndex); } - public Project updateProject(UUID uuid, String name, String description, String version, List tags, PackageURL purl, boolean active, boolean commitIndex) { - return getProjectQueryManager().updateProject(uuid, name, description, version, tags, purl, active, commitIndex); - } - public Project updateProject(Project transientProject, boolean commitIndex) { return getProjectQueryManager().updateProject(transientProject, commitIndex); }