Logical inconsistence between Set and SortedSet interfaces

2013-01-27 Thread Andrej Hollmann
Hello, I want to add few products to the SortedSet and sort them by price. I add four different elements to TreeSet: ["salt",0.5$], ["milk", 1$], ["bread", 1$], ["bananas", 2$] But at the end my TreeSet contains only three elements: ["salt",0.5$], ["bread", 1$], ["bananas", 2$] The "bread" re

Re: Logical inconsistence between Set and SortedSet interfaces

2013-01-27 Thread Peter Levart
You can also create your own java.util.Comparator implementation that never returns 0 for two "different" keys. In your example, you would have to break the ties by 1st comparing the desired attribute(s) that you want to order by and then some unique attribute - you might want to add it to the

Re: Proxy.isProxyClass scalability

2013-01-27 Thread Florian Weimer
On 01/24/2013 04:55 PM, Vitaly Davidovich wrote: I'm not that familiar with ClassValue but I don't doubt it scales better than a synch map, It should be quite a bit faster. Here's an example: It's quite a bit code,

Re: Proxy.[isProxyClass|getProxyClass] scalability

2013-01-27 Thread Peter Levart
Hi Alan, David, I think I have a solution for scalability problems of java.lang.reflect.Proxy: * http://dl.dropbox.com/u/101777488/jdk8-tl/proxy/webrev.01/index.html I designed it along the lines mentioned in previous mail (see below). First I thought that both caches (a cache mapping reques

Re: Proxy.[isProxyClass|getProxyClass] scalability

2013-01-27 Thread Peter Levart
Hi again, By simple rearrangement of code in Proxy.getProxyClass (moved the parameters validation to slow-path) I managed to speed-up the fast-path getProxyClass so that now it's raw speed is 40x the speed of current getProxyClass method: * http://dl.dropbox.com/u/101777488/jdk8-tl/proxy/web