Javascript Builder creating invalid Javascript for Lists
--------------------------------------------------------
Key: STS-231
URL: http://mc4j.org/jira/browse/STS-231
Project: Stripes
Type: Bug
Versions: Release 1.3.2
Environment: JDK1.5, Win32
Reporter: Simon
Assigned to: Tim Fennell
Priority: Minor
The JavascriptBuilder uses a Set<Object> to track visted objects and hence
avoid exporting the same object multiple times. However Set< > uses
Object.equals() method to determine membership not object identity. Therefore
the visited object set is actually tracking "equal" objects.
Unfortunately Java's AbstractList class overrides equals() such that Lists
containing the same elements are considered equal. This causes the following
simple test case to generate invalid Javascript from JavascriptBuilder:
HashMap h = new HashMap();
h.put("list1", new ArrayList());
h.put("list2", new ArrayList());
new JavaScriptBuilder(h).build(new StringWriter());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development