You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
abstract class Test {
abstract <T> @NonNull T get(Class<T> type);
Collection<Map.Entry<String, String>> getEndpointMap(Stream<Test> tests) {
return tests
.map(val -> Map.entry(val.get(String.class), val.get(String.class)))
.toList();
}
}
compilation fails with
C:\Projects\pvyscomponents\java\libs\kernel\repository\api\src\main\java\com\provys\repository\Test.java:22:30
java: [return] incompatible types in return.
type of expression: @Initialized @NonNull Entry<@Initialized @NonNull String, @Initialized @Nullable String>
method return type: @Initialized @NonNull Entry<@Initialized @NonNull String, @Initialized @NonNull String>
It is a bit strange that if type arguments for Map.entry are specified in offending line, code compiles without warnings .map(val -> Map.<String, String>entry(val.get(String.class), val.get(String.class)))
The text was updated successfully, but these errors were encountered:
compilation fails with
It is a bit strange that if type arguments for Map.entry are specified in offending line, code compiles without warnings
.map(val -> Map.<String, String>entry(val.get(String.class), val.get(String.class)))
The text was updated successfully, but these errors were encountered: