Re: ZoneRules.of() implies that transitionList is a superset of standardOffsetTransitionList but doesn't check that

2020-01-31 Thread Roman Leventov
> On 1/29/20 9:56 PM, Roman Leventov wrote: > > 1) ZoneRules.of() implies that transitionList is a superset of > > standardOffsetTransitionList but doesn't check that. Then it's possible > to > > construct ZoneRules instances that don't work correctly: > &g

Re: ZoneRules.of() implies that transitionList is a superset of standardOffsetTransitionList but doesn't check that

2020-01-31 Thread Roman Leventov
ns) in place for the 4th argument on ZoneRules.of(), so > that the transition happens on the transition day? > > For 2), good catch for the missing 'i', we need a JBS issue for that to > fix it. > > Naoto > > On 1/31/20 6:08 AM, Roman Leventov wrote: > > java.bugs.com &l

ZoneRules.of() implies that transitionList is a superset of standardOffsetTransitionList but doesn't check that

2020-01-29 Thread Roman Leventov
1) ZoneRules.of() implies that transitionList is a superset of standardOffsetTransitionList but doesn't check that. Then it's possible to construct ZoneRules instances that don't work correctly: @Test public void zoneRulesTest() { LocalDateTime transitionDay =

Re: Note bulk methods in Javadocs for Collections.synchronizedXxx()

2020-01-01 Thread Roman Leventov
e them > right. > > Maybe we could tackle this (and similar requests in the future) by adding, > once > and for all, something like: > > Consider using concurrent collections instead, such as those that can > be > found in the java.util.concurrent package. > > -Pav

Note bulk methods in Javadocs for Collections.synchronizedXxx()

2019-12-28 Thread Roman Leventov
I think Javadocs for Collections.synchronizedXxx() should mention not only "traversing it via Iterator, Spliterator or Stream" as something that must be synchronized externally, but also cases when a synchronized collection is an argument to a bulk collection method, including: - new

ClassValue - clarify Javadoc

2019-01-28 Thread Roman Leventov
computeValue() documentation says: "This method will be invoked within the first thread that accesses the value with the get method. Normally, this method is invoked at most once per class, but it may be invoked again if there has been a call to remove." It sounds exactly like ClassValue

Sized Collector supplier

2018-09-18 Thread Roman Leventov
Is there a reason why java.util.stream.Collector doesn't support sized supply of a mutable result container? It seems that it could be hugely beneficial when the size of the stream is known, e. g. for precise ArrayList and HashMap.

Use iterator() in AbstractList.equals() instead of listIterator()

2018-04-06 Thread Roman Leventov
iterator() has chances to be slightly more efficient than listIterator(). At very least AbstractList's own ListItr implementation contains one more implicit field referencing the base class, so objects of AbstractList.ListItr are often 8 bytes bigger than objects of AbstractList.Itr.

Re: [PATCH] Optimization of AbstractStringBuilder.ensureCapacityInternal()

2018-02-23 Thread Roman Leventov
nd avoid zeroing out the newly allocated array > that we have to take care not to break. > > /Claes > > > On 2018-02-22 17:51, Roman Leventov wrote: > >> AbstractStringBuilder.ensureCapacityInternal() doesn't need to copy the >> whole underlying array, only the part unt

Re: [PATCH] Optimization of AbstractStringBuilder.ensureCapacityInternal()

2018-02-22 Thread Roman Leventov
Similar optimizations are also possible in ArrayList and Vector. On 22 February 2018 at 17:51, Roman Leventov <leventov...@gmail.com> wrote: > AbstractStringBuilder.ensureCapacityInternal() doesn't need to copy the > whole underlying array, only the part until the current count. &g

[PATCH] Optimization of AbstractStringBuilder.ensureCapacityInternal()

2018-02-22 Thread Roman Leventov
AbstractStringBuilder.ensureCapacityInternal() doesn't need to copy the whole underlying array, only the part until the current count. diff --git a/src/java.base/share/classes/java/lang/AbstractStringBuilder.java b/src/java.base/share/classes/java/lang/AbstractStringBuilder.java ---

Why isEmpty(), retainAll() and containsAll() not supported with default implementations in JDK8?

2014-02-14 Thread Roman Leventov
I'm sure there was a discussion somewhere in JDK mailing lists, but I couldn't find. Please, give me a link. I've tried to ask on SO: http://stackoverflow.com/questions/21758081/why-many-methods-in-jcf-interfaces-not-made-default-in-java-8, proved that JDK developers don't read SO :)