My favorites | Sign in
Project Home Wiki
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 784: ArrayList<Int> ends up as ArrayList<Object> in the generated code.
2 people starred this issue and may be notified of changes. Back to list
Status:  Refused
Owner:  waneck
Closed:  Aug 2013


Sign in to add a comment
 
Reported by Mihai...@gmail.com, Apr 22, 2012
Consider this code:

var x = new ArrayList<Int>();
    for (i in 0...50)
        x.add(i);
		
var i:java.util.Iterator<Int>  = x.iterator();
    while (i.hasNext())
        trace(i.next());

In the generated source it will end up as: ArrayList<Object> instead of ArrayList<int> which would lead to extensive boxing/unboxing.
Apr 22, 2012
Project Member #1 waneck
Actually if it was ArrayList<Integer>, the performance would be the same. The problem really is that if you are interacting with some native code that expects ArrayList<Integer>, it would fail. So it should be fixed!
Status: Reproduced
Owner: waneck
May 6, 2012
Project Member #2 waneck
Related: Null<Int> -> java.lang.Integer
May 27, 2012
Project Member #3 waneck
 Issue 862  has been merged into this issue.
May 27, 2012
Project Member #4 waneck
(No comment was entered for this change.)
Labels: Priority-Urgent
Jun 2, 2012
Project Member #5 waneck
This one will be quite a big change. I'll postpone it until I've got Java passing most unit tests, as I'll need some extensive testing for it.
Jul 15, 2012
Project Member #6 waneck
Attached a first patch to address this issue. It proved to be too unstable for 2.10 . Will need to postpone this for Haxe 3.0
genjava.patch
2.7 KB   View   Download
Labels: -Priority-Urgent Priority-haXe3
Aug 20, 2012
Project Member #7 waneck
 Issue 1160  has been merged into this issue.
Feb 21, 2013
Project Member #8 waneck
I have an idea on how to deal with them, to provide compatibility with native code: Instead of it becoming ArrayList<Object>, it will become ArrayList . I'll try a patch later on today
Feb 22, 2013
Project Member #9 waneck
(No comment was entered for this change.)
Labels: -Priority-haXe3 Priority-3.2
Feb 24, 2013
Project Member #10 si...@haxe.org
(No comment was entered for this change.)
Labels: -Priority-3.2 Milestone-3.2
Feb 25, 2013
Project Member #11 waneck
(No comment was entered for this change.)
Labels: -Milestone-3.2 Milestone-3.0
May 5, 2013
Project Member #12 waneck
(No comment was entered for this change.)
Labels: -Milestone-3.0 Milestone-3.2
Aug 7, 2013
Project Member #13 franco.p...@gmail.com
all issues have been moved to github: https://github.com/HaxeFoundation/haxe/issues
Status: Refused
Sign in to add a comment

Powered by Google Project Hosting