problem is that need adding some public api to HashMap or
Collections.
Yep, sounds like a better version of guava.newHashMap.
Xeno Amess 于2022年2月9日周三 09:51写道:
> I agree that it would
>> be preferable for the expression to be something like this:
>
> (int) Math.ceil(expected / 0.
but it's confusing that its behavior differs from HashMap
> in this
> regard.)
>
> If we don't add a Java SE utility like "newHashMapWithExpectedSize",
> fallbacks would
> be to introduce an internal JDK utility method that is called from various
> places,
> or jus
wait, things get interesting now.
We do have such a test named ConstantDirectoryOptimalCapacity to make sure
this does not happen, but my tests still fill under the idea debugger.
Is there any specialist for help? I would dig in but it is a little
complicated.
[image: image.png]
Xeno Amess 于2022
Sorry for my mistake.
After a more throughout dig in, this thing has already fixed several years
ago, at year 2015.
Issue close.
Xeno Amess 于2022年2月4日周五 21:40写道:
> Besides, is it worthy to develop a public float Math.ceil(float) function?
>
> Xeno Amess 于2022年2月4日周五 21:39写道:
>
>
Besides, is it worthy to develop a public float Math.ceil(float) function?
Xeno Amess 于2022年2月4日周五 21:39写道:
> patch applied.
>
> Index: src/java.base/share/classes/java/lang/Module.java
> IDEA additional info:
> Subsystem: com.intellij.openapi.diff.impl.patch.Chars
this(Math.max((int) ((float)m.size() / DEFAULT_LOAD_FACTOR + 1.0F),
+this(Math.max((int) Math.ceil(m.size() / DEFAULT_LOAD_FACTOR),
DEFAULT_INITIAL_CAPACITY),
DEFAULT_LOAD_FACTOR);
putAll(m);
Xeno Amess 于2022年2月4日周五 18:45写道:
> also find some other places ha
also find some other places have same problem.
If some of your already-in people aggree, I would create a pr, but
according to the rules seems I should wait for now.
Xeno Amess 于2022年2月4日周五 18:42写道:
> import java.lang.reflect.Array;
> import java.lang.reflect.Field;
> import java.uti
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
public class TestMap {
public static void main(String[] args) throws
NoSuchFieldException, IllegalAccessException {
HashMap a = new HashMap<>();
fill12(a);
gree. Pooling takes time and
> memory
> >> to manage, and if there are very few duplicates, it's a waste of both. I
> >> believe it should be up to the programmer to decide if this is
> appropriate
> >> in their situation. Of course, the GC system seems to be capable
never should,as Object can be use as lock.
XenoAmess
From: core-libs-dev on behalf of Bernd
Eckenfels
Sent: Friday, December 24, 2021 5:51:55 AM
To: alan Snyder ; core-libs-dev
Subject: Re: a quick question about String
new String() always creates a new
sample codes here https://github.com/openjdk/jdk/pull/5874 if anyone
interested
Xeno Amess 于2021年10月10日周日 上午4:00写道:
> sigh.
>
> quite some good things I always want are at valhalla
> <https://openjdk.java.net/projects/valhalla/>, but I just don't think
> they will come sta
projects/valhalla/
> [2] https://openjdk.java.net/jeps/8261007
>
> -Pavel
>
> > On 9 Oct 2021, at 18:19, Xeno Amess wrote:
> >
> > I suggest putting them in Arrays btw.
>
>
I suggest putting them in Arrays btw.
Brian Burkhalter 于2021年10月8日周五 上午5:37写道:
> Re-directing to the appropriate mailing list, core-libs-dev; please
> exclude jdk-dev from any reply.
>
> How can they be shared when they are different data types, viz., byte vs.
> char?
>
> On Oct 7, 2021, at 2:26 PM, Xeno Amess wro
Xeno Amess 于 2021年10月8日周五 上午5:45写道:
> each for each class...
>
> byte[] and char[] of course cannot mix...at least, cannt mix from java
> side. I'm not that sure if such black magic can do on jvm side. I don't
> think it can.
>
> It is not safe to open the containing pool to
15 matches
Mail list logo