Bug 459 : Map<>, HashMap<> etc. not working
Last modified: 2007-07-16 07:30




Status:
RESOLVED
Resolution:
DUPLICATE of bug 598
Priority:
P3
Severity:
enhancement

 

Reporter:
mkn
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2006-11-27 11:08
Rev 121, WinXP.

Code:
Map<String, Integer> m = new HashMap<String, Integer>();

Results in:
unxpected token: <
..although that is AFAIK how you construct a Map in Java.

Also, code:
Map m = new HashMap();
m.put("fish", 2);

Results in:
Semantic Error: No applicable overload for a method with signature
"put(java.lang.String, int)" was found in type "java.util.Map". Perhaps you
wanted the overloaded version "java.lang.Object put(java.lang.Object $1,
java.lang.Object $2);" instead?

My guess is that all this bug needs is a small fix in the semantics check
of the precompiler so that it accepts the <Key, Value> of the Map
constructors.
Additional Comment #1 From fry 2006-11-27 11:33
we don't support java 1.5 or its language constructs, as stated quite
explicitly:
http://processing.org/reference/environment/platforms.html#java

we'd like to include this at some point, so i'm leaving this filed as a
feature request. i've been working to get the preproc upgraded to handle
1.5, but it's unfortunately quite a significant task.
Additional Comment #2 From fry 2007-07-16 07:30


*** This bug has been marked as a duplicate of 598 ***