Skip to content

FormattingConversionServiceFactoryBean.setConverters declares Set<Object> ParameterizedType restricting programmatic usage [SPR-6742] #11408

@spring-projects-issues

Description

@spring-projects-issues

Keith Donald opened SPR-6742 and commented

Shouldn't:

public void setConverters(Set<Object> converters)

be written as:

public void setConverters(Set<? extends Object> converters)

?

With the current declaration, the compiler won't allow me to do something as simple as:

FormattingConversionServiceFactoryBean factory = new FormattingConversionServiceFactoryBean();
Set<MyGenericConverter> converters = Collections.singleton(new MyGenericConverter());
factory.setConverters(converters);

There may be other places in the code base where this is an issue if I recall.


Referenced from: commits 6fcca3c

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions