Skip to content

Commit e3600d4

Browse files
committed
chore(black-duck): Remove an unnecessary override
While the function is a proper work-around for the issue in the overridden function, the function is not called anymore by the Black Duck advisor. Signed-off-by: Frank Viernau <[email protected]>
1 parent 330ce58 commit e3600d4

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

plugins/advisors/black-duck/src/main/kotlin/ExtendedComponentService.kt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import com.blackduck.integration.blackduck.api.core.BlackDuckPath
2424
import com.blackduck.integration.blackduck.api.core.response.LinkMultipleResponses
2525
import com.blackduck.integration.blackduck.api.generated.discovery.ApiDiscovery
2626
import com.blackduck.integration.blackduck.api.generated.response.ComponentsView
27-
import com.blackduck.integration.blackduck.api.generated.view.ComponentView
2827
import com.blackduck.integration.blackduck.api.generated.view.OriginView
2928
import com.blackduck.integration.blackduck.api.generated.view.VulnerabilityView
3029
import com.blackduck.integration.blackduck.configuration.BlackDuckServerConfigBuilder
@@ -38,7 +37,6 @@ import com.blackduck.integration.log.SilentIntLogger
3837
import com.blackduck.integration.rest.HttpUrl
3938
import com.blackduck.integration.util.IntEnvironmentVariables
4039

41-
import java.util.Optional
4240
import 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
*/
5957
internal 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

Comments
 (0)