fix(java): check if a version exists when determining GAV by file name for jar files (#5630)

This commit is contained in:
DmitriyLewen
2024-01-10 13:22:50 +06:00
committed by GitHub
parent d0c81e23c4
commit 37e7e3eabf
3 changed files with 8 additions and 8 deletions

View File

@@ -142,8 +142,8 @@ func (d *DB) SearchBySHA1(sha1 string) (jar.Properties, error) {
}, nil
}
func (d *DB) SearchByArtifactID(artifactID string) (string, error) {
indexes, err := d.driver.SelectIndexesByArtifactIDAndFileType(artifactID, types.JarType)
func (d *DB) SearchByArtifactID(artifactID, version string) (string, error) {
indexes, err := d.driver.SelectIndexesByArtifactIDAndFileType(artifactID, version, types.JarType)
if err != nil {
return "", xerrors.Errorf("select error: %w", err)
} else if len(indexes) == 0 {