This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: java raw type

1 reply
Ricky Clarkson
Joined: 2008-12-19,
User offline. Last seen 3 years 2 weeks ago.
Hi Ishaaq,

I just generified the JLine sources - I hope http://github.com/rickyclarkson/jline/tree/master is useful to you.

2009/2/21 Ishaaq Chandy <ishaaq@gmail.com>
@James: thanks that worked!

@Ricky: the library is jline: http://jline.sourceforge.net/ - used for more advanced console IO than what a pure Java solution can give you. The interface method in question is jline.Completor#complete(String, int, java.util.List) - you use it for libreadline-like tab-completion on your console app.

2009/2/21 Ricky Clarkson <ricky.clarkson@gmail.com>
Out of interest, is this a library for which source is available?  Can you give me something to google?

2009/2/20 Ishaaq Chandy <ishaaq@gmail.com>
Hi all,
I have to implement a Java interface that has a method that takes a raw java.util.List. The library is pre-1.5 so is not generified. Implementations of the method must add strings into the list - yes, it is a rotten design contract, but not my design :)

My understanding is because it is a raw List rather than a List<?> I can't use existential types here. Looking at previous discussions this group has had I understand that the only option I have is to write a Java wrapper class that does the unsafe casts required to get this to work. The discussions I were from mid last year and I was wondering if things have changed since then.

Regards,
Ishaaq



Ishaaq Chandy
Joined: 2009-02-16,
User offline. Last seen 42 years 45 weeks ago.
Re: java raw type
Haha! - you planning to generify the internets jar by jar?

Thanks Ricky

2009/2/21 Ricky Clarkson <ricky.clarkson@gmail.com>
Hi Ishaaq,

I just generified the JLine sources - I hope http://github.com/rickyclarkson/jline/tree/master is useful to you.

2009/2/21 Ishaaq Chandy <ishaaq@gmail.com>
@James: thanks that worked!

@Ricky: the library is jline: http://jline.sourceforge.net/ - used for more advanced console IO than what a pure Java solution can give you. The interface method in question is jline.Completor#complete(String, int, java.util.List) - you use it for libreadline-like tab-completion on your console app.

2009/2/21 Ricky Clarkson <ricky.clarkson@gmail.com>
Out of interest, is this a library for which source is available?  Can you give me something to google?

2009/2/20 Ishaaq Chandy <ishaaq@gmail.com>
Hi all,
I have to implement a Java interface that has a method that takes a raw java.util.List. The library is pre-1.5 so is not generified. Implementations of the method must add strings into the list - yes, it is a rotten design contract, but not my design :)

My understanding is because it is a raw List rather than a List<?> I can't use existential types here. Looking at previous discussions this group has had I understand that the only option I have is to write a Java wrapper class that does the unsafe casts required to get this to work. The discussions I were from mid last year and I was wondering if things have changed since then.

Regards,
Ishaaq




Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland