- labels: --> J2S Core Compiler
java2script is not translating static methods with generic signatures like java.util.HashTable.ṅewEntry() in project net.sf.j2s.java.core:
private static <K, V> Entry<K, V> newEntry(K key, V value, int hash) {
return new Entry<K, V>(key, value);
}
the method is simply not translated to javascript. If I change the method without generics like:
private static Entry newEntry(Object key, Object value, int hash) {
return new Entry(key, value);
}
then the method is correctly translated.
In consecuence, the following java code throws browser Error: "java.util.Hashtable.newEntry is not a function":
Hashtable<String, Object> t = new Hashtable<String, Object>();
t.put("1", 1);
If the compiler bug cannot be solved easily I suggest to change java.util.HashTable.ṅewEntry method to the non-generic given form so at least we solve hastable... The method is overriding nothing so I think there is no problem.