Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeDescriptor#getElementTypeDescriptor does not throw IllegalStateException anymore #23996

Closed
michael-simons opened this issue Nov 14, 2019 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Milestone

Comments

@michael-simons
Copy link
Contributor

michael-simons commented Nov 14, 2019

The JavaDoc of TypeDescriptor#getElementTypeDescriptor states

@throws IllegalStateException if this type is not a {@code java.util.Collection} or array type

However, that is not the case:

public static void main(String...a) {
	System.out.println(TypeDescriptor.valueOf(String.class).getElementTypeDescriptor());
	System.out.println(TypeDescriptor.valueOf(String[].class).getElementTypeDescriptor());
}

This works without an exception.

I would provide a fix, if I knew what is wrong: The behaviour or only the JavaDoc.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 14, 2019
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 14, 2019
@jhoeller jhoeller added this to the 5.2.2 milestone Nov 14, 2019
@jhoeller
Copy link
Contributor

Well spotted! This used to be true but changed in 5.0. I'll revise the javadoc accordingly.

@jhoeller jhoeller self-assigned this Nov 14, 2019
@jhoeller jhoeller changed the title JavaDoc of TypeDescriptor#getElementTypeDescriptor is wrong. TypeDescriptor#getElementTypeDescriptor does not throw IllegalStateException anymore Nov 14, 2019
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.1.x labels Nov 14, 2019
@michael-simons
Copy link
Contributor Author

Thanks, @jhoeller !

@jhoeller
Copy link
Contributor

Turns out that it actually changed back in 4.0... The last one with actual IllegalStateException throwing there was 3.2.x :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

3 participants