version
of JDK/Hotspot it is supported, where it is implemented in JDK?
When I take look at a product I'm working on, I see a lot instances of
ArrayList$Itr objects,
which are created by for-each loops (we use JDK 7u51).
Thanks in advance!
Best regards,
Andrej Golovnin
Hi Rémi, Vitaly,
Thank you for your explanation and for the tips!
if you see a lot of instances of ArrayList iterator it means that you have a
code path that create an iterator and use it later and the JIT is not able to
see the creation and the use in the same inlining horizon. As Vitaly
version
of JDK/Hotspot it is supported, where it is implemented in JDK?
When I take look at a product I'm working on, I see a lot instances of
ArrayList$Itr objects,
which are created by for-each loops (we use JDK 7u51).
Thanks in advance!
Best regards,
Andrej Golovnin
Hi Otávio,
it would be nice, if you would not modify the classes
sun.reflect.UnsafeXXXFieldAccessorImpl.
This classes should be changed as a part of the fix for the issue JDK-5043030.
The patch for this issue is already in work.
Best regards,
Andrej Golovnin
On 24.05.2014, at 16:34, Otávio
it and I hope you can sponsor it.
Best regards,
Andrej Golovnin
it differently?
Let me know, if you need more data or if I should write some test.
If don't want accept the patch, then it's OK. But in this case you
should close the issue 5043030 and explain why it won't be fixed.
Best regards,
Andrej Golovnin
[i] = null;
Best regards,
Andrej Golovnin
the name is actually interned in terms of String.intern().
And you can compare the name of a method with == with interned Strings.
The same applies to a name of a class and to a name of a field too.
Please feel free to correct me.
Best regards,
Andrej Golovnin
cheers
/Joel
On 07 Jun 2014
regards,
Andrej Golovnin
LC_MONETARY=de_DE.utf8
export LC_NUMERIC=de_DE.utf8
export LC_MEASUREMENT=de_DE.utf8
export LC_TIME=de_DE.utf8
make test TEST=jdk_lang
I have created patch to fix this problem. The patch is attached to this
mail.
Best regards,
Andrej Golovnin
[1]
http://mail.openjdk.java.net/pipermail/core-libs-dev/2014
.
Wouldn't it be better to use here Long.parseLong(String)?
Long.valueOf(String) would always create a new object here, as expTime and
tStamp represents the time and they are never in the range [-128;127].
Best regards,
Andrej Golovnin
).hashCode();
}
The method Long.hashCode(long) (added in JDK 8) should be used to calculate
the hash for a long value, e.g.:
+return Long.hashCode(pName);
Best regards,
Andrej Golovnin
On Fri, Jun 27, 2014 at 12:00 PM, Pavel Rappo pavel.ra...@oracle.com
wrote:
I created an issue
, that's a
pity. We could mention you in the 'Reviewed-by' line. Your contributions are
really good.
Thanks! But I don't really care about it as long as I can help to improve the
overall code quality.
Best regards,
Andrej Golovnin
Hi Otávio,
About Andrej, is it not possible add two people in Contributed-by: tag?
Thanks! But it's not needed. It's your contribution. I just help to review
the changes.
Best regards,
Andrej Golovnin
. I hope
you didn't committed the patch for the Longs yet. There were also changes
to the classes in the package jdk.internal.org.objectweb.asm.
Best regards,
Andrej Golovnin
On Tue, Jul 1, 2014 at 2:39 PM, Pavel Rappo pavel.ra...@oracle.com wrote:
Otavio,
As with [1], I created an issue
to the ASM project
[1]? Thanks!
Best regards,
Andrej Golovnin
[1] http://asm.ow2.org/
).toString();
But I'm not sure how common is the usage of #hexDouble-method. Maybe this
change is not worth it.
Best regards,
Andrej Golovnin
On Mon, Jul 14, 2014 at 2:23 PM, Claes Redestad claes.redes...@oracle.com
wrote:
Hi again,
updated webrev: http://cr.openjdk.java.net/~redestad/8050142
change can be applied to the class
src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java.
Best regards,
Andrej Golovnin
On Mon, Aug 11, 2014 at 5:29 AM, Otávio Gonçalves de Santana
otavioj...@java.net wrote:
Done.
https://dl.dropboxusercontent.com/u/16109193/open_jdk
on the dev or users mailing lists and send a message to JavaCC project. I'm
sure the developers of JavaCC would help you.
Best regards,
Andrej Golovnin
About readable of code I just renamed this class to sb instead of buf,
strbuf, etc. Because using StringBuilder beyond be more explicit I can
Hi Otávio,
please ignore the previous diff. I'm sorry, there was a small mistake. I
have attached the corrected version.
Best regards,
Andrej Golovnin
On Mon, Aug 11, 2014 at 1:55 PM, Andrej Golovnin andrej.golov...@gmail.com
wrote:
Hi Otávio,
About the template in Parser.jjt
StringBuilder().append(abc).append(o1).append('c').append(o2).append('\n').toString();
instead of:
String s = new
StringBuilder().append(abc).append(o1).append(c).append(o2).append(\n).toString();
Best regards,
Andrej Golovnin
https://dl.dropboxusercontent.com/u/16109193/open_jdk
/X509CertSelector.java
src/share/classes/javax/crypto/CryptoPermission.java
src/share/classes/javax/management/relation/Role.java
In src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj in the line 423 a dot
is missed before append:
423 {jjtn000.name.append( '.')append(t.image); }
Best regards,
Andrej
at src/java.desktop/share/classes/javax/swing/RepaintManager.java.
Best regards,
Andrej Golovnin
http://cr.openjdk.java.net/~weijun/8038277/core/webrev.00/
http://cr.openjdk.java.net/~weijun/8038277/extra/webrev.00/
--Max
On Aug 21, 2014, at 10:32, Otávio Gonçalves de Santana
Hi Martin,
you are right. And in the line 297:
297 sb.append(getClass().getName()).append('
').append(Integer.toString(hashCode()));
Integer.toString() can be removed too.
Best regards,
Andrej Golovnin
On Thu, Aug 21, 2014 at 3:26 PM, Martin Desruisseaux
martin.desruisse
problems are in
src/java.base/share/classes/sun/security/x509/X509CRLImpl.java in the line
576
src/java.base/share/classes/sun/security/x509/X509CertInfo.java in the line
332
Best regards,
Andrej Golovnin
:
sun.reflect.*
I think this patch is good to go. I need to file some Oracle internal
requests, should take about a week, then I can sponsor this.
I am very pleased to hear that and I hope to contribute more.
Best regards,
Andrej Golovnin
Hello Joe,
when you already going to change the AnnotationType class,
could you also please remove duplicate line (lines 115 and 121
are identical) in the for-loop in the constructor:
https://dl.dropbox.com/u/148428677/jdk8/AnnotationType/webrev.01/index.html
Thanks,
Andrej
On 26.03.2013, at
which use ORM solutions).
The patch does not modify Unsafe-based FieldAccessors for double and float
fields as the wrapper classes does not provide caching for fields of this types.
Best regards
Andrej Golovnin
.
What do you think about it?
Best regards
Andrej Golovnin
PS: here is the inlined patch
# HG changeset patch
# User golovnin
# Date 1335989617 -7200
# Node ID 13e3638f723582d1df0b7c45c6aa983d4c2eed17
# Parent cfd7602f5c5247d551290ccf2cb2f5cd13fd8ce2
- use #valueOf()-methods in Unsafe-based
private transient final static int[] byteTable0 = byteTables[0];
Best regards,
Andrej Golovnin
Hi Paul,
wouldn't it be better to use Objects#equals(Object, Object) in the
line 3293 in the Arrays class instead of the ternary operator (the
same applies to the line 3238)?
Best regards,
Andrej Golovnin
On Mon, Oct 12, 2015 at 9:31 AM, Paul Sandoz <paul.san...@oracle.com> wrote:
>
che will not work as expected.
Best regards,
Andrej Golovnin
odType,
WrongMethodTypeException, LambdaConversioinException). Does it have
some special meaning? I'm just curious.
Best regards,
Andrej Golovnin
d be the same. But it is easier to read.
Otherwise looks good. And I think you need now a real reviewer. :-)
Best regards,
Andrej Golovnin
+) {
1344 cls[i] = int.class;
1345 }
The for-loop can be replaced by:
Arrays.fill(cls, int.class);
Best regards,
Andrej Golovnin
ate-tests.sh
The files do not have a copyright header.
Best regards,
Andrej Golovnin
ppend((String) null);
The first one requires to copy byte values from the "null" String. The
second one ends up in the call to AsbtractStringBuilder.appendNull().
Best regards,
Andrej Golovnin
> Apologies, I confused you with another Andrey :)
>
> Sure, let's do class-only:
> http://cr.openjdk.java.net/~shade/8148730/webrev.02/
No problem, Aleksey. Looks much better now. :)
Best regards,
Andrej Golovnin
Hi Aleksej,
is it really needed to add the "@since 9" tag to the
methods/constructors when the whole class is since JDK 9? As far as I
know the @since tag should be only added to class members introduced
in a later version than the class.
Best regards,
Andrej Golovnin
On Mon, Feb 1,
n a later version than the class. This
minimizes the number of @since tags.
Best regards,
Andrej Golovnin
Hi Ivan,
> Please review the upcoming API changes:
> http://cr.openjdk.java.net/~ikrylov/8147844.jdk.00/
I think the semicolon at the end of the line 887 is not needed, e.g:
887 public static void onSpinWait() {};
should be
887 public static void onSpinWait() {}
Best regards,
return hostClass.getName().replace(".", "/") +
"$$StringConcat”;
Maybe you should use here the character based String#replace()-method as it is
faster and
does not produce as much garbage as the CharSequence based method does.
Best regards,
Andrej Golovnin
and an user of the Stream API and
the Optional class, I vote against deprecating of the Optional.get()-method.
(We have a democracy here, haven't we? :-D)
Best regards,
Andrej Golovnin
raise an error in such cases.
I mean if IntelliJ is able to give you a hint that you use Optional.get()
without the isPresent()-check, then the Java compiler should be able
to do it too.
Just my two cents.
Best regards,
Andrej Golovnin
d override the fillInStackTrace()-method and make it empty. And
later in the class LambdaForm I would just print the cause of
BytecodeGenerationException.
src/java.base/share/classes/java/lang/invoke/LambdaForm.java
In the line 739 the field LF_FAILED should be final.
Best regards,
Andrej Golovnin
return new ZipCoder(cs);
79 } catch (Throwable t) {
80 t.printStackTrace();
81 }
82 return new ZipCoder(Charset.defaultCharset());
83 }
Wouldn't it be better to use System.Logger instead of printStackTrace
in the line 80?
Best regards,
Andrej Golovn
Hi Sherman,
thanks for the update. It looks much better now.
One more thing:
src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipCoder.java
70 private static ZipCoder utf8 = new UTF8();
I think this field can be final as it never changes.
Best regards,
Andrej Golovnin
> On 18 Jan 2017, at 19
The indentation is broken. You use tabs. But in JDK you must use
spaces, see
http://cr.openjdk.java.net/~alundblad/styleguide/index-v6.html#toc-indentation
Best regards,
Andrej Golovnin
On Thu, Sep 1, 2016 at 10:06 PM, Patrick Reinhart <patr...@reini.net> wrote:
> Hi Alan,
> Hi Pa
think
the JavaDocs do not reflect what the method does.
And one more thing. Because we have now only one method to get a
stream I think the constant RESOURCE_CHARACTERISTICS should be defined
inside the #resources()-method. It is not needed to define it as a
static final field.
Best regards,
Andrej
ly at compile
> time not on each method call.
As explained by Paul, the bitwise OR-operator is evaluated by the Java compiler
during the compilation time. Therefore there is no penalty at runtime if you
define the constant inside the method.
Best regards,
Andrej Golovnin
Hi Patrick,
looks good for me. Thanks!
Best regards,
Andrej Golovnin
the stream */
2612 private int totalBytesRead = 0;
I think the type of the field totalBytesRead must be long. In the
#skip(long)-method you update it with a long value.
Best regards,
Andrej Golovnin
Hi Stuart,
> Webrev:
>
> http://cr.openjdk.java.net/~smarks/reviews/8152617/webrev.0/
267 public Optional flatMap(Function> mapper)
I think there should be a space between “public” and “”.
Best regards,
Andrej Golovnin
eam().map(this::getJarEntry);
And if you add a method #getName() to the Name class,
then you can use method references in the lines 604 and 614 too.
+1 to Tagir's suggestions.
Best regards,
Andrej Golovnin
Alan Bateman.
> The revised webrev is here:
>
> http://cr.openjdk.java.net/~smarks/reviews/8134373/webrev.03/
looks good. Thanks!
Best regards,
Andrej Golovnin
>
> In any case, yes, the specifications of the ResourceBundle.Control fields
> should be changed to remove the links t
s
constants at all because they are part of the Public API and existed
in this form for a long time. Please ask someone from Oracle for help.
They can explain it better when it is OK to change and when not. Maybe
Stuart can do that.
Best regards,
Andrej Golovnin
ink the test should also check that all public methods
throw exceptions as described in the JavaDocs.
Best regards,
Andrej Golovnin
> On 10 Dec 2016, at 02:02, Vincent Ryan <vincent.x.r...@oracle.com> wrote:
>
> Thanks to those who provided review comments.
>
> I have incorpor
Hi,
src/jdk.jartool/share/classes/sun/tools/jar/Main.java
682 if (info != null) {
683 info.print(out);
684return true;
685 }
The indentation in the line 684 is wrong: it uses 3 spaces instead of 4.
Best regards,
Andrej
Hi Claes,
76 public static final int CLASS_NAME_SB_SIZE = 48;
Why is this constant public?
Btw. for our product this value is too small. We have packages with
longer names. I would use 64. :-)
Best regards,
Andrej Golovnin
On Tue, Nov 29, 2016 at 2:18 PM, Claes Redestad
<claes.re
!Character.isWhitespace(c);
273 c = current())
274 {
is easier to read than the long or-condition which is then negated?
Best regards,
Andrej Golovnin
On Tue, Nov 29, 2016 at 11:41 PM, Peter Levart <peter.lev...@gmail.com> wrote:
> Hi Cla
> On 15/11/17 10:03, Andrej Golovnin wrote:
>> I think we would need to write ugly code in any case as Java 9 has now
>> two empty list implementations: Collections.emptyList() and List.of().
>>
>> Collections.emptyList().sort() does not throw an exception.
&g
orces ugly code.
I think we would need to write ugly code in any case as Java 9 has now
two empty list implementations: Collections.emptyList() and List.of().
Collections.emptyList().sort() does not throw an exception.
List.of().sort() throws an exception.
Best regards,
Andrej Golovnin
>
&g
uld be much better. In any case please take look at
the implementation of the #lastIndexOf() method in the
AbstractImmutableList class. It looks like a copy of
AbstractImmutableList#indexOf() and this is wrong.
Best regards,
Andrej Golovnin
:
/**
* Returns the {@code Class} object of all the elements of this set.
*
* @return the {@code Class} object of all the elements of this set.
*
* @since 10
*/
public Class elementType()
The suggested change is attached as diff.
Best reagrds,
Andrej Golovnin
I’m fine with it. When not, then let us debate about an alternative solution.
:-)
Best regards,
Andrej Golovnin
f this problem
and I’m sure that you would provide the best possible solution. :-)
Best regards,
Andrej Golovnin
to mention, that Set12, SetN, Map12 and MapN should also
have specialised implementations for the #forEach-methods and for
the #spliterator()-methods in Set12, SetN.
Thanks!
Best regards,
Andrej Golovnin
e to use the SubList class:
115 int size;
The size field should be final.
Thanks!
Best regards,
Andrej Golovnin
leaners, how do Cleaners support such usages?
Instead of ThreadPoolExecutor.finalize you can override
ThreadPoolExecutor.terminated.
Best regards
Andrej Golovnin
/constant/SymbolicRefTest.java
test/jdk/java/lang/invoke/constant/TypeDescriptorTest.java
And I also think that Constable.describeConstable() is weirdly named.
What about:
#describe()
#getDescriptor()
#getConstantDescriptor()
#toConstantDescriptor()
Best regards,
Andrej Golovnin
On Wed, May 23, 2018
be defined on the CharSequence interface with default
implementations and not on the String class. The sub-classes of
CharSequence shall then provide optimised implementations. This would
allow us to have this methods on StringBuilder and CharBuffer too.
Best regards,
Andrej Golovnin
On Wed, Apr 25, 2018
mplicit nullcheck of o
602 }
I think that the comment about the implicit null check in the line 601
is not needed anymore.
Best regards,
Andrej Golovnin
what's went wrong.
Best regards,
Andrej Golovnin
return (Set)Set.of(new HashSet<>(coll).toArray());
}
Best regards,
Andrej Golovnin
> Hi all,
>
> the current implementation of Set.copyOf(Collection coll)
> creates an intermediate HashSet object to remove duplicates even when
> coll is already a Set. The attached patch adds an additional check
> whether coll is already a Set and if yes, then calls #toArray()
> directly on coll
static void VERIFY(String result, String string, int repeat) {
Why is the method name in uppercase?
Best regards,
Andrej Golovnin
On Wed, Feb 28, 2018 at 5:31 PM, Jim Laskey <james.las...@oracle.com> wrote:
> Introduction of a new instance method String::repeat to allow an efficient
>
even better
as Class does not have own implementations of #hasCode() and
#equals() methods.
Best regards,
Andrej Golovnin
On Thu, Mar 1, 2018 at 1:14 PM, Claes Redestad
<claes.redes...@oracle.com> wrote:
> Hi,
>
> two trivial optimizations that get rid of a few percent on ISC startu
Hi David,
+if (! Modifier.isStatic(m.getModifiers())) {
I think the whitespace after the ‘!’-sign should be removed.
Best regards,
Andrej Golovnin
> On 14. Mar 2018, at 19:09, David Lloyd <david.ll...@redhat.com> wrote:
>
> On Wed, Mar 14, 2018 at 1:00
of the result" would be better.
Best regards,
Andrej Golovnin
to zero.
Best regards,
Andrej Golovnin
On Tue, Sep 18, 2018 at 7:53 PM Jim Laskey wrote:
>
> Please review the code for String::detab and String::entab. Used to expand
> tabs into spaces, and spaces back to tabs.
>
> webrev: http://cr.openjdk.java.net/~jlaskey/8210717/webrev/index.ht
80 matches
Mail list logo