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

ClassCastException ParameterizedTypeImpl cannot be cast to Class #63

Open
olegs opened this issue Jan 17, 2017 · 0 comments
Open

ClassCastException ParameterizedTypeImpl cannot be cast to Class #63

olegs opened this issue Jan 17, 2017 · 0 comments

Comments

@olegs
Copy link

olegs commented Jan 17, 2017

Simple test case to reproduce is available here: https://github.com/olegs/yamlbeans/blob/master/test/com/esotericsoftware/yamlbeans/GenericsTest.java

Version 1.11 fails, while 1.08 works well in this case. As far as I can see the problem is located within the following commit: 98bb930#diff-3fc4c5fd5c3ad7273e6668dfdf14b79eR249

Stacktrace:

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class

	at com.esotericsoftware.yamlbeans.Beans$Property.getElementTypeFromGenerics(Beans.java:283)
	at com.esotericsoftware.yamlbeans.Beans$Property.<init>(Beans.java:272)
	at com.esotericsoftware.yamlbeans.Beans$FieldProperty.<init>(Beans.java:245)
	at com.esotericsoftware.yamlbeans.Beans.getProperties(Beans.java:153)
	at com.esotericsoftware.yamlbeans.YamlWriter.countObjectReferences(YamlWriter.java:308)
	at com.esotericsoftware.yamlbeans.YamlWriter.write(YamlWriter.java:77)
	at com.esotericsoftware.yamlbeans.GenericsTest.testComplexMap(GenericsTest.java:36)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant