Re: RFR :7088419 : (L) Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 and java.util.zip.Adler32

2013-05-26 Thread David Holmes
Hi David, On 24/05/2013 2:06 AM, David Chase wrote: So where do we stand on this? Can we call it a bug and eligible for inclusion? And are there other issues to deal with? I think this form of the optimization is more amenable to inclusion. I would be happy to discuss exactly what is going o

Re: Time to put a stop to Thread.stop?

2013-05-26 Thread David Holmes
On 25/05/2013 4:14 AM, Martin Buchholz wrote: On Fri, May 24, 2013 at 6:18 AM, Alan Bateman wrote: The webrev with the proposed changes is here. As I mentioned in one of the replies, there are 4 j.u.c tests that need to be updated so I've changed these tests to use Unsafe.throwException. Al

Re: RFR JDK-8015299

2013-05-26 Thread David Holmes
I concur with Martin on all counts. Confusing NUL and NULL is also a pet peeve of mine :) David On 25/05/2013 2:15 AM, Martin Buchholz wrote: Hi John, The memory leak fix looks good. --- IIRC I was the author of the comment, so it is not surprising that I might prefer that version. "nul" is

Re: RFR 8009581: Xpathexception does not honor initcause()

2013-05-26 Thread David Holmes
On 26/05/2013 1:41 AM, Alan Bateman wrote: On 25/05/2013 09:37, Aleksej Efimov wrote: David, Jason, Thank you for your comments and suggestions. They all were taken in account and as a result - the new webrev: http://cr.openjdk.java.net/~dmeetry/8009581/webrev.2/ I think this looks better. I as

Re: RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees

2013-05-26 Thread Doug Lea
On 05/26/13 08:08, Peter Levart wrote: Clever idea. So your common TreeNode would extend LinkedHashMap.Entry. Right. (Or renamings/refactorings of these). And that begets other improvements in part by guaranteeing root is first node of bin, so doesn't need TreeBins (which I cannot do in CHM bec

Re: RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees

2013-05-26 Thread Peter Levart
On 05/26/2013 01:34 PM, Doug Lea wrote: On 05/26/13 07:02, Peter Levart wrote: I couldn't work out a TreeNode class that could be used by both HashMap and LinkedHashMap, since LHM would need a TreeNode derived from LinkedHashMap.Entry, not HashMap.Entry. So instead I used composition, wher

Re: RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees

2013-05-26 Thread Doug Lea
On 05/26/13 07:02, Peter Levart wrote: I couldn't work out a TreeNode class that could be used by both HashMap and LinkedHashMap, since LHM would need a TreeNode derived from LinkedHashMap.Entry, not HashMap.Entry. So instead I used composition, where TreeNode has-a [Linked]HashMap.Entry. Hi

Re: ConcurrentMap.putIfAbsent(Object, Supplier)?

2013-05-26 Thread Peter Levart
Hi Philippe, I think you are looking for Map.computeIfAbsent(K, Supplier) which was added to Map interface recently. Regards, Peter On 05/26/2013 01:22 PM, Philippe Marschall wrote: Hi I often find myself writing code like this: ConcurrentMap map = ...; Object value = map.get(key); if (val

Re: ConcurrentMap.putIfAbsent(Object, Supplier)?

2013-05-26 Thread Philippe Marschall
On 26.05.2013 13:25, Peter Levart wrote: Hi Philippe, I think you are looking for Map.computeIfAbsent(K, Supplier) which was added to Map interface recently. Yes I am, thanks. Philippe

ConcurrentMap.putIfAbsent(Object, Supplier)?

2013-05-26 Thread Philippe Marschall
Hi I often find myself writing code like this: ConcurrentMap map = ...; Object value = map.get(key); if (value == null) { Object newValue = expensiveComputation(); Object previous = map.putIfAbsent(key, newValue); if (previous != null) { value = previous; } else { value = newValu

AutoCloseable XMLStreamReader and XMLStreamWriter?

2013-05-26 Thread Philippe Marschall
Hi It would be nice if javax.xml.stream.XMLStreamReader and javax.xml.stream.XMLStreamWriter could be made to extend java.lang.AutoCloseable so that they can be used in a try-with-resouces statement. The some does for XMLEventReader and XMLEventReader. I'm not sure this is the right mailing

Re: RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees

2013-05-26 Thread Peter Levart
On 05/23/2013 09:02 PM, Brent Christian wrote: On 5/23/13 5:20 AM, Doug Lea wrote: * Given that balanced trees are not used in WeakHashMap or Hashtable, I wonder why the TreeNode etc classes are not just nested inside HashMap (usable from subclass LinkedHashMap). And if so, it would be simpler,