@@ -24,7 +24,6 @@ import com.blackduck.integration.blackduck.api.core.BlackDuckPath
2424import com.blackduck.integration.blackduck.api.core.response.LinkMultipleResponses
2525import com.blackduck.integration.blackduck.api.generated.discovery.ApiDiscovery
2626import com.blackduck.integration.blackduck.api.generated.response.ComponentsView
27- import com.blackduck.integration.blackduck.api.generated.view.ComponentView
2827import com.blackduck.integration.blackduck.api.generated.view.OriginView
2928import com.blackduck.integration.blackduck.api.generated.view.VulnerabilityView
3029import com.blackduck.integration.blackduck.configuration.BlackDuckServerConfigBuilder
@@ -38,7 +37,6 @@ import com.blackduck.integration.log.SilentIntLogger
3837import com.blackduck.integration.rest.HttpUrl
3938import com.blackduck.integration.util.IntEnvironmentVariables
4039
41- import java.util.Optional
4240import java.util.concurrent.Executors
4341
4442// Parameter for BlackDuck services factory, see also
@@ -54,7 +52,7 @@ private val KB_COMPONENTS_SEARCH_PATH = BlackDuckPath(
5452)
5553
5654/* *
57- * This class adds a couple of functions which are missing in the super class and fixes an issue with an override .
55+ * This class adds a couple of functions which are missing in the super class.
5856 */
5957internal class ExtendedComponentService (
6058 blackDuckApiClient : BlackDuckApiClient ,
@@ -84,17 +82,6 @@ internal class ExtendedComponentService(
8482 override fun searchKbComponentsByExternalId (externalId : ExternalId ): List <ComponentsView > =
8583 getAllSearchResults(externalId)
8684
87- override fun getComponentView (searchResult : ComponentsView ): Optional <ComponentView > {
88- // The super function accidentally uses the URL to the version view, while it should use the URL to the
89- // component view. This override fixes that.
90- if (searchResult.component.isNotBlank()) {
91- val url = HttpUrl (searchResult.component)
92- return Optional .ofNullable(blackDuckApiClient.getResponse(url, ComponentView ::class .java))
93- } else {
94- return Optional .empty()
95- }
96- }
97-
9885 override fun getOriginView (searchResult : ComponentsView ): OriginView ? {
9986 if (searchResult.variant.isNullOrBlank()) return null
10087
0 commit comments