Code: Select all
List auth = routeProperties.getAuth();
for (Route authRoute : auth) {
addAuthRoute(authRoute);
}
Code: Select all
Foreach not applicable to type 'java.util.List'
Code: Select all
@Component
@ConfigurationProperties(prefix = "routes")
public class RouteProperties {
@Setter
private List auth;
public List getAuth() {
if (auth == null) {
auth = new ArrayList();
}
return auth;
}
}
< /code>
Da der Code noch ausgeführt wird und die Tests noch bestehen, gehe ich davon aus, dass dies auf der Seite von Intellij ein falsch positives ist. Also habe ich alles ausprobiert, was ich mir vorstellen kann, um dies loszuwerden. Dinge, die ich ausprobiert habe, sind: < /p>
[list]
[*] Gradle Clean & Gradle Build < /li>
Deleting des .idea -Ordners < /li>
Deleting des Build -Ordners < /li>
uikidate yarty. />
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
< /code>
< /li>
java {
sourceCompatibility = 21
targetCompatibility = 21
}
Die falsch positive positive bestand in beiden Fällen.>