michelangelo13 / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

ClassCastException in org/openid4java/message/ax/FetchResponse #199

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Request AX attribute with count == 0
2. Get a ClassCastException

What is the expected output? What do you see instead?

It should return all values. Instead it crashes.

What version of the product are you using? On what operating system?

0.9.7

Please provide any additional information below.

From org.openid4java.message.ax.FetchResponse.createFetchResponse(FetchRequest, 
Map):

                Iterator values = ((List)value).iterator();

                // only send up the the maximum requested number
                int max = req.getCount(alias);
                if (max == 0)
                    max = ((List)values).size(); // <-- this is the class cast exception

Last line should read:

max = ((List)value).size();

(value is a List, values is an Iterator).

Original issue reported on code.google.com by christop...@gmail.com on 15 Oct 2013 at 7:15