Re: RFR - JDK-8203442 String::transform (Code Review) (was: RFR - JDK-8203442 String::transform (Code Review))

2018-11-13 Thread Andrej Golovnin
the result" would be better. Best regards, Andrej Golovnin

Re: RFR - JDK-8210717 String::detab, String::entab (Code Review)

2018-09-19 Thread Andrej Golovnin
ls 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/ind

Re: [PATCH] Minor optimisation for Set.copyOf(Collection)

2018-06-22 Thread Andrej Golovnin
return (Set)Set.of(new HashSet<>(coll).toArray()); } Best regards, Andrej Golovnin

Re: [PATCH] Minor optimisation for Set.copyOf(Collection)

2018-06-22 Thread 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 a

[PATCH] Minor optimisation for Set.copyOf(Collection)

2018-06-22 Thread Andrej Golovnin
what's went wrong. Best regards, Andrej Golovnin

Re: RFR: implementation for JEP 334: JVM Constants API

2018-05-24 Thread 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

Re: Please review CSR : JDK-8200437 String#isBlank

2018-04-25 Thread Andrej Golovnin
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

Re: [PATCH] 8188240: Reflection Proxy should skip static methods

2018-03-14 Thread Andrej Golovnin
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 wrote: > > On Wed, Mar 14, 2018 at 1:00 PM, mandy chung wrote: >> Thanks

Re: RFR: 8198888: Reduce string allocation churn in InvokerBytecodeGenerator

2018-03-01 Thread Andrej Golovnin
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 wrote: > Hi, > > two trivial optimizations that get rid of a few percent on ISC startup > tests. > > Webrev: http://cr

Re: RFR: JDK-8197594: String#repeat

2018-02-28 Thread Andrej Golovnin
2 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 wrote: > Introduction of a new instance method String::repeat to allow an efficient > and concise approach fo

Re: [11] RFR: 8193128: Reduce number of implementation classes returned by List/Set/Map.of()

2018-01-08 Thread Andrej Golovnin
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

Re: [10?] RFR: 8193128: Reduce number of implementation classes returned by List/Set/Map.of()

2017-12-09 Thread Andrej Golovnin
f this problem and I’m sure that you would provide the best possible solution. :-) Best regards, Andrej Golovnin

Re: Add EnumMap.keyType() and EnumSet.elementType()

2017-12-09 Thread Andrej Golovnin
problem, then I’m fine with it. When not, then let us debate about an alternative solution. :-) Best regards, Andrej Golovnin

Re: [10?] RFR: 8193128: Reduce number of implementation classes returned by List/Set/Map.of()

2017-12-09 Thread 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

Re: [10?] RFR: 8193128: Reduce number of implementation classes returned by List/Set/Map.of()

2017-12-09 Thread Andrej Golovnin
would like to use the SubList class: 115 int size; The size field should be final. Thanks! Best regards, Andrej Golovnin

Re: [10?] RFR: 8193128: Reduce number of implementation classes returned by List/Set/Map.of()

2017-12-07 Thread Andrej Golovnin
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

Add EnumMap.keyType() and EnumSet.elementType()

2017-12-07 Thread 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

Re: Collections.emptyList().sort() does nothing

2017-11-15 Thread Andrej Golovnin
> 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. >&

Re: Collections.emptyList().sort() does nothing

2017-11-15 Thread Andrej Golovnin
ould 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 > > For singleton list I can kin

Re: ThreadPoolExecutor and finalization

2017-10-30 Thread Andrej Golovnin
of ThreadPoolExecutor.finalize you can override ThreadPoolExecutor.terminated. Best regards Andrej Golovnin

Re: RFR JDK-8172921: Zip filesystem performance improvement and code cleanup

2017-01-18 Thread Andrej Golovnin
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

Re: RFR JDK-8172921: Zip filesystem performance improvement and code cleanup

2017-01-17 Thread 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 G

Re: [9] RFR 8170769: Provide a simple hexdump facility for binary data

2016-12-10 Thread 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 wrote: > > Thanks to those who provided review comments. > > I have incorporated most of them and update

Re: RFR JDK-8170952: jar's usage message output need some cleanup

2016-12-09 Thread Andrej Golovnin
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

Re: RFR: 8035424: (reflect) Performance problem in sun.reflect.generics.parser.SignatureParser

2016-11-29 Thread Andrej Golovnin
mp; c != '>' && c != '<' && 272!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,

Re: RFR: 8170467: (reflect) Optimize SignatureParser's use of StringBuilders

2016-11-29 Thread Andrej Golovnin
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 wrote: >

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-10-12 Thread Andrej Golovnin
from 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 li

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-10-10 Thread Andrej Golovnin
ants 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

Re: RFR(s): 8152617 add missing wildcards to Optional or() and flatMap()

2016-10-07 Thread 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

Re: RFR: JDK-8161230 ClassLoader: add resource methods returning java.util.stream.Stream

2016-09-08 Thread Andrej Golovnin
Hi Patrick, looks good for me. Thanks! Best regards, Andrej Golovnin

Re: RFR 9: 8155760 Implement Serialization Filtering

2016-09-08 Thread 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

Re: RFR: JDK-8161230 ClassLoader: add resource methods returning java.util.stream.Stream

2016-09-08 Thread Andrej Golovnin
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

Re: RFR: JDK-8161230 ClassLoader: add resource methods returning java.util.stream.Stream

2016-09-08 Thread Andrej Golovnin
ore I 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, A

Re: RFR: JDK-8161230 ClassLoader: add resource methods returning java.util.stream.Stream

2016-09-01 Thread Andrej Golovnin
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 wrote: > Hi Alan, > Hi Paul, > > Here is the first

Re: RFR 8163798: Add a versionedStream method to JarFile

2016-08-25 Thread Andrej Golovnin
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

Re: RFR(S): 8160717: MethodHandles.loop() does not check for excessive signature

2016-07-06 Thread 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

Re: RFR(m): 8140281 deprecate Optional.get()

2016-04-29 Thread Andrej Golovnin
to 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

Re: RFR(m): 8140281 deprecate Optional.get()

2016-04-29 Thread Andrej Golovnin
treamEx! Great job! :-) As an average Java developer 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

Re: RFR (S) 8149835: StringConcatFactory should emit classes with the same package as the host class

2016-02-16 Thread Andrej Golovnin
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

Re: RFR (XS) 8148730: Add @since tags in new String concat APIs

2016-02-01 Thread 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

Re: RFR (XS) 8148730: Add @since tags in new String concat APIs

2016-02-01 Thread Andrej Golovnin
rs added in a later version than the class. This minimizes the number of @since tags. Best regards, Andrej Golovnin

Re: RFR (XS) 8148730: Add @since tags in new String concat APIs

2016-02-01 Thread 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,

Re: RFR(XS): 8147844: new method j.l.Runtime.onSpinWait()

2016-01-27 Thread 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,

Re: Code (Pre-)Review for JEP 280: Indify String Concat

2015-11-30 Thread Andrej Golovnin
+) { 1344 cls[i] = int.class; 1345 } The for-loop can be replaced by: Arrays.fill(cls, int.class); Best regards, Andrej Golovnin

Re: Code (Pre-)Review for JEP 280: Indify String Concat

2015-11-30 Thread Andrej Golovnin
); The result should 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

Re: Code (Pre-)Review for JEP 280: Indify String Concat

2015-11-28 Thread Andrej Golovnin
MethodType, WrongMethodTypeException, LambdaConversioinException). Does it have some special meaning? I'm just curious. Best regards, Andrej Golovnin

Re: Code (Pre-)Review for JEP 280: Indify String Concat

2015-11-27 Thread Andrej Golovnin
ill not work as expected. Best regards, Andrej Golovnin

Re: Code (Pre-)Review for JEP 280: Indify String Concat

2015-11-26 Thread 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

Re: Code (Pre-)Review for JEP 280: Indify String Concat

2015-11-26 Thread Andrej Golovnin
ate-tests.sh The files do not have a copyright header. Best regards, Andrej Golovnin

Re: Array equality, comparison and mismatch

2015-10-12 Thread 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 wrote: > >> On 22 Sep 2015,

Re: RFR JDK-6321472: Add CRC-32C API

2014-11-06 Thread Andrej Golovnin
tic int[][] byteTables = new int[8][256]; 65 private transient final static int[] byteTable; 66 private transient final static int[] byteTable0 = byteTables[0]; Best regards, Andrej Golovnin

Re: RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-08-29 Thread Andrej Golovnin
e=all,file=$JCOV_OUT,merge=merge where jcov_jdk_lang.txt contains the single line: 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

Re: Replace concat String to append in StringBuilder parameters

2014-08-26 Thread Andrej Golovnin
;) should be changed to: 316 sb.append("Extension unknown: DER encoded OCTET string =\n") same 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

Re: Replace concat String to append in StringBuilder parameters

2014-08-21 Thread Andrej Golovnin
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 < mar

Re: Replace concat String to append in StringBuilder parameters

2014-08-21 Thread Andrej Golovnin
indentation. I looked only 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

Re: Replace concat String to append in StringBuilder parameters

2014-08-12 Thread Andrej Golovnin
urity/cert/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); }

Re: Replace concat String to append in StringBuilder parameters

2014-08-11 Thread Andrej Golovnin
nice opportunity to create an RFE for the Javac team. Following code: Object o1 = ...; Object o2 = ...; String s = "abc" + o1 + "c" + o2 + "\n"; should be translated to: String s = new StringBuilder().append("abc").append(o1).append('c

Re: Replace concat String to append in StringBuilder parameters

2014-08-11 Thread Andrej Golovnin
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 wrote: > Hi Otávio, > > About the template in Parser.jjt, TokenMgrError.java

Re: Replace concat String to append in StringBuilder parameters

2014-08-11 Thread Andrej Golovnin
ects/javacc/lists 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 bey

Re: Replace concat String to append in StringBuilder parameters

2014-08-11 Thread Andrej Golovnin
iName).append(']'); 272 } 273 274 return "Extension " + type + ", server_name: " + sb; 275 } to: 268 public String toString() { 269 StringBuilder sb = new StringBuilder(); 270 sb.append("Extension ").append

Re: RFR [9]: 8050142: Optimize java.util.Formatter

2014-07-14 Thread Andrej Golovnin
.append(iexp).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 wrote: > Hi again, > > updated webrev: http://cr

Re: RFR [9]: 8050142: Optimize java.util.Formatter

2014-07-14 Thread Andrej Golovnin
but maybe you can change the line 3781 exp.append("0").append(len - 1); to use the character-based API to append a single character. Best regards, Andrej Golovnin On Mon, Jul 14, 2014 at 12:07 PM, Claes Redestad wrote: > Hi, > > please review t

Re: RFR: 8049892: Replace uses of 'new Integer()' with appropriate alternative across core classes

2014-07-10 Thread Andrej Golovnin
l.java src/share/classes/sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl.java src/share/classes/sun/reflect/UnsafeStaticIntegerFieldAccessorImpl.java This classes will be fixed by the patch for the issue 5043030. Otherwise it looks good. Best regards, Andrej Golovnin On Fri, Jul 11, 20

Re: Character, Byte, Short valueOf instead of new instance

2014-07-01 Thread Andrej Golovnin
d you please submit the ASM related changes to the ASM project [1]? Thanks! Best regards, Andrej Golovnin [1] http://asm.ow2.org/

Re: Long valueOf instead of new Long

2014-07-01 Thread Andrej Golovnin
Hi Pavel, > As per [1] I'm updating this thread with yet another webrev: > > http://cr.openjdk.java.net/~prappo/8048267/webrev.05 Thanks and looks good. Best regards, Andrej Golovnin

Re: Character, Byte, Short valueOf instead of new instance

2014-07-01 Thread Andrej Golovnin
d into JDK next time. 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 wrote: > Otavio, > > As wi

Re: Long valueOf instead of new Long

2014-06-30 Thread Andrej Golovnin
work on it. Otherwise it looks good to me. Best regards, Andrej Golovnin

Re: Long valueOf instead of new Long

2014-06-30 Thread 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

Re: Long valueOf instead of new Long

2014-06-27 Thread Andrej Golovnin
p here the code a little bit. > > P.S. Andrej, it looks like you don't have an 'Author' status. Well, 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

Re: Long valueOf instead of new Long

2014-06-27 Thread Andrej Golovnin
n Long.valueOf(pName).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 wrote: > I created an issu

Re: Long valueOf instead of new Long

2014-06-26 Thread Andrej Golovnin
Stamp)).longValue(); > +long lastTime = (Long.valueOf(tStamp)).longValue(); > > > Paul. > > 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

[PATCH] LambdaTranslationTest[1|2] may fail when executed with other locale than US

2014-06-21 Thread 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

Re: RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-06-12 Thread Andrej Golovnin
hing I think we should make the decision whether we are going to drop the VM part or not. As I already said, I'm for the consistent behavior and therefore against the dropping the VM part. But I'm only the user of the JDK. Maybe other members of the core team could share with us their opinion. Best regards, Andrej Golovnin

Re: RFR 9 and 8u: JDK-8029674: (reflect) getMethods returns default methods that are not members of the class

2014-06-09 Thread Andrej Golovnin
:set_name(mh(), name()); Therefore I would say 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,

Re: RFR 9 and 8u: JDK-8029674: (reflect) getMethods returns default methods that are not members of the class

2014-06-07 Thread Andrej Golovnin
getParameterTypes(), 2768 toRemove.getParameterTypes())) { 2769 methods[i] = null; Best regards, Andrej Golovnin

Re: RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-06-05 Thread Andrej Golovnin
Hi, any update? Best regards, Andrej Golovnin On 29.05.2014, at 09:35, Joel Borggrén-Franck wrote: > Hi, > > We need you send in the patches via the mailing list. Please reply to your > mail with the diffs attached directly (not zipped for example). > > I’ll might have ti

Re: RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-06-02 Thread Andrej Golovnin
em with Integer objects too. I brought the example with Boolean objects just because at least in the theory we should have per JVM only two instances of Boolean class. But in the reality we have to many of them. Best regards, Andrej Golovnin

Re: RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-05-29 Thread Andrej Golovnin
tion back to Java by calling JavaCalls::call_static(&boxed_value, klass_handle, vmSymbols::valueOf_name(), valueOf_signature, &args, THREAD); But maybe I misunderstood the implementation of JavaCalls. Best regards, Andrej Golovnin

Re: RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-05-29 Thread Andrej Golovnin
in TLABs and are removed by GC when the use case is finished, I would say we have allocated 9GB of Boolean objects to much. Or do you see 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

Re: RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-05-29 Thread Andrej Golovnin
Hi all, as requested here are the patches as diffs. Best regards, Andrej Golovnin On 28.05.2014, at 23:44, Andrej Golovnin wrote: > Hi Joe, > > I have prepared a patch for the issue JDK-5043030. > The patch consists of two parts: one for jdk and one for hotspot. > You can f

Re: RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-05-29 Thread Andrej Golovnin
As I wrote in my previous mail, the JDK patch contains two regression tests for jtreg to verify my changes. If you run this tests using current JDK9, than the tests will fail. After applying my patches the tests executed without any problem. Best regards, Andrej Golovnin > > cheers > /

RFR: 5043030 (reflect) unnecessary object creation in reflection

2014-05-28 Thread Andrej Golovnin
it and I hope you can sponsor it. Best regards, Andrej Golovnin

Re: Boolean valueOf instead of new Boolean

2014-05-24 Thread 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

Re: Which optimizations does Hotspot apply?

2014-01-30 Thread Andrej Golovnin
n, since which 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

Re: Which optimizations does Hotspot apply?

2014-01-27 Thread 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

Re: Which optimizations does Hotspot apply?

2014-01-24 Thread Andrej Golovnin
n, since which 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

Re: JDK 8 RFR for JDK-7185456 : (ann) Optimize Annotation handling in java/sun.reflect.* code for small number of annotationsC

2013-03-27 Thread 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 23

Re: [PATCH] Use #valueOf()-methods in Unsafe-based FieldAccessors

2012-05-02 Thread Andrej Golovnin
ge AccessorGenerator and its sub-classes to use #valueOf()-methods. 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 cfd7602f5c5247d551290

[PATCH] Use #valueOf()-methods in Unsafe-based FieldAccessors

2012-05-01 Thread Andrej Golovnin
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