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
wonderfly opened this issue
Jan 9, 2015
· 4 comments
Assignees
Labels
🚨This issue needs some love.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Version of google-http-java-client: 1.9.0-beta
Java environment: Java 6
There is a dangerous initialization problem in the class
com.google.api.client.http.UriTemplate. The COMPOSITE_PREFIXES map is not filled after classloading but only when the enum CompositeOutput is used. This means the first time getCompositeOutput is called, the map is still empty and only on line 190 the map is filled.
Output:
first:
second:/a/b/c How would you expect it to be fixed? Initialize map in a static {} block
The result of calling UriTemplate.expand twice should be the same
🚨This issue needs some love.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
From willem.s...@gmail.com on May 19, 2012 09:57:13
Version of google-http-java-client: 1.9.0-beta
Java environment: Java 6
There is a dangerous initialization problem in the class
com.google.api.client.http.UriTemplate. The COMPOSITE_PREFIXES map is not filled after classloading but only when the enum CompositeOutput is used. This means the first time getCompositeOutput is called, the map is still empty and only on line 190 the map is filled.
Testcase:
Map<String, Object> map = new HashMap<String, Object>();
map.put("id", Arrays.asList("a", "b", "c").iterator());
System.out.println("first:" + UriTemplate.expand("{/id_}", map, false));
System.out.println("second:" + UriTemplate.expand("{/id_}", map, false));
Output:
first:
second:/a/b/c How would you expect it to be fixed? Initialize map in a static {} block
The result of calling UriTemplate.expand twice should be the same
Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=117
The text was updated successfully, but these errors were encountered: