Skip to content

Commit

Permalink
refactor(azure): fix incompatible generic type issue faced during upg…
Browse files Browse the repository at this point in the history
…rade to springboot 2.5.15

While upgrading springboot 2.5.15, encounter below error in clouddriver-azure module:
```
startup failed:
/clouddriver/clouddriver-azure/src/main/groovy/com/netflix/spinnaker/clouddriver/azure/client/AzureNetworkClient.groovy: 234: [Static type checking] - Incompatible generic argument types. Cannot assign java.util.List <java.lang.Object> to: java.util.Collection <AzureAppGatewayDescription>
 @ line 234, column 5.
       result
       ^

/clouddriver/clouddriver-azure/src/main/groovy/com/netflix/spinnaker/clouddriver/azure/security/AzureCredentialsInitializer.groovy: 63: [Static type checking] - Incompatible generic argument types. Cannot assign java.util.List <java.lang.Object> to: java.util.List <AzureNamedAccountCredentials>
 @ line 63, column 5.
       azureAccounts
       ^

2 errors

> Task :clouddriver-azure:compileGroovy FAILED
```
To fix this issue use explicit typecasting of relevant variable.
  • Loading branch information
j-sandy committed Nov 1, 2023
1 parent 20a8cf6 commit fca36c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class AzureNetworkClient extends AzureBaseClient {
* @return a Collection of objects which represent an Application Gateway in Azure
*/
Collection<AzureAppGatewayDescription> getAppGatewaysAll(String region) {
def result = []
Collection<AzureAppGatewayDescription> result = []

try {
def currentTime = System.currentTimeMillis()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ class AzureCredentialsInitializer {
}
}

azureAccounts
azureAccounts as List<AzureNamedAccountCredentials>
}
}

0 comments on commit fca36c3

Please sign in to comment.