[ nice-Bugs-871232 ] Byte Integer type param interfaces

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #871232, was opened at 2004-01-05 13:38
Message generated for change (Comment added) made by igouy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=871232&group_id=12788

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Isaac Gouy (igouy)
Assigned to: Nobody/Anonymous (nobody)
Summary: Byte Integer type param interfaces

Initial Comment:
set() converts Integer to Byte?

\Nice\Test>java -jar t.jar
   set 1   class java.lang.Byte
   get 1   class java.lang.Integer
   Exception in 
      thread "main"java.util.NoSuchElementException
          at test.fun.get(I:\pls\Nice\Test\..\test:10)
          at test.dispatch.get()
          at test.fun.main(I:\pls\Nice\Test\..\test:17)


void main(String[] args){
   HashPropertyMap<int, double> h = new 
HashPropertyMap();

   h.set(1, 2.5);
   h.get(1);
}


public interface ReadablePropertyMap<K, V> {
  V get(K key);
}


public interface ReadWritePropertyMap<K, V> extends 
ReadablePropertyMap<K, V> {
  void set(K key, V value);
}


public class HashPropertyMap<K, V> 
   implements ReadWritePropertyMap<K, V> {

   private HashMap<K, V> data = new HashMap();

   set(key, value){ 
      let o = object(key);
      if (o != null) println("set " key "   " o.getClass());

      data.put(key, value);
   }

   get(key){ 
      let o = object(key);
      if (o != null) println("get " key "   " o.getClass());

      let res = data[key];
      if (res == null)
         throw new NoSuchElementException();
      
      return res;
   }
}




----------------------------------------------------------------------

>Comment By: Isaac Gouy (igouy)
Date: 2004-01-05 15:09

Message:
Logged In: YES 
user_id=536291

void main(String[] args){
   HashPropertyMap<int, double> h = new HashPropertyMap();
   h.set(32767, 2.5);
   h.get(32767);
}

gives:

   \Nice\Test>java -jar t.jar
   set 32767   class java.lang.Short
   get 32767   class java.lang.Integer
   Exception in thread "main" java.util.NoSuchElementException
           at test.fun.get(I:\pls\Nice\Test\..\test:10)
           at test.dispatch.get()
           at test.fun.main(I:\pls\Nice\Test\..\test:17)


----------------------------------------------------------------------

Comment By: Arjan Boeijink (arjanb)
Date: 2004-01-05 14:56

Message:
Logged In: YES 
user_id=688815

Something is wrong with the code generated in the main 
method and but I have no idea why it happens yet.

----------------------------------------------------------------------

Comment By: Isaac Gouy (igouy)
Date: 2004-01-05 13:40

Message:
Logged In: YES 
user_id=536291

Nice compiler version 0.9.6 prerelease (build 2004.01.05, 
05:42:10 UTC)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=871232&group_id=12788


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.