From jaroslav.tulach at oracle.com Fri Aug 1 04:39:36 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Fri, 01 Aug 2014 06:39:36 +0200 Subject: WAR == single classloader was: Benefits of activeReferenceQueue In-Reply-To: <53D78FE5.50906@redhat.com> References: <2296697.ZmJV3U9KFH@logouticek> <1877778.1B9EpdAxaD@logouticek> <53D78FE5.50906@redhat.com> Message-ID: <1551320.KMaPOkQ6qx@logouticek> Dne ?t 29. ?ervence 2014 14:13:25, Florian Weimer napsal(a): > On 07/29/2014 10:05 AM, Jaroslav Tulach wrote: > > Plus, because there is a single classloader which loads all the classes > > from a WAR, by keeping the activerReferenceQueue thread alive and holding > > reference to the queue, we hold reference to its class and the > > classloader and thus all classes referenced by it. > > > > And this memory leak accumulates with every re-deploy. > > Could you interrupt the thread when URLClassLoader#close() is called? Hello Florian, I am not sure how to hook into URLClassLoader#close? It is the container who creates the classloader, not my library and I don't see any way to add a "listener" to the close method (without a reflection). -jt From jaroslav.tulach at oracle.com Fri Aug 1 05:15:57 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Fri, 01 Aug 2014 07:15:57 +0200 Subject: Summary of 1st week was: ReferenceQueue.remove to allow GC of the queue itself In-Reply-To: <2781FC2F-5456-405D-AFF2-CA593F88CFF0@oracle.com> References: <2296697.ZmJV3U9KFH@logouticek> <2781FC2F-5456-405D-AFF2-CA593F88CFF0@oracle.com> Message-ID: <1559679.kb4kKeLocq@logouticek> Dear all. On Fri Jul 25, 2014: > So, let?s start with the problem, rather than the solution. Could you start > with writing up what issue you?re trying to address, and then we can > proceed to evaluating whether the proposed solution is the right one? Thanks for the encouragement, thanks for your comments, suggestions and ideas. I believe it is time to provide more permanent (than an email) summary of what we discussed so far. I've added such comment to the JIRA: https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13531670&p age=com.atlassian.jira.plugin.system.issuetabpanels:comment- tabpanel#comment-13531670[1] Please let me know if I am misinterpreting something. JIRA comment is editable, so I should be able to fix it. I hope we continue our discussions and come up with even better ways to address the activeReferenceQueue cleanup problem! -jt > On Jul 24, 2014, at 7:29 AM, Jaroslav Tulach wrote: > > Hi. > > I'd like to add one new method into java.lang.ref.ReferenceQueue. Can > > anyone help me go through the review process? I've reported > > https://bugs.openjdk.java.net/browse/JDK-8051843 > > but that probably is not enough, right? > > > > Thanks in advance for your help. > > -jt -------- [1] https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13531670&p age=com.atlassian.jira.plugin.system.issuetabpanels:comment- tabpanel#comment-13531670 From amy.lu at oracle.com Fri Aug 1 06:45:06 2014 From: amy.lu at oracle.com (Amy Lu) Date: Fri, 01 Aug 2014 14:45:06 +0800 Subject: RFR 8054095: No space allowed in platforms string in ProblemList.txt Message-ID: <53DB3772.1000304@oracle.com> Please review the problem list change for JDK-8054095 http://cr.openjdk.java.net/~ewang/amylu/JDK-8054095/webrev.00/ In ProblemList.txt, when specify multiple platforms, the space between the platform names is not accepted by jtreg harness. This change is to remove the empty space between the platform names. Thanks, Amy From weijun.wang at oracle.com Fri Aug 1 07:13:14 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Fri, 1 Aug 2014 15:13:14 +0800 Subject: RFR 8054095: No space allowed in platforms string in ProblemList.txt In-Reply-To: <53DB3772.1000304@oracle.com> References: <53DB3772.1000304@oracle.com> Message-ID: The change looks good. So does the closed side. I read jtharness and it seems a line is broken into 3 parts separated by space(s). Either the 2nd or the 3rd part will be used by jtreg as platforms, but not both. I'm not sure if jtharness or jtreg should also be updated. Thanks Max On Aug 1, 2014, at 14:45, Amy Lu wrote: > Please review the problem list change for JDK-8054095 > > http://cr.openjdk.java.net/~ewang/amylu/JDK-8054095/webrev.00/ > > In ProblemList.txt, when specify multiple platforms, the space between the platform names is not accepted by jtreg harness. > This change is to remove the empty space between the platform names. > Thanks, > Amy > From vincent.x.ryan at oracle.com Fri Aug 1 13:20:25 2014 From: vincent.x.ryan at oracle.com (Vincent Ryan) Date: Fri, 1 Aug 2014 14:20:25 +0100 Subject: RFR JDK-8051991: Flatten VersionHelper hierarchies In-Reply-To: <6522E5EA-CA3C-4C73-9B63-BA91D0D1AA03@oracle.com> References: <6522E5EA-CA3C-4C73-9B63-BA91D0D1AA03@oracle.com> Message-ID: <372747C8-E3C5-4003-B23D-22BE4226E3B3@oracle.com> Look fine Pavel. Thanks. On 25 Jul 2014, at 13:59, Pavel Rappo wrote: > Hi everyone, > > Could you please review my change for JDK-8051991? > > http://cr.openjdk.java.net/~prappo/8051991/webrev.00/ > > -Pavel From neil.toda at oracle.com Fri Aug 1 14:29:16 2014 From: neil.toda at oracle.com (Neil Toda) Date: Fri, 01 Aug 2014 07:29:16 -0700 Subject: Please View Change : 8044867 : Fix raw and unchecked lint warnings in sun.tools.* In-Reply-To: <53DAD834.3000309@oracle.com> References: <53DAB627.5020408@oracle.com> <53DAD834.3000309@oracle.com> Message-ID: <53DBA43C.8030803@oracle.com> Thanks Joe. -neil On 7/31/2014 4:58 PM, Joe Darcy wrote: > Looks fine Neil; thanks, > > -Joe > > > On 07/31/2014 02:33 PM, Neil Toda wrote: >> >> Please view this patch cleaning up lint rawtypes, cast, and unchecked >> warnings in sun.tools.* >> >> http://cr.openjdk.java.net/~ntoda/8044867/webrev-04/ >> >> jbs: https://bugs.openjdk.java.net/browse/JDK-8044867 >> >> Thanks >> >> -neil >> >> >> > From pavel.rappo at oracle.com Fri Aug 1 15:50:22 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Fri, 1 Aug 2014 16:50:22 +0100 Subject: RFR JDK-8054158: Fix typos in JNDI-related packages Message-ID: Hi everyone, Could you please review my change for JDK-8054158? http://cr.openjdk.java.net/~prappo/8054158/webrev.00/ -Pavel From roger.riggs at oracle.com Fri Aug 1 16:06:51 2014 From: roger.riggs at oracle.com (roger riggs) Date: Fri, 01 Aug 2014 12:06:51 -0400 Subject: RFR JDK-8054158: Fix typos in JNDI-related packages In-Reply-To: References: Message-ID: <53DBBB1B.9050207@oracle.com> Hi Pavel, The changes look fine. Thanks, Roger On 8/1/2014 11:50 AM, Pavel Rappo wrote: > Hi everyone, > > Could you please review my change for JDK-8054158? > > http://cr.openjdk.java.net/~prappo/8054158/webrev.00/ > > -Pavel From vincent.x.ryan at oracle.com Fri Aug 1 16:21:55 2014 From: vincent.x.ryan at oracle.com (Vincent Ryan) Date: Fri, 1 Aug 2014 17:21:55 +0100 Subject: RFR JDK-8054158: Fix typos in JNDI-related packages In-Reply-To: References: Message-ID: <90620257-2877-44EC-ADF2-349055E9B807@oracle.com> Thanks for fixing those typso. On 1 Aug 2014, at 16:50, Pavel Rappo wrote: > Hi everyone, > > Could you please review my change for JDK-8054158? > > http://cr.openjdk.java.net/~prappo/8054158/webrev.00/ > > -Pavel From pavel.rappo at oracle.com Fri Aug 1 16:45:06 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Fri, 1 Aug 2014 17:45:06 +0100 Subject: RFR JDK-8054158: Fix typos in JNDI-related packages In-Reply-To: <53DBBB1B.9050207@oracle.com> References: <53DBBB1B.9050207@oracle.com> Message-ID: <272C5506-17BD-4EDE-B7AB-1B4FEE288C11@oracle.com> Roger, Vincent, Here are updates more of a structural type (grammar and syntax rather than spelling) and some deletions: http://cr.openjdk.java.net/~prappo/8054158/webrev.01/ src/share/classes/com/sun/jndi/dns/DnsClient.java src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java src/share/classes/com/sun/jndi/ldap/pool/Pool.java src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java -Pavel On 1 Aug 2014, at 17:06, roger riggs wrote: > Hi Pavel, > > The changes look fine. > > Thanks, Roger > > On 8/1/2014 11:50 AM, Pavel Rappo wrote: >> Hi everyone, >> >> Could you please review my change for JDK-8054158? >> >> http://cr.openjdk.java.net/~prappo/8054158/webrev.00/ >> >> -Pavel > From roger.riggs at oracle.com Fri Aug 1 18:10:09 2014 From: roger.riggs at oracle.com (roger riggs) Date: Fri, 01 Aug 2014 14:10:09 -0400 Subject: RFR JDK-8054158: Fix typos in JNDI-related packages In-Reply-To: <272C5506-17BD-4EDE-B7AB-1B4FEE288C11@oracle.com> References: <53DBBB1B.9050207@oracle.com> <272C5506-17BD-4EDE-B7AB-1B4FEE288C11@oracle.com> Message-ID: <53DBD801.5050608@oracle.com> Hi Pavel, Looks fine. Roger On 8/1/2014 12:45 PM, Pavel Rappo wrote: > Roger, Vincent, > > Here are updates more of a structural type (grammar and syntax rather than spelling) and some deletions: > > http://cr.openjdk.java.net/~prappo/8054158/webrev.01/ > > src/share/classes/com/sun/jndi/dns/DnsClient.java > src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java > src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java > src/share/classes/com/sun/jndi/ldap/pool/Pool.java > src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java > > -Pavel > > On 1 Aug 2014, at 17:06, roger riggs wrote: > >> Hi Pavel, >> >> The changes look fine. >> >> Thanks, Roger >> >> On 8/1/2014 11:50 AM, Pavel Rappo wrote: >>> Hi everyone, >>> >>> Could you please review my change for JDK-8054158? >>> >>> http://cr.openjdk.java.net/~prappo/8054158/webrev.00/ >>> >>> -Pavel From david.holmes at oracle.com Sun Aug 3 03:23:07 2014 From: david.holmes at oracle.com (David Holmes) Date: Sun, 03 Aug 2014 13:23:07 +1000 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53D6D842.7000103@oracle.com> References: <53D6D842.7000103@oracle.com> Message-ID: <53DDAB1B.7000004@oracle.com> Hi Ioi, Sending a partial review as I've been delayed again. :( A few minor comments: src/share/vm/classfile/classLoader.hpp This enum is using inconsistent style for the constants: 149 enum SomeConstants { 150 package_hash_table_size = 31, // Number of buckets 151 MAX_CLASSPATH_INDEX = 0x7fffffff 152 }; --- src/share/vm/classfile/dictionary.cpp 223 void Dictionary::remove_error_classes() { Does this mean "remove erroneous classes"? What kinds of errors are we referring to here? 225 int index = 0; // Defined here for portability! Do not move ??? Do we have a C compiler that can't declare loop variables? 231 Klass* e = probe->klass(); 232 InstanceKlass* ik = InstanceKlass::cast(e); Can we dispense with the curiously named 'e' local? --- src/share/vm/classfile/systemDictionary.cpp 982 guarantee(!DumpSharedSpaces, "must not create anonymoys classes when dumping"); Typo: anonymoys 1221 // FIXME: locking comment out of date! This FIXME needs fixing. SharedClassUtil::is_shared_boot_class should be SharedClassUtil::is_shared_class as it doesn't know whether the passed in class is a "boot" class or not. David ------ On 29/07/2014 9:09 AM, Ioi Lam wrote: > Hi Folks, > > Please review the following clean up and refactoring of the CDS code, > for JDK9 > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ > https://bugs.openjdk.java.net/browse/JDK-8046070 > > Summary of fix: > > Clean up and refactor the Class Data Sharing (CDS) code, including: > > + Improve archive integrity checking > + Support bytecode verification during archive dumping time > + Allow the user to configure the CDS class list and archive file. > + Allow future extension of the CDS class loading mechanism. > > Tests: > > JPRT > UTE (vm.runtime.testlist, vm.quick.testlist, > vm.parallel_class_loading.testlist) > Various adhoc SQE tests on Aurora > JCK > > Thanks > - Ioi From ioi.lam at oracle.com Sun Aug 3 06:59:57 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Sat, 02 Aug 2014 23:59:57 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53DDAB1B.7000004@oracle.com> References: <53D6D842.7000103@oracle.com> <53DDAB1B.7000004@oracle.com> Message-ID: <53DDDDED.8060503@oracle.com> David, thanks for the comments. I will fix the code as you suggested. > 225 int index = 0; // Defined here for portability! Do not move > > ??? Do we have a C compiler that can't declare loop variables? I probably had two loops using the "index" variable. I remember some old C++ compilers would be confused if you do for (int index=0; ...) {} for (int index=0; ...) {} and would complain that "index" was declared twice. In any case, I will remove the comment here and move the declaration of "index" into the "for" statement. - Ioi On 8/2/14, 8:23 PM, David Holmes wrote: > Hi Ioi, > > Sending a partial review as I've been delayed again. :( > > A few minor comments: > > src/share/vm/classfile/classLoader.hpp > > This enum is using inconsistent style for the constants: > > 149 enum SomeConstants { > 150 package_hash_table_size = 31, // Number of buckets > 151 MAX_CLASSPATH_INDEX = 0x7fffffff > 152 }; > > --- > > src/share/vm/classfile/dictionary.cpp > > 223 void Dictionary::remove_error_classes() { > > Does this mean "remove erroneous classes"? What kinds of errors are we > referring to here? > > 225 int index = 0; // Defined here for portability! Do not move > > ??? Do we have a C compiler that can't declare loop variables? > > 231 Klass* e = probe->klass(); > 232 InstanceKlass* ik = InstanceKlass::cast(e); > > Can we dispense with the curiously named 'e' local? > > --- > > src/share/vm/classfile/systemDictionary.cpp > > 982 guarantee(!DumpSharedSpaces, "must not create anonymoys > classes when dumping"); > > Typo: anonymoys > > 1221 // FIXME: locking comment out of date! > > This FIXME needs fixing. > > > SharedClassUtil::is_shared_boot_class should be > SharedClassUtil::is_shared_class as it doesn't know whether the passed > in class is a "boot" class or not. > > David > ------ > > On 29/07/2014 9:09 AM, Ioi Lam wrote: >> Hi Folks, >> >> Please review the following clean up and refactoring of the CDS code, >> for JDK9 >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >> https://bugs.openjdk.java.net/browse/JDK-8046070 >> >> Summary of fix: >> >> Clean up and refactor the Class Data Sharing (CDS) code, including: >> >> + Improve archive integrity checking >> + Support bytecode verification during archive dumping time >> + Allow the user to configure the CDS class list and archive file. >> + Allow future extension of the CDS class loading mechanism. >> >> Tests: >> >> JPRT >> UTE (vm.runtime.testlist, vm.quick.testlist, >> vm.parallel_class_loading.testlist) >> Various adhoc SQE tests on Aurora >> JCK >> >> Thanks >> - Ioi From ivan.gerasimov at oracle.com Mon Aug 4 11:27:31 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 04 Aug 2014 15:27:31 +0400 Subject: RFR [8051382] Optimize java.lang.reflect.Modifier.toString() In-Reply-To: References: <53C9A214.1060101@oracle.com> <53C9A640.8030808@oracle.com> <53C9C758.5070203@oracle.com> Message-ID: <53DF6E23.2010509@oracle.com> Hi Martin! Sorry for the pause, I had to take a break. Thank you for your StringJoiner rework! I created a bug to track it: https://bugs.openjdk.java.net/browse/JDK-8054221 With your implementation of StringJoiner, the first version of Modifier.toString() [1] became (almost) as fast as original, and a bit clearer. [1] http://cr.openjdk.java.net/~igerasim/8051382/0/webrev/ Will you approve the change to Modifier.toString? Sincerely your, Ivan On 19.07.2014 19:58, Martin Buchholz wrote: > StringJoiner seems written in a style suitable for an application, not > in a low-level performance-oriented style suitable for a JDK core > library. But we can fix that. > > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/StringJoiner-optimization/ > > > > On Fri, Jul 18, 2014 at 6:18 PM, Ivan Gerasimov > > wrote: > > > On 19.07.2014 3:07, Martin Buchholz wrote: > > > I took a quick look at StringJoiner. It looks to me like this > won't be an optimization, because StringJoiner uses > StringBuilder internally, and will actually perform more total > operations. > > > Unfortunately this is true. > Microbenchmarking shows that StringJoiner makes the things 30% > slower, which is sad. > > Then I propose another simple patch giving +15% to the speed: > > http://cr.openjdk.java.net/~igerasim/8051382/1/webrev/ > > > Sincerely yours, > Inan > > From fweimer at redhat.com Mon Aug 4 11:27:47 2014 From: fweimer at redhat.com (Florian Weimer) Date: Mon, 04 Aug 2014 13:27:47 +0200 Subject: WAR == single classloader was: Benefits of activeReferenceQueue In-Reply-To: <1551320.KMaPOkQ6qx@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <1877778.1B9EpdAxaD@logouticek> <53D78FE5.50906@redhat.com> <1551320.KMaPOkQ6qx@logouticek> Message-ID: <53DF6E33.3090509@redhat.com> On 08/01/2014 06:39 AM, Jaroslav Tulach wrote: > Dne ?t 29. ?ervence 2014 14:13:25, Florian Weimer napsal(a): >> On 07/29/2014 10:05 AM, Jaroslav Tulach wrote: >>> Plus, because there is a single classloader which loads all the classes >>> from a WAR, by keeping the activerReferenceQueue thread alive and holding >>> reference to the queue, we hold reference to its class and the >>> classloader and thus all classes referenced by it. >>> >>> And this memory leak accumulates with every re-deploy. >> >> Could you interrupt the thread when URLClassLoader#close() is called? > > Hello Florian, > I am not sure how to hook into URLClassLoader#close? It is the container who > creates the classloader, not my library and I don't see any way to add a > "listener" to the close method (without a reflection). Wouldn't it be the job of the container to provide such notification just before unloading the module? I wonder if it is possible to fake such notification with finalization which is triggered after class unloading, but it seems this needs separate class loaders and will likely be rather brittle. -- Florian Weimer / Red Hat Product Security From david.lloyd at redhat.com Mon Aug 4 13:42:50 2014 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 04 Aug 2014 08:42:50 -0500 Subject: WAR == single classloader was: Benefits of activeReferenceQueue In-Reply-To: <53DF6E33.3090509@redhat.com> References: <2296697.ZmJV3U9KFH@logouticek> <1877778.1B9EpdAxaD@logouticek> <53D78FE5.50906@redhat.com> <1551320.KMaPOkQ6qx@logouticek> <53DF6E33.3090509@redhat.com> Message-ID: <53DF8DDA.3090908@redhat.com> On 08/04/2014 06:27 AM, Florian Weimer wrote: > On 08/01/2014 06:39 AM, Jaroslav Tulach wrote: >> Dne ?t 29. ?ervence 2014 14:13:25, Florian Weimer napsal(a): >>> On 07/29/2014 10:05 AM, Jaroslav Tulach wrote: >>>> Plus, because there is a single classloader which loads all the classes >>>> from a WAR, by keeping the activerReferenceQueue thread alive and >>>> holding >>>> reference to the queue, we hold reference to its class and the >>>> classloader and thus all classes referenced by it. >>>> >>>> And this memory leak accumulates with every re-deploy. >>> >>> Could you interrupt the thread when URLClassLoader#close() is called? >> >> Hello Florian, >> I am not sure how to hook into URLClassLoader#close? It is the >> container who >> creates the classloader, not my library and I don't see any way to add a >> "listener" to the close method (without a reflection). > > Wouldn't it be the job of the container to provide such notification > just before unloading the module? > > I wonder if it is possible to fake such notification with finalization > which is triggered after class unloading, but it seems this needs > separate class loaders and will likely be rather brittle. Servlets are EE components, and as such, you should be able to establish a @PreDestroy interceptor, which was introduced for exactly this kind of purpose (cleanup and reclaiming of per-component resources). Also servlets have a destroy method IIRC. IOW all of this seems unnecessary. -- - DML From vasily.stolbov at oracle.com Mon Aug 4 13:45:02 2014 From: vasily.stolbov at oracle.com (vasily stolbov) Date: Mon, 04 Aug 2014 17:45:02 +0400 Subject: RFR (XS) JDK-8051861 [TESTBUG] test "java/math/BigInteger/BigIntegerTest.java" does not hold Random value to have a possibility to reproduce it In-Reply-To: <53D11A95.3030705@oracle.com> References: <53D11A95.3030705@oracle.com> Message-ID: <53DF8E5E.6020306@oracle.com> Hi, Please review and help me with integration: Problem: java.math.BigInteger.BigIntegerTest uses java.math.Random(), so we have no possibility to reproduce it. Solution: Test gets start random seed from environment variable. If this variable not exists, test write current random seed to log. Bug: https://bugs.openjdk.java.net/browse/JDK-8051861 Fix: (in attachment) Best regards, Vasily -------------- next part -------------- diff -r 08d0c4b1a48d test/java/math/BigInteger/BigIntegerTest.java --- a/test/java/math/BigInteger/BigIntegerTest.java Wed Jul 02 10:03:40 2014 +0100 +++ b/test/java/math/BigInteger/BigIntegerTest.java Fri Jul 25 19:22:05 2014 +0400 @@ -34,6 +34,8 @@ import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.lang.Long; +import java.lang.System; import java.math.BigInteger; import java.util.Random; @@ -944,8 +946,23 @@ * */ public static void main(String[] args) throws Exception { + //reproducibility fix + String seed = System.getProperty("startseed"); + if(seed!=null){ + rnd.setSeed(Long.valueOf(seed).longValue()); + System.err.println("Seed: " + seed); + }else{ + Long currentSeed = rnd.nextLong(); + System.err.println("Seed: " + currentSeed); + rnd.setSeed(currentSeed); + } + + + // Some variables for sizing test numbers in bits + + int order1 = ORDER_MEDIUM; int order2 = ORDER_SMALL; int order3 = ORDER_KARATSUBA; From jaroslav.tulach at oracle.com Mon Aug 4 13:46:40 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Mon, 04 Aug 2014 15:46:40 +0200 Subject: Why is finalize wrong? In-Reply-To: <53D77C35.9050805@oracle.com> References: <2296697.ZmJV3U9KFH@logouticek> <100490444.vZHLe3CSFC@logouticek> <53D77C35.9050805@oracle.com> Message-ID: <24689252.yEYuCUqD1k@logouticek> Hi. Last week we touched topic of finalization and what is wrong with it. I proposed three reasons why Object.finalize is bad. Is it correct and extensive list or would you change it or expand it? Thanks as ... > > # 1 - Because of automatic JDK management thread? > > # 2 - Or because once finalize() is called, one still has reference to the > > "gone" object and can re-activate it? > > #3 - Or because the finalizer thread is shared between completely > > unrelated > > objects and misbehavior of one can cause problems for others? ...I consider #2 the worst idea: > > My personal top three starts with #2. That is logically invalid. #3 can be > > a problem, but so can be any other misbehaving thread in an application. > > #1 is completely OK, from my perspective and I think I got some support... > Weak references and reference queues were introduced to address some of > the short comings of finalization as well as providing other > capabilities within a GC'd environment. ...I just have to say that the Reference&ReferenceQueue as of JDK8 is not enough. As the case of activeReferenceQueue shows, the fact that each instance of ReferenceQueue where one uses remove() needs one dedicated thread is a big flaw. Fixing the flaw in an external library is not easy (see the summary from last week: https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13531670&p [1]age=com.atlassian.jira.plugin.system.issuetabpanels:comment- tabpanel#comment-13531670). Moreover David Holmes finds introductions of new system level threads uneasy: > The threading aspect is somewhat tangential. Any time you choose to > introduce a new thread to perform a task you have to be concerned about > the lifetime of the task and thus the thread. But when thinking about it, we can have functionality of activeReferenceQueue in JDK without introducing any new thread! We can reuse the existing finalizer one! I plan to propose a patch which will look at the activeReferenceQueue problem from a completely new perspective and offer "lightweight finalize" solution that will have above discussed properties #1 and #3, but will not suffer from #2 (the biggest problem with Object.finalize). I just wanted to ask before I start: Is somebody aware of other problems with Object.finalize than #1, #2 and #3? -jt -------- [1] https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13531670&p From david.lloyd at redhat.com Mon Aug 4 13:50:22 2014 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 04 Aug 2014 08:50:22 -0500 Subject: Why is finalize wrong? In-Reply-To: <24689252.yEYuCUqD1k@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <100490444.vZHLe3CSFC@logouticek> <53D77C35.9050805@oracle.com> <24689252.yEYuCUqD1k@logouticek> Message-ID: <53DF8F9E.6090704@redhat.com> On 08/04/2014 08:46 AM, Jaroslav Tulach wrote: > Hi. > Last week we touched topic of finalization and what is wrong with it. I proposed three > reasons why Object.finalize is bad. Is it correct and extensive list or would you change > it or expand it? Thanks as ... > >>> # 1 - Because of automatic JDK management thread? >>> # 2 - Or because once finalize() is called, one still has reference to the >>> "gone" object and can re-activate it? >>> #3 - Or because the finalizer thread is shared between completely >>> unrelated >>> objects and misbehavior of one can cause problems for others? > > ...I consider #2 the worst idea: > >>> My personal top three starts with #2. That is logically invalid. #3 can be >>> a problem, but so can be any other misbehaving thread in an application. >>> #1 is completely OK, from my perspective > > and I think I got some support... > >> Weak references and reference queues were introduced to address some of >> the short comings of finalization as well as providing other >> capabilities within a GC'd environment. > > ...I just have to say that the Reference&ReferenceQueue as of JDK8 is not enough. As > the case of activeReferenceQueue shows, the fact that each instance of > ReferenceQueue where one uses remove() needs one dedicated thread is a big flaw. > Fixing the flaw in an external library is not easy (see the summary from last week: > https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13531670&p > [1]age=com.atlassian.jira.plugin.system.issuetabpanels:comment- > tabpanel#comment-13531670). > > Moreover David Holmes finds introductions of new system level threads uneasy: > >> The threading aspect is somewhat tangential. Any time you choose to >> introduce a new thread to perform a task you have to be concerned about >> the lifetime of the task and thus the thread. > > But when thinking about it, we can have functionality of activeReferenceQueue in JDK > without introducing any new thread! We can reuse the existing finalizer one! > > I plan to propose a patch which will look at the activeReferenceQueue problem from a > completely new perspective and offer "lightweight finalize" solution that will have > above discussed properties #1 and #3, but will not suffer from #2 (the biggest > problem with Object.finalize). > > I just wanted to ask before I start: Is somebody aware of other problems with > Object.finalize than #1, #2 and #3? Yup. Did you know that an object can be finalized while there are still instance methods of that object executing? We've actually seen it happen. Just take a few minutes to think about what that means! Almost every remaining use case for finalize is made unsafe and/or useless by this fact. If you still think that finalize is a good idea, given that it's basically defective *and* there is almost always a better solution, then I will be quite astounded I think. -- - DML From vasily.stolbov at oracle.com Mon Aug 4 14:01:49 2014 From: vasily.stolbov at oracle.com (vasily stolbov) Date: Mon, 04 Aug 2014 18:01:49 +0400 Subject: Fwd: RFR (XS) JDK-8051861 [TESTBUG] test "java/math/BigInteger/BigIntegerTest.java" does not hold Random value to have a possibility to reproduce it In-Reply-To: <53DF8E5E.6020306@oracle.com> References: <53DF8E5E.6020306@oracle.com> Message-ID: <53DF924D.4050608@oracle.com> -------- Original Message -------- Subject: RFR (XS) JDK-8051861 [TESTBUG] test "java/math/BigInteger/BigIntegerTest.java" does not hold Random value to have a possibility to reproduce it Date: Mon, 04 Aug 2014 17:45:02 +0400 From: vasily stolbov Organization: Oracle Corporation To: core-libs-dev at openjdk.java.net Hi, Please review and help me with integration: Problem: java.math.BigInteger.BigIntegerTest uses java.math.Random(), so we have no possibility to reproduce it. Solution: Test gets start random seed from environment variable. If this variable not exists, test write current random seed to log. Bug: https://bugs.openjdk.java.net/browse/JDK-8051861 Fix: (in attachment) Best regards, Vasily -------------- next part -------------- diff -r 08d0c4b1a48d test/java/math/BigInteger/BigIntegerTest.java --- a/test/java/math/BigInteger/BigIntegerTest.java Wed Jul 02 10:03:40 2014 +0100 +++ b/test/java/math/BigInteger/BigIntegerTest.java Fri Jul 25 19:22:05 2014 +0400 @@ -34,6 +34,8 @@ import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.lang.Long; +import java.lang.System; import java.math.BigInteger; import java.util.Random; @@ -944,8 +946,23 @@ * */ public static void main(String[] args) throws Exception { + //reproducibility fix + String seed = System.getProperty("startseed"); + if(seed!=null){ + rnd.setSeed(Long.valueOf(seed).longValue()); + System.err.println("Seed: " + seed); + }else{ + Long currentSeed = rnd.nextLong(); + System.err.println("Seed: " + currentSeed); + rnd.setSeed(currentSeed); + } + + + // Some variables for sizing test numbers in bits + + int order1 = ORDER_MEDIUM; int order2 = ORDER_SMALL; int order3 = ORDER_KARATSUBA; From ivan.gerasimov at oracle.com Mon Aug 4 16:16:30 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 04 Aug 2014 20:16:30 +0400 Subject: RFR [8054221] StringJoiner imlementation optimization Message-ID: <53DFB1DE.2030901@oracle.com> Hello! Here's the proposal by Martin Buchholz to improve implementation of StringJoiner class: http://cr.openjdk.java.net/~martin/webrevs/openjdk9/StringJoiner-optimization/ I think that result of concatenation in the merge() method can be saved to be reused later. This would be useful, for example, if a StringJoiner is merged into other StringJoiners several times. So, here's my slightly modified version of the Martin's webrev: http://cr.openjdk.java.net/~igerasim/8054221/0/webrev/ I've also modified the test to regularly test cases with empty prefixes/suffixes. Sincerely yours, Ivan From claes.redestad at oracle.com Mon Aug 4 17:04:13 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 04 Aug 2014 19:04:13 +0200 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53DFB1DE.2030901@oracle.com> References: <53DFB1DE.2030901@oracle.com> Message-ID: <53DFBD0D.1010602@oracle.com> Hi, - is there a sufficiently good reason not to use an ArrayList over a manually resized String[] here? It'd simplify and use overflow-conscious code at a negligible performance cost - nit: elt(s) -> element(s) - nit: always use curly braces /Claes On 08/04/2014 06:16 PM, Ivan Gerasimov wrote: > Hello! > > Here's the proposal by Martin Buchholz to improve implementation of > StringJoiner class: > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/StringJoiner-optimization/ > > > I think that result of concatenation in the merge() method can be > saved to be reused later. > This would be useful, for example, if a StringJoiner is merged into > other StringJoiners several times. > > So, here's my slightly modified version of the Martin's webrev: > http://cr.openjdk.java.net/~igerasim/8054221/0/webrev/ > > I've also modified the test to regularly test cases with empty > prefixes/suffixes. > > Sincerely yours, > Ivan From martinrb at google.com Tue Aug 5 01:29:56 2014 From: martinrb at google.com (Martin Buchholz) Date: Mon, 4 Aug 2014 18:29:56 -0700 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53DFBD0D.1010602@oracle.com> References: <53DFB1DE.2030901@oracle.com> <53DFBD0D.1010602@oracle.com> Message-ID: On Mon, Aug 4, 2014 at 10:04 AM, Claes Redestad wrote: > Hi, > > - is there a sufficiently good reason not to use an ArrayList > over a manually resized String[] here? It'd simplify and use > overflow-conscious code at a negligible performance cost > This is a core library - it should be fanatically devoted to high performance. Should HashMap have an internal ArrayList instead of an array? > - nit: elt(s) -> element(s) > - nit: always use curly braces Nah. From martinrb at google.com Tue Aug 5 05:52:58 2014 From: martinrb at google.com (Martin Buchholz) Date: Mon, 4 Aug 2014 22:52:58 -0700 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53DFB1DE.2030901@oracle.com> References: <53DFB1DE.2030901@oracle.com> Message-ID: Thanks, Ivan. On Mon, Aug 4, 2014 at 9:16 AM, Ivan Gerasimov wrote: > Hello! > > Here's the proposal by Martin Buchholz to improve implementation of > StringJoiner class: > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/ > StringJoiner-optimization/ > > I think that result of concatenation in the merge() method can be saved to > be reused later. > This would be useful, for example, if a StringJoiner is merged into other > StringJoiners several times. > > Looks good - saving the result of compaction is a good idea. --- I'm truly unsure whether it's worth optimizing for size < 2. But if we do that, I think we should optimize size == 0 as well, thus: if (addLen == 0 && size <= 1) return (size == 0) ? "" : elts[0]; --- 240 if (other == this) { I doubt that optimizing specially for a self-merge is worthwhile. When you're thinking of doing that, you probably really want Strings.repeat(String, int copies) https://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/base/Strings.java?r=5cc3b0b33392b02ff95a4ce5f291c439b5b1406e#154 I suggest adding repeat to String! So, here's my slightly modified version of the Martin's webrev: > http://cr.openjdk.java.net/~igerasim/8054221/0/webrev/ > > I've also modified the test to regularly test cases with empty > prefixes/suffixes. > > Sincerely yours, > Ivan > From martinrb at google.com Tue Aug 5 06:03:47 2014 From: martinrb at google.com (Martin Buchholz) Date: Mon, 4 Aug 2014 23:03:47 -0700 Subject: RFR [8051382] Optimize java.lang.reflect.Modifier.toString() In-Reply-To: <53DF6E23.2010509@oracle.com> References: <53C9A214.1060101@oracle.com> <53C9A640.8030808@oracle.com> <53C9C758.5070203@oracle.com> <53DF6E23.2010509@oracle.com> Message-ID: Looks good! On Mon, Aug 4, 2014 at 4:27 AM, Ivan Gerasimov wrote: > Hi Martin! > > Sorry for the pause, I had to take a break. > > Thank you for your StringJoiner rework! > I created a bug to track it: > https://bugs.openjdk.java.net/browse/JDK-8054221 > > With your implementation of StringJoiner, the first version of > Modifier.toString() [1] became (almost) as fast as original, and a bit > clearer. > > [1] http://cr.openjdk.java.net/~igerasim/8051382/0/webrev/ > > Will you approve the change to Modifier.toString? > > Sincerely your, > Ivan > > > > On 19.07.2014 19:58, Martin Buchholz wrote: > > StringJoiner seems written in a style suitable for an application, not in > a low-level performance-oriented style suitable for a JDK core library. > But we can fix that. > > > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/StringJoiner-optimization/ > > > On Fri, Jul 18, 2014 at 6:18 PM, Ivan Gerasimov > wrote: > >> >> On 19.07.2014 3:07, Martin Buchholz wrote: >> >>> >>> I took a quick look at StringJoiner. It looks to me like this won't be >>> an optimization, because StringJoiner uses StringBuilder internally, and >>> will actually perform more total operations. >>> >> >> Unfortunately this is true. >> Microbenchmarking shows that StringJoiner makes the things 30% slower, >> which is sad. >> >> Then I propose another simple patch giving +15% to the speed: >> >> http://cr.openjdk.java.net/~igerasim/8051382/1/webrev/ >> >> Sincerely yours, >> Inan >> >> > > From dmitry.degrave at oracle.com Tue Aug 5 10:41:11 2014 From: dmitry.degrave at oracle.com (dmeetry degrave) Date: Tue, 05 Aug 2014 14:41:11 +0400 Subject: RFR: 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese locale Message-ID: <53E0B4C7.4070403@oracle.com> Hello, Please review a simple fix (jdk 8 and 9) for 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese locale bug: https://bugs.openjdk.java.net/browse/JDK-8042126 fix: http://cr.openjdk.java.net/~dmeetry/8042126/webrev.01 thanks, dmeetry From ivan.gerasimov at oracle.com Tue Aug 5 11:55:39 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 05 Aug 2014 15:55:39 +0400 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: References: <53DFB1DE.2030901@oracle.com> Message-ID: <53E0C63B.50503@oracle.com> Thanks you Martin! On 05.08.2014 9:52, Martin Buchholz wrote: > > I'm truly unsure whether it's worth optimizing for size < 2. With saving results of compaction in merge, this case will become a little more common. This way X.merge(Y); Y.toString(); can work a bit faster. > But if we do that, I think we should optimize size == 0 as well, thus: > > if (addLen == 0 && size <= 1) > return (size == 0) ? "" : elts[0]; Yes, done. > --- > 240 if (other == this) { > > I doubt that optimizing specially for a self-merge is worthwhile. You're probably correct, it's not worth coding that. I just was upset that combining with itself doesn't work as well as in other cases, that's why I implemented it. I'll remove it. Here's the updated webrev: http://cr.openjdk.java.net/~igerasim/8054221/1/webrev/ > When you're thinking of doing that, you probably really want > Strings.repeat(String, int copies) > https://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/base/Strings.java?r=5cc3b0b33392b02ff95a4ce5f291c439b5b1406e#154 > > I suggest adding repeat to String! > Yes, it would be a useful addition. In addition, there might be overloads with a delimiter, prefix and suffix :-) Sincerely yours, Ivan From roger.riggs at oracle.com Tue Aug 5 13:45:00 2014 From: roger.riggs at oracle.com (roger riggs) Date: Tue, 05 Aug 2014 09:45:00 -0400 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53E0C63B.50503@oracle.com> References: <53DFB1DE.2030901@oracle.com> <53E0C63B.50503@oracle.com> Message-ID: <53E0DFDC.4010002@oracle.com> Hi, Don't get too carried away on adding convience methods, last year when StringJoiner was proposed, there was quite a bit of tension between enough and too much. Don't add to the size and maintenance of the JDK without a clear use case and knowledge that the APIs will be used frequently. Roger On 8/5/2014 7:55 AM, Ivan Gerasimov wrote: > Thanks you Martin! > > On 05.08.2014 9:52, Martin Buchholz wrote: >> >> I'm truly unsure whether it's worth optimizing for size < 2. > > With saving results of compaction in merge, this case will become a > little more common. > This way X.merge(Y); Y.toString(); can work a bit faster. > >> But if we do that, I think we should optimize size == 0 as well, thus: >> >> if (addLen == 0 && size <= 1) >> return (size == 0) ? "" : elts[0]; > Yes, done. > >> --- >> 240 if (other == this) { >> >> I doubt that optimizing specially for a self-merge is worthwhile. > > You're probably correct, it's not worth coding that. > I just was upset that combining with itself doesn't work as well as in > other cases, that's why I implemented it. > I'll remove it. > > Here's the updated webrev: > http://cr.openjdk.java.net/~igerasim/8054221/1/webrev/ > >> When you're thinking of doing that, you probably really want >> Strings.repeat(String, int copies) >> https://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/base/Strings.java?r=5cc3b0b33392b02ff95a4ce5f291c439b5b1406e#154 >> >> >> I suggest adding repeat to String! >> > > Yes, it would be a useful addition. > In addition, there might be overloads with a delimiter, prefix and > suffix :-) > > Sincerely yours, > Ivan > From fweimer at redhat.com Tue Aug 5 13:56:20 2014 From: fweimer at redhat.com (Florian Weimer) Date: Tue, 05 Aug 2014 15:56:20 +0200 Subject: WAR == single classloader was: Benefits of activeReferenceQueue In-Reply-To: <53DF8DDA.3090908@redhat.com> References: <2296697.ZmJV3U9KFH@logouticek> <1877778.1B9EpdAxaD@logouticek> <53D78FE5.50906@redhat.com> <1551320.KMaPOkQ6qx@logouticek> <53DF6E33.3090509@redhat.com> <53DF8DDA.3090908@redhat.com> Message-ID: <53E0E284.5060003@redhat.com> On 08/04/2014 03:42 PM, David M. Lloyd wrote: > Servlets are EE components, and as such, you should be able to establish > a @PreDestroy interceptor, which was introduced for exactly this kind of > purpose (cleanup and reclaiming of per-component resources). Also > servlets have a destroy method IIRC. > > IOW all of this seems unnecessary. I wasn't sure if there was precedent for adding such functionality to containers. I could imagine some philosophical objections, but there often is no good alternative if you need the functionality. So I guess the advice here is: use the proper container interfaces for this, or if they don't exist, fix the container. :-) -- Florian Weimer / Red Hat Product Security From ivan.gerasimov at oracle.com Tue Aug 5 19:19:15 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 05 Aug 2014 23:19:15 +0400 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53E0C63B.50503@oracle.com> References: <53DFB1DE.2030901@oracle.com> <53E0C63B.50503@oracle.com> Message-ID: <53E12E33.7010102@oracle.com> >> But if we do that, I think we should optimize size == 0 as well, thus: >> >> if (addLen == 0 && size <= 1) >> return (size == 0) ? "" : elts[0]; > Yes, done. > Or we can just call compactElts() if addLenn == 0, so it will work for any size. Updated the webrev at the same location: http://cr.openjdk.java.net/~igerasim/8054221/1/webrev/ Sincerely yours, Ivan From martinrb at google.com Tue Aug 5 19:33:42 2014 From: martinrb at google.com (Martin Buchholz) Date: Tue, 5 Aug 2014 12:33:42 -0700 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53E0DFDC.4010002@oracle.com> References: <53DFB1DE.2030901@oracle.com> <53E0C63B.50503@oracle.com> <53E0DFDC.4010002@oracle.com> Message-ID: On Tue, Aug 5, 2014 at 6:45 AM, roger riggs wrote: > Hi, > > Don't get too carried away on adding convience methods, last year when > StringJoiner > was proposed, there was quite a bit of tension between enough and too much. > StringJoiner is certainly funky. I'm not sure what the perfect string joining API is, but StringJoiner probably isn't it. > Don't add to the size and maintenance of the JDK without a clear use case > and knowledge that the APIs will be used frequently. String repetition is quite popular - in perl, it has its own operator ("x") ! I see thousands of uses of Strings.repeat here at Google. From martinrb at google.com Wed Aug 6 06:14:49 2014 From: martinrb at google.com (Martin Buchholz) Date: Tue, 5 Aug 2014 23:14:49 -0700 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53E12E33.7010102@oracle.com> References: <53DFB1DE.2030901@oracle.com> <53E0C63B.50503@oracle.com> <53E12E33.7010102@oracle.com> Message-ID: 39 private final static String PREFIXES[] = {"", "{", "@#$%"}; This C style syntax is not good Java style - use String[] instead. 177 if (addLen == 0) { 178 compactElts(); 179 return size == 0 ? "" : elts[0]; 180 } I'm concerned about the extra String[8] created by compactElts. We assume that StringJoiners are all temporary objects, so don't bother creating that shorter String[8] to hold the one sole element on compaction - just reuse the original array (but should we null out the entries? probably) On Tue, Aug 5, 2014 at 12:19 PM, Ivan Gerasimov wrote: > > But if we do that, I think we should optimize size == 0 as well, thus: >>> >>> if (addLen == 0 && size <= 1) >>> return (size == 0) ? "" : elts[0]; >>> >> Yes, done. >> >> Or we can just call compactElts() if addLenn == 0, so it will work for > any size. > > Updated the webrev at the same location: > http://cr.openjdk.java.net/~igerasim/8054221/1/webrev/ > > Sincerely yours, > Ivan > > From ivan.gerasimov at oracle.com Wed Aug 6 09:47:54 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 06 Aug 2014 13:47:54 +0400 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: References: <53DFB1DE.2030901@oracle.com> <53E0C63B.50503@oracle.com> <53E12E33.7010102@oracle.com> Message-ID: <53E1F9CA.2010806@oracle.com> On 06.08.2014 10:14, Martin Buchholz wrote: > 39 private final static String PREFIXES[] = {"", "{", "@#$%"}; > This C style syntax is not good Java style - use String[] instead. > Thanks! fixed > 177 if (addLen == 0) { > 178 compactElts(); > 179 return size == 0 ? "" : elts[0]; > 180 } > I'm concerned about the extra String[8] created by compactElts. We > assume that StringJoiners are all temporary objects, so don't bother > creating that shorter String[8] to hold the one sole element on > compaction - just reuse the original array (but should we null out the > entries? probably) > The benchmark showed that allocating a new array is faster than nullifying the existing one. But if we set the entries to null in the loop that is already there, it will probably be no slower than allocation. Here's the updated webrev: http://cr.openjdk.java.net/~igerasim/8054221/2/webrev/ Sincerely yours, Ivan > > On Tue, Aug 5, 2014 at 12:19 PM, Ivan Gerasimov > > wrote: > > > But if we do that, I think we should optimize size == 0 as > well, thus: > > if (addLen == 0 && size <= 1) > return (size == 0) ? "" : elts[0]; > > Yes, done. > > Or we can just call compactElts() if addLenn == 0, so it will work > for any size. > > Updated the webrev at the same location: > http://cr.openjdk.java.net/~igerasim/8054221/1/webrev/ > > > Sincerely yours, > Ivan > > From jaroslav.tulach at oracle.com Wed Aug 6 10:17:38 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Wed, 06 Aug 2014 12:17:38 +0200 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <24689252.yEYuCUqD1k@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <53D77C35.9050805@oracle.com> <24689252.yEYuCUqD1k@logouticek> Message-ID: <6517606.3JH0BrhG34@logouticek> OK, time to show the code. I've added an alternative patch to JDK-8051843: https://bugs.openjdk.java.net/secure/attachment/21640/ActiveQueueFinalizer.diff I suggest to start reading it from bottom - e.g. the test, the documentation and then the implementation. Now there is time for some discussion: First of all I should mention that the patch is sufficient to solve all the problems NetBeans and people reusing NetBeans libraries in dynamic classloader systems (e.g. containers) have. This is a pro. Next thing to check is whether the change can cause some harm. Here are the areas of concern we have identified so far: > > > # 1 - Because of automatic JDK management thread? The patch introduces no new thread. It reuses already existing one. No allocation of new system resources. Status quo is kept. On the other hand, this is a pro over own ReferenceQueue.remove calls. One saves a thread per instance of such queue. > > > # 2 - Or because once finalize() is called, one still has reference to > > > the > > > "gone" object and can re-activate it? This problem does not exist with activeQueue(). When the run() method on a Reference is called, this.get() already returns null. I believe this addresses also David M. LLoyd's concern: > Yup. Did you know that an object can be finalized while there are still > instance methods of that object executing? We've actually seen it Sure, but that cannot happen with activeQueue() as the referent is really gone before appropriate Reference.run() is executed. Certainly a pro over Object.finalize. Status quo with respect to ReferenceQueue as that behaves the same. > > > #3 - Or because the finalizer thread is shared between completely > > > unrelated > > > objects and misbehavior of one can cause problems for others? No regression in this aspect either. finalizer thread already has this problem, and we are not making it worse. Status quo is kept. Well written application actually benefit from this behavior, as they save system threads (compared to own ReferenceQueue.remove implementations). > If you still think that finalize is a good idea, given that it's > basically defective *and* there is almost always a better solution, I believe activeQueue() in core libraries is good idea. Because it fills the gap between (dangerous, unusable) Object.finalize and (ineffective) attempts to code the same logic in libraries (via own Thread+ReferenceQueue.remove) I see at least one pro and no cons. Are there other points of view? -jt From david.holmes at oracle.com Wed Aug 6 10:20:18 2014 From: david.holmes at oracle.com (David Holmes) Date: Wed, 06 Aug 2014 20:20:18 +1000 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53D6D842.7000103@oracle.com> References: <53D6D842.7000103@oracle.com> Message-ID: <53E20162.7070000@oracle.com> Hi Ioi, Continuing ... just a few minor comments Thanks, David ------ hotspot/src/share/vm/memory/filemap.cpp Nit: printing string literals doesn't need to use %s ie: + tty->print("%s", "["); + tty->vprint(msg, ap); + tty->print_cr("%s", "]"); Should just be: + tty->print("["); + tty->vprint(msg, ap); + tty->print_cr("]"); --- Why do we need memset here: 140 FileMapInfo::FileMapInfo() { 141 assert(_current_info == NULL, "must be singleton"); // not thread safe 142 _current_info = this; 143 memset(this, 0, sizeof(FileMapInfo)); --- I don't quite follow the name related logic here: 224 strcpy(strptr, name); but strcpy rather than strncpy raises a red-flag. --- What is the role of this: 230 EXCEPTION_MARK; Can new_array post exceptions? If so you need to deal with it else the EXCEPTION_MARK will terminate the VM abruptly. --- hotspot/src/share/vm/memory/metaspaceShared.cpp 779 // Rewrite and unlink classes. 780 tty->print_cr("Rewriting and linking classes ..."); Is it linking or unlinking? --- hotspot/src/share/vm/oops/instanceKlass.hpp + // was loaded. For archived classes, this filed is either NULL (for system Typo: filed + // needed after afterwards. Typo: after after ---- test/testlibrary/com/oracle/java/testlibrary/BuildHelper.java File has the wrong copyright header. On 29/07/2014 9:09 AM, Ioi Lam wrote: > Hi Folks, > > Please review the following clean up and refactoring of the CDS code, > for JDK9 > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ > https://bugs.openjdk.java.net/browse/JDK-8046070 > > Summary of fix: > > Clean up and refactor the Class Data Sharing (CDS) code, including: > > + Improve archive integrity checking > + Support bytecode verification during archive dumping time > + Allow the user to configure the CDS class list and archive file. > + Allow future extension of the CDS class loading mechanism. > > Tests: > > JPRT > UTE (vm.runtime.testlist, vm.quick.testlist, > vm.parallel_class_loading.testlist) > Various adhoc SQE tests on Aurora > JCK > > Thanks > - Ioi From aleksej.efimov at oracle.com Wed Aug 6 13:30:30 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Wed, 06 Aug 2014 17:30:30 +0400 Subject: RFR: 8049343: (tz) Support tzdata2014e In-Reply-To: <53CEB9B3.50307@oracle.com> References: <53CEB9B3.50307@oracle.com> Message-ID: <53E22DF6.9080104@oracle.com> Hello, Can I ask one more time for a review of this tzdata fix, please? -Aleksej On 07/22/2014 11:21 PM, Aleksej Efimov wrote: > Hi, > > Please review the tzdata2014e [1] integration fix to JDK9: > http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.00/ > > Two issues with JSR310 implementation were discovered during > integration process: > First issue is related to the internal representation of the '24:00' > value. The JSR310 implementation treats this value as a next day 00:00 > time. The workaround already exists in the code for similar entries > and this failure was resolved in similar way [2]. > For the second issue JDK-8051641 [3] was filled and > 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one that > fails with this tzdata. > Other time zone related test passes without failures. > > Thank you, > Aleksej > > [1] https://bugs.openjdk.java.net/browse/JDK-8049343 > [2] > http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.00/src/share/classes/sun/util/calendar/ZoneInfoFile.java.patch > [3] https://bugs.openjdk.java.net/browse/JDK-8051641 From roger.riggs at oracle.com Wed Aug 6 13:46:23 2014 From: roger.riggs at oracle.com (roger riggs) Date: Wed, 06 Aug 2014 09:46:23 -0400 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <6517606.3JH0BrhG34@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <53D77C35.9050805@oracle.com> <24689252.yEYuCUqD1k@logouticek> <6517606.3JH0BrhG34@logouticek> Message-ID: <53E231AF.7070101@oracle.com> Hi, I can't help but ask how this differs from sun.misc.Cleaner? One concern is about security and robustness of the code that is run on the system threads. I don't have the history but these are very sensitive areas of operation. Roger On 8/6/2014 6:17 AM, Jaroslav Tulach wrote: > OK, > time to show the code. I've added an alternative patch to JDK-8051843: > https://bugs.openjdk.java.net/secure/attachment/21640/ActiveQueueFinalizer.diff > I suggest to start reading it from bottom - e.g. the test, the documentation > and then the implementation. > > Now there is time for some discussion: First of all I should mention that the > patch is sufficient to solve all the problems NetBeans and people reusing > NetBeans libraries in dynamic classloader systems (e.g. containers) have. This > is a pro. > > Next thing to check is whether the change can cause some harm. Here are the > areas of concern we have identified so far: > >>>> # 1 - Because of automatic JDK management thread? > The patch introduces no new thread. It reuses already existing one. No > allocation of new system resources. Status quo is kept. > > On the other hand, this is a pro over own ReferenceQueue.remove calls. One > saves a thread per instance of such queue. > >>>> # 2 - Or because once finalize() is called, one still has reference to >>>> the >>>> "gone" object and can re-activate it? > This problem does not exist with activeQueue(). When the run() method on a > Reference is called, this.get() already returns null. I believe this addresses > also David M. LLoyd's concern: > >> Yup. Did you know that an object can be finalized while there are still >> instance methods of that object executing? We've actually seen it > Sure, but that cannot happen with activeQueue() as the referent is really gone > before appropriate Reference.run() is executed. > > Certainly a pro over Object.finalize. Status quo with respect to ReferenceQueue > as that behaves the same. > >>>> #3 - Or because the finalizer thread is shared between completely >>>> unrelated >>>> objects and misbehavior of one can cause problems for others? > No regression in this aspect either. finalizer thread already has this problem, > and we are not making it worse. Status quo is kept. Well written application > actually benefit from this behavior, as they save system threads (compared to > own ReferenceQueue.remove implementations). > >> If you still think that finalize is a good idea, given that it's >> basically defective *and* there is almost always a better solution, > I believe activeQueue() in core libraries is good idea. Because it fills the > gap between (dangerous, unusable) Object.finalize and (ineffective) attempts to > code the same logic in libraries (via own Thread+ReferenceQueue.remove) > > I see at least one pro and no cons. Are there other points of view? > -jt > From martinrb at google.com Wed Aug 6 14:13:18 2014 From: martinrb at google.com (Martin Buchholz) Date: Wed, 6 Aug 2014 07:13:18 -0700 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53E1F9CA.2010806@oracle.com> References: <53DFB1DE.2030901@oracle.com> <53E0C63B.50503@oracle.com> <53E12E33.7010102@oracle.com> <53E1F9CA.2010806@oracle.com> Message-ID: I have more comments, but this is good to go. 69 @Test(expectedExceptions = {NullPointerException.class}) Controversial - many people, including myself, think this is too magical without adding much value. My own preference is assertThrows e.g. in http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/test/tck/JSR166TestCase.java?revision=1.121&view=markup Microbenchmarks undermeasure the impact of allocation, which increases with heap size. Real world java applications struggle with allocation/gc, not cpu. So don't measure allocation against cpu directly in microbenchmarks. On Wed, Aug 6, 2014 at 2:47 AM, Ivan Gerasimov wrote: > > On 06.08.2014 10:14, Martin Buchholz wrote: > > 39 private final static String PREFIXES[] = {"", "{", "@#$%"}; > > This C style syntax is not good Java style - use String[] instead. > > Thanks! fixed > > > 177 if (addLen == 0) { 178 compactElts(); 179 return size == 0 ? "" : elts[0]; 180 } > > I'm concerned about the extra String[8] created by compactElts. We assume > that StringJoiners are all temporary objects, so don't bother creating that > shorter String[8] to hold the one sole element on compaction - just reuse > the original array (but should we null out the entries? probably) > > > The benchmark showed that allocating a new array is faster than nullifying > the existing one. > But if we set the entries to null in the loop that is already there, it > will probably be no slower than allocation. > > > Here's the updated webrev: > http://cr.openjdk.java.net/~igerasim/8054221/2/webrev/ > > Sincerely yours, > Ivan > > > > On Tue, Aug 5, 2014 at 12:19 PM, Ivan Gerasimov > wrote: > >> >> But if we do that, I think we should optimize size == 0 as well, thus: >>>> >>>> if (addLen == 0 && size <= 1) >>>> return (size == 0) ? "" : elts[0]; >>>> >>> Yes, done. >>> >>> Or we can just call compactElts() if addLenn == 0, so it will work for >> any size. >> >> Updated the webrev at the same location: >> http://cr.openjdk.java.net/~igerasim/8054221/1/webrev/ >> >> Sincerely yours, >> Ivan >> >> > > From roger.riggs at oracle.com Wed Aug 6 16:16:52 2014 From: roger.riggs at oracle.com (roger riggs) Date: Wed, 06 Aug 2014 12:16:52 -0400 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: References: <53DFB1DE.2030901@oracle.com> <53E0C63B.50503@oracle.com> <53E12E33.7010102@oracle.com> <53E1F9CA.2010806@oracle.com> Message-ID: <53E254F4.5080102@oracle.com> Hi, If a function like assertThrows was included in TestNG, it would make sense to use it. The TestNG expectedException mechanism is adequate and creating a one-off extension to TestNG would raise the maintenance costs without adding much value. Roger On 8/6/2014 10:13 AM, Martin Buchholz wrote: > I have more comments, but this is good to go. > > 69 @Test(expectedExceptions = {NullPointerException.class}) > > > Controversial - many people, including myself, think this is too magical > without adding much value. My own preference is assertThrows e.g. in > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/test/tck/JSR166TestCase.java?revision=1.121&view=markup > > Microbenchmarks undermeasure the impact of allocation, which increases with > heap size. Real world java applications struggle with allocation/gc, not > cpu. So don't measure allocation against cpu directly in microbenchmarks. > > > > > > On Wed, Aug 6, 2014 at 2:47 AM, Ivan Gerasimov > wrote: > >> On 06.08.2014 10:14, Martin Buchholz wrote: >> >> 39 private final static String PREFIXES[] = {"", "{", "@#$%"}; >> >> This C style syntax is not good Java style - use String[] instead. >> >> Thanks! fixed >> >> >> 177 if (addLen == 0) { 178 compactElts(); 179 return size == 0 ? "" : elts[0]; 180 } >> >> I'm concerned about the extra String[8] created by compactElts. We assume >> that StringJoiners are all temporary objects, so don't bother creating that >> shorter String[8] to hold the one sole element on compaction - just reuse >> the original array (but should we null out the entries? probably) >> >> >> The benchmark showed that allocating a new array is faster than nullifying >> the existing one. >> But if we set the entries to null in the loop that is already there, it >> will probably be no slower than allocation. >> >> >> Here's the updated webrev: >> http://cr.openjdk.java.net/~igerasim/8054221/2/webrev/ >> >> Sincerely yours, >> Ivan >> >> >> >> On Tue, Aug 5, 2014 at 12:19 PM, Ivan Gerasimov >> wrote: >>> But if we do that, I think we should optimize size == 0 as well, thus: >>>>> if (addLen == 0 && size <= 1) >>>>> return (size == 0) ? "" : elts[0]; >>>>> >>>> Yes, done. >>>> >>>> Or we can just call compactElts() if addLenn == 0, so it will work for >>> any size. >>> >>> Updated the webrev at the same location: >>> http://cr.openjdk.java.net/~igerasim/8054221/1/webrev/ >>> >>> Sincerely yours, >>> Ivan >>> >>> >> From martinrb at google.com Wed Aug 6 16:50:47 2014 From: martinrb at google.com (Martin Buchholz) Date: Wed, 6 Aug 2014 09:50:47 -0700 Subject: RFR [8054221] StringJoiner imlementation optimization In-Reply-To: <53E254F4.5080102@oracle.com> References: <53DFB1DE.2030901@oracle.com> <53E0C63B.50503@oracle.com> <53E12E33.7010102@oracle.com> <53E1F9CA.2010806@oracle.com> <53E254F4.5080102@oracle.com> Message-ID: I agree that assertions like assertThrows belongs in your test framework. For this change my preference would be to revert to the previous code without expectedExceptions but author preference wins. On Wed, Aug 6, 2014 at 9:16 AM, roger riggs wrote: > Hi, > > If a function like assertThrows was included in TestNG, it would make > sense to use it. > The TestNG expectedException mechanism is adequate and creating a one-off > extension to TestNG > would raise the maintenance costs without adding much value. > > Roger > > > > On 8/6/2014 10:13 AM, Martin Buchholz wrote: > >> I have more comments, but this is good to go. >> >> 69 @Test(expectedExceptions = {NullPointerException.class}) >> >> >> Controversial - many people, including myself, think this is too magical >> without adding much value. My own preference is assertThrows e.g. in >> http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/ >> test/tck/JSR166TestCase.java?revision=1.121&view=markup >> >> Microbenchmarks undermeasure the impact of allocation, which increases >> with >> heap size. Real world java applications struggle with allocation/gc, not >> cpu. So don't measure allocation against cpu directly in microbenchmarks. >> >> >> >> >> >> On Wed, Aug 6, 2014 at 2:47 AM, Ivan Gerasimov > > >> wrote: >> >> On 06.08.2014 10:14, Martin Buchholz wrote: >>> >>> 39 private final static String PREFIXES[] = {"", "{", "@#$%"}; >>> >>> This C style syntax is not good Java style - use String[] instead. >>> >>> Thanks! fixed >>> >>> >>> 177 if (addLen == 0) { 178 compactElts(); 179 >>> return size == 0 ? "" : elts[0]; 180 } >>> >>> I'm concerned about the extra String[8] created by compactElts. We >>> assume >>> that StringJoiners are all temporary objects, so don't bother creating >>> that >>> shorter String[8] to hold the one sole element on compaction - just reuse >>> the original array (but should we null out the entries? probably) >>> >>> >>> The benchmark showed that allocating a new array is faster than >>> nullifying >>> the existing one. >>> But if we set the entries to null in the loop that is already there, it >>> will probably be no slower than allocation. >>> >>> >>> Here's the updated webrev: >>> http://cr.openjdk.java.net/~igerasim/8054221/2/webrev/ >>> >>> Sincerely yours, >>> Ivan >>> >>> >>> >>> On Tue, Aug 5, 2014 at 12:19 PM, Ivan Gerasimov < >>> ivan.gerasimov at oracle.com >>> >>>> wrote: >>>> But if we do that, I think we should optimize size == 0 as well, thus: >>>> >>>>> if (addLen == 0 && size <= 1) >>>>>> return (size == 0) ? "" : elts[0]; >>>>>> >>>>>> Yes, done. >>>>> >>>>> Or we can just call compactElts() if addLenn == 0, so it will work >>>>> for >>>>> >>>> any size. >>>> >>>> Updated the webrev at the same location: >>>> http://cr.openjdk.java.net/~igerasim/8054221/1/webrev/ >>>> >>>> Sincerely yours, >>>> Ivan >>>> >>>> >>>> >>> > From aleksej.efimov at oracle.com Wed Aug 6 19:13:05 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Wed, 06 Aug 2014 23:13:05 +0400 Subject: RFR: 8049343: (tz) Support tzdata2014e In-Reply-To: <53E22DF6.9080104@oracle.com> References: <53CEB9B3.50307@oracle.com> <53E22DF6.9080104@oracle.com> Message-ID: <53E27E41.9060102@oracle.com> Hello, I'm withdrawing this review request because the new tzdata2014f release is available. I will update the 8049343 bug and will use it for later tzdata2014f integration. Thank you, Aleksej On 08/06/2014 05:30 PM, Aleksej Efimov wrote: > Hello, > > Can I ask one more time for a review of this tzdata fix, please? > > -Aleksej > > On 07/22/2014 11:21 PM, Aleksej Efimov wrote: >> Hi, >> >> Please review the tzdata2014e [1] integration fix to JDK9: >> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.00/ >> >> Two issues with JSR310 implementation were discovered during >> integration process: >> First issue is related to the internal representation of the '24:00' >> value. The JSR310 implementation treats this value as a next day >> 00:00 time. The workaround already exists in the code for similar >> entries and this failure was resolved in similar way [2]. >> For the second issue JDK-8051641 [3] was filled and >> 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one that >> fails with this tzdata. >> Other time zone related test passes without failures. >> >> Thank you, >> Aleksej >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8049343 >> [2] >> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.00/src/share/classes/sun/util/calendar/ZoneInfoFile.java.patch >> [3] https://bugs.openjdk.java.net/browse/JDK-8051641 > From karen.kinnear at oracle.com Wed Aug 6 19:52:20 2014 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Wed, 6 Aug 2014 15:52:20 -0400 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53D6D842.7000103@oracle.com> References: <53D6D842.7000103@oracle.com> Message-ID: <882C4F15-1A5E-4DD8-8C28-E9686846CB4F@oracle.com> Ioi, Changes look really good. Just minor comments: 1. jdk: SecureClassLoader.java: getProtectionDomain please add a comment that this assumes no signers and combine the first and third lines 2. classFileParser.cpp Would it make sense to move the assertion from skip_over_field_name for DumpSharedSpaces to JavaCalls::call* ? 3. classLoader.cpp "VM internal error. Must not load .class file during dump time" - I think what you are saying is that class data sharing only supports loading .class files from .jar files - maybe modify the error message 4. classLoader.cpp line 258: could you fix mmaped -> mmapped 5. classLoader.cpp lines 468, 519: I think this changes the TraceClassLoading behavior? I think you want if (TraceClassLoading || TraceClassPaths && Verbose) to print_meta_index (or maybe TraceClassPaths || (TraceClassLoading && Verbose) same with line 549- PrintSharedArchiveAndExit - really you mean same as above? 6. classLoader.cpp check_shared_classpath - what does CDS before these changes do if you have an empty path in the archived classpath or a non-empty directory? - what happens if the archive is created (DumpSharedSpaces) without an empty path or with a non-empty directory but used with an empty path element or a non-empty directory? line 587 calls check_shared_classpath on if DumpSharedSpaces? 7. classLoader.cpp line 1085: you have a ResourceMark when you created class_name, so you don't need another one just a note: the class_name is legally allowed to be null - if you had succeeded in parseClassFile you would use parsed_name for any printing of the result (your code is fine, just wanted you to know) 8. dictionary.cpp line 225 - I presume this is for a specific compiler? If you know what it is, it would help to record it here in case in future we could move this 9. systemDictionary.cpp comment lines 1221-1224 10. sharedPathsMiscInfo.hpp alst-> also (spelling) 11. SharedPathsMiscInfo Why do you put this in metaspace if it is deallocated after initialization? I would have expected a CHeapObj not in metaspace? Or if metaspace makes sense, maybe ask Coleen how other metaspace information that is freed gets recorded (did we need the new metaspace object type "Deallocated"?) is this related to metadataFactory.hpp lines 82-87? 12. Just checking for documentation for use If you created a CDS archive (version 1), and then try to use it with the new code - will the archive continue to work as it did before? Or do you have to recreated it as a version 2 archive? I presume we need to document this change. Is it the case that an archive is expected to match a given jdk (or hotspot) version? So this is not a surprise to customers? Or is this behavior new with 8u40? 13. filemap.hpp FIXME comment 129 - what is the current state of this? Is this a planned future change? 14. metaspaceShared.cpp: line 861: "druing" -> "during" not new: lines 779/780: Comment says "Rewrite and unlink classes", prints "Rewriting and linking classes" Maybe the comment could say: "Rewrite and link missing classes, then unlink all classes as part of dump" Your comment says super interfaces may have been missed from the classlist(s) - I believe that loading any class requires preloading any supertypes - superclasses and superinterfaces - so I would not expect those to be missing at this time - or is that just in the case of failed verification? 15. metaspaceShared.cpp line 682: could you possibly change the comment from "repeat" to "iterate"? 16. metaspaceShared.cpp _check_one_shared_class: at this point you are checking supertypes for failed verification 1) have you ever seen a class that passed verification but one of its supertypes failed? I don't think that should be possible? I'm not sure what this loop is for? Just for the IgnoreUnverifiableClassesDuringDump? I have to go to a meeting, so more later. thanks, Karen On Jul 28, 2014, at 7:09 PM, Ioi Lam wrote: > Hi Folks, > > Please review the following clean up and refactoring of the CDS code, for JDK9 > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ > https://bugs.openjdk.java.net/browse/JDK-8046070 > > Summary of fix: > > Clean up and refactor the Class Data Sharing (CDS) code, including: > > + Improve archive integrity checking > + Support bytecode verification during archive dumping time > + Allow the user to configure the CDS class list and archive file. > + Allow future extension of the CDS class loading mechanism. > > Tests: > > JPRT > UTE (vm.runtime.testlist, vm.quick.testlist, vm.parallel_class_loading.testlist) > Various adhoc SQE tests on Aurora > JCK > > Thanks > - Ioi From brent.christian at oracle.com Wed Aug 6 21:45:56 2014 From: brent.christian at oracle.com (Brent Christian) Date: Wed, 06 Aug 2014 14:45:56 -0700 Subject: RFR JDK-8034032 : Check src/macosx/native/java/util/prefs/MacOSXPreferencesFile.m for JNI pending issues Message-ID: <53E2A214.7090107@oracle.com> Please review my fix for: Bug: https://bugs.openjdk.java.net/browse/JDK-8034032 Webrev: http://cr.openjdk.java.net/~bchristi/8034032/webrev.0/ Within jdk/src/macosx/native/java/util/prefs/MacOSXPreferencesFile.m, there is a pattern of making blocks of toCF() calls, where later toCF() calls are made when there could be an exception pending from an earlier toCF() call. toCF()creates a CFString from a Java String. If an error occurs, it will raise an exception by calling the throwIfNull() macro: #define throwIfNull(var, msg) \ do { \ if (var == NULL) { \ throwOutOfMemoryError(env, msg); \ goto bad##var; \ } \ } while (0) Note: "##var" is substituted for whatever text is serving as "var", and throwIfNull() is meant to jump to the cleanup portion of a function (e.g. "badvar") to do cleanup before exiting. This goto behavior is used more as intended elsewhere in MacOSXPreferencesFile.m. toCF() doesn't have such cleanup to do. An example of a series of calls to toCF(): 650 CFStringRef path = toCF(env, jpath); 651 CFStringRef child = toCF(env, jchild); 652 CFStringRef name = toCF(env, jname); It's not until later that we check that everything turned out OK: 661 if (!path || !child || !name) goto badparams; If one toCF() call throws an OOME exception, it will still be pending when the next call to toCF() makes a JNI call, (GetStringLength() in this case). I believe the right thing to do here is to check the success of each toCF() call before making the next toCF() call. I've left the existing null checks / 'goto badparams' as is. I also clear any pending exceptions in throwOutOfMemoryError(). Thanks, -Brent From naoto.sato at oracle.com Wed Aug 6 22:42:54 2014 From: naoto.sato at oracle.com (Naoto Sato) Date: Wed, 06 Aug 2014 15:42:54 -0700 Subject: RFR: 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese locale In-Reply-To: <53E0B4C7.4070403@oracle.com> References: <53E0B4C7.4070403@oracle.com> Message-ID: <53E2AF6E.2050800@oracle.com> Looks good to me. Naoto On 8/5/14, 3:41 AM, dmeetry degrave wrote: > Hello, > > Please review a simple fix (jdk 8 and 9) for > > 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese locale > > bug: https://bugs.openjdk.java.net/browse/JDK-8042126 > fix: http://cr.openjdk.java.net/~dmeetry/8042126/webrev.01 > > thanks, > dmeetry From ioi.lam at oracle.com Thu Aug 7 01:25:51 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Wed, 06 Aug 2014 18:25:51 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53E20162.7070000@oracle.com> References: <53D6D842.7000103@oracle.com> <53E20162.7070000@oracle.com> Message-ID: <53E2D59F.3050305@oracle.com> Hi David, Thanks for the reviews. I will incorporate your suggestions. See additional comments below: On 8/6/14, 3:20 AM, David Holmes wrote: > Hi Ioi, > > Continuing ... just a few minor comments > > Thanks, > David > ------ > > hotspot/src/share/vm/memory/filemap.cpp > > Nit: printing string literals doesn't need to use %s ie: > > + tty->print("%s", "["); > + tty->vprint(msg, ap); > + tty->print_cr("%s", "]"); > > Should just be: > > + tty->print("["); > + tty->vprint(msg, ap); > + tty->print_cr("]"); > > --- > Why do we need memset here: > > 140 FileMapInfo::FileMapInfo() { > 141 assert(_current_info == NULL, "must be singleton"); // not > thread safe > 142 _current_info = this; > 143 memset(this, 0, sizeof(FileMapInfo)); > The FileMapInfo is a CHeapObj. Does the "new" operator zero the memory? I added the memset just for "extra safety". Maybe I should remove it (the original code didn't do memset)? > --- > I don't quite follow the name related logic here: > > 224 strcpy(strptr, name); > I am adding an assert like this. Do you think this is enough? + assert(strptr + strlen(name) + 1 <= strptr_max, "miscalculated buffer size"); strcpy(strptr, name); strptr += name_bytes; ... EXCEPTION_MARK; Array* arr = MetadataFactory::new_array(loader_data, (bytes + 7)/8, THREAD); strptr = (char*)(arr->data()); + strptr_max = strptr + bytes; > but strcpy rather than strncpy raises a red-flag. > > --- > What is the role of this: > > 230 EXCEPTION_MARK; > > Can new_array post exceptions? If so you need to deal with it else the > EXCEPTION_MARK will terminate the VM abruptly. > At dump time, new_array() will fail if SharedReadOnlySpace or SharedReadWriteSpace is too small. But instead of throwing an exception, it will print a message about SharedReadOnlySpace or SharedReadWriteSpace, and exit the VM. The EXCEPTION_MARK just indicates we should never return back to this function with a pending exception. > --- > > hotspot/src/share/vm/memory/metaspaceShared.cpp > > 779 // Rewrite and unlink classes. > 780 tty->print_cr("Rewriting and linking classes ..."); > > Is it linking or unlinking? > linking. I will fix comment. > --- > > hotspot/src/share/vm/oops/instanceKlass.hpp > > + // was loaded. For archived classes, this filed is either NULL > (for system > > Typo: filed > > + // needed after afterwards. > > Typo: after after > > ---- > > test/testlibrary/com/oracle/java/testlibrary/BuildHelper.java > > File has the wrong copyright header. > > > On 29/07/2014 9:09 AM, Ioi Lam wrote: >> Hi Folks, >> >> Please review the following clean up and refactoring of the CDS code, >> for JDK9 >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >> https://bugs.openjdk.java.net/browse/JDK-8046070 >> >> Summary of fix: >> >> Clean up and refactor the Class Data Sharing (CDS) code, including: >> >> + Improve archive integrity checking >> + Support bytecode verification during archive dumping time >> + Allow the user to configure the CDS class list and archive file. >> + Allow future extension of the CDS class loading mechanism. >> >> Tests: >> >> JPRT >> UTE (vm.runtime.testlist, vm.quick.testlist, >> vm.parallel_class_loading.testlist) >> Various adhoc SQE tests on Aurora >> JCK >> >> Thanks >> - Ioi From masayoshi.okutsu at oracle.com Thu Aug 7 02:38:03 2014 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Thu, 07 Aug 2014 11:38:03 +0900 Subject: RFR: 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese locale In-Reply-To: <53E2AF6E.2050800@oracle.com> References: <53E0B4C7.4070403@oracle.com> <53E2AF6E.2050800@oracle.com> Message-ID: <53E2E68B.2050000@oracle.com> The root cause of this "problem" is the semantic difference between the legacy JRE resources and the CLDR-drived resources. The root CLDR resources have the narrow month names as numbers to be language-neutral, while the JRE root resources have them as English. If you specify Locale.ROOT, you will get the English ones rather than the numbers. That is somehow an intended behavior (or a known restriction). The narrow names are supported only in java.time due to compatibility constraints with java.text. So the narrow month names should go to src/share/classes/sun/text/resources/ja/JavaTimeSupplementary_ja.java rather than FormatData_ja.java. There should be more locales which have the same problem. Thanks, Masayoshi On 8/7/2014 7:42 AM, Naoto Sato wrote: > Looks good to me. > > Naoto > > On 8/5/14, 3:41 AM, dmeetry degrave wrote: >> Hello, >> >> Please review a simple fix (jdk 8 and 9) for >> >> 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese >> locale >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8042126 >> fix: http://cr.openjdk.java.net/~dmeetry/8042126/webrev.01 >> >> thanks, >> dmeetry From david.holmes at oracle.com Thu Aug 7 03:25:35 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 07 Aug 2014 13:25:35 +1000 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53E2D59F.3050305@oracle.com> References: <53D6D842.7000103@oracle.com> <53E20162.7070000@oracle.com> <53E2D59F.3050305@oracle.com> Message-ID: <53E2F1AF.2070607@oracle.com> A couple of responses inline ... Cheers, David On 7/08/2014 11:25 AM, Ioi Lam wrote: > Hi David, > > Thanks for the reviews. I will incorporate your suggestions. See > additional comments below: > > On 8/6/14, 3:20 AM, David Holmes wrote: >> Hi Ioi, >> >> Continuing ... just a few minor comments >> >> Thanks, >> David >> ------ >> >> hotspot/src/share/vm/memory/filemap.cpp >> >> Nit: printing string literals doesn't need to use %s ie: >> >> + tty->print("%s", "["); >> + tty->vprint(msg, ap); >> + tty->print_cr("%s", "]"); >> >> Should just be: >> >> + tty->print("["); >> + tty->vprint(msg, ap); >> + tty->print_cr("]"); >> >> --- >> Why do we need memset here: >> >> 140 FileMapInfo::FileMapInfo() { >> 141 assert(_current_info == NULL, "must be singleton"); // not >> thread safe >> 142 _current_info = this; >> 143 memset(this, 0, sizeof(FileMapInfo)); >> > The FileMapInfo is a CHeapObj. Does the "new" operator zero the > memory? I added the memset just for "extra safety". Maybe I should > remove it (the original code didn't do memset)? I would not expect the memory to be zeroed. The fields of the object should be initialized as appropriate. >> --- >> I don't quite follow the name related logic here: >> >> 224 strcpy(strptr, name); >> > I am adding an assert like this. Do you think this is enough? No I think static analysis tools may flag this as a "bad usage". > + assert(strptr + strlen(name) + 1 <= strptr_max, "miscalculated > buffer size"); > strcpy(strptr, name); > strptr += name_bytes; > ... > EXCEPTION_MARK; > Array* arr = MetadataFactory::new_array(loader_data, > (bytes + 7)/8, THREAD); > strptr = (char*)(arr->data()); > + strptr_max = strptr + bytes; > >> but strcpy rather than strncpy raises a red-flag. >> >> --- >> What is the role of this: >> >> 230 EXCEPTION_MARK; >> >> Can new_array post exceptions? If so you need to deal with it else the >> EXCEPTION_MARK will terminate the VM abruptly. >> > At dump time, new_array() will fail if SharedReadOnlySpace or > SharedReadWriteSpace is too small. But instead of throwing an exception, > it will print a message about SharedReadOnlySpace or > SharedReadWriteSpace, and exit the VM. > > The EXCEPTION_MARK just indicates we should never return back to this > function with a pending exception. Use of EXCEPTION_MARK is always a bit unclear to me. Thanks, David ----------------- >> --- >> >> hotspot/src/share/vm/memory/metaspaceShared.cpp >> >> 779 // Rewrite and unlink classes. >> 780 tty->print_cr("Rewriting and linking classes ..."); >> >> Is it linking or unlinking? >> > linking. I will fix comment. >> --- >> >> hotspot/src/share/vm/oops/instanceKlass.hpp >> >> + // was loaded. For archived classes, this filed is either NULL >> (for system >> >> Typo: filed >> >> + // needed after afterwards. >> >> Typo: after after >> >> ---- >> >> test/testlibrary/com/oracle/java/testlibrary/BuildHelper.java >> >> File has the wrong copyright header. >> >> >> On 29/07/2014 9:09 AM, Ioi Lam wrote: >>> Hi Folks, >>> >>> Please review the following clean up and refactoring of the CDS code, >>> for JDK9 >>> >>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >>> https://bugs.openjdk.java.net/browse/JDK-8046070 >>> >>> Summary of fix: >>> >>> Clean up and refactor the Class Data Sharing (CDS) code, including: >>> >>> + Improve archive integrity checking >>> + Support bytecode verification during archive dumping time >>> + Allow the user to configure the CDS class list and archive file. >>> + Allow future extension of the CDS class loading mechanism. >>> >>> Tests: >>> >>> JPRT >>> UTE (vm.runtime.testlist, vm.quick.testlist, >>> vm.parallel_class_loading.testlist) >>> Various adhoc SQE tests on Aurora >>> JCK >>> >>> Thanks >>> - Ioi > From masayoshi.okutsu at oracle.com Thu Aug 7 03:38:45 2014 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Thu, 07 Aug 2014 12:38:45 +0900 Subject: RFR: 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese locale In-Reply-To: <53E2E68B.2050000@oracle.com> References: <53E0B4C7.4070403@oracle.com> <53E2AF6E.2050800@oracle.com> <53E2E68B.2050000@oracle.com> Message-ID: <53E2F4C5.3060806@oracle.com> Sorry, I forgot about Calendar.getDisplayName. Perhaps the JRE semantic (Locale.ROOT is English) support for all narrow names should be given up. I will take over this one because it will require some changes to the locale service provider framework. Thanks, Masayoshi On 8/7/2014 11:38 AM, Masayoshi Okutsu wrote: > The root cause of this "problem" is the semantic difference between > the legacy JRE resources and the CLDR-drived resources. The root CLDR > resources have the narrow month names as numbers to be > language-neutral, while the JRE root resources have them as English. > If you specify Locale.ROOT, you will get the English ones rather than > the numbers. That is somehow an intended behavior (or a known > restriction). > > The narrow names are supported only in java.time due to compatibility > constraints with java.text. So the narrow month names should go to > src/share/classes/sun/text/resources/ja/JavaTimeSupplementary_ja.java > rather than FormatData_ja.java. There should be more locales which > have the same problem. > > Thanks, > Masayoshi > > On 8/7/2014 7:42 AM, Naoto Sato wrote: >> Looks good to me. >> >> Naoto >> >> On 8/5/14, 3:41 AM, dmeetry degrave wrote: >>> Hello, >>> >>> Please review a simple fix (jdk 8 and 9) for >>> >>> 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese >>> locale >>> >>> bug: https://bugs.openjdk.java.net/browse/JDK-8042126 >>> fix: http://cr.openjdk.java.net/~dmeetry/8042126/webrev.01 >>> >>> thanks, >>> dmeetry > From ioi.lam at oracle.com Thu Aug 7 05:32:31 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Wed, 06 Aug 2014 22:32:31 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <882C4F15-1A5E-4DD8-8C28-E9686846CB4F@oracle.com> References: <53D6D842.7000103@oracle.com> <882C4F15-1A5E-4DD8-8C28-E9686846CB4F@oracle.com> Message-ID: <53E30F6F.6090509@oracle.com> Hi Karen, Thanks for the review. Please see my comments in-line. On 8/6/14, 12:52 PM, Karen Kinnear wrote: > Ioi, > > Changes look really good. Just minor comments: > > 1. jdk: SecureClassLoader.java: getProtectionDomain > please add a comment that this assumes no signers and combine the first and third lines fixed. > 2. classFileParser.cpp > Would it make sense to move the assertion from skip_over_field_name for DumpSharedSpaces > to JavaCalls::call* ? fixed. > 3. classLoader.cpp > "VM internal error. Must not load .class file during dump time" > - I think what you are saying is that class data sharing only supports loading .class files from .jar files - maybe > modify the error message fixed > 4. classLoader.cpp > line 258: could you fix mmaped -> mmapped fixed > 5. classLoader.cpp > lines 468, 519: I think this changes the TraceClassLoading behavior? I think you want > if (TraceClassLoading || TraceClassPaths && Verbose) to print_meta_index (or maybe TraceClassPaths || (TraceClassLoading && Verbose) > same with line 549- PrintSharedArchiveAndExit - really you mean same as above? Line 549 is intended: trace_class_path() internally checks for TraceClassPaths. if (!PrintSharedArchiveAndExit) { trace_class_path("[Bootstrap loader class path=", sys_class_path); } I fixed the other cases you pointed out. > 6. classLoader.cpp > check_shared_classpath > - what does CDS before these changes do if you have an empty path in the archived classpath or a non-empty directory? In JDK8, If you have an empty bootclasspath for dumping -- it won't go very far :-) $ java -Dsun.boot.class.path= -Xshare:dump Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object If you have an non-empty directory: $ java -Xbootclasspath/a:/tmp -Xshare:dump Loading classes to share ... done. .... An error has occurred while processing the shared archive file. Boot classpath directory /tmp is not empty. Error occurred during initialization of VM Unable to use shared archive. > - what happens if the archive is created (DumpSharedSpaces) without an empty path or with a non-empty directory > but used with an empty path element or a non-empty directory? The archive will fail to load because the dump-time classpath does not match the run-time classpath. There's also a check to make sure that if you had an empty directory during dump time, the directory must remain empty during run-time. > line 587 calls check_shared_classpath only if DumpSharedSpaces? This is intentional. If you're not dumping, the boot classpath can have non-empty dirs. > 7. classLoader.cpp > line 1085: you have a ResourceMark when you created class_name, so you don't need another one > just a note: the class_name is legally allowed to be null - if you had succeeded in parseClassFile you would use > parsed_name for any printing of the result (your code is fine, just wanted you to know) fixed > 8. dictionary.cpp > line 225 - I presume this is for a specific compiler? If you know what it is, it would help to record it here > in case in future we could move this David Holmes also noticed this. I removed the comment as it really doesn't apply. > 9. systemDictionary.cpp > comment lines 1221-1224 I removed these lines as they are out of date. > 10. sharedPathsMiscInfo.hpp > alst-> also (spelling) > > 11. SharedPathsMiscInfo > Why do you put this in metaspace if it is deallocated after initialization? I would have expected a CHeapObj not in metaspace? SharedPathsMiscInfo are allocated from CHeap: class SharedPathsMiscInfo : public CHeapObj {....} hotspot/src/share/vm/classfile/sharedClassUtil.hpp: static SharedPathsMiscInfo* allocate_shared_paths_misc_info() { return new SharedPathsMiscInfo(); } > Or if metaspace makes sense, maybe ask Coleen how other metaspace information that is freed gets recorded (did we need the new metaspace object type "Deallocated"?) > is this related to metadataFactory.hpp lines 82-87? Unrelated. Those lines are describing cases where loading of a class fails (missing super class, etc) and would have been freed in the normal run-time, but I saw crashes during dump time. I will file a bug and fix this FIXME after the initial push. > 12. Just checking for documentation for use > If you created a CDS archive (version 1), and then try to use it with the new code - will the archive continue to work as it > did before? Or do you have to recreated it as a version 2 archive? I presume we need to document this change. Is it the > case that an archive is expected to match a given jdk (or hotspot) version? So this is not a surprise to customers? Or is > this behavior new with 8u40? The archive is specific to a JDK build version (has always been -- see FileMapHeader::_jvm_ident[]), so this shouldn't be a surprise. I guess the "version" field isn't strictly necessary, but I updated it from 1 to 2 because the FileMapHeader has been restructured a lot. > 13. filemap.hpp > FIXME comment 129 - what is the current state of this? Is this a planned future change? this comment still applies. I will file a bug for a future fix (performance only, not a functionality bug). > 14. metaspaceShared.cpp: > line 861: "druing" -> "during" > not new: lines 779/780: Comment says "Rewrite and unlink classes", prints "Rewriting and linking classes" > Maybe the comment could say: "Rewrite and link missing classes, then unlink all classes as part of dump" "Rewrite and link classes" would be the right comment here. Klass::remove_unshareable_info() is called at a later stage. > Your comment says super interfaces may have been missed from the classlist(s) > - I believe that loading any class requires preloading any supertypes - superclasses and superinterfaces - so I would > not expect those to be missing at this time - or is that just in the case of failed verification? > I will double check exactly what could be missing and rewrite the comments accordingly. > 15. metaspaceShared.cpp > line 682: could you possibly change the comment from "repeat" to "iterate"? fixed > 16. metaspaceShared.cpp > _check_one_shared_class: at this point you are checking supertypes for failed verification > 1) have you ever seen a class that passed verification but one of its supertypes failed? I don't think that should be possible? > I'm not sure what this loop is for? Just for the IgnoreUnverifiableClassesDuringDump? If my vague memory is correct (I could be totally wrong), during verification some constant pool entries are resolved, which leads to the loading of unrelated classes. In a normal run (without CDS), these extra classes are verified lazily when they are initialized. However, during dumping, we want to verify these classes as well, so that everything in the archive is verified. This is the reason for the iterations. Let me double check. > I have to go to a meeting, so more later. Thank you so much! - Ioi > thanks, > Karen > > On Jul 28, 2014, at 7:09 PM, Ioi Lam wrote: > >> Hi Folks, >> >> Please review the following clean up and refactoring of the CDS code, for JDK9 >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >> https://bugs.openjdk.java.net/browse/JDK-8046070 >> >> Summary of fix: >> >> Clean up and refactor the Class Data Sharing (CDS) code, including: >> >> + Improve archive integrity checking >> + Support bytecode verification during archive dumping time >> + Allow the user to configure the CDS class list and archive file. >> + Allow future extension of the CDS class loading mechanism. >> >> Tests: >> >> JPRT >> UTE (vm.runtime.testlist, vm.quick.testlist, vm.parallel_class_loading.testlist) >> Various adhoc SQE tests on Aurora >> JCK >> >> Thanks >> - Ioi From dmitry.degrave at oracle.com Thu Aug 7 06:48:05 2014 From: dmitry.degrave at oracle.com (dmeetry degrave) Date: Thu, 07 Aug 2014 10:48:05 +0400 Subject: RFR: 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese locale In-Reply-To: <53E2F4C5.3060806@oracle.com> References: <53E0B4C7.4070403@oracle.com> <53E2AF6E.2050800@oracle.com> <53E2E68B.2050000@oracle.com> <53E2F4C5.3060806@oracle.com> Message-ID: <53E32125.90403@oracle.com> Naoto, Masayoshi, thanks for looking at this! On 08/07/2014 07:38 AM, Masayoshi Okutsu wrote: > Sorry, I forgot about Calendar.getDisplayName. Perhaps the JRE semantic > (Locale.ROOT is English) support for all narrow names should be given up. > > I will take over this one because it will require some changes to the > locale service provider framework. > > Thanks, > Masayoshi > > On 8/7/2014 11:38 AM, Masayoshi Okutsu wrote: >> The root cause of this "problem" is the semantic difference between >> the legacy JRE resources and the CLDR-drived resources. The root CLDR >> resources have the narrow month names as numbers to be >> language-neutral, while the JRE root resources have them as English. >> If you specify Locale.ROOT, you will get the English ones rather than >> the numbers. That is somehow an intended behavior (or a known >> restriction). >> >> The narrow names are supported only in java.time due to compatibility >> constraints with java.text. So the narrow month names should go to >> src/share/classes/sun/text/resources/ja/JavaTimeSupplementary_ja.java >> rather than FormatData_ja.java. There should be more locales which >> have the same problem. >> >> Thanks, >> Masayoshi >> >> On 8/7/2014 7:42 AM, Naoto Sato wrote: >>> Looks good to me. >>> >>> Naoto >>> >>> On 8/5/14, 3:41 AM, dmeetry degrave wrote: >>>> Hello, >>>> >>>> Please review a simple fix (jdk 8 and 9) for >>>> >>>> 8042126: DateTimeFormatter "MMMMM" returns English value in Japanese >>>> locale >>>> >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8042126 >>>> fix: http://cr.openjdk.java.net/~dmeetry/8042126/webrev.01 >>>> >>>> thanks, >>>> dmeetry >> > From aph at redhat.com Thu Aug 7 07:17:16 2014 From: aph at redhat.com (Andrew Haley) Date: Thu, 07 Aug 2014 08:17:16 +0100 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <6517606.3JH0BrhG34@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <53D77C35.9050805@oracle.com> <24689252.yEYuCUqD1k@logouticek> <6517606.3JH0BrhG34@logouticek> Message-ID: <53E327FC.5020609@redhat.com> On 06/08/14 11:17, Jaroslav Tulach wrote: >> Yup. Did you know that an object can be finalized while there are still >> > instance methods of that object executing? We've actually seen it > Sure, but that cannot happen with activeQueue() as the referent is really gone > before appropriate Reference.run() is executed. I'm sure that it can happen, in just the same way. An object can be "really gone" even when one of its instance methods is still executing. I'm wondering whether it's really worth your time applying band-aids to a broken mechanism. Andrew. From jaroslav.tulach at oracle.com Thu Aug 7 07:43:43 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Thu, 07 Aug 2014 09:43:43 +0200 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <53E327FC.5020609@redhat.com> References: <2296697.ZmJV3U9KFH@logouticek> <6517606.3JH0BrhG34@logouticek> <53E327FC.5020609@redhat.com> Message-ID: <4542226.2tcRe74ULK@logouticek> Dne ?t 7. srpna 2014 08:17:16, Andrew Haley napsal(a): > I'm wondering whether it's really worth your time applying band-aids to > a broken mechanism. Under the assumption WeakReference and ReferenceQueue are flawless, there is no reason to call a mechanism based on WeakReference and ReferenceQueue synergy "broken". > An object can be > "really gone" even when one of its instance methods is still executing. That would probably signal a major flaw in the JVM. In any case, this is orthogonal to the discussion I am leading. I am operating on the assumption that the new APIs which were designed to replace Object.finalize - e.g. WeakReference and ReferenceQueue & co. are flawless. > On 06/08/14 11:17, Jaroslav Tulach wrote: > > Sure, but that cannot happen with activeQueue() as the referent is really > > gone before appropriate Reference.run() is executed. > I'm sure that it can happen, in just the same way. You are more than welcomed to prove your claim and report bug to JDK. I'd say. -jt From fweimer at redhat.com Thu Aug 7 08:48:43 2014 From: fweimer at redhat.com (Florian Weimer) Date: Thu, 07 Aug 2014 10:48:43 +0200 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53D6D842.7000103@oracle.com> References: <53D6D842.7000103@oracle.com> Message-ID: <53E33D6B.8010102@redhat.com> On 07/29/2014 01:09 AM, Ioi Lam wrote: > Hi Folks, > > Please review the following clean up and refactoring of the CDS code, > for JDK9 > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ > https://bugs.openjdk.java.net/browse/JDK-8046070 Can you check if this bit in hotspot/src/share/vm/runtime/arguments.cpp is still up-to-date? 1566 #ifdef COMPILER2 1567 // Shared spaces work fine with other GCs but causes bytecode rewriting 1568 // to be disabled, which hurts interpreter performance and decreases 1569 // server performance. When -server is specified, keep the default off 1570 // unless it is asked for. Future work: either add bytecode rewriting 1571 // at link time, or rewrite bytecodes in non-shared methods. 1572 if (!DumpSharedSpaces && !RequireSharedSpaces && 1573 (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) { 1574 no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on."); 1575 } 1576 #endif I think with tiered compilation, the server VM should suffer less from the lack of bytecode rewriting because early C1 compilation reduces the dependency on interpreter performance. Or is this not true? Thanks, Florian -- Florian Weimer / Red Hat Product Security From paul.sandoz at oracle.com Thu Aug 7 09:21:21 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 7 Aug 2014 11:21:21 +0200 Subject: Redundant null checks due to casts Re: [9] RFR (M): 8037209: Improvements and cleanups to bytecode assembly for lambda forms In-Reply-To: References: <5322EBF2.7030209@oracle.com> <5322F3D7.9010103@oracle.com> <94F61B19-8904-42FA-9E16-CC0A6B30FD79@oracle.com> <53230184.9090007@oracle.com> <2FCC64E3-3753-4CE0-9CC6-849FF737BFB5@oracle.com> <53232FF3.9020803@oracle.com> <53305E52.2060001@oracle.com> <53BBC340.7040509@oracle.com> <7FAEB94F-EB98-49A9-A4B0-9B4A6B730CA9@oracle.com> Message-ID: <3DDDFA19-086C-43D2-9E3E-B349142A7FD2@oracle.com> I have logged the following issue for redundant null checks: https://bugs.openjdk.java.net/browse/JDK-8054492 Paul. From dl at cs.oswego.edu Thu Aug 7 11:22:59 2014 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 07 Aug 2014 07:22:59 -0400 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <4542226.2tcRe74ULK@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <6517606.3JH0BrhG34@logouticek> <53E327FC.5020609@redhat.com> <4542226.2tcRe74ULK@logouticek> Message-ID: <53E36193.8020404@cs.oswego.edu> On 08/07/2014 03:43 AM, Jaroslav Tulach wrote: > Dne ?t 7. srpna 2014 08:17:16, Andrew Haley napsal(a): >> I'm wondering whether it's really worth your time applying band-aids to >> a broken mechanism. > > Under the assumption WeakReference and ReferenceQueue are flawless, there is no > reason to call a mechanism based on WeakReference and ReferenceQueue synergy > "broken". > >> An object can be >> "really gone" even when one of its instance methods is still executing. > > That would probably signal a major flaw in the JVM. Finalization is not broken in the sense of not meeting its specs (see http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.6) but some surprising and undesirable cases are allowed, and actually occur, in highly concurrent programs. Including cases where finalizers may run concurrently with the final invocation of a method on the target. Because the specs interact with the details of the memory model, we have been discussing (on jmm-dev list) possible changes and improvements. But in the mean time (or in any case), the best practice is to consider finalization as a last resort, after ruling out all other possible cleanup strategies. Finalization is easy to spec, implement, and control in purely sequential systems, but is a questionable idea in concurrent ones. -Doug From aph at redhat.com Thu Aug 7 15:50:39 2014 From: aph at redhat.com (Andrew Haley) Date: Thu, 07 Aug 2014 16:50:39 +0100 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <4542226.2tcRe74ULK@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <6517606.3JH0BrhG34@logouticek> <53E327FC.5020609@redhat.com> <4542226.2tcRe74ULK@logouticek> Message-ID: <53E3A04F.3060009@redhat.com> On 07/08/14 08:43, Jaroslav Tulach wrote: >> > On 06/08/14 11:17, Jaroslav Tulach wrote: >>> > > Sure, but that cannot happen with activeQueue() as the referent is really >>> > > gone before appropriate Reference.run() is executed. >> > I'm sure that it can happen, in just the same way. > You are more than welcomed to prove your claim and report bug to JDK. I'd say. It's not a bug: it's in the specification, has been since 1996. Andrew. From chris.hegarty at oracle.com Thu Aug 7 16:24:16 2014 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 7 Aug 2014 17:24:16 +0100 Subject: RFR JDK-8034032 : Check src/macosx/native/java/util/prefs/MacOSXPreferencesFile.m for JNI pending issues In-Reply-To: <53E2A214.7090107@oracle.com> References: <53E2A214.7090107@oracle.com> Message-ID: <23F7847E-EB77-4454-8800-002FF030BBDF@oracle.com> This looks ok to me Brent, and I agree with your conservative approach. -Chris. On 6 Aug 2014, at 22:45, Brent Christian wrote: > Please review my fix for: > > Bug: > https://bugs.openjdk.java.net/browse/JDK-8034032 > Webrev: > http://cr.openjdk.java.net/~bchristi/8034032/webrev.0/ > > > Within jdk/src/macosx/native/java/util/prefs/MacOSXPreferencesFile.m, > there is a pattern of making blocks of toCF() calls, where > later toCF() calls are made when there could be an exception pending from an earlier toCF() call. > > toCF()creates a CFString from a Java String. If an error occurs, it will raise an exception by calling the throwIfNull() macro: > > #define throwIfNull(var, msg) \ > do { \ > if (var == NULL) { \ > throwOutOfMemoryError(env, msg); \ > goto bad##var; \ > } \ > } while (0) > > Note: "##var" is substituted for whatever text is serving as "var", and throwIfNull() is meant to jump to the cleanup portion of a function (e.g. "badvar") to do cleanup before exiting. > > This goto behavior is used more as intended elsewhere in MacOSXPreferencesFile.m. toCF() doesn't have such cleanup to do. > > An example of a series of calls to toCF(): > > 650 CFStringRef path = toCF(env, jpath); > 651 CFStringRef child = toCF(env, jchild); > 652 CFStringRef name = toCF(env, jname); > > It's not until later that we check that everything turned out OK: > > 661 if (!path || !child || !name) goto badparams; > > If one toCF() call throws an OOME exception, it will still be pending when the next call to toCF() makes a JNI call, (GetStringLength() in this case). > > I believe the right thing to do here is to check the success of each toCF() call before making the next toCF() call. I've left the existing null checks / 'goto badparams' as is. > > I also clear any pending exceptions in throwOutOfMemoryError(). > > Thanks, > -Brent > From brent.christian at oracle.com Thu Aug 7 21:23:56 2014 From: brent.christian at oracle.com (Brent Christian) Date: Thu, 07 Aug 2014 14:23:56 -0700 Subject: RFR JDK-8034032 : Check src/macosx/native/java/util/prefs/MacOSXPreferencesFile.m for JNI pending issues In-Reply-To: <23F7847E-EB77-4454-8800-002FF030BBDF@oracle.com> References: <53E2A214.7090107@oracle.com> <23F7847E-EB77-4454-8800-002FF030BBDF@oracle.com> Message-ID: <53E3EE6C.7060204@oracle.com> Thanks, Chris! On 8/7/14 9:24 AM, Chris Hegarty wrote: > This looks ok to me Brent, and I agree with your conservative approach. > > -Chris. > > On 6 Aug 2014, at 22:45, Brent Christian wrote: > >> Please review my fix for: >> >> Bug: >> https://bugs.openjdk.java.net/browse/JDK-8034032 >> Webrev: >> http://cr.openjdk.java.net/~bchristi/8034032/webrev.0/ >> >> >> Within jdk/src/macosx/native/java/util/prefs/MacOSXPreferencesFile.m, >> there is a pattern of making blocks of toCF() calls, where >> later toCF() calls are made when there could be an exception pending from an earlier toCF() call. >> >> toCF()creates a CFString from a Java String. If an error occurs, it will raise an exception by calling the throwIfNull() macro: >> >> #define throwIfNull(var, msg) \ >> do { \ >> if (var == NULL) { \ >> throwOutOfMemoryError(env, msg); \ >> goto bad##var; \ >> } \ >> } while (0) >> >> Note: "##var" is substituted for whatever text is serving as "var", and throwIfNull() is meant to jump to the cleanup portion of a function (e.g. "badvar") to do cleanup before exiting. >> >> This goto behavior is used more as intended elsewhere in MacOSXPreferencesFile.m. toCF() doesn't have such cleanup to do. >> >> An example of a series of calls to toCF(): >> >> 650 CFStringRef path = toCF(env, jpath); >> 651 CFStringRef child = toCF(env, jchild); >> 652 CFStringRef name = toCF(env, jname); >> >> It's not until later that we check that everything turned out OK: >> >> 661 if (!path || !child || !name) goto badparams; >> >> If one toCF() call throws an OOME exception, it will still be pending when the next call to toCF() makes a JNI call, (GetStringLength() in this case). >> >> I believe the right thing to do here is to check the success of each toCF() call before making the next toCF() call. I've left the existing null checks / 'goto badparams' as is. >> >> I also clear any pending exceptions in throwOutOfMemoryError(). >> >> Thanks, >> -Brent >> > From lance.andersen at oracle.com Thu Aug 7 22:44:52 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Thu, 7 Aug 2014 18:44:52 -0400 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* Message-ID: Hi, Looking for a reviewer for corrections to various javadoc typos The webrev can be found at http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ Best, Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From joe.darcy at oracle.com Thu Aug 7 23:49:41 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 07 Aug 2014 16:49:41 -0700 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* In-Reply-To: References: Message-ID: <53E41095.5060702@oracle.com> On 08/07/2014 03:44 PM, Lance Andersen wrote: > Hi, > > Looking for a reviewer for corrections to various javadoc typos > > The webrev can be found at http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ > > Best, > Lance > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > Hi Lance, In src/share/classes/java/sql/CallableStatement.java @@ -1899,7 +1900,7 @@ * @param length the number of bytes in the parameter data. * @throws SQLException if parameterName does not correspond to a named * parameter; if the length specified - * is less than zero; if the number of bytes in the inputstream does not match + * is less than zero; if the number of bytes in the Inputstream does not match * the specified length; if a database access error occurs or * this method is called on a closed CallableStatement * @exception SQLFeatureNotSupportedException if the JDBC driver does not support I think the new line would be better using either "input stream" or "{@code InputStream}". Similar comment in src/share/classes/javax/sql/RowSet.java @@ -1420,7 +1420,7 @@ void setBlob (int i, Blob x) throws SQLException; /** - * Sets the designated parameter to a InputStream object. The inputstream must contain the number + * Sets the designated parameter to a InputStream object. The InputStream must contain the number * of characters specified by length otherwise a SQLException will be * generated when the PreparedStatement is executed. * This method differs from the setBinaryStream (int, InputStream, int) @@ -1474,7 +1474,8 @@ throws SQLException; /** - * Sets the designated parameter to a InputStream object. The inputstream must contain the number + * Sets the designated parameter to a InputStream object. + * The inputstream must contain the number * of characters specified by length, otherwise a SQLException will be * generated when the CallableStatement is executed. * This method differs from the setBinaryStream (int, InputStream, int) Otherwise, the changes look okay. Cheers, -Joe From lance.andersen at oracle.com Thu Aug 7 23:57:49 2014 From: lance.andersen at oracle.com (Lance @ Oracle) Date: Thu, 7 Aug 2014 19:57:49 -0400 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* In-Reply-To: <53E41095.5060702@oracle.com> References: <53E41095.5060702@oracle.com> Message-ID: Hi joe, Thank you for the quick review. I will change those to {@code Inputstream} Best, Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPad > On Aug 7, 2014, at 7:49 PM, Joe Darcy wrote: > >> On 08/07/2014 03:44 PM, Lance Andersen wrote: >> Hi, >> >> Looking for a reviewer for corrections to various javadoc typos >> >> The webrev can be found at http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ >> >> Best, >> Lance >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> >> >> > > Hi Lance, > > In src/share/classes/java/sql/CallableStatement.java > > @@ -1899,7 +1900,7 @@ > * @param length the number of bytes in the parameter data. > * @throws SQLException if parameterName does not correspond to a named > * parameter; if the length specified > - * is less than zero; if the number of bytes in the inputstream does not match > + * is less than zero; if the number of bytes in the Inputstream does not match > * the specified length; if a database access error occurs or > * this method is called on a closed CallableStatement > * @exception SQLFeatureNotSupportedException if the JDBC driver does not support > > I think the new line would be better using either "input stream" or "{@code InputStream}". > > Similar comment in src/share/classes/javax/sql/RowSet.java > > @@ -1420,7 +1420,7 @@ > void setBlob (int i, Blob x) throws SQLException; > > /** > - * Sets the designated parameter to a InputStream object. The inputstream must contain the number > + * Sets the designated parameter to a InputStream object. The InputStream must contain the number > * of characters specified by length otherwise a SQLException will be > * generated when the PreparedStatement is executed. > * This method differs from the setBinaryStream (int, InputStream, int) > > @@ -1474,7 +1474,8 @@ > throws SQLException; > > /** > - * Sets the designated parameter to a InputStream object. The inputstream must contain the number > + * Sets the designated parameter to a InputStream object. > + * The inputstream must contain the number > * of characters specified by length, otherwise a SQLException will be > * generated when the CallableStatement is executed. > * This method differs from the setBinaryStream (int, InputStream, int) > > Otherwise, the changes look okay. > > Cheers, > > -Joe From ivan.gerasimov at oracle.com Fri Aug 8 00:09:44 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 08 Aug 2014 04:09:44 +0400 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* In-Reply-To: References: <53E41095.5060702@oracle.com> Message-ID: <53E41548.4010900@oracle.com> Hi Lance! I like to grep for the word duplicates :) Under jdk/src/share/classes/javax/sql grep found: ./rowset/spi/SyncFactory.java: * Adds*the the* given synchronization provider to the factory register. Guidelines ./rowset/spi/SyncFactory.java: * ROWSET properties and stores lazy references into*the the* internal registry. ./rowset/spi/SyncProvider.java: * degrees *of of *care. The first group of constants indicate how synchronization ./rowset/spi/package.html:For *the the* next level up, the ./rowset/BaseRowSet.java: * in the driver documentation. Although there are guidelines*for for *how ./rowset/RowSetProvider.java: * in jars available to the runtime. For example, to have*the the* RowSetFactory ./rowset/JoinRowSet.java: * A match column can *be be *set in two ways: ./rowset/JoinRowSet.java: * An ANSI-style JOIN providing *a a* full JOIN. Specifies that all ./rowset/serial/package.html:that *the the* originating data source manages.
./rowset/serial/package.html:wasNull is used to determine whether *the the* last value read was SQL NULL. ./rowset/CachedRowSet.java: * until*all all *components reading this CachedRowSet object ./rowset/CachedRowSet.java: * row *in in* this CachedRowSet object ./rowset/CachedRowSet.java: * on *the the* rowset reader (RowSetReader object) from the ./rowset/CachedRowSet.java: * was instantiated, or if none *was was* set, the default provider ./rowset/FilteredRowSet.java: * FilteredRowSet object are detected. A new filter*has has* an ./rowset/RowSetMetaDataImpl.java: * Retrieves*the the* suggested column title for the designated ./rowset/RowSetMetaDataImpl.java: * The field that holds *the the* type name used by this particular data source ./rowset/package.html:standard interfaces specified in this package *and and* may extend the Would you please include these typo fixes in your patch? Sincerely yours, Ivan On 08.08.2014 3:57, Lance @ Oracle wrote: > Hi joe, > > Thank you for the quick review. > > I will change those to {@code Inputstream} > > Best, > Lance > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > Sent from my iPad > >> On Aug 7, 2014, at 7:49 PM, Joe Darcy wrote: >> >>> On 08/07/2014 03:44 PM, Lance Andersen wrote: >>> Hi, >>> >>> Looking for a reviewer for corrections to various javadoc typos >>> >>> The webrev can be found at http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ >>> >>> Best, >>> Lance >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> >>> >>> >> Hi Lance, >> >> In src/share/classes/java/sql/CallableStatement.java >> >> @@ -1899,7 +1900,7 @@ >> * @param length the number of bytes in the parameter data. >> * @throws SQLException if parameterName does not correspond to a named >> * parameter; if the length specified >> - * is less than zero; if the number of bytes in the inputstream does not match >> + * is less than zero; if the number of bytes in the Inputstream does not match >> * the specified length; if a database access error occurs or >> * this method is called on a closed CallableStatement >> * @exception SQLFeatureNotSupportedException if the JDBC driver does not support >> >> I think the new line would be better using either "input stream" or "{@code InputStream}". >> >> Similar comment in src/share/classes/javax/sql/RowSet.java >> >> @@ -1420,7 +1420,7 @@ >> void setBlob (int i, Blob x) throws SQLException; >> >> /** >> - * Sets the designated parameter to a InputStream object. The inputstream must contain the number >> + * Sets the designated parameter to a InputStream object. The InputStream must contain the number >> * of characters specified by length otherwise a SQLException will be >> * generated when the PreparedStatement is executed. >> * This method differs from the setBinaryStream (int, InputStream, int) >> >> @@ -1474,7 +1474,8 @@ >> throws SQLException; >> >> /** >> - * Sets the designated parameter to a InputStream object. The inputstream must contain the number >> + * Sets the designated parameter to a InputStream object. >> + * The inputstream must contain the number >> * of characters specified by length, otherwise a SQLException will be >> * generated when the CallableStatement is executed. >> * This method differs from the setBinaryStream (int, InputStream, int) >> >> Otherwise, the changes look okay. >> >> Cheers, >> >> -Joe > From weijun.wang at oracle.com Fri Aug 8 00:10:22 2014 From: weijun.wang at oracle.com (Weijun Wang) Date: Fri, 08 Aug 2014 08:10:22 +0800 Subject: Create a child class object based on a parent one Message-ID: <53E4156E.5060905@oracle.com> I have a class A and a sub class B. B contains no extra fields than A. Now there is an object of A and I want to create a B which is "identical" to it. What I am doing is public B(A old) { for (Field f: A.class.getDeclaredFields()) { if (!Modifier.isStatic(f.getModifiers())) { f.setAccessible(true); try { f.set(this, f.get(old)); } catch (Exception e) { throw new RuntimeException(e); } } } } Is there a better way to do this? I can think of Unsafe. Please note I cannot put an A inside B because there are instanceof calls that B must isa A. Also, the A object will be discarded so there is no need to clone the fields. Thanks Max From ivan.gerasimov at oracle.com Fri Aug 8 00:16:02 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 08 Aug 2014 04:16:02 +0400 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* In-Reply-To: <53E41548.4010900@oracle.com> References: <53E41095.5060702@oracle.com> <53E41548.4010900@oracle.com> Message-ID: <53E416C2.2060906@oracle.com> And a few more duplicates under jdk/src/share/classes/java/sql: ./NClob.java: * which *provides provides* methods for getting the ./Connection.java: * @exception *SQLException SQLException* if a database access error occurs ./Connection.java: * @exception *SQLException SQLException* if a database access error occurs ./Connection.java: * @exception *SQLException SQLException* if a database access error occurs ./Connection.java: * You must set *the the* values for the TypeMap prior to ./Connection.java: * can *be be* determined by invoking ./DatabaseMetaData.java: *

Each procedure description has *the the* following columns: ./DatabaseMetaData.java: *

Each function description has *the the* following columns: On 08.08.2014 4:09, Ivan Gerasimov wrote: > Hi Lance! > > I like to grep for the word duplicates :) > Under jdk/src/share/classes/javax/sql grep found: > > ./rowset/spi/SyncFactory.java: * Adds*the the* given > synchronization provider to the factory register. Guidelines > ./rowset/spi/SyncFactory.java: * ROWSET properties and stores lazy > references into*the the* internal registry. > ./rowset/spi/SyncProvider.java: * degrees *of of *care. The first > group of constants indicate how synchronization > ./rowset/spi/package.html:For *the the* next level up, the > ./rowset/BaseRowSet.java: * in the driver documentation. Although > there are guidelines*for for *how > ./rowset/RowSetProvider.java: * in jars available to the runtime. > For example, to have*the the* RowSetFactory > ./rowset/JoinRowSet.java: * A match column can *be be *set in two ways: > ./rowset/JoinRowSet.java: * An ANSI-style JOIN > providing *a a* full JOIN. Specifies that all > ./rowset/serial/package.html:that *the the* originating data source > manages.
> ./rowset/serial/package.html:wasNull is used to determine > whether *the the* last value read was SQL NULL. > ./rowset/CachedRowSet.java: * until*all all *components reading > this CachedRowSet object > ./rowset/CachedRowSet.java: * row *in in* this > CachedRowSet object > ./rowset/CachedRowSet.java: * on *the the* rowset reader > (RowSetReader object) from the > ./rowset/CachedRowSet.java: * was instantiated, or if none > *was was* set, the default provider > ./rowset/FilteredRowSet.java: * FilteredRowSet object are > detected. A new filter*has has* an > ./rowset/RowSetMetaDataImpl.java: * Retrieves*the the* suggested > column title for the designated > ./rowset/RowSetMetaDataImpl.java: * The field that holds *the > the* type name used by this particular data source > ./rowset/package.html:standard interfaces specified in this package > *and and* may extend the > > Would you please include these typo fixes in your patch? > > Sincerely yours, > Ivan > > On 08.08.2014 3:57, Lance @ Oracle wrote: >> Hi joe, >> >> Thank you for the quick review. >> >> I will change those to {@code Inputstream} >> >> Best, >> Lance >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> Sent from my iPad >> >>> On Aug 7, 2014, at 7:49 PM, Joe Darcy wrote: >>> >>>> On 08/07/2014 03:44 PM, Lance Andersen wrote: >>>> Hi, >>>> >>>> Looking for a reviewer for corrections to various javadoc typos >>>> >>>> The webrev can be found at >>>> http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ >>>> >>>> Best, >>>> Lance >>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >>>> >>>> >>>> >>> Hi Lance, >>> >>> In src/share/classes/java/sql/CallableStatement.java >>> >>> @@ -1899,7 +1900,7 @@ >>> * @param length the number of bytes in the parameter data. >>> * @throws SQLException if parameterName does not correspond >>> to a named >>> * parameter; if the length specified >>> - * is less than zero; if the number of bytes in the inputstream >>> does not match >>> + * is less than zero; if the number of bytes in the Inputstream >>> does not match >>> * the specified length; if a database access error occurs or >>> * this method is called on a closed >>> CallableStatement >>> * @exception SQLFeatureNotSupportedException if the JDBC >>> driver does not support >>> >>> I think the new line would be better using either "input stream" or >>> "{@code InputStream}". >>> >>> Similar comment in src/share/classes/javax/sql/RowSet.java >>> >>> @@ -1420,7 +1420,7 @@ >>> void setBlob (int i, Blob x) throws SQLException; >>> >>> /** >>> - * Sets the designated parameter to a InputStream >>> object. The inputstream must contain the number >>> + * Sets the designated parameter to a InputStream >>> object. The InputStream must contain the number >>> * of characters specified by length otherwise a >>> SQLException will be >>> * generated when the PreparedStatement is executed. >>> * This method differs from the setBinaryStream (int, >>> InputStream, int) >>> >>> @@ -1474,7 +1474,8 @@ >>> throws SQLException; >>> >>> /** >>> - * Sets the designated parameter to a InputStream >>> object. The inputstream must contain the number >>> + * Sets the designated parameter to a InputStream >>> object. >>> + * The inputstream must contain the number >>> * of characters specified by length, otherwise a >>> SQLException will be >>> * generated when the CallableStatement is executed. >>> * This method differs from the setBinaryStream (int, >>> InputStream, int) >>> >>> Otherwise, the changes look okay. >>> >>> Cheers, >>> >>> -Joe >> > > > From jaroslav.tulach at oracle.com Fri Aug 8 08:01:05 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Fri, 08 Aug 2014 10:01:05 +0200 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <53E3A04F.3060009@redhat.com> References: <2296697.ZmJV3U9KFH@logouticek> <4542226.2tcRe74ULK@logouticek> <53E3A04F.3060009@redhat.com> Message-ID: <1878881.YVfIXLJOUy@logouticek> Hello Doug, thanks for your reply and clarification about finalization. May I ask for one more clarification, this time about WeakReference behavior? There has been a claim made in this thread that an object which is "really gone" (from a point of view of WeakReference) may have its instance method being executed. Something like: obj = new Object(); ref = new WeakReference(obj); class OtherThread extends Thread { public void run() { obj.toString(); obj = null; } } new OtherThread().start(); obj = null; while (ref.get() != null) { // wait } assert ref.get() == null; // can the OtherThread be calling toString() on obj now!? >From my point of view, this is impossible. Once ref.get() returns null, the obj is no longer reachable and is "really gone". Would you be so kind and confirm this observation or is there a chance Andrew could be right? On Aug 7 2014 Andrew Haley wrote: > It's not a bug: it's in the specification, has been since 1996. Given the fact that WeakReference & co. has been introduced in JDK 1.2 and that version was released at the end of 1998, I bet it was just a communication problem, as Andrew must have been talking about something else than WeakReference + ReferenceQueue behavior. -jt > On 08/07/2014 03:43 AM, Jaroslav Tulach wrote: > > Dne ?t 7. srpna 2014 08:17:16, Andrew Haley napsal(a): > >> I'm wondering whether it's really worth your time applying band-aids to > >> a broken mechanism. > > > > Under the assumption WeakReference and ReferenceQueue are flawless, there > > is no reason to call a mechanism based on WeakReference and > > ReferenceQueue synergy "broken". > > > >> An object can be > >> "really gone" even when one of its instance methods is still executing. > > > > That would probably signal a major flaw in the JVM. > > Finalization is not broken in the sense of not meeting its specs > (see http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.6) > but some surprising and undesirable cases are allowed, > and actually occur, in highly concurrent programs. > Including cases where finalizers may run concurrently with > the final invocation of a method on the target. > Because the specs interact with the details of the memory model, > we have been discussing (on jmm-dev list) possible changes > and improvements. But in the mean time (or in any case), the best > practice is to consider finalization as a last resort, after > ruling out all other possible cleanup strategies. > Finalization is easy to spec, implement, and control in > purely sequential systems, but is a questionable idea in > concurrent ones. > > -Doug Dne ?t 7. srpna 2014 16:50:39, Andrew Haley napsal(a): > On 07/08/14 08:43, Jaroslav Tulach wrote: > >> > On 06/08/14 11:17, Jaroslav Tulach wrote: > >>> > > Sure, but that cannot happen with activeQueue() as the referent is > >>> > > really > >>> > > gone before appropriate Reference.run() is executed. > >> > > >> > I'm sure that it can happen, in just the same way. > > > > You are more than welcomed to prove your claim and report bug to JDK. I'd > > say. > It's not a bug: it's in the specification, has been since 1996. > > Andrew. From jaroslav.tulach at oracle.com Fri Aug 8 08:45:08 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Fri, 08 Aug 2014 10:45:08 +0200 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <6517606.3JH0BrhG34@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <24689252.yEYuCUqD1k@logouticek> <6517606.3JH0BrhG34@logouticek> Message-ID: <1438446.rtp1OfbMMD@logouticek> Roger Riggs wrote: > I can't help but ask how this differs from sun.misc.Cleaner? > One concern is about security and robustness of the code that is run on > the system threads. > I don't have the history but these are very sensitive areas of operation. Thanks for bringing Cleaner into the picture, Roger! I was told something like this exists in the implementation packages of JDK but I could not find it (was looking for a class like Finalize.*Something.*...). Yes, the active reference queue concept is quite similar to Cleaner. That has a lot of positive implications, I think: - NetBeans needs activeReferenceQueue(), JDK needs Cleaner - there must be a need for this kind of lightweight finalization, then! - JDK9 promises to be more secure by disallowing access to sun.* packages. Together with such promise the team announced that some useful utilities will be turned into official API (sun.misc.Unsafe particularly). Looks like Cleaner is another useful tool as well - so let's treat my quest for lightweight finalization as an attempt to come up with an official API to replace Cleaner. Technically both activeReferenceQueue and Cleaner seem similar, except following differences: - Cleaner's run() method is called on internal JDK thread. If the client cleanup code misbehaves, no References will be queued into their ReferenceQueues. That is probably too fragile for public API. My patch which introduces Reference.activeQueue() is doing client code callbacks on the finalizer thread which already has all the sufferings with client code - e.g. no increased security/stability risks. In the process of seeking official API for lightweight finalization I suggest to use the finalizer thread for callbacks. - Cleaner creates own instance of PhantomReference while activeQueue can be used with any type of Reference (just choose your own and make it implement Runnable). For many usecases the activeQueue approach is more efficient. Often one needs WeakReference or SoftReference to the object and also the cleanup code - with Cleaner current design this requires two references - one client one and one internal PhantomReference in the Cleaner. activeQueue needs just the client one. Even if one does not need own reference, the activeQueue approach needs one object less - as the PhantomReference and Runnable are merged into one. In any case I am really glad a synergy in needs of JDK and NetBeans has been found. Hopefully that will lead to easier acceptance of the need for a official public API for lightweight finalization. -jt Dne St 6. srpna 2014 12:17:38, Jaroslav Tulach napsal(a): > OK, > time to show the code. I've added an alternative patch to JDK-8051843: > https://bugs.openjdk.java.net/secure/attachment/21640/ActiveQueueFinalizer.d > iff I suggest to start reading it from bottom - e.g. the test, the > documentation and then the implementation. > > Now there is time for some discussion: First of all I should mention that > the patch is sufficient to solve all the problems NetBeans and people > reusing NetBeans libraries in dynamic classloader systems (e.g. containers) > have. This is a pro. > > Next thing to check is whether the change can cause some harm. Here are the > > areas of concern we have identified so far: > > > > # 1 - Because of automatic JDK management thread? > > The patch introduces no new thread. It reuses already existing one. No > allocation of new system resources. Status quo is kept. > > On the other hand, this is a pro over own ReferenceQueue.remove calls. One > saves a thread per instance of such queue. > > > > > # 2 - Or because once finalize() is called, one still has reference to > > > > the > > > > "gone" object and can re-activate it? > > This problem does not exist with activeQueue(). When the run() method on a > Reference is called, this.get() already returns null. I believe this > addresses > also David M. LLoyd's concern: > > Yup. Did you know that an object can be finalized while there are still > > instance methods of that object executing? We've actually seen it > > Sure, but that cannot happen with activeQueue() as the referent is really > gone before appropriate Reference.run() is executed. > > Certainly a pro over Object.finalize. Status quo with respect to > ReferenceQueue as that behaves the same. > > > > > #3 - Or because the finalizer thread is shared between completely > > > > unrelated > > > > objects and misbehavior of one can cause problems for others? > > No regression in this aspect either. finalizer thread already has this > problem, and we are not making it worse. Status quo is kept. Well written > application actually benefit from this behavior, as they save system > threads (compared to own ReferenceQueue.remove implementations). > > > If you still think that finalize is a good idea, given that it's > > basically defective *and* there is almost always a better solution, > > I believe activeQueue() in core libraries is good idea. Because it fills the > gap between (dangerous, unusable) Object.finalize and (ineffective) > attempts to code the same logic in libraries (via own > Thread+ReferenceQueue.remove) > > I see at least one pro and no cons. Are there other points of view? > -jt From aph at redhat.com Fri Aug 8 09:01:14 2014 From: aph at redhat.com (Andrew Haley) Date: Fri, 08 Aug 2014 10:01:14 +0100 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <1878881.YVfIXLJOUy@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <4542226.2tcRe74ULK@logouticek> <53E3A04F.3060009@redhat.com> <1878881.YVfIXLJOUy@logouticek> Message-ID: <53E491DA.1000409@redhat.com> On 08/08/14 09:01, Jaroslav Tulach wrote: > Given the fact that WeakReference & co. has been introduced in JDK > 1.2 and that version was released at the end of 1998, I bet it was > just a communication problem, as Andrew must have been talking about > something else than WeakReference + ReferenceQueue behavior. You don't have to believe me, read this: http://thevirtualmachinist.blogspot.co.uk/2011/07/subtle-issue-of-reachability.html http://thevirtualmachinist.blogspot.co.uk/2011/07/reachability-follow-up.html The problem is not to do with WeakReferences or ReferenceQueues, but with the notion of reachability in the VM. The language which permits this behaviour is: "Optimizing transformations of a program can be designed that reduce the number of objects that are reachable to be less than those which would naively be considered reachable. For example, a Java compiler or code generator may choose to set a variable or parameter that will no longer be used to null to cause the storage for such an object to be potentially reclaimable sooner. "Another example of this occurs if the values in an object's fields are stored in registers. The program may then access the registers instead of the object, and never access the object again. This would imply that the object is garbage." Andrew. From jaroslav.tulach at oracle.com Fri Aug 8 10:55:00 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Fri, 08 Aug 2014 12:55 +0200 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <53E491DA.1000409@redhat.com> References: <2296697.ZmJV3U9KFH@logouticek> <1878881.YVfIXLJOUy@logouticek> <53E491DA.1000409@redhat.com> Message-ID: <3890343.r8o9NcaM0N@logouticek> Dne P? 8. srpna 2014 10:01:14, Andrew Haley napsal(a): > On 08/08/14 09:01, Jaroslav Tulach wrote: > > Given the fact that WeakReference & co. has been introduced in JDK > > 1.2 and that version was released at the end of 1998, I bet it was > > just a communication problem, as Andrew must have been talking about > > something else than WeakReference + ReferenceQueue behavior. > > You don't have to believe me, read this: > > http://thevirtualmachinist.blogspot.co.uk/2011/07/subtle-issue-of-reachabili > ty.html Interesting, but not really related. Maybe a topic for the memory management group to require a receiver of an instance method call to be considered GC root while the method is running. Btw. if anyone really gets into problems described in the article, this: byte[] getData() { try { return array.clone(); } finally { Logger.getLogger("keep").log(Level.FINEST, "alive {0}", this); } } is a way to prevent GC of this while the getData() method is running. My assumption is that the Logger.log call is so polymorphic that it won't be possible for a VM to inline it and/or optimize away - even it is usually a no-op. -jt PS: On a similar note: http://wiki.apidesign.org/wiki/CompilerOptimizations[1] > http://thevirtualmachinist.blogspot.co.uk/2011/07/reachability-follow-up.ht > ml > > The problem is not to do with WeakReferences or ReferenceQueues, but with > the notion of reachability in the VM. > > The language which permits this behaviour is: > > "Optimizing transformations of a program can be designed that reduce > the number of objects that are reachable to be less than those which > would naively be considered reachable. For example, a Java compiler or > code generator may choose to set a variable or parameter that will no > longer be used to null to cause the storage for such an object to be > potentially reclaimable sooner. > > "Another example of this occurs if the values in an object's fields > are stored in registers. The program may then access the registers > instead of the object, and never access the object again. This would > imply that the object is garbage." > > Andrew. -------- [1] http://wiki.apidesign.org/wiki/CompilerOptimizations From lance.andersen at oracle.com Fri Aug 8 11:07:55 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Fri, 8 Aug 2014 07:07:55 -0400 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* In-Reply-To: <53E416C2.2060906@oracle.com> References: <53E41095.5060702@oracle.com> <53E41548.4010900@oracle.com> <53E416C2.2060906@oracle.com> Message-ID: Hi Joe, Ivan, Thank you for the feedback. Attached is the revised webrev http://cr.openjdk.java.net/~lancea/8054555/webrev.01/ Best, Lance On Aug 7, 2014, at 8:16 PM, Ivan Gerasimov wrote: > And a few more duplicates under jdk/src/share/classes/java/sql: > > ./NClob.java: * which provides provides methods for getting the > ./Connection.java: * @exception SQLException SQLException if a database access error occurs > ./Connection.java: * @exception SQLException SQLException if a database access error occurs > ./Connection.java: * @exception SQLException SQLException if a database access error occurs > ./Connection.java: * You must set the the values for the TypeMap prior to > ./Connection.java: * can be be determined by invoking > ./DatabaseMetaData.java: *

Each procedure description has the the following columns: > ./DatabaseMetaData.java: *

Each function description has the the following columns: > > On 08.08.2014 4:09, Ivan Gerasimov wrote: >> Hi Lance! >> >> I like to grep for the word duplicates :) >> Under jdk/src/share/classes/javax/sql grep found: >> >> ./rowset/spi/SyncFactory.java: * Adds*the the* given synchronization provider to the factory register. Guidelines >> ./rowset/spi/SyncFactory.java: * ROWSET properties and stores lazy references into*the the* internal registry. >> ./rowset/spi/SyncProvider.java: * degrees *of of *care. The first group of constants indicate how synchronization >> ./rowset/spi/package.html:For *the the* next level up, the >> ./rowset/BaseRowSet.java: * in the driver documentation. Although there are guidelines*for for *how >> ./rowset/RowSetProvider.java: * in jars available to the runtime. For example, to have*the the* RowSetFactory >> ./rowset/JoinRowSet.java: * A match column can *be be *set in two ways: >> ./rowset/JoinRowSet.java: * An ANSI-style JOIN providing *a a* full JOIN. Specifies that all >> ./rowset/serial/package.html:that *the the* originating data source manages.
>> ./rowset/serial/package.html:wasNull is used to determine whether *the the* last value read was SQL NULL. >> ./rowset/CachedRowSet.java: * until*all all *components reading this CachedRowSet object >> ./rowset/CachedRowSet.java: * row *in in* this CachedRowSet object >> ./rowset/CachedRowSet.java: * on *the the* rowset reader (RowSetReader object) from the >> ./rowset/CachedRowSet.java: * was instantiated, or if none *was was* set, the default provider >> ./rowset/FilteredRowSet.java: * FilteredRowSet object are detected. A new filter*has has* an >> ./rowset/RowSetMetaDataImpl.java: * Retrieves*the the* suggested column title for the designated >> ./rowset/RowSetMetaDataImpl.java: * The field that holds *the the* type name used by this particular data source >> ./rowset/package.html:standard interfaces specified in this package *and and* may extend the >> >> Would you please include these typo fixes in your patch? >> >> Sincerely yours, >> Ivan >> >> On 08.08.2014 3:57, Lance @ Oracle wrote: >>> Hi joe, >>> >>> Thank you for the quick review. >>> >>> I will change those to {@code Inputstream} >>> >>> Best, >>> Lance >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> Sent from my iPad >>> >>>> On Aug 7, 2014, at 7:49 PM, Joe Darcy wrote: >>>> >>>>> On 08/07/2014 03:44 PM, Lance Andersen wrote: >>>>> Hi, >>>>> >>>>> Looking for a reviewer for corrections to various javadoc typos >>>>> >>>>> The webrev can be found at http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ >>>>> >>>>> Best, >>>>> Lance >>>>> >>>>> >>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>> Oracle Java Engineering >>>>> 1 Network Drive >>>>> Burlington, MA 01803 >>>>> Lance.Andersen at oracle.com >>>>> >>>>> >>>>> >>>> Hi Lance, >>>> >>>> In src/share/classes/java/sql/CallableStatement.java >>>> >>>> @@ -1899,7 +1900,7 @@ >>>> * @param length the number of bytes in the parameter data. >>>> * @throws SQLException if parameterName does not correspond to a named >>>> * parameter; if the length specified >>>> - * is less than zero; if the number of bytes in the inputstream does not match >>>> + * is less than zero; if the number of bytes in the Inputstream does not match >>>> * the specified length; if a database access error occurs or >>>> * this method is called on a closed CallableStatement >>>> * @exception SQLFeatureNotSupportedException if the JDBC driver does not support >>>> >>>> I think the new line would be better using either "input stream" or "{@code InputStream}". >>>> >>>> Similar comment in src/share/classes/javax/sql/RowSet.java >>>> >>>> @@ -1420,7 +1420,7 @@ >>>> void setBlob (int i, Blob x) throws SQLException; >>>> >>>> /** >>>> - * Sets the designated parameter to a InputStream object. The inputstream must contain the number >>>> + * Sets the designated parameter to a InputStream object. The InputStream must contain the number >>>> * of characters specified by length otherwise a SQLException will be >>>> * generated when the PreparedStatement is executed. >>>> * This method differs from the setBinaryStream (int, InputStream, int) >>>> >>>> @@ -1474,7 +1474,8 @@ >>>> throws SQLException; >>>> >>>> /** >>>> - * Sets the designated parameter to a InputStream object. The inputstream must contain the number >>>> + * Sets the designated parameter to a InputStream object. >>>> + * The inputstream must contain the number >>>> * of characters specified by length, otherwise a SQLException will be >>>> * generated when the CallableStatement is executed. >>>> * This method differs from the setBinaryStream (int, InputStream, int) >>>> >>>> Otherwise, the changes look okay. >>>> >>>> Cheers, >>>> >>>> -Joe >>> >> >> >> > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From stanimir at riflexo.com Fri Aug 8 12:02:41 2014 From: stanimir at riflexo.com (Stanimir Simeonoff) Date: Fri, 8 Aug 2014 15:02:41 +0300 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <1878881.YVfIXLJOUy@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <4542226.2tcRe74ULK@logouticek> <53E3A04F.3060009@redhat.com> <1878881.YVfIXLJOUy@logouticek> Message-ID: Hi Jaroslav, The snippet is likely to just result into a NPE at obj.toString() than anything else as "obj" must be a member and volatile to even compile. Stanimir On Fri, Aug 8, 2014 at 11:01 AM, Jaroslav Tulach wrote: > Hello Doug, > thanks for your reply and clarification about finalization. May I ask for > one more > clarification, this time about WeakReference behavior? > > There has been a claim made in this thread that an object which is "really > gone" (from > a point of view of WeakReference) may have its instance method being > executed. > Something like: > > obj = new Object(); > ref = new WeakReference(obj); > class OtherThread extends Thread { > public void run() { > obj.toString(); > obj = null; > } > } > new OtherThread().start(); > obj = null; > while (ref.get() != null) { > // wait > } > assert ref.get() == null; > // can the OtherThread be calling toString() on obj now!? > > From my point of view, this is impossible. Once ref.get() returns null, > the obj is no > longer reachable and is "really gone". Would you be so kind and confirm > this > observation or is there a chance Andrew could be right? > > On Aug 7 2014 Andrew Haley wrote: > > It's not a bug: it's in the specification, has been since 1996. > > Given the fact that WeakReference & co. has been introduced in JDK 1.2 and > that > version was released at the end of 1998, I bet it was just a communication > problem, as > Andrew must have been talking about something else than WeakReference + > ReferenceQueue behavior. > > -jt > > > > On 08/07/2014 03:43 AM, Jaroslav Tulach wrote: > > > Dne ?t 7. srpna 2014 08:17:16, Andrew Haley napsal(a): > > >> I'm wondering whether it's really worth your time applying band-aids > to > > >> a broken mechanism. > > > > > > Under the assumption WeakReference and ReferenceQueue are flawless, > there > > > is no reason to call a mechanism based on WeakReference and > > > ReferenceQueue synergy "broken". > > > > > >> An object can be > > >> "really gone" even when one of its instance methods is still > executing. > > > > > > That would probably signal a major flaw in the JVM. > > > > Finalization is not broken in the sense of not meeting its specs > > (see > http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.6) > > but some surprising and undesirable cases are allowed, > > and actually occur, in highly concurrent programs. > > Including cases where finalizers may run concurrently with > > the final invocation of a method on the target. > > Because the specs interact with the details of the memory model, > > we have been discussing (on jmm-dev list) possible changes > > and improvements. But in the mean time (or in any case), the best > > practice is to consider finalization as a last resort, after > > ruling out all other possible cleanup strategies. > > Finalization is easy to spec, implement, and control in > > purely sequential systems, but is a questionable idea in > > concurrent ones. > > > > -Doug > > Dne ?t 7. srpna 2014 16:50:39, Andrew Haley napsal(a): > > On 07/08/14 08:43, Jaroslav Tulach wrote: > > >> > On 06/08/14 11:17, Jaroslav Tulach wrote: > > >>> > > Sure, but that cannot happen with activeQueue() as the referent > is > > >>> > > really > > >>> > > gone before appropriate Reference.run() is executed. > > >> > > > >> > I'm sure that it can happen, in just the same way. > > > > > > You are more than welcomed to prove your claim and report bug to JDK. > I'd > > > say. > > It's not a bug: it's in the specification, has been since 1996. > > > > Andrew. > > From aph at redhat.com Fri Aug 8 12:47:33 2014 From: aph at redhat.com (Andrew Haley) Date: Fri, 08 Aug 2014 13:47:33 +0100 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <3890343.r8o9NcaM0N@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <1878881.YVfIXLJOUy@logouticek> <53E491DA.1000409@redhat.com> <3890343.r8o9NcaM0N@logouticek> Message-ID: <53E4C6E5.4070207@redhat.com> On 08/08/2014 11:55 AM, Jaroslav Tulach wrote: > Dne P? 8. srpna 2014 10:01:14, Andrew Haley napsal(a): > >> On 08/08/14 09:01, Jaroslav Tulach wrote: >> > Given the fact that WeakReference & co. has been introduced in JDK >> > 1.2 and that version was released at the end of 1998, I bet it was >> > just a communication problem, as Andrew must have been talking about >> > something else than WeakReference + ReferenceQueue behavior. >> >> You don't have to believe me, read this: >> >> http://thevirtualmachinist.blogspot.co.uk/2011/07/subtle-issue-of-reachability.html > > Interesting, but not really related. Your question was "Why is finalize wrong?" This is one reason that I consider finalization (which includes finalizers, weak references, and phantom references) to be wrong, so it is a direct answer to your question. That, and the fact that finalizable objects may end up in a region which is never collected. So: finalization can happen too early, too late, or never. It is difficult to use and error-prone, so much so that I suspect that most finalizers out in the wild are broken. > Maybe a topic for the memory management group to require a receiver > of an instance method call to be considered GC root while the method > is running. I think that one has been considered and rejected. It would add pressure to register-straved machines (think x86). > Btw. if anyone really gets into problems described in the article, this: Yes, people really do get into those problems. There are lots of things one can do to defer finalization, some of them more lightweight than using a logger. We've tried many of them. My current favourite is AtomicIntegerFieldUpdater.lazySet(), which I think cannot be optimized away, but a smart compiler may realize that the object is not reachable from other threads and eliminate it. Maybe. > My assumption is that the Logger.log call is so polymorphic that it > won't be possible for a VM to inline it and/or optimize away - even > it is usually a no-op. But would you bet the farm on that assumption? HotSpot is very good at inlining polymorphic calls. Andrew. From ivan.gerasimov at oracle.com Fri Aug 8 13:39:06 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 08 Aug 2014 17:39:06 +0400 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* In-Reply-To: References: <53E41095.5060702@oracle.com> <53E41548.4010900@oracle.com> <53E416C2.2060906@oracle.com> Message-ID: <53E4D2FA.9010100@oracle.com> Hi Lance! 1) src/share/classes/java/sql/CallableStatement.java + * is less than zero; if the number of bytes in the "{@code InputStream} should be + * is less than zero; if the number of bytes in the {@code InputStream} 3) src/share/classes/javax/sql/RowSet.java + * The reader must contain the number should the Reader be capitalized as in the line above it? + * The reader must contain the number should the reader be marked with {@code} for consistency? 4) src/share/classes/javax/sql/rowset/serial/SerialBlob.java + // is for backwards compatibiiity should be + // is for backwards compatibility Otherwise look good! Sincerely yours, Ivan On 08.08.2014 15:07, Lance Andersen wrote: > Hi Joe, Ivan, > > Thank you for the feedback. > > Attached is the revised webrev > > http://cr.openjdk.java.net/~lancea/8054555/webrev.01/ > > > Best, > Lance > On Aug 7, 2014, at 8:16 PM, Ivan Gerasimov > wrote: > >> And a few more duplicates under jdk/src/share/classes/java/sql: >> >> ./NClob.java: * which *provides provides* methods for getting the >> ./Connection.java: * @exception *SQLException SQLException* if a >> database access error occurs >> ./Connection.java: * @exception *SQLException SQLException* if a >> database access error occurs >> ./Connection.java: * @exception *SQLException SQLException* if a >> database access error occurs >> ./Connection.java: * You must set *the the* values for the >> TypeMap prior to >> ./Connection.java: * can *be be* determined by invoking >> ./DatabaseMetaData.java: *

Each procedure description has *the >> the* following columns: >> ./DatabaseMetaData.java: *

Each function description has *the >> the* following columns: >> >> On 08.08.2014 4:09, Ivan Gerasimov wrote: >>> Hi Lance! >>> >>> I like to grep for the word duplicates :) >>> Under jdk/src/share/classes/javax/sql grep found: >>> >>> ./rowset/spi/SyncFactory.java: * Adds*the the* given >>> synchronization provider to the factory register. Guidelines >>> ./rowset/spi/SyncFactory.java: * ROWSET properties and stores >>> lazy references into*the the* internal registry. >>> ./rowset/spi/SyncProvider.java: * degrees *of of *care. The first >>> group of constants indicate how synchronization >>> ./rowset/spi/package.html:For *the the* next level up, the >>> ./rowset/BaseRowSet.java: * in the driver documentation. >>> Although there are guidelines*for for *how >>> ./rowset/RowSetProvider.java: * in jars available to the >>> runtime. For example, to have*the the* RowSetFactory >>> ./rowset/JoinRowSet.java: * A match column can *be be *set in two ways: >>> ./rowset/JoinRowSet.java: * An ANSI-style JOIN >>> providing *a a* full JOIN. Specifies that all >>> ./rowset/serial/package.html:that *the the* originating data source >>> manages.
>>> ./rowset/serial/package.html:wasNull is used to >>> determine whether *the the* last value read was SQL NULL. >>> ./rowset/CachedRowSet.java: * until*all all *components reading >>> this CachedRowSet object >>> ./rowset/CachedRowSet.java: * row *in in* this >>> CachedRowSet object >>> ./rowset/CachedRowSet.java: * on *the the* rowset reader >>> (RowSetReader object) from the >>> ./rowset/CachedRowSet.java: * was instantiated, or if none >>> *was was* set, the default provider >>> ./rowset/FilteredRowSet.java: * FilteredRowSet object >>> are detected. A new filter*has has* an >>> ./rowset/RowSetMetaDataImpl.java: * Retrieves*the the* suggested >>> column title for the designated >>> ./rowset/RowSetMetaDataImpl.java: * The field that holds >>> *the the* type name used by this particular data source >>> ./rowset/package.html:standard interfaces specified in this package >>> *and and* may extend the >>> >>> Would you please include these typo fixes in your patch? >>> >>> Sincerely yours, >>> Ivan >>> >>> On 08.08.2014 3:57, Lance @ Oracle wrote: >>>> Hi joe, >>>> >>>> Thank you for the quick review. >>>> >>>> I will change those to {@code Inputstream} >>>> >>>> Best, >>>> Lance >>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >>>> Sent from my iPad >>>> >>>>> On Aug 7, 2014, at 7:49 PM, Joe Darcy wrote: >>>>> >>>>>> On 08/07/2014 03:44 PM, Lance Andersen wrote: >>>>>> Hi, >>>>>> >>>>>> Looking for a reviewer for corrections to various javadoc typos >>>>>> >>>>>> The webrev can be found at >>>>>> http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ >>>>>> >>>>>> Best, >>>>>> Lance >>>>>> >>>>>> >>>>>> Lance Andersen| Principal Member of Technical Staff | >>>>>> +1.781.442.2037 >>>>>> Oracle Java Engineering >>>>>> 1 Network Drive >>>>>> Burlington, MA 01803 >>>>>> Lance.Andersen at oracle.com >>>>>> >>>>>> >>>>>> >>>>> Hi Lance, >>>>> >>>>> In src/share/classes/java/sql/CallableStatement.java >>>>> >>>>> @@ -1899,7 +1900,7 @@ >>>>> * @param length the number of bytes in the parameter data. >>>>> * @throws SQLException if parameterName does not correspond >>>>> to a named >>>>> * parameter; if the length specified >>>>> - * is less than zero; if the number of bytes in the >>>>> inputstream does not match >>>>> + * is less than zero; if the number of bytes in the >>>>> Inputstream does not match >>>>> * the specified length; if a database access error occurs or >>>>> * this method is called on a closed >>>>> CallableStatement >>>>> * @exception SQLFeatureNotSupportedException if the JDBC >>>>> driver does not support >>>>> >>>>> I think the new line would be better using either "input stream" >>>>> or "{@code InputStream}". >>>>> >>>>> Similar comment in src/share/classes/javax/sql/RowSet.java >>>>> >>>>> @@ -1420,7 +1420,7 @@ >>>>> void setBlob (int i, Blob x) throws SQLException; >>>>> >>>>> /** >>>>> - * Sets the designated parameter to a >>>>> InputStream object. The inputstream must contain >>>>> the number >>>>> + * Sets the designated parameter to a >>>>> InputStream object. The InputStream >>>>> must contain the number >>>>> * of characters specified by length otherwise a >>>>> SQLException will be >>>>> * generated when the PreparedStatement is >>>>> executed. >>>>> * This method differs from the setBinaryStream (int, >>>>> InputStream, int) >>>>> >>>>> @@ -1474,7 +1474,8 @@ >>>>> throws SQLException; >>>>> >>>>> /** >>>>> - * Sets the designated parameter to a >>>>> InputStream object. The inputstream >>>>> must contain the number >>>>> + * Sets the designated parameter to a >>>>> InputStream object. >>>>> + * The inputstream must contain the number >>>>> * of characters specified by length, otherwise a >>>>> SQLException will be >>>>> * generated when the CallableStatement is >>>>> executed. >>>>> * This method differs from the setBinaryStream (int, >>>>> InputStream, int) >>>>> >>>>> Otherwise, the changes look okay. >>>>> >>>>> Cheers, >>>>> >>>>> -Joe >>>> >>> >>> >>> >> > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From jaroslav.tulach at oracle.com Fri Aug 8 13:41:56 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Fri, 08 Aug 2014 15:41:56 +0200 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: References: <2296697.ZmJV3U9KFH@logouticek> <1878881.YVfIXLJOUy@logouticek> Message-ID: <1750688.xV4r4reA8L@logouticek> Dne P? 8. srpna 2014 15:02:41, Stanimir Simeonoff napsal(a): > The snippet is likely to just result into a NPE at obj.toString() than > anything else as "obj" must be a member and volatile to even compile. Well, it is just pseudo-code. Please notice that variables don't even have right types. My primary question was whether toString() can be on stack while ref.get() returns null. According to articles provided by Andrew[1], toString() can be on stack, even if obj (e.g. this for toString()) is garbage collected. This is a bit surprising (an OOP fan would expect that this is GC root while its instance method is running), but such behavior is said to be in accordance to the 1.8 spec. Question for Doug (as a member of jmm-dev list) then is: would not it be wise to change the spec to require this to be GC root while its instance method is being executed? -jt > > On Fri, Aug 8, 2014 at 11:01 AM, Jaroslav Tulach > wrote: > > > > Hello Doug, > > thanks for your reply and clarification about finalization. May I ask for > > one more > > clarification, this time about WeakReference behavior? > > > > There has been a claim made in this thread that an object which is "really > > gone" (from > > a point of view of WeakReference) may have its instance method being > > executed. > > Something like: > > > > obj = new Object(); > > ref = new WeakReference(obj); > > class OtherThread extends Thread { > > > > public void run() { > > > > obj.toString(); > > obj = null; > > > > } > > > > } > > new OtherThread().start(); > > obj = null; > > while (ref.get() != null) { > > > > // wait > > > > } > > assert ref.get() == null; > > // can the OtherThread be calling toString() on obj now!? > > > > From my point of view, this is impossible. Once ref.get() returns null, > > the obj is no > > longer reachable and is "really gone". Would you be so kind and confirm > > this > > observation or is there a chance Andrew could be right? > > > > On Aug 7 2014 Andrew Haley wrote: > > > It's not a bug: it's in the specification, has been since 1996. > > > > Given the fact that WeakReference & co. has been introduced in JDK 1.2 and > > that > > version was released at the end of 1998, I bet it was just a communication > > problem, as > > Andrew must have been talking about something else than WeakReference + > > ReferenceQueue behavior. > > > > -jt > > > > > On 08/07/2014 03:43 AM, Jaroslav Tulach wrote: > > > > Dne ?t 7. srpna 2014 08:17:16, Andrew Haley napsal(a): > > > >> I'm wondering whether it's really worth your time applying band-aids > > > > to > > > > > >> a broken mechanism. > > > > > > > > Under the assumption WeakReference and ReferenceQueue are flawless, > > > > there > > > > > > is no reason to call a mechanism based on WeakReference and > > > > ReferenceQueue synergy "broken". > > > > > > > >> An object can be > > > >> "really gone" even when one of its instance methods is still > > > > executing. > > > > > > That would probably signal a major flaw in the JVM. > > > > > > Finalization is not broken in the sense of not meeting its specs > > > (see > > > > http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.6) > > > > > but some surprising and undesirable cases are allowed, > > > and actually occur, in highly concurrent programs. > > > Including cases where finalizers may run concurrently with > > > the final invocation of a method on the target. > > > Because the specs interact with the details of the memory model, > > > we have been discussing (on jmm-dev list) possible changes > > > and improvements. But in the mean time (or in any case), the best > > > practice is to consider finalization as a last resort, after > > > ruling out all other possible cleanup strategies. > > > Finalization is easy to spec, implement, and control in > > > purely sequential systems, but is a questionable idea in > > > concurrent ones. > > > > > > -Doug > > > > Dne ?t 7. srpna 2014 16:50:39, Andrew Haley napsal(a): > > > On 07/08/14 08:43, Jaroslav Tulach wrote: > > > >> > On 06/08/14 11:17, Jaroslav Tulach wrote: > > > >>> > > Sure, but that cannot happen with activeQueue() as the referent > > > > is > > > > > >>> > > really > > > >>> > > gone before appropriate Reference.run() is executed. > > > >> > > > > >> > I'm sure that it can happen, in just the same way. > > > > > > > > You are more than welcomed to prove your claim and report bug to JDK. > > > > I'd > > > > > > say. > > > From lance.andersen at oracle.com Fri Aug 8 17:14:48 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Fri, 8 Aug 2014 13:14:48 -0400 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* In-Reply-To: <53E4D2FA.9010100@oracle.com> References: <53E41095.5060702@oracle.com> <53E41548.4010900@oracle.com> <53E416C2.2060906@oracle.com> <53E4D2FA.9010100@oracle.com> Message-ID: <45CCC3DF-3CA4-4FCC-9878-F4D9ED89121D@oracle.com> Hi Ivan, Here is the revised with your additional input. I think I needed extra coffee this morning http://cr.openjdk.java.net/~lancea/8054555/webrev.02/ Best, Lance On Aug 8, 2014, at 9:39 AM, Ivan Gerasimov wrote: > Hi Lance! > > 1) > src/share/classes/java/sql/CallableStatement.java > > + * is less than zero; if the number of bytes in the "{@code InputStream} > should be > + * is less than zero; if the number of bytes in the {@code InputStream} > > 3) > src/share/classes/javax/sql/RowSet.java > > + * The reader must contain the number > should the Reader be capitalized as in the line above it? > > + * The reader must contain the number > should the reader be marked with {@code} for consistency? > > 4) > src/share/classes/javax/sql/rowset/serial/SerialBlob.java > > + // is for backwards compatibiiity > should be > + // is for backwards compatibility > > Otherwise look good! > > Sincerely yours, > Ivan > > > On 08.08.2014 15:07, Lance Andersen wrote: >> Hi Joe, Ivan, >> >> Thank you for the feedback. >> >> Attached is the revised webrev >> >> http://cr.openjdk.java.net/~lancea/8054555/webrev.01/ >> >> Best, >> Lance >> On Aug 7, 2014, at 8:16 PM, Ivan Gerasimov wrote: >> >>> And a few more duplicates under jdk/src/share/classes/java/sql: >>> >>> ./NClob.java: * which provides provides methods for getting the >>> ./Connection.java: * @exception SQLException SQLException if a database access error occurs >>> ./Connection.java: * @exception SQLException SQLException if a database access error occurs >>> ./Connection.java: * @exception SQLException SQLException if a database access error occurs >>> ./Connection.java: * You must set the the values for the TypeMap prior to >>> ./Connection.java: * can be be determined by invoking >>> ./DatabaseMetaData.java: *

Each procedure description has the the following columns: >>> ./DatabaseMetaData.java: *

Each function description has the the following columns: >>> >>> On 08.08.2014 4:09, Ivan Gerasimov wrote: >>>> Hi Lance! >>>> >>>> I like to grep for the word duplicates :) >>>> Under jdk/src/share/classes/javax/sql grep found: >>>> >>>> ./rowset/spi/SyncFactory.java: * Adds*the the* given synchronization provider to the factory register. Guidelines >>>> ./rowset/spi/SyncFactory.java: * ROWSET properties and stores lazy references into*the the* internal registry. >>>> ./rowset/spi/SyncProvider.java: * degrees *of of *care. The first group of constants indicate how synchronization >>>> ./rowset/spi/package.html:For *the the* next level up, the >>>> ./rowset/BaseRowSet.java: * in the driver documentation. Although there are guidelines*for for *how >>>> ./rowset/RowSetProvider.java: * in jars available to the runtime. For example, to have*the the* RowSetFactory >>>> ./rowset/JoinRowSet.java: * A match column can *be be *set in two ways: >>>> ./rowset/JoinRowSet.java: * An ANSI-style JOIN providing *a a* full JOIN. Specifies that all >>>> ./rowset/serial/package.html:that *the the* originating data source manages.
>>>> ./rowset/serial/package.html:wasNull is used to determine whether *the the* last value read was SQL NULL. >>>> ./rowset/CachedRowSet.java: * until*all all *components reading this CachedRowSet object >>>> ./rowset/CachedRowSet.java: * row *in in* this CachedRowSet object >>>> ./rowset/CachedRowSet.java: * on *the the* rowset reader (RowSetReader object) from the >>>> ./rowset/CachedRowSet.java: * was instantiated, or if none *was was* set, the default provider >>>> ./rowset/FilteredRowSet.java: * FilteredRowSet object are detected. A new filter*has has* an >>>> ./rowset/RowSetMetaDataImpl.java: * Retrieves*the the* suggested column title for the designated >>>> ./rowset/RowSetMetaDataImpl.java: * The field that holds *the the* type name used by this particular data source >>>> ./rowset/package.html:standard interfaces specified in this package *and and* may extend the >>>> >>>> Would you please include these typo fixes in your patch? >>>> >>>> Sincerely yours, >>>> Ivan >>>> >>>> On 08.08.2014 3:57, Lance @ Oracle wrote: >>>>> Hi joe, >>>>> >>>>> Thank you for the quick review. >>>>> >>>>> I will change those to {@code Inputstream} >>>>> >>>>> Best, >>>>> Lance >>>>> >>>>> >>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>> Oracle Java Engineering >>>>> 1 Network Drive >>>>> Burlington, MA 01803 >>>>> Lance.Andersen at oracle.com >>>>> Sent from my iPad >>>>> >>>>>> On Aug 7, 2014, at 7:49 PM, Joe Darcy wrote: >>>>>> >>>>>>> On 08/07/2014 03:44 PM, Lance Andersen wrote: >>>>>>> Hi, >>>>>>> >>>>>>> Looking for a reviewer for corrections to various javadoc typos >>>>>>> >>>>>>> The webrev can be found at http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ >>>>>>> >>>>>>> Best, >>>>>>> Lance >>>>>>> >>>>>>> >>>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>>>> Oracle Java Engineering >>>>>>> 1 Network Drive >>>>>>> Burlington, MA 01803 >>>>>>> Lance.Andersen at oracle.com >>>>>>> >>>>>>> >>>>>>> >>>>>> Hi Lance, >>>>>> >>>>>> In src/share/classes/java/sql/CallableStatement.java >>>>>> >>>>>> @@ -1899,7 +1900,7 @@ >>>>>> * @param length the number of bytes in the parameter data. >>>>>> * @throws SQLException if parameterName does not correspond to a named >>>>>> * parameter; if the length specified >>>>>> - * is less than zero; if the number of bytes in the inputstream does not match >>>>>> + * is less than zero; if the number of bytes in the Inputstream does not match >>>>>> * the specified length; if a database access error occurs or >>>>>> * this method is called on a closed CallableStatement >>>>>> * @exception SQLFeatureNotSupportedException if the JDBC driver does not support >>>>>> >>>>>> I think the new line would be better using either "input stream" or "{@code InputStream}". >>>>>> >>>>>> Similar comment in src/share/classes/javax/sql/RowSet.java >>>>>> >>>>>> @@ -1420,7 +1420,7 @@ >>>>>> void setBlob (int i, Blob x) throws SQLException; >>>>>> >>>>>> /** >>>>>> - * Sets the designated parameter to a InputStream object. The inputstream must contain the number >>>>>> + * Sets the designated parameter to a InputStream object. The InputStream must contain the number >>>>>> * of characters specified by length otherwise a SQLException will be >>>>>> * generated when the PreparedStatement is executed. >>>>>> * This method differs from the setBinaryStream (int, InputStream, int) >>>>>> >>>>>> @@ -1474,7 +1474,8 @@ >>>>>> throws SQLException; >>>>>> >>>>>> /** >>>>>> - * Sets the designated parameter to a InputStream object. The inputstream must contain the number >>>>>> + * Sets the designated parameter to a InputStream object. >>>>>> + * The inputstream must contain the number >>>>>> * of characters specified by length, otherwise a SQLException will be >>>>>> * generated when the CallableStatement is executed. >>>>>> * This method differs from the setBinaryStream (int, InputStream, int) >>>>>> >>>>>> Otherwise, the changes look okay. >>>>>> >>>>>> Cheers, >>>>>> >>>>>> -Joe >>>>> >>>> >>>> >>>> >>> >> >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> >> >> > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From ivan.gerasimov at oracle.com Fri Aug 8 20:42:15 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Sat, 09 Aug 2014 00:42:15 +0400 Subject: RFR: 8054555, javadoc clean-up in java.sql, javax.sql.* In-Reply-To: <45CCC3DF-3CA4-4FCC-9878-F4D9ED89121D@oracle.com> References: <53E41095.5060702@oracle.com> <53E41548.4010900@oracle.com> <53E416C2.2060906@oracle.com> <53E4D2FA.9010100@oracle.com> <45CCC3DF-3CA4-4FCC-9878-F4D9ED89121D@oracle.com> Message-ID: <53E53627.9040200@oracle.com> Looks good! I've scanned through the webrev and found no issues. I'm not an official reviewer though. Sincerely yours, Ivan On 08.08.2014 21:14, Lance Andersen wrote: > Hi Ivan, > > Here is the revised with your additional input. I think I needed > extra coffee this morning > http://cr.openjdk.java.net/~lancea/8054555/webrev.02/ > > > Best, > Lance > On Aug 8, 2014, at 9:39 AM, Ivan Gerasimov > wrote: > >> Hi Lance! >> >> 1) >> src/share/classes/java/sql/CallableStatement.java >> >> + * is less than zero; if the number of bytes in the "{@code >> InputStream} >> should be >> + * is less than zero; if the number of bytes in the {@code >> InputStream} >> >> 3) >> src/share/classes/javax/sql/RowSet.java >> >> + * The reader must contain the number >> should the Reader be capitalized as in the line above it? >> >> + * The reader must contain the number >> should the reader be marked with {@code} for consistency? >> >> 4) >> src/share/classes/javax/sql/rowset/serial/SerialBlob.java >> >> + // is for backwards compatibiiity >> should be >> + // is for backwards compatibility >> >> Otherwise look good! >> >> Sincerely yours, >> Ivan >> >> >> On 08.08.2014 15:07, Lance Andersen wrote: >>> Hi Joe, Ivan, >>> >>> Thank you for the feedback. >>> >>> Attached is the revised webrev >>> >>> http://cr.openjdk.java.net/~lancea/8054555/webrev.01/ >>> >>> >>> Best, >>> Lance >>> On Aug 7, 2014, at 8:16 PM, Ivan Gerasimov >>> > wrote: >>> >>>> And a few more duplicates under jdk/src/share/classes/java/sql: >>>> >>>> ./NClob.java: * which *provides provides* methods for getting the >>>> ./Connection.java: * @exception *SQLException SQLException* if >>>> a database access error occurs >>>> ./Connection.java: * @exception *SQLException SQLException* if >>>> a database access error occurs >>>> ./Connection.java: * @exception *SQLException SQLException* if >>>> a database access error occurs >>>> ./Connection.java: * You must set *the the* values for the >>>> TypeMap prior to >>>> ./Connection.java: * can *be be* determined by invoking >>>> ./DatabaseMetaData.java: *

Each procedure description has >>>> *the the* following columns: >>>> ./DatabaseMetaData.java: *

Each function description has >>>> *the the* following columns: >>>> >>>> On 08.08.2014 4:09, Ivan Gerasimov wrote: >>>>> Hi Lance! >>>>> >>>>> I like to grep for the word duplicates :) >>>>> Under jdk/src/share/classes/javax/sql grep found: >>>>> >>>>> ./rowset/spi/SyncFactory.java: * Adds*the the* given >>>>> synchronization provider to the factory register. Guidelines >>>>> ./rowset/spi/SyncFactory.java: * ROWSET properties and stores >>>>> lazy references into*the the* internal registry. >>>>> ./rowset/spi/SyncProvider.java: * degrees *of of *care. The first >>>>> group of constants indicate how synchronization >>>>> ./rowset/spi/package.html:For *the the* next level up, the >>>>> ./rowset/BaseRowSet.java: * in the driver documentation. >>>>> Although there are guidelines*for for *how >>>>> ./rowset/RowSetProvider.java: * in jars available to the >>>>> runtime. For example, to have*the the* RowSetFactory >>>>> ./rowset/JoinRowSet.java: * A match column can *be be *set in two >>>>> ways: >>>>> ./rowset/JoinRowSet.java: * An ANSI-style JOIN >>>>> providing *a a* full JOIN. Specifies that all >>>>> ./rowset/serial/package.html:that *the the* originating data >>>>> source manages.
>>>>> ./rowset/serial/package.html:wasNull is used to >>>>> determine whether *the the* last value read was SQL NULL. >>>>> ./rowset/CachedRowSet.java: * until*all all *components reading >>>>> this CachedRowSet object >>>>> ./rowset/CachedRowSet.java: * row *in in* this >>>>> CachedRowSet object >>>>> ./rowset/CachedRowSet.java: * on *the the* rowset reader >>>>> (RowSetReader object) from the >>>>> ./rowset/CachedRowSet.java: * was instantiated, or if none >>>>> *was was* set, the default provider >>>>> ./rowset/FilteredRowSet.java: * FilteredRowSet object >>>>> are detected. A new filter*has has* an >>>>> ./rowset/RowSetMetaDataImpl.java: * Retrieves*the the* >>>>> suggested column title for the designated >>>>> ./rowset/RowSetMetaDataImpl.java: * The field that holds >>>>> *the the* type name used by this particular data source >>>>> ./rowset/package.html:standard interfaces specified in this >>>>> package *and and* may extend the >>>>> >>>>> Would you please include these typo fixes in your patch? >>>>> >>>>> Sincerely yours, >>>>> Ivan >>>>> >>>>> On 08.08.2014 3:57, Lance @ Oracle wrote: >>>>>> Hi joe, >>>>>> >>>>>> Thank you for the quick review. >>>>>> >>>>>> I will change those to {@code Inputstream} >>>>>> >>>>>> Best, >>>>>> Lance >>>>>> >>>>>> >>>>>> Lance Andersen| Principal Member of Technical Staff | >>>>>> +1.781.442.2037 >>>>>> Oracle Java Engineering >>>>>> 1 Network Drive >>>>>> Burlington, MA 01803 >>>>>> Lance.Andersen at oracle.com >>>>>> Sent from my iPad >>>>>> >>>>>>> On Aug 7, 2014, at 7:49 PM, Joe Darcy wrote: >>>>>>> >>>>>>>> On 08/07/2014 03:44 PM, Lance Andersen wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> Looking for a reviewer for corrections to various javadoc typos >>>>>>>> >>>>>>>> The webrev can be found at >>>>>>>> http://cr.openjdk.java.net/~lancea/8054555/webrev.00/ >>>>>>>> >>>>>>>> Best, >>>>>>>> Lance >>>>>>>> >>>>>>>> >>>>>>>> Lance Andersen| Principal Member of Technical Staff | >>>>>>>> +1.781.442.2037 >>>>>>>> Oracle Java Engineering >>>>>>>> 1 Network Drive >>>>>>>> Burlington, MA 01803 >>>>>>>> Lance.Andersen at oracle.com >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> Hi Lance, >>>>>>> >>>>>>> In src/share/classes/java/sql/CallableStatement.java >>>>>>> >>>>>>> @@ -1899,7 +1900,7 @@ >>>>>>> * @param length the number of bytes in the parameter data. >>>>>>> * @throws SQLException if parameterName does not >>>>>>> correspond to a named >>>>>>> * parameter; if the length specified >>>>>>> - * is less than zero; if the number of bytes in the >>>>>>> inputstream does not match >>>>>>> + * is less than zero; if the number of bytes in the >>>>>>> Inputstream does not match >>>>>>> * the specified length; if a database access error occurs or >>>>>>> * this method is called on a closed >>>>>>> CallableStatement >>>>>>> * @exception SQLFeatureNotSupportedException if the JDBC >>>>>>> driver does not support >>>>>>> >>>>>>> I think the new line would be better using either "input stream" >>>>>>> or "{@code InputStream}". >>>>>>> >>>>>>> Similar comment in src/share/classes/javax/sql/RowSet.java >>>>>>> >>>>>>> @@ -1420,7 +1420,7 @@ >>>>>>> void setBlob (int i, Blob x) throws SQLException; >>>>>>> >>>>>>> /** >>>>>>> - * Sets the designated parameter to a >>>>>>> InputStream object. The inputstream must contain >>>>>>> the number >>>>>>> + * Sets the designated parameter to a >>>>>>> InputStream object. The InputStream >>>>>>> must contain the number >>>>>>> * of characters specified by length otherwise a >>>>>>> SQLException will be >>>>>>> * generated when the PreparedStatement is >>>>>>> executed. >>>>>>> * This method differs from the setBinaryStream (int, >>>>>>> InputStream, int) >>>>>>> >>>>>>> @@ -1474,7 +1474,8 @@ >>>>>>> throws SQLException; >>>>>>> >>>>>>> /** >>>>>>> - * Sets the designated parameter to a >>>>>>> InputStream object. The inputstream >>>>>>> must contain the number >>>>>>> + * Sets the designated parameter to a >>>>>>> InputStream object. >>>>>>> + * The inputstream must contain the number >>>>>>> * of characters specified by length, otherwise a >>>>>>> SQLException will be >>>>>>> * generated when the CallableStatement is >>>>>>> executed. >>>>>>> * This method differs from the setBinaryStream (int, >>>>>>> InputStream, int) >>>>>>> >>>>>>> Otherwise, the changes look okay. >>>>>>> >>>>>>> Cheers, >>>>>>> >>>>>>> -Joe >>>>>> >>>>> >>>>> >>>>> >>>> >>> >>> >>> >>> >>> Lance >>> Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> >>> >>> >> > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From ivan.gerasimov at oracle.com Fri Aug 8 21:26:18 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Sat, 09 Aug 2014 01:26:18 +0400 Subject: RFR: [8054714] Use StringJoiner where it makes the code cleaner Message-ID: <53E5407A.10407@oracle.com> Hello everyone! This is a follower of the recently fixed [8051382] -- Optimize java.lang.reflect.Modifier.toString(). I found a dozen+ other places in jdk, where using the StringJoiner makes the code shorter and cleaner. Would you please help review the fix? http://cr.openjdk.java.net/~igerasim/8054714/0/webrev/ Sincerely yours, Ivan From ioi.lam at oracle.com Fri Aug 8 21:49:06 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Fri, 08 Aug 2014 14:49:06 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53E2F1AF.2070607@oracle.com> References: <53D6D842.7000103@oracle.com> <53E20162.7070000@oracle.com> <53E2D59F.3050305@oracle.com> <53E2F1AF.2070607@oracle.com> Message-ID: <53E545D2.8020405@oracle.com> On 8/6/14, 8:25 PM, David Holmes wrote: > A couple of responses inline ... > > Cheers, > David > > On 7/08/2014 11:25 AM, Ioi Lam wrote: >> Hi David, >> >> Thanks for the reviews. I will incorporate your suggestions. See >> additional comments below: >> >> On 8/6/14, 3:20 AM, David Holmes wrote: >>> Hi Ioi, >>> >>> Continuing ... just a few minor comments >>> >>> Thanks, >>> David >>> ------ >>> >>> hotspot/src/share/vm/memory/filemap.cpp >>> >>> Nit: printing string literals doesn't need to use %s ie: >>> >>> + tty->print("%s", "["); >>> + tty->vprint(msg, ap); >>> + tty->print_cr("%s", "]"); >>> >>> Should just be: >>> >>> + tty->print("["); >>> + tty->vprint(msg, ap); >>> + tty->print_cr("]"); >>> >>> --- >>> Why do we need memset here: >>> >>> 140 FileMapInfo::FileMapInfo() { >>> 141 assert(_current_info == NULL, "must be singleton"); // not >>> thread safe >>> 142 _current_info = this; >>> 143 memset(this, 0, sizeof(FileMapInfo)); >>> >> The FileMapInfo is a CHeapObj. Does the "new" operator zero the >> memory? I added the memset just for "extra safety". Maybe I should >> remove it (the original code didn't do memset)? > > I would not expect the memory to be zeroed. The fields of the object > should be initialized as appropriate. > I'll leave the memset there for now. It happens only once for a small region and doesn't seem to hurt. >>> --- >>> I don't quite follow the name related logic here: >>> >>> 224 strcpy(strptr, name); >>> >> I am adding an assert like this. Do you think this is enough? > > No I think static analysis tools may flag this as a "bad usage". > I have changed it to call strncpy. >> + assert(strptr + strlen(name) + 1 <= strptr_max, "miscalculated >> buffer size"); >> strcpy(strptr, name); >> strptr += name_bytes; >> ... >> EXCEPTION_MARK; >> Array* arr = MetadataFactory::new_array(loader_data, >> (bytes + 7)/8, THREAD); >> strptr = (char*)(arr->data()); >> + strptr_max = strptr + bytes; >> >>> but strcpy rather than strncpy raises a red-flag. >>> >>> --- >>> What is the role of this: >>> >>> 230 EXCEPTION_MARK; >>> >>> Can new_array post exceptions? If so you need to deal with it else the >>> EXCEPTION_MARK will terminate the VM abruptly. >>> >> At dump time, new_array() will fail if SharedReadOnlySpace or >> SharedReadWriteSpace is too small. But instead of throwing an exception, >> it will print a message about SharedReadOnlySpace or >> SharedReadWriteSpace, and exit the VM. >> >> The EXCEPTION_MARK just indicates we should never return back to this >> function with a pending exception. > > Use of EXCEPTION_MARK is always a bit unclear to me. > I added comments like this: EXCEPTION_MARK; // The following call should never throw, but would exit VM on error. Array* arr = MetadataFactory::new_array(loader_data, (bytes + 7)/8, THREAD); Thanks - Ioi > Thanks, > David > ----------------- > >>> --- >>> >>> hotspot/src/share/vm/memory/metaspaceShared.cpp >>> >>> 779 // Rewrite and unlink classes. >>> 780 tty->print_cr("Rewriting and linking classes ..."); >>> >>> Is it linking or unlinking? >>> >> linking. I will fix comment. >>> --- >>> >>> hotspot/src/share/vm/oops/instanceKlass.hpp >>> >>> + // was loaded. For archived classes, this filed is either NULL >>> (for system >>> >>> Typo: filed >>> >>> + // needed after afterwards. >>> >>> Typo: after after >>> >>> ---- >>> >>> test/testlibrary/com/oracle/java/testlibrary/BuildHelper.java >>> >>> File has the wrong copyright header. >>> >>> >>> On 29/07/2014 9:09 AM, Ioi Lam wrote: >>>> Hi Folks, >>>> >>>> Please review the following clean up and refactoring of the CDS code, >>>> for JDK9 >>>> >>>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >>>> https://bugs.openjdk.java.net/browse/JDK-8046070 >>>> >>>> Summary of fix: >>>> >>>> Clean up and refactor the Class Data Sharing (CDS) code, >>>> including: >>>> >>>> + Improve archive integrity checking >>>> + Support bytecode verification during archive dumping time >>>> + Allow the user to configure the CDS class list and archive >>>> file. >>>> + Allow future extension of the CDS class loading mechanism. >>>> >>>> Tests: >>>> >>>> JPRT >>>> UTE (vm.runtime.testlist, vm.quick.testlist, >>>> vm.parallel_class_loading.testlist) >>>> Various adhoc SQE tests on Aurora >>>> JCK >>>> >>>> Thanks >>>> - Ioi >> From ioi.lam at oracle.com Fri Aug 8 21:51:18 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Fri, 08 Aug 2014 14:51:18 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53E33D6B.8010102@redhat.com> References: <53D6D842.7000103@oracle.com> <53E33D6B.8010102@redhat.com> Message-ID: <53E54656.8070603@oracle.com> On 8/7/14, 1:48 AM, Florian Weimer wrote: > On 07/29/2014 01:09 AM, Ioi Lam wrote: >> Hi Folks, >> >> Please review the following clean up and refactoring of the CDS code, >> for JDK9 >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >> https://bugs.openjdk.java.net/browse/JDK-8046070 > > Can you check if this bit in > hotspot/src/share/vm/runtime/arguments.cpp is still up-to-date? > > 1566 #ifdef COMPILER2 > 1567 // Shared spaces work fine with other GCs but causes bytecode > rewriting > 1568 // to be disabled, which hurts interpreter performance and > decreases > 1569 // server performance. When -server is specified, keep the > default off > 1570 // unless it is asked for. Future work: either add bytecode > rewriting > 1571 // at link time, or rewrite bytecodes in non-shared methods. > 1572 if (!DumpSharedSpaces && !RequireSharedSpaces && > 1573 (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) { > 1574 no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have > to manually setup to on."); > 1575 } > 1576 #endif > Unfortunately this is still true. I think there's a bug on this and we don't have time to address that within this patch. > I think with tiered compilation, the server VM should suffer less from > the lack of bytecode rewriting because early C1 compilation reduces > the dependency on interpreter performance. Or is this not true? > It might help, but I have not run any benchmarks to verify this. Thanks - Ioi > Thanks, > Florian From claes.redestad at oracle.com Sat Aug 9 00:44:26 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Sat, 09 Aug 2014 02:44:26 +0200 Subject: RFR: [8054714] Use StringJoiner where it makes the code cleaner In-Reply-To: <53E5407A.10407@oracle.com> References: <53E5407A.10407@oracle.com> Message-ID: <53E56EEA.6030202@oracle.com> Looks good to me, if that matters... Not sure if worth considering, but for simple cases like src/share/classes/java/util/PropertyPermission.java, you could return the possible constant values instead: static String getActions(int mask) { switch (mask & 0x3) { case 1: return SecurityConstants.READ; case 2: return SecurityConstants.WRITE; case 3: return SecurityConstants.RW; default: return ""; } } Also, now that it's backed by a String[], some of these cases could be optimized if StringJoiner had a way to set/ensure capacity (what leaky abstractions?). Thanks! /Claes On 2014-08-08 23:26, Ivan Gerasimov wrote: > Hello everyone! > > This is a follower of the recently fixed [8051382] -- Optimize > java.lang.reflect.Modifier.toString(). > > I found a dozen+ other places in jdk, where using the StringJoiner > makes the code shorter and cleaner. > > Would you please help review the fix? > > http://cr.openjdk.java.net/~igerasim/8054714/0/webrev/ > > Sincerely yours, > Ivan From joe.darcy at oracle.com Sat Aug 9 01:38:20 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 08 Aug 2014 18:38:20 -0700 Subject: RFR: [8054714] Use StringJoiner where it makes the code cleaner In-Reply-To: <53E5407A.10407@oracle.com> References: <53E5407A.10407@oracle.com> Message-ID: <53E57B8C.5030900@oracle.com> Hello, In src/share/classes/java/util/PropertyPermission.java, I believe the separator in 327 static String getActions(int mask) { 328 StringJoiner sj = new StringJoiner(", "); should be "," (a single comma) rather than ", " (a comma followed by a space). In src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java, 1390 StringJoiner cookieValue = new StringJoiner(", "); the separator used in the original code seems to be "; " rather than ", ". Cheers, -Joe On 08/08/2014 02:26 PM, Ivan Gerasimov wrote: > Hello everyone! > > This is a follower of the recently fixed [8051382] -- Optimize > java.lang.reflect.Modifier.toString(). > > I found a dozen+ other places in jdk, where using the StringJoiner > makes the code shorter and cleaner. > > Would you please help review the fix? > > http://cr.openjdk.java.net/~igerasim/8054714/0/webrev/ > > Sincerely yours, > Ivan From peter.firmstone at zeus.net.au Sat Aug 9 05:56:16 2014 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Sat, 09 Aug 2014 15:56:16 +1000 Subject: The future of Serialization Message-ID: <1407563776.1841.30.camel@Nokia-N900> I've noticed there's not much interest in improving Serialization on these lists. This makes me wonder if java Serialization has lost relevance in recent years with the rise of protocol buffers apache thrift and other means of data transfer over byte streams. The burden of implementing Serializable can significantly hamper developers efforts when refactoring, it's quite common for some projects to make no guarantee regarding Serialization compatibility between releases. Also implementation of Serializable can double project development hours, hamper future development and increase software maintenance costs. Serialization also presents opportunities for attackers and has been responsible for a number of zero day exploits. I don't know if isolates will be included with JDK 9 for Jigsaw, or whether ClassLoaders alone will provide isolation for modules. The ability to limit visibility and provide isolation of implementation classes as well as providing limits on memory and threads for isolated modules would also improve platform security. Serialization may provide a means to hot upgrade modules, but more flexible options that doesn't cause serial data lock in need to be developed. Should Serializable eventually be deprecated? Should Serialization be disabled by default? Should a new mechanism be developed? If a new mechanism is developed, what about circular object relationships? Regards, Peter. From ivan.gerasimov at oracle.com Sat Aug 9 06:00:39 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Sat, 09 Aug 2014 10:00:39 +0400 Subject: RFR: [8054714] Use StringJoiner where it makes the code cleaner In-Reply-To: <53E57B8C.5030900@oracle.com> References: <53E5407A.10407@oracle.com> <53E57B8C.5030900@oracle.com> Message-ID: <53E5B907.2010909@oracle.com> Thanks Joe! I should have been more accurate with keeping the original delimiters. Please find the updated webrev here: http://cr.openjdk.java.net/~igerasim/8054714/1/webrev/ Sincerely yours, Ivan On 09.08.2014 5:38, Joe Darcy wrote: > Hello, > > In src/share/classes/java/util/PropertyPermission.java, I believe the > separator in > > 327 static String getActions(int mask) { > 328 StringJoiner sj = new StringJoiner(", "); > > should be "," (a single comma) rather than ", " (a comma followed by a > space). > > In src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java, > > 1390 StringJoiner cookieValue = new > StringJoiner(", "); > > the separator used in the original code seems to be "; " rather than > ", ". > > Cheers, > > -Joe > > > On 08/08/2014 02:26 PM, Ivan Gerasimov wrote: >> Hello everyone! >> >> This is a follower of the recently fixed [8051382] -- Optimize >> java.lang.reflect.Modifier.toString(). >> >> I found a dozen+ other places in jdk, where using the StringJoiner >> makes the code shorter and cleaner. >> >> Would you please help review the fix? >> >> http://cr.openjdk.java.net/~igerasim/8054714/0/webrev/ >> >> Sincerely yours, >> Ivan > > > From ivan.gerasimov at oracle.com Sat Aug 9 06:32:58 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Sat, 09 Aug 2014 10:32:58 +0400 Subject: RFR: [8054714] Use StringJoiner where it makes the code cleaner In-Reply-To: <53E56EEA.6030202@oracle.com> References: <53E5407A.10407@oracle.com> <53E56EEA.6030202@oracle.com> Message-ID: <53E5C09A.6080106@oracle.com> On 09.08.2014 4:44, Claes Redestad wrote: > Looks good to me, if that matters... > Thanks Claes! > Not sure if worth considering, but for simple cases like > src/share/classes/java/util/PropertyPermission.java, you could return > the possible constant values instead: > > static String getActions(int mask) { > switch (mask & 0x3) { > case 1: > return SecurityConstants.READ; > case 2: > return SecurityConstants.WRITE; > case 3: > return SecurityConstants.RW; > default: > return ""; > } > } > Yes, this will surely work faster. I've incorporated your suggestion: http://cr.openjdk.java.net/~igerasim/8054714/1/webrev/ > Also, now that it's backed by a String[], some of these cases could be > optimized if StringJoiner had a way to set/ensure capacity (what leaky > abstractions?). > I wasn't planning to change the StringJoiner's API with this fix :-) Sincerely yours, Ivan > Thanks! > > /Claes > > > On 2014-08-08 23:26, Ivan Gerasimov wrote: >> Hello everyone! >> >> This is a follower of the recently fixed [8051382] -- Optimize >> java.lang.reflect.Modifier.toString(). >> >> I found a dozen+ other places in jdk, where using the StringJoiner >> makes the code shorter and cleaner. >> >> Would you please help review the fix? >> >> http://cr.openjdk.java.net/~igerasim/8054714/0/webrev/ >> >> Sincerely yours, >> Ivan > > > From dl at cs.oswego.edu Sat Aug 9 11:18:54 2014 From: dl at cs.oswego.edu (Doug Lea) Date: Sat, 9 Aug 2014 07:18:54 -0400 (EDT) Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <1750688.xV4r4reA8L@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <1878881.YVfIXLJOUy@logouticek> <1750688.xV4r4reA8L@logouticek> Message-ID: <49869.208.97.121.124.1407583134.squirrel@altair.cs.oswego.edu> > Dne P?? 8. srpna 2014 15:02:41, Stanimir Simeonoff napsal(a): > > According to articles provided by Andrew[1], toString() can be on stack, > even if obj > (e.g. this for toString()) is garbage collected. This is a bit surprising > (an OOP fan > would expect that this is GC root while its instance method is running), > but such > behavior is said to be in accordance to the 1.8 spec. > > Question for Doug (as a member of jmm-dev list) then is: would not it be > wise to > change the spec to require this to be GC root while its instance method is > being > executed? > Possible changes are being discussed. It is not clear yet exactly what rules would better match people's expectations while remaining implementable by JVMs, and/or whether they would force performance degradations even for the vast majority of code not using finalizers. It is very possible the end result will just be to clarify rules and provide mechanisms allowing better programmer control. Any changes would go into effect for JDK9 at the earliest, so if you can find a way to avoid use of finalizers here, it would be a better option. -Doug From brian.goetz at oracle.com Sat Aug 9 17:20:47 2014 From: brian.goetz at oracle.com (Brian Goetz) Date: Sat, 09 Aug 2014 13:20:47 -0400 Subject: The future of Serialization In-Reply-To: <1407563776.1841.30.camel@Nokia-N900> References: <1407563776.1841.30.camel@Nokia-N900> Message-ID: <53E6586F.7080906@oracle.com> > I've noticed there's not much interest in improving Serialization on > these lists. This makes me wonder if java Serialization has lost > relevance in recent years with the rise of protocol buffers apache > thrift and other means of data transfer over byte streams. I sense your frustration, but I think you may be reaching the wrong conclusion. The lack of response is probably not evidence that there's no interest in fixing serialization; its that fixing serialization, with all the constraints that "fix" entails, is just really really hard, and its much easier to complain about it (and even say "let's just get rid of it") than to fix it. > Should Serializable eventually be deprecated? Should Serialization be > disabled by default? Should a new mechanism be developed? If a new > mechanism is developed, what about circular object relationships? As I delved into my own explorations of serialization, I started to realize why such a horrible approach was the one that was ultimately chosen; while serialization is horrible and awful and leaky and insecure and complex and brittle, it does address problems like cyclic data structures and independent evolution of subclass and superclass better than the "clean" models. My conclusion is, at best, a new mechanism would have to live side-by-side with the old one, since it could only handle 95% of the cases. It might handle those 95% much better -- more cleanly, securely, and allowing easier schema evolution -- but the hard cases are still there. Still, reducing the use of the horrible old mechanism may still be a worthy goal, even if it can't be killed outright. From jeffhain at rocketmail.com Sun Aug 10 21:12:32 2014 From: jeffhain at rocketmail.com (Jeff Hain) Date: Sun, 10 Aug 2014 22:12:32 +0100 Subject: Create a child class object based on a parent one In-Reply-To: <53E4156E.5060905@oracle.com> References: <53E4156E.5060905@oracle.com> Message-ID: <1407705152.64188.YahooMailNeo@web172406.mail.ir2.yahoo.com> >Is there a better way to do this? I can think of Unsafe. You could define a protected copy constructor like this: protected A(A toCopy) { ??? this.x = toCopy.x; } and call it from B constructor: public B(A toCopy) { ??? super(toCopy); } >Please note I cannot put an A inside B because there are instanceof >calls that B must isa A. You could still put A in B, and override all methods in B to delegate to A, but that would waste memory (but if having an interface for A, B could just implement the interface instead of extending A, and that would work well). -Jeff From otaviojava at java.net Sun Aug 10 21:33:30 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Sun, 10 Aug 2014 18:33:30 -0300 Subject: Replace concat String to append in StringBuilder parameters Message-ID: *Motivation:* Make another append instead of concat String inside of append parameter in StringBuilder class. To avoid an extra StringBuilder created for the purpose of concatenating. So it will save memory and will faster than concat String. Doing a code to benchMark[1], the result is: Benchmark Mode Samples Mean Mean error Units m.StringBuilderConcatBenchMark.stringBuilder thrpt 10 6317444.705 108673.584 ops/s m.StringBuilderConcatBenchMark.stringBuilderWithConcat thrpt 10 3354554.435 68353.924 ops/s The webrev of all code is: https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat.zip [1] @State(Scope.Thread) @OutputTimeUnit(TimeUnit.SECONDS) public class StringBuilderConcatBenchMark { private static final String F = "!!!!"; private static final String E = " running in Java "; private static final String D = " in the code "; private static final String C = " to try impact "; private static final String B = " with some text "; private static final String A = "Doing a test"; @GenerateMicroBenchmark public void stringBuilder(BlackHole bh) { bh.consume(createBuilder(A, B, C, D, E, F)); } @GenerateMicroBenchmark public void stringBuilderWithConcat(BlackHole bh) { bh.consume(createBuilderWithConcat(A, B, C, D, E, F)); } private StringBuilder createBuilder(String... values) { StringBuilder text = new StringBuilder(); text.append(values[0]).append(values[1]) .append(values[2]).append(values[3]) .append(values[4]).append(values[5]); return text; } private StringBuilder createBuilderWithConcat(String... values) { StringBuilder text = new StringBuilder(); text.append(values[0] + values[1]) .append(values[2] + values[3]) .append(values[4]+ values[5]); return text; } } -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/ThreadTab.java --- a/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java Sun Aug 10 18:02:01 2014 -0300 @@ -368,7 +368,7 @@ sb.append(Messages.STACK_TRACE); int index = 0; for (StackTraceElement e : ti.getStackTrace()) { - sb.append(e.toString()+"\n"); + sb.append(e.toString()).append("\n"); if (monitors != null) { for (MonitorInfo mi : monitors) { if (mi.getLockedStackDepth() == index) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java --- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Sun Aug 10 18:02:01 2014 -0300 @@ -79,25 +79,24 @@ String textColor = String.format("%06x", foreground.getRGB() & 0xFFFFFF); StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append("
"); for (int i = 0; i < arr.length; i++) { if (i % 2 == 0) { - sb.append(""); + sb.append(""); } else { - sb.append(""); + sb.append(""); } } if (arr.length == 0) { - sb.append(""); + sb.append(""); } sb.append("
" +
-                            (arr[i] == null ?
-                                arr[i] : htmlize(arr[i].toString())) +
-                            "
")
+                            .append(arr[i] == null ?
+                                    arr[i] : htmlize(arr[i].toString()))
+                            .append("
" +
-                            (arr[i] == null ?
-                                arr[i] : htmlize(arr[i].toString())) +
-                            "
")
+                            .append(arr[i] == null ?
+                                    arr[i] : htmlize(arr[i].toString()))
+                            .append("
"); arrayEditor.setText(sb.toString()); diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XTree.java --- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java Sun Aug 10 18:02:01 2014 -0300 @@ -507,13 +507,13 @@ // key order defined by the "orderedKeyPropertyList" for (String key : orderedKeyPropertyList) { if (map.containsKey(key)) { - sb.append(key + "=" + map.get(key) + ","); + sb.append(key).append("=").append(map.get(key)).append(","); map.remove(key); } } // Add the remaining key/value pairs to the buffer for (Map.Entry entry : map.entrySet()) { - sb.append(entry.getKey() + "=" + entry.getValue() + ","); + sb.append(entry.getKey()).append("=").append(entry.getValue()).append(","); } String orderedKeyPropertyListString = sb.toString(); orderedKeyPropertyListString = orderedKeyPropertyListString.substring( @@ -622,7 +622,7 @@ // StringBuilder sb = new StringBuilder(); for (MBeanParameterInfo mbpi : mboi.getSignature()) { - sb.append(mbpi.getType() + ","); + sb.append(mbpi.getType()).append(","); } String signature = sb.toString(); if (signature.length() > 0) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jps/Jps.java --- a/src/share/classes/sun/tools/jps/Jps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jps/Jps.java Sun Aug 10 18:02:01 2014 -0300 @@ -92,28 +92,28 @@ vm = monitoredHost.getMonitoredVm(id, 0); errorString = " -- main class information unavailable"; - output.append(" " + MonitoredVmUtil.mainClass(vm, + output.append(" ").append(MonitoredVmUtil.mainClass(vm, arguments.showLongPaths())); if (arguments.showMainArgs()) { errorString = " -- main args information unavailable"; String mainArgs = MonitoredVmUtil.mainArgs(vm); if (mainArgs != null && mainArgs.length() > 0) { - output.append(" " + mainArgs); + output.append(" ").append(mainArgs); } } if (arguments.showVmArgs()) { errorString = " -- jvm args information unavailable"; String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) { - output.append(" " + jvmArgs); + output.append(" ").append(jvmArgs); } } if (arguments.showVmFlags()) { errorString = " -- jvm flags information unavailable"; String jvmFlags = MonitoredVmUtil.jvmFlags(vm); if (jvmFlags != null && jvmFlags.length() > 0) { - output.append(" " + jvmFlags); + output.append(" ").append(jvmFlags); } } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/RawOutputFormatter.java --- a/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Sun Aug 10 18:02:01 2014 -0300 @@ -50,7 +50,7 @@ StringBuilder headerBuilder = new StringBuilder(); for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { Monitor m = i.next(); - headerBuilder.append(m.getName() + " "); + headerBuilder.append(m.getName()).append(" "); } header = headerBuilder.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/SyntaxException.java --- a/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/SyntaxException.java Sun Aug 10 18:02:01 2014 -0300 @@ -65,7 +65,7 @@ public SyntaxException(int lineno, Set expected, Token found) { StringBuilder msg = new StringBuilder(); - msg.append("Syntax error at line " + lineno + ": Expected one of \'"); + msg.append("Syntax error at line ").append(lineno).append(": Expected one of \'"); boolean first = true; for (Iterator i = expected.iterator(); i.hasNext(); /* empty */) { @@ -74,11 +74,11 @@ msg.append(keyWord); first = false; } else { - msg.append("|" + keyWord); + msg.append("|").append(keyWord); } } - msg.append("\', Found " + found.toMessage()); + msg.append("\', Found ").append(found.toMessage()); message = msg.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/Token.java --- a/src/share/classes/sun/tools/jstat/Token.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/Token.java Sun Aug 10 18:02:01 2014 -0300 @@ -89,18 +89,18 @@ sb.append("ttype=TT_EOF"); break; case StreamTokenizer.TT_NUMBER: - sb.append("ttype=TT_NUM,").append("nval="+nval); + sb.append("ttype=TT_NUM,").append("nval=").append(nval); break; case StreamTokenizer.TT_WORD: if (sval == null) { sb.append("ttype=TT_WORD:IDENTIFIER"); } else { - sb.append("ttype=TT_WORD:").append("sval="+sval); + sb.append("ttype=TT_WORD:").append("sval=").append(sval); } break; default: if (ttype == (int)'"') { - sb.append("ttype=TT_STRING:").append("sval="+sval); + sb.append("ttype=TT_STRING:").append("sval=").append(sval); } else { sb.append("ttype=TT_CHAR:").append((char)ttype); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstatd/RemoteHostImpl.java --- a/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Sun Aug 10 18:02:01 2014 -0300 @@ -68,7 +68,7 @@ sb.append("local://").append(lvmid).append("@localhost"); if (mode != null) { - sb.append("?mode=" + mode); + sb.append("?mode=").append(mode); } String vmidStr = sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/security/acl/AclEntryImpl.java --- a/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/acl/AclEntryImpl.java Sun Aug 10 18:02:01 2014 -0300 @@ -147,7 +147,7 @@ s.append("Group."); else s.append("User."); - s.append(user + "="); + s.append(user).append("="); Enumeration e = permissions(); while(e.hasMoreElements()) { Permission p = e.nextElement(); diff -r dde9f5cfde5f src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java --- a/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Sun Aug 10 18:02:01 2014 -0300 @@ -640,8 +640,7 @@ for (int i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append("0").append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs/SigningCertificateInfo.java --- a/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Sun Aug 10 18:02:01 2014 -0300 @@ -158,8 +158,8 @@ } sb.append(hexDumper.encode(certHash)); if (issuer != null && serialNumber != null) { - sb.append("\n\tIssuer: " + issuer + "\n"); - sb.append("\t" + serialNumber); + sb.append("\n\tIssuer: ").append(issuer).append("\n"); + sb.append("\t").append(serialNumber); } sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs11/P11KeyStore.java --- a/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs11/P11KeyStore.java Sun Aug 10 18:02:01 2014 -0300 @@ -196,24 +196,24 @@ } else if (type == ATTR_CLASS_CERT) { sb.append("\ttype=[trusted cert]\n"); } - sb.append("\tlabel=[" + label + "]\n"); + sb.append("\tlabel=[").append(label).append("]\n"); if (id == null) { sb.append("\tid=[null]\n"); } else { - sb.append("\tid=" + P11KeyStore.getID(id) + "\n"); + sb.append("\tid=").append(P11KeyStore.getID(id)).append("\n"); } - sb.append("\ttrusted=[" + trusted + "]\n"); - sb.append("\tmatched=[" + matched + "]\n"); + sb.append("\ttrusted=[").append(trusted).append("]\n"); + sb.append("\tmatched=[").append(matched).append("]\n"); if (cert == null) { sb.append("\tcert=[null]\n"); } else { - sb.append("\tcert=[\tsubject: " + - cert.getSubjectX500Principal() + - "\n\t\tissuer: " + - cert.getIssuerX500Principal() + - "\n\t\tserialNum: " + - cert.getSerialNumber().toString() + - "]"); + sb.append("\tcert=[\tsubject: ") + .append(cert.getSubjectX500Principal()) + .append("\n\t\tissuer: ") + .append(cert.getIssuerX500Principal()) + .append("\n\t\tserialNum: ") + .append(cert.getSerialNumber().toString()) + .append("]"); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/PolicyFile.java --- a/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/PolicyFile.java Sun Aug 10 18:02:01 2014 -0300 @@ -1500,8 +1500,7 @@ if (i != 0) { sb.append(", "); } - sb.append(principalInfo[i][0] + " " + - "\"" + principalInfo[i][1] + "\""); + sb.append(principalInfo[i][0]).append(" ").append("\"").append(principalInfo[i][1]).append("\""); } if (pli.hasNext()) { sb.append(", "); @@ -1776,9 +1775,9 @@ if (principals != null && principals.length > 0) { StringBuilder palBuf = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palBuf.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append("\""); if (i < principals.length-1) palBuf.append(", "); else @@ -1884,7 +1883,7 @@ throw new Exception(form.format(source)); } - sb.append(X500PRINCIPAL + " \"" + suffix + "\""); + sb.append(X500PRINCIPAL + " \"").append(suffix).append("\""); startIndex = e+2; } else { MessageFormat form = new MessageFormat diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/CertId.java --- a/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/CertId.java Sun Aug 10 18:02:01 2014 -0300 @@ -223,13 +223,13 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertId \n"); - sb.append("Algorithm: " + hashAlgId.toString() +"\n"); + sb.append("Algorithm: ").append(hashAlgId.toString()).append("\n"); sb.append("issuerNameHash \n"); HexDumpEncoder encoder = new HexDumpEncoder(); sb.append(encoder.encode(issuerNameHash)); sb.append("\nissuerKeyHash: \n"); sb.append(encoder.encode(issuerKeyHash)); - sb.append("\n" + certSerialNumber.toString()); + sb.append("\n").append(certSerialNumber.toString()); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/OCSPResponse.java --- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Sun Aug 10 18:02:01 2014 -0300 @@ -812,14 +812,14 @@ StringBuilder sb = new StringBuilder(); sb.append("SingleResponse: \n"); sb.append(certId); - sb.append("\nCertStatus: "+ certStatus + "\n"); + sb.append("\nCertStatus: ").append(certStatus).append("\n"); if (certStatus == CertStatus.REVOKED) { - sb.append("revocationTime is " + revocationTime + "\n"); - sb.append("revocationReason is " + revocationReason + "\n"); + sb.append("revocationTime is ").append(revocationTime).append("\n"); + sb.append("revocationReason is ").append(revocationReason).append("\n"); } - sb.append("thisUpdate is " + thisUpdate + "\n"); + sb.append("thisUpdate is ").append(thisUpdate).append("\n"); if (nextUpdate != null) { - sb.append("nextUpdate is " + nextUpdate + "\n"); + sb.append("nextUpdate is ").append(nextUpdate).append("\n"); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java --- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Sun Aug 10 18:02:01 2014 -0300 @@ -124,7 +124,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Build Forward Flag: " + String.valueOf(buildForward) + "\n"); + sb.append(" Build Forward Flag: ").append(String.valueOf(buildForward)).append("\n"); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/HandshakeMessage.java --- a/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java Sun Aug 10 18:02:01 2014 -0300 @@ -1478,7 +1478,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/ServerNameExtension.java --- a/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/ServerNameExtension.java Sun Aug 10 18:02:01 2014 -0300 @@ -268,7 +268,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); for (SNIServerName sniName : sniMap.values()) { - sb.append("[" + sniName + "]"); + sb.append("[").append(sniName).append("]"); } return "Extension " + type + ", server_name: " + sb; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java --- a/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Sun Aug 10 18:02:01 2014 -0300 @@ -122,7 +122,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Sun Aug 10 18:02:01 2014 -0300 @@ -113,7 +113,7 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Extension " + type + ", curve names: {"); + sb.append("Extension ").append(type).append(", curve names: {"); boolean first = true; for (int curveId : curveIds) { if (first) { @@ -138,7 +138,7 @@ } else if (curveId == ARBITRARY_CHAR2) { sb.append("arbitrary_explicit_char2_curves"); } else { - sb.append("unknown curve " + curveId); + sb.append("unknown curve ").append(curveId); } } sb.append("}"); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/jarsigner/Main.java --- a/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/jarsigner/Main.java Sun Aug 10 18:02:01 2014 -0300 @@ -676,13 +676,12 @@ ((man.getAttributes(name) != null) || (man.getAttributes("./"+name) != null) || (man.getAttributes("/"+name) != null)); - sb.append( - (isSigned ? rb.getString("s") : rb.getString("SPACE")) + - (inManifest ? rb.getString("m") : rb.getString("SPACE")) + - (inStore ? rb.getString("k") : rb.getString("SPACE")) + - (inScope ? rb.getString("i") : rb.getString("SPACE")) + - ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") + - rb.getString("SPACE")); + sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE")) + .append(inManifest ? rb.getString("m") : rb.getString("SPACE")) + .append(inStore ? rb.getString("k") : rb.getString("SPACE")) + .append(inScope ? rb.getString("i") : rb.getString("SPACE")) + .append((inStoreOrScope & NOT_ALIAS) != 0 ? "X" : " ") + .append(rb.getString("SPACE")); sb.append("|"); } @@ -704,11 +703,11 @@ // Print no info for unsigned entries when -verbose:all, // to be consistent with old behavior. if (signatureRelated(name)) { - sb.append("\n" + tab + rb.getString( - ".Signature.related.entries.") + "\n\n"); + sb.append("\n").append(tab).append(rb.getString( + ".Signature.related.entries.")).append("\n\n"); } else { - sb.append("\n" + tab + rb.getString( - ".Unsigned.entries.") + "\n\n"); + sb.append("\n").append(tab).append(rb.getString( + ".Unsigned.entries.")).append("\n\n"); } } @@ -1605,8 +1604,8 @@ // No more warning, we alreay have hasExpiredCert or notYetValidCert } else { chainNotValidated = true; - sb.append(tab + rb.getString(".CertPath.not.validated.") + - e.getLocalizedMessage() + "]\n"); // TODO + sb.append(tab).append(rb.getString(".CertPath.not.validated.")) + .append(e.getLocalizedMessage()).append("]\n"); // TODO } } String result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/policytool/PolicyTool.java --- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java Sun Aug 10 18:02:01 2014 -0300 @@ -980,8 +980,9 @@ grantEntry.principals.listIterator(); while (list.hasNext()) { PolicyParser.PrincipalEntry pppe = list.next(); - sb.append(" Principal " + pppe.getDisplayClass() + " " + - pppe.getDisplayName(true)); + sb.append(" Principal ").append(pppe.getDisplayClass()) + .append(" ") + .append(pppe.getDisplayName(true)); if (list.hasNext()) sb.append(", "); } result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/AVA.java --- a/src/share/classes/sun/security/x509/AVA.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/AVA.java Sun Aug 10 18:02:01 2014 -0300 @@ -1147,7 +1147,7 @@ // Emit the string ... quote it if needed // if string is already quoted, don't re-quote if (!alreadyQuoted && quoteNeeded) { - retval.append("\"" + sbuffer.toString() + "\""); + retval.append("\"").append(sbuffer.toString()).append("\""); } else { retval.append(sbuffer.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPoint.java --- a/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPoint.java Sun Aug 10 18:02:01 2014 -0300 @@ -381,22 +381,22 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPoint:\n " + fullName + "\n"); + sb.append("DistributionPoint:\n ").append(fullName).append("\n"); } if (relativeName != null) { - sb.append("DistributionPoint:\n " + relativeName + "\n"); + sb.append("DistributionPoint:\n ").append(relativeName).append("\n"); } if (reasonFlags != null) { sb.append(" ReasonFlags:\n"); for (int i = 0; i < reasonFlags.length; i++) { if (reasonFlags[i]) { - sb.append(" " + reasonToString(i) + "\n"); + sb.append(" ").append(reasonToString(i)).append("\n"); } } } if (crlIssuer != null) { - sb.append(" CRLIssuer:" + crlIssuer + "\n"); + sb.append(" CRLIssuer:").append(crlIssuer).append("\n"); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPointName.java --- a/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPointName.java Sun Aug 10 18:02:01 2014 -0300 @@ -231,10 +231,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPointName:\n " + fullName + "\n"); + sb.append("DistributionPointName:\n ").append(fullName).append("\n"); } else { - sb.append("DistributionPointName:\n " + relativeName + "\n"); + sb.append("DistributionPointName:\n ").append(relativeName).append("\n"); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/PolicyInformation.java --- a/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/PolicyInformation.java Sun Aug 10 18:02:01 2014 -0300 @@ -259,7 +259,7 @@ */ public String toString() { StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString()); - s.append(policyQualifiers + " ]\n"); + s.append(policyQualifiers).append(" ]\n"); return s.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLEntryImpl.java --- a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Sun Aug 10 18:02:01 2014 -0300 @@ -292,17 +292,17 @@ StringBuilder sb = new StringBuilder(); sb.append(serialNumber.toString()); - sb.append(" On: " + revocationDate.toString()); + sb.append(" On: ").append(revocationDate.toString()); if (certIssuer != null) { - sb.append("\n Certificate issuer: " + certIssuer); + sb.append("\n Certificate issuer: ").append(certIssuer); } if (extensions != null) { Collection allEntryExts = extensions.getAllExtensions(); Extension[] exts = allEntryExts.toArray(new Extension[0]); - sb.append("\n CRL Entry Extensions: " + exts.length); + sb.append("\n CRL Entry Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n [" + (i+1) + "]: "); + sb.append("\n [").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -313,9 +313,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append("\n"); } } else sb.append(ext.toString()); //sub-class exists diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLImpl.java --- a/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLImpl.java Sun Aug 10 18:02:01 2014 -0300 @@ -537,31 +537,32 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("X.509 CRL v" + (version+1) + "\n"); + sb.append("X.509 CRL v").append(version + 1).append("\n"); if (sigAlgId != null) - sb.append("Signature Algorithm: " + sigAlgId.toString() + - ", OID=" + (sigAlgId.getOID()).toString() + "\n"); + sb.append("Signature Algorithm: ").append(sigAlgId.toString()) + .append(", OID=") + .append((sigAlgId.getOID()).toString()).append("\n"); if (issuer != null) - sb.append("Issuer: " + issuer.toString() + "\n"); + sb.append("Issuer: ").append(issuer.toString()).append("\n"); if (thisUpdate != null) - sb.append("\nThis Update: " + thisUpdate.toString() + "\n"); + sb.append("\nThis Update: ").append(thisUpdate.toString()).append("\n"); if (nextUpdate != null) - sb.append("Next Update: " + nextUpdate.toString() + "\n"); + sb.append("Next Update: ").append(nextUpdate.toString()).append("\n"); if (revokedList.isEmpty()) sb.append("\nNO certificates have been revoked\n"); else { - sb.append("\nRevoked Certificates: " + revokedList.size()); + sb.append("\nRevoked Certificates: ").append(revokedList.size()); int i = 1; for (X509CRLEntry entry: revokedList) { - sb.append("\n[" + i++ + "] " + entry.toString()); + sb.append("\n[").append(i++).append("] ").append(entry.toString()); } } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Object[] objs = allExts.toArray(); - sb.append("\nCRL Extensions: " + objs.length); + sb.append("\nCRL Extensions: ").append(objs.length); for (int i = 0; i < objs.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = (Extension)objs[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -572,9 +573,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append("\n"); } } else sb.append(ext.toString()); // sub-class exists @@ -585,8 +585,7 @@ } if (signature != null) { HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) - + "\n"); + sb.append("\nSignature:\n").append(encoder.encodeBuffer(signature)).append("\n"); } else sb.append("NOT signed yet\n"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertImpl.java --- a/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertImpl.java Sun Aug 10 18:02:01 2014 -0300 @@ -802,11 +802,11 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(info.toString() + "\n"); - sb.append(" Algorithm: [" + algId.toString() + "]\n"); + sb.append(info.toString()).append("\n"); + sb.append(" Algorithm: [").append(algId.toString()).append("]\n"); HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); + sb.append(" Signature:\n").append(encoder.encodeBuffer(signature)); sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertInfo.java --- a/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertInfo.java Sun Aug 10 18:02:01 2014 -0300 @@ -298,27 +298,27 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(" " + version.toString() + "\n"); - sb.append(" Subject: " + subject.toString() + "\n"); - sb.append(" Signature Algorithm: " + algId.toString() + "\n"); - sb.append(" Key: " + pubKey.toString() + "\n"); - sb.append(" " + interval.toString() + "\n"); - sb.append(" Issuer: " + issuer.toString() + "\n"); - sb.append(" " + serialNum.toString() + "\n"); + sb.append(" ").append(version.toString()).append("\n"); + sb.append(" Subject: ").append(subject.toString()).append("\n"); + sb.append(" Signature Algorithm: ").append(algId.toString()).append("\n"); + sb.append(" Key: ").append(pubKey.toString()).append("\n"); + sb.append(" ").append(interval.toString()).append("\n"); + sb.append(" Issuer: ").append(issuer.toString()).append("\n"); + sb.append(" ").append(serialNum.toString()).append("\n"); // optional v2, v3 extras if (issuerUniqueId != null) { - sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n"); + sb.append(" Issuer Id:\n").append(issuerUniqueId.toString()).append("\n"); } if (subjectUniqueId != null) { - sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n"); + sb.append(" Subject Id:\n").append(subjectUniqueId.toString()).append("\n"); } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Extension[] exts = allExts.toArray(new Extension[0]); - sb.append("\nCertificate Extensions: " + exts.length); + sb.append("\nCertificate Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -329,9 +329,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append("\n"); } } else sb.append(ext.toString()); //sub-class exists @@ -341,10 +340,10 @@ } Map invalid = extensions.getUnparseableExtensions(); if (invalid.isEmpty() == false) { - sb.append("\nUnparseable certificate extensions: " + invalid.size()); + sb.append("\nUnparseable certificate extensions: ").append(invalid.size()); int i = 1; for (Extension ext : invalid.values()) { - sb.append("\n[" + (i++) + "]: "); + sb.append("\n[").append(i++).append("]: "); sb.append(ext); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java --- a/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Sun Aug 10 18:02:01 2014 -0300 @@ -465,10 +465,10 @@ private static void appendIfLiteralAddress(String addr, StringBuffer sb) { if (IPAddressUtil.isIPv4LiteralAddress(addr)) { - sb.append("dns://" + addr + " "); + sb.append("dns://").append(addr).append(" "); } else { if (IPAddressUtil.isIPv6LiteralAddress(addr)) { - sb.append("dns://[" + addr + "] "); + sb.append("dns://[").append(addr).append("] "); } } } diff -r dde9f5cfde5f src/share/classes/sun/net/www/HeaderParser.java --- a/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/HeaderParser.java Sun Aug 10 18:02:01 2014 -0300 @@ -221,14 +221,14 @@ public String toString () { Iterator k = keys(); StringBuffer sbuf = new StringBuffer(); - sbuf.append ("{size="+asize+" nkeys="+nkeys+" "); + sbuf.append("{size=").append(asize).append(" nkeys=").append(nkeys).append(" "); for (int i=0; k.hasNext(); i++) { String key = k.next(); String val = findValue (i); if (val != null && "".equals (val)) { val = null; } - sbuf.append (" {"+key+(val==null?"":","+val)+"}"); + sbuf.append(" {").append(key).append(val == null ? "" : "," + val).append("}"); if (k.hasNext()) { sbuf.append (","); } diff -r dde9f5cfde5f src/share/classes/sun/net/www/MimeEntry.java --- a/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/MimeEntry.java Sun Aug 10 18:02:01 2014 -0300 @@ -288,7 +288,7 @@ int action = getAction(); if (action != MimeEntry.UNKNOWN) { - sb.append("action=" + actionKeywords[action]); + sb.append("action=").append(actionKeywords[action]); needSeparator = true; } @@ -297,7 +297,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("application=" + command); + sb.append("application=").append(command); needSeparator = true; } @@ -305,7 +305,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("icon=" + getImageFileName()); + sb.append("icon=").append(getImageFileName()); needSeparator = true; } @@ -314,7 +314,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("file_extensions=" + extensions); + sb.append("file_extensions=").append(extensions); needSeparator = true; } @@ -323,7 +323,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("description=" + description); + sb.append("description=").append(description); } return sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/management/Agent.java --- a/src/share/classes/sun/management/Agent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/Agent.java Sun Aug 10 18:02:00 2014 -0300 @@ -502,7 +502,7 @@ } else { StringBuilder message = new StringBuilder(params[0]); for (int i = 1; i < params.length; i++) { - message.append(" " + params[i]); + message.append(" ").append(params[i]); } error(key, message.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/management/MappedMXBeanType.java --- a/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/MappedMXBeanType.java Sun Aug 10 18:02:00 2014 -0300 @@ -289,7 +289,7 @@ if (et.isPrimitive()) { className = new StringBuilder(c.getName()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append("L").append(baseElementType.getTypeName()).append(";"); } try { mappedTypeClass = Class.forName(className.toString()); @@ -385,7 +385,7 @@ if (elementType instanceof Class && ((Class) elementType).isPrimitive()) { className = new StringBuilder(gat.toString()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append("L").append(baseElementType.getTypeName()).append(";"); } try { mappedTypeClass = Class.forName(className.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/launcher/LauncherHelper.java --- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Sun Aug 10 18:02:00 2014 -0300 @@ -370,8 +370,7 @@ outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1", vm)); outBuf = (isServerClass) - ? outBuf.append(",\n" + - getLocalizedMessage("java.launcher.ergo.message2") + "\n\n") + ? outBuf.append(",\n").append(getLocalizedMessage("java.launcher.ergo.message2")).append("\n\n") : outBuf.append(".\n\n"); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/font/AttributeValues.java --- a/src/share/classes/sun/font/AttributeValues.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/AttributeValues.java Sun Aug 10 18:02:00 2014 -0300 @@ -542,7 +542,7 @@ } } } - b.append("[btx=" + baselineTransform + ", ctx=" + charTransform + "]"); + b.append("[btx=").append(baselineTransform).append(", ctx=").append(charTransform).append("]"); b.append('}'); return b.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/Decoration.java --- a/src/share/classes/sun/font/Decoration.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/Decoration.java Sun Aug 10 18:02:00 2014 -0300 @@ -431,12 +431,12 @@ StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); - if (fgPaint != null) sb.append("fgPaint: " + fgPaint); - if (bgPaint != null) sb.append(" bgPaint: " + bgPaint); + if (fgPaint != null) sb.append("fgPaint: ").append(fgPaint); + if (bgPaint != null) sb.append(" bgPaint: ").append(bgPaint); if (swapColors) sb.append(" swapColors: true"); if (strikethrough) sb.append(" strikethrough: true"); - if (stdUnderline != null) sb.append(" stdUnderline: " + stdUnderline); - if (imUnderline != null) sb.append(" imUnderline: " + imUnderline); + if (stdUnderline != null) sb.append(" stdUnderline: ").append(stdUnderline); + if (imUnderline != null) sb.append(" imUnderline: ").append(imUnderline); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/StandardGlyphVector.java --- a/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/StandardGlyphVector.java Sun Aug 10 18:02:00 2014 -0300 @@ -1894,7 +1894,7 @@ } } catch(Exception e) { - buf.append(" " + e.getMessage()); + buf.append(" ").append(e.getMessage()); } buf.append("}"); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/swing/GroupLayout.java --- a/src/share/classes/javax/swing/GroupLayout.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/GroupLayout.java Sun Aug 10 18:02:00 2014 -0300 @@ -1239,15 +1239,12 @@ padding = ", userCreated=" + paddingSpring.getUserCreated() + ", matches=" + paddingSpring.getMatchDescription(); } - buffer.append(indent + spring.getClass().getName() + " " + - Integer.toHexString(spring.hashCode()) + " " + - origin + - ", size=" + spring.getSize() + - ", alignment=" + spring.getAlignment() + - " prefs=[" + spring.getMinimumSize(axis) + - " " + spring.getPreferredSize(axis) + - " " + spring.getMaximumSize(axis) + - padding + "]\n"); + buffer.append(indent).append(spring.getClass().getName()) + .append(" ").append(Integer.toHexString(spring.hashCode())).append(" ") + .append(origin).append(", size=").append(spring.getSize()).append(", alignment=") + .append(spring.getAlignment()).append(" prefs=[").append(spring.getMinimumSize(axis)).append(" ") + .append(spring.getPreferredSize(axis)).append(" ").append(spring.getMaximumSize(axis)) + .append(padding).append("]\n"); if (spring instanceof Group) { List springs = ((Group)spring).springs; indent += " "; diff -r dde9f5cfde5f src/share/classes/javax/swing/JColorChooser.java --- a/src/share/classes/javax/swing/JColorChooser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/JColorChooser.java Sun Aug 10 18:02:00 2014 -0300 @@ -545,8 +545,7 @@ protected String paramString() { StringBuilder chooserPanelsString = new StringBuilder(""); for (int i=0; i keys = keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); - sb.append(key + "=" + get(key) + ", "); + sb.append(key).append("=").append(get(key)).append(", "); } int length = sb.length(); if (length > 1) { diff -r dde9f5cfde5f src/share/classes/javax/swing/RepaintManager.java --- a/src/share/classes/javax/swing/RepaintManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/RepaintManager.java Sun Aug 10 18:02:00 2014 -0300 @@ -992,7 +992,7 @@ public synchronized String toString() { StringBuilder sb = new StringBuilder(); if(dirtyComponents != null) - sb.append("" + dirtyComponents); + sb.append("").append(dirtyComponents); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/swing/event/TreeModelEvent.java --- a/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/event/TreeModelEvent.java Sun Aug 10 18:02:00 2014 -0300 @@ -294,20 +294,19 @@ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(getClass().getName() + " " + - Integer.toString(hashCode())); + sb.append(getClass().getName()).append(" ").append(Integer.toString(hashCode())); if(path != null) - sb.append(" path " + path); + sb.append(" path ").append(path); if(childIndices != null) { sb.append(" indices [ "); for(int counter = 0; counter < childIndices.length; counter++) - sb.append(Integer.toString(childIndices[counter])+ " "); + sb.append(Integer.toString(childIndices[counter])).append(" "); sb.append("]"); } if(children != null) { sb.append(" children [ "); for(int counter = 0; counter < children.length; counter++) - sb.append(children[counter] + " "); + sb.append(children[counter]).append(" "); sb.append("]"); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Sun Aug 10 18:02:00 2014 -0300 @@ -1330,8 +1330,8 @@ for (Object obj : values) { String val = ((obj == null) ? "" : obj.toString()); - plainBuf.append(val + "\n"); - htmlBuf.append("

  • " + val + "\n"); + plainBuf.append(val).append("\n"); + htmlBuf.append("
  • ").append(val).append("\n"); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicListUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Sun Aug 10 18:02:00 2014 -0300 @@ -2948,8 +2948,8 @@ for (int i = 0; i < values.length; i++) { Object obj = values[i]; String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\n"); - htmlStr.append("
  • " + val + "\n"); + plainStr.append(val).append("\n"); + htmlStr.append("
  • ").append(val).append("\n"); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTableUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Sun Aug 10 18:02:00 2014 -0300 @@ -2230,8 +2230,8 @@ for (int col = 0; col < cols.length; col++) { Object obj = table.getValueAt(rows[row], cols[col]); String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\t"); - htmlStr.append(" " + val + "\n"); + plainStr.append(val).append("\t"); + htmlStr.append(" ").append(val).append("\n"); } // we want a newline at the end of each line and not a tab plainStr.deleteCharAt(plainStr.length() - 1).append("\n"); diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Sun Aug 10 18:02:00 2014 -0300 @@ -3618,8 +3618,8 @@ boolean leaf = model.isLeaf(node); String label = getDisplayString(path, true, leaf); - plainStr.append(label + "\n"); - htmlStr.append("
  • " + label + "\n"); + plainStr.append(label).append("\n"); + htmlStr.append("
  • ").append(label).append("\n"); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java --- a/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Sun Aug 10 18:02:00 2014 -0300 @@ -1160,13 +1160,13 @@ rows = rowMapper.getRowsForPaths(selection); else rows = null; - sb.append(getClass().getName() + " " + hashCode() + " [ "); + sb.append(getClass().getName()).append(" ").append(hashCode()).append(" [ "); for(int counter = 0; counter < selCount; counter++) { if(rows != null) - sb.append(selection[counter].toString() + "@" + - Integer.toString(rows[counter])+ " "); + sb.append(selection[counter].toString()).append("@") + .append(Integer.toString(rows[counter])).append(" "); else - sb.append(selection[counter].toString() + " "); + sb.append(selection[counter].toString()).append(" "); } sb.append("]"); return sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/AudioFileFormat.java --- a/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/AudioFileFormat.java Sun Aug 10 18:02:00 2014 -0300 @@ -276,19 +276,19 @@ //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() throws unexpected NullPointerException if (type != null) { - buf.append(type.toString() + " (." + type.getExtension() + ") file"); + buf.append(type.toString()).append(" (.").append(type.getExtension()).append(") file"); } else { buf.append("unknown file format"); } if (byteLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", byte length: " + byteLength); + buf.append(", byte length: ").append(byteLength); } - buf.append(", data format: " + format); + buf.append(", data format: ").append(format); if (frameLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", frame length: " + frameLength); + buf.append(", frame length: ").append(frameLength); } return new String(buf); diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/DataLine.java --- a/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/DataLine.java Sun Aug 10 18:02:00 2014 -0300 @@ -473,17 +473,17 @@ StringBuilder sb = new StringBuilder(); if ( (formats.length == 1) && (formats[0] != null) ) { - sb.append(" supporting format " + formats[0]); + sb.append(" supporting format ").append(formats[0]); } else if (getFormats().length > 1) { - sb.append(" supporting " + getFormats().length + " audio formats"); + sb.append(" supporting ").append(getFormats().length).append(" audio formats"); } if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) { - sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes"); + sb.append(", and buffers of ").append(minBufferSize).append(" to ").append(maxBufferSize).append(" bytes"); } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) { - sb.append(", and buffers of at least " + minBufferSize + " bytes"); + sb.append(", and buffers of at least ").append(minBufferSize).append(" bytes"); } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) { - sb.append(", and buffers of up to " + minBufferSize + " bytes"); + sb.append(", and buffers of up to ").append(minBufferSize).append(" bytes"); } return new String(super.toString() + sb); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/security/auth/kerberos/KerberosTicket.java --- a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Sun Aug 10 18:02:00 2014 -0300 @@ -651,8 +651,7 @@ StringBuilder caddrString = new StringBuilder(); if (clientAddresses != null) { for (int i = 0; i < clientAddresses.length; i++) { - caddrString.append("clientAddresses[" + i + "] = " + - clientAddresses[i].toString()); + caddrString.append("clientAddresses[").append(i).append("] = ").append(clientAddresses[i].toString()); } } return ("Ticket (hex) = " + "\n" + -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/naming/BinaryRefAddr.java --- a/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/BinaryRefAddr.java Sun Aug 10 18:02:00 2014 -0300 @@ -169,7 +169,7 @@ str.append("AddressContents: "); for (int i = 0; i= 32) str.append(" ...\n"); diff -r dde9f5cfde5f src/share/classes/javax/naming/NameImpl.java --- a/src/share/classes/javax/naming/NameImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/NameImpl.java Sun Aug 10 18:02:00 2014 -0300 @@ -170,7 +170,7 @@ endQuote = one ? syntaxEndQuote1 : syntaxEndQuote2; i += syntaxTypevalSeparator.length(); - answer.append(syntaxTypevalSeparator+beginQuote); // add back + answer.append(syntaxTypevalSeparator).append(beginQuote); // add back // consume string until matching quote for (i += beginQuote.length(); diff -r dde9f5cfde5f src/share/classes/javax/naming/RefAddr.java --- a/src/share/classes/javax/naming/RefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/RefAddr.java Sun Aug 10 18:02:00 2014 -0300 @@ -141,7 +141,7 @@ public String toString(){ StringBuilder str = new StringBuilder("Type: " + addrType + "\n"); - str.append("Content: " + getContent() + "\n"); + str.append("Content: ").append(getContent()).append("\n"); return (str.toString()); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/crypto/CryptoPermission.java --- a/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/crypto/CryptoPermission.java Sun Aug 10 18:01:59 2014 -0300 @@ -370,18 +370,16 @@ */ public String toString() { StringBuilder buf = new StringBuilder(100); - buf.append("(CryptoPermission " + alg + " " + maxKeySize); + buf.append("(CryptoPermission ").append(alg).append(" ").append(maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { - buf.append(" , effective " + - ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits()); + buf.append(" , effective ").append(((RC2ParameterSpec) algParamSpec).getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { - buf.append(" , rounds " + - ((RC5ParameterSpec)algParamSpec).getRounds()); + buf.append(" , rounds ").append(((RC5ParameterSpec) algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL - buf.append(" " + exemptionMechanism); + buf.append(" ").append(exemptionMechanism); } buf.append(")"); return buf.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/management/MBeanPermission.java --- a/src/share/classes/javax/management/MBeanPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/MBeanPermission.java Sun Aug 10 18:02:00 2014 -0300 @@ -455,7 +455,7 @@ name.append(className); if (member == null) member = "-"; - name.append("#" + member); + name.append("#").append(member); if (objectName == null) name.append("[-]"); else diff -r dde9f5cfde5f src/share/classes/javax/management/modelmbean/RequiredModelMBean.java --- a/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Sun Aug 10 18:02:00 2014 -0300 @@ -716,13 +716,12 @@ } retStr.append("\nMBeanInfo for ModelMBean is:"); - retStr.append("\nCLASSNAME: \t"+ info.getClassName()); - retStr.append("\nDESCRIPTION: \t"+ info.getDescription()); + retStr.append("\nCLASSNAME: \t").append(info.getClassName()); + retStr.append("\nDESCRIPTION: \t").append(info.getDescription()); try { - retStr.append("\nMBEAN DESCRIPTOR: \t"+ - info.getMBeanDescriptor()); + retStr.append("\nMBEAN DESCRIPTOR: \t").append(info.getMBeanDescriptor()); } catch (Exception e) { retStr.append("\nMBEAN DESCRIPTOR: \t" + " is invalid"); } @@ -734,13 +733,12 @@ for (int i=0; i { /* Serial version */ diff -r dde9f5cfde5f src/share/classes/javax/management/relation/Role.java --- a/src/share/classes/javax/management/relation/Role.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/Role.java Sun Aug 10 18:02:00 2014 -0300 @@ -227,7 +227,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + name + "; role value: "); + result.append("role name: ").append(name).append("; role value: "); for (Iterator objNameIter = objectNameList.iterator(); objNameIter.hasNext();) { ObjectName currObjName = objNameIter.next(); diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleInfo.java --- a/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleInfo.java Sun Aug 10 18:02:00 2014 -0300 @@ -456,13 +456,13 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role info name: " + name); - result.append("; isReadable: " + isReadable); - result.append("; isWritable: " + isWritable); - result.append("; description: " + description); - result.append("; minimum degree: " + minDegree); - result.append("; maximum degree: " + maxDegree); - result.append("; MBean class: " + referencedMBeanClassName); + result.append("role info name: ").append(name); + result.append("; isReadable: ").append(isReadable); + result.append("; isWritable: ").append(isWritable); + result.append("; description: ").append(description); + result.append("; minimum degree: ").append(minDegree); + result.append("; maximum degree: ").append(maxDegree); + result.append("; MBean class: ").append(referencedMBeanClassName); return result.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleUnresolved.java --- a/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleUnresolved.java Sun Aug 10 18:02:00 2014 -0300 @@ -282,7 +282,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + roleName); + result.append("role name: ").append(roleName); if (roleValue != null) { result.append("; value: "); for (Iterator objNameIter = roleValue.iterator(); @@ -294,7 +294,7 @@ } } } - result.append("; problem type: " + problemType); + result.append("; problem type: ").append(problemType); return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/util/Scanner.java --- a/src/share/classes/java/util/Scanner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/Scanner.java Sun Aug 10 18:01:59 2014 -0300 @@ -1304,20 +1304,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.Scanner"); - sb.append("[delimiters=" + delimPattern + "]"); - sb.append("[position=" + position + "]"); - sb.append("[match valid=" + matchValid + "]"); - sb.append("[need input=" + needInput + "]"); - sb.append("[source closed=" + sourceClosed + "]"); - sb.append("[skipped=" + skipped + "]"); - sb.append("[group separator=" + groupSeparator + "]"); - sb.append("[decimal separator=" + decimalSeparator + "]"); - sb.append("[positive prefix=" + positivePrefix + "]"); - sb.append("[negative prefix=" + negativePrefix + "]"); - sb.append("[positive suffix=" + positiveSuffix + "]"); - sb.append("[negative suffix=" + negativeSuffix + "]"); - sb.append("[NaN string=" + nanString + "]"); - sb.append("[infinity string=" + infinityString + "]"); + sb.append("[delimiters=").append(delimPattern).append("]"); + sb.append("[position=").append(position).append("]"); + sb.append("[match valid=").append(matchValid).append("]"); + sb.append("[need input=").append(needInput).append("]"); + sb.append("[source closed=").append(sourceClosed).append("]"); + sb.append("[skipped=").append(skipped).append("]"); + sb.append("[group separator=").append(groupSeparator).append("]"); + sb.append("[decimal separator=").append(decimalSeparator).append("]"); + sb.append("[positive prefix=").append(positivePrefix).append("]"); + sb.append("[negative prefix=").append(negativePrefix).append("]"); + sb.append("[positive suffix=").append(positiveSuffix).append("]"); + sb.append("[negative suffix=").append(negativeSuffix).append("]"); + sb.append("[NaN string=").append(nanString).append("]"); + sb.append("[infinity string=").append(infinityString).append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Matcher.java --- a/src/share/classes/java/util/regex/Matcher.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Matcher.java Sun Aug 10 18:01:59 2014 -0300 @@ -1295,9 +1295,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.regex.Matcher"); - sb.append("[pattern=" + pattern()); + sb.append("[pattern=").append(pattern()); sb.append(" region="); - sb.append(regionStart() + "," + regionEnd()); + sb.append(regionStart()).append(",").append(regionEnd()); sb.append(" lastmatch="); if ((first >= 0) && (group() != null)) { sb.append(group()); diff -r dde9f5cfde5f src/share/classes/java/util/regex/Pattern.java --- a/src/share/classes/java/util/regex/Pattern.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Pattern.java Sun Aug 10 18:01:59 2014 -0300 @@ -1488,10 +1488,10 @@ for(int x=0; x0) - result.append("|"+next); + result.append("|").append(next); next = composeOneStep(next); if (next != null) - result.append("|"+produceEquivalentAlternation(next)); + result.append("|").append(produceEquivalentAlternation(next)); } return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/text/ChoiceFormat.java --- a/src/share/classes/java/text/ChoiceFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/text/ChoiceFormat.java Sun Aug 10 18:01:59 2014 -0300 @@ -272,7 +272,7 @@ double tryLess = Math.abs(Math.IEEEremainder(less, 1.0d)); if (tryLessOrEqual < tryLess) { - result.append(""+choiceLimits[i]); + result.append("").append(choiceLimits[i]); result.append('#'); } else { if (choiceLimits[i] == Double.POSITIVE_INFINITY) { @@ -280,7 +280,7 @@ } else if (choiceLimits[i] == Double.NEGATIVE_INFINITY) { result.append("-\u221E"); } else { - result.append(""+less); + result.append("").append(less); } result.append('<'); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/security/CodeSigner.java --- a/src/share/classes/java/security/CodeSigner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSigner.java Sun Aug 10 18:01:59 2014 -0300 @@ -156,9 +156,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("Signer: " + signerCertPath.getCertificates().get(0)); + sb.append("Signer: ").append(signerCertPath.getCertificates().get(0)); if (timestamp != null) { - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); } sb.append(")"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/java/security/CodeSource.java --- a/src/share/classes/java/security/CodeSource.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSource.java Sun Aug 10 18:01:59 2014 -0300 @@ -468,12 +468,12 @@ if (this.certs != null && this.certs.length > 0) { for (int i = 0; i < this.certs.length; i++) { - sb.append( " " + this.certs[i]); + sb.append(" ").append(this.certs[i]); } } else if (this.signers != null && this.signers.length > 0) { for (int i = 0; i < this.signers.length; i++) { - sb.append( " " + this.signers[i]); + sb.append(" ").append(this.signers[i]); } } else { sb.append(" "); diff -r dde9f5cfde5f src/share/classes/java/security/KeyStore.java --- a/src/share/classes/java/security/KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/KeyStore.java Sun Aug 10 18:01:59 2014 -0300 @@ -610,8 +610,7 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Private key entry and certificate chain with " - + chain.length + " elements:\r\n"); + sb.append("Private key entry and certificate chain with ").append(chain.length).append(" elements:\r\n"); for (Certificate cert : chain) { sb.append(cert); sb.append("\r\n"); diff -r dde9f5cfde5f src/share/classes/java/security/PermissionCollection.java --- a/src/share/classes/java/security/PermissionCollection.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/PermissionCollection.java Sun Aug 10 18:01:59 2014 -0300 @@ -179,7 +179,7 @@ public String toString() { Enumeration enum_ = elements(); StringBuilder sb = new StringBuilder(); - sb.append(super.toString()+" (\n"); + sb.append(super.toString()).append(" (\n"); while (enum_.hasMoreElements()) { try { sb.append(" "); diff -r dde9f5cfde5f src/share/classes/java/security/ProtectionDomain.java --- a/src/share/classes/java/security/ProtectionDomain.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/ProtectionDomain.java Sun Aug 10 18:01:59 2014 -0300 @@ -291,9 +291,9 @@ StringBuilder palBuf = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palBuf.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append("\""); if (i < principals.length-1) palBuf.append(",\n"); else diff -r dde9f5cfde5f src/share/classes/java/security/Timestamp.java --- a/src/share/classes/java/security/Timestamp.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/Timestamp.java Sun Aug 10 18:01:59 2014 -0300 @@ -143,10 +143,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); List certs = signerCertPath.getCertificates(); if (!certs.isEmpty()) { - sb.append("TSA: " + certs.get(0)); + sb.append("TSA: ").append(certs.get(0)); } else { sb.append("TSA: "); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CertPath.java --- a/src/share/classes/java/security/cert/CertPath.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CertPath.java Sun Aug 10 18:01:59 2014 -0300 @@ -224,17 +224,16 @@ Iterator stringIterator = getCertificates().iterator(); - sb.append("\n" + type + " Cert Path: length = " - + getCertificates().size() + ".\n"); + sb.append("\n").append(type).append(" Cert Path: length = ").append(getCertificates().size()).append(".\n"); sb.append("[\n"); int i = 1; while (stringIterator.hasNext()) { - sb.append("==========================================" - + "===============Certificate " + i + " start.\n"); + sb.append("==========================================" + "===============Certificate ") + .append(i).append(" start.\n"); Certificate stringCert = stringIterator.next(); sb.append(stringCert.toString()); - sb.append("\n========================================" - + "=================Certificate " + i + " end.\n\n\n"); + sb.append("\n========================================" + "=================Certificate ") + .append(i).append(" end.\n\n\n"); i++; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CollectionCertStoreParameters.java --- a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Sun Aug 10 18:01:59 2014 -0300 @@ -134,7 +134,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CollectionCertStoreParameters: [\n"); - sb.append(" collection: " + coll + "\n"); + sb.append(" collection: ").append(coll).append("\n"); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/LDAPCertStoreParameters.java --- a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Sun Aug 10 18:01:59 2014 -0300 @@ -141,8 +141,8 @@ StringBuilder sb = new StringBuilder(); sb.append("LDAPCertStoreParameters: [\n"); - sb.append(" serverName: " + serverName + "\n"); - sb.append(" port: " + port + "\n"); + sb.append(" serverName: ").append(serverName).append("\n"); + sb.append(" port: ").append(port).append("\n"); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXBuilderParameters.java --- a/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXBuilderParameters.java Sun Aug 10 18:01:59 2014 -0300 @@ -192,7 +192,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Maximum Path Length: " + maxPathLength + "\n"); + sb.append(" Maximum Path Length: ").append(maxPathLength).append("\n"); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Sun Aug 10 18:01:59 2014 -0300 @@ -109,10 +109,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathBuilderResult: [\n"); - sb.append(" Certification Path: " + certPath + "\n"); - sb.append(" Trust Anchor: " + getTrustAnchor().toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(getPolicyTree()) + "\n"); - sb.append(" Subject Public Key: " + getPublicKey() + "\n"); + sb.append(" Certification Path: ").append(certPath).append("\n"); + sb.append(" Trust Anchor: ").append(getTrustAnchor().toString()).append("\n"); + sb.append(" Policy Tree: ").append(String.valueOf(getPolicyTree())).append("\n"); + sb.append(" Subject Public Key: ").append(getPublicKey()).append("\n"); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Sun Aug 10 18:01:59 2014 -0300 @@ -150,9 +150,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathValidatorResult: [\n"); - sb.append(" Trust Anchor: " + trustAnchor.toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(policyTree) + "\n"); - sb.append(" Subject Public Key: " + subjectPublicKey + "\n"); + sb.append(" Trust Anchor: ").append(trustAnchor.toString()).append("\n"); + sb.append(" Policy Tree: ").append(String.valueOf(policyTree)).append("\n"); + sb.append(" Subject Public Key: ").append(subjectPublicKey).append("\n"); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXParameters.java --- a/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXParameters.java Sun Aug 10 18:01:59 2014 -0300 @@ -698,8 +698,7 @@ /* start with trusted anchor info */ if (unmodTrustAnchors != null) { - sb.append(" Trust Anchors: " + unmodTrustAnchors.toString() - + "\n"); + sb.append(" Trust Anchors: ").append(unmodTrustAnchors.toString()).append("\n"); } /* now, append initial state information */ @@ -707,29 +706,27 @@ if (unmodInitialPolicies.isEmpty()) { sb.append(" Initial Policy OIDs: any\n"); } else { - sb.append(" Initial Policy OIDs: [" - + unmodInitialPolicies.toString() + "]\n"); + sb.append(" Initial Policy OIDs: [").append(unmodInitialPolicies.toString()).append("]\n"); } } /* now, append constraints on all certificates in the path */ - sb.append(" Validity Date: " + String.valueOf(date) + "\n"); - sb.append(" Signature Provider: " + String.valueOf(sigProvider) + "\n"); - sb.append(" Default Revocation Enabled: " + revocationEnabled + "\n"); - sb.append(" Explicit Policy Required: " + explicitPolicyRequired + "\n"); - sb.append(" Policy Mapping Inhibited: " + policyMappingInhibited + "\n"); - sb.append(" Any Policy Inhibited: " + anyPolicyInhibited + "\n"); - sb.append(" Policy Qualifiers Rejected: " + policyQualifiersRejected + "\n"); + sb.append(" Validity Date: ").append(String.valueOf(date)).append("\n"); + sb.append(" Signature Provider: ").append(String.valueOf(sigProvider)).append("\n"); + sb.append(" Default Revocation Enabled: ").append(revocationEnabled).append("\n"); + sb.append(" Explicit Policy Required: ").append(explicitPolicyRequired).append("\n"); + sb.append(" Policy Mapping Inhibited: ").append(policyMappingInhibited).append("\n"); + sb.append(" Any Policy Inhibited: ").append(anyPolicyInhibited).append("\n"); + sb.append(" Policy Qualifiers Rejected: ").append(policyQualifiersRejected).append("\n"); /* now, append target cert requirements */ - sb.append(" Target Cert Constraints: " + String.valueOf(certSelector) + "\n"); + sb.append(" Target Cert Constraints: ").append(String.valueOf(certSelector)).append("\n"); /* finally, append miscellaneous parameters */ if (certPathCheckers != null) - sb.append(" Certification Path Checkers: [" - + certPathCheckers.toString() + "]\n"); + sb.append(" Certification Path Checkers: [").append(certPathCheckers.toString()).append("]\n"); if (certStores != null) - sb.append(" CertStores: [" + certStores.toString() + "]\n"); + sb.append(" CertStores: [").append(certStores.toString()).append("]\n"); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PolicyQualifierInfo.java --- a/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PolicyQualifierInfo.java Sun Aug 10 18:01:59 2014 -0300 @@ -163,9 +163,8 @@ HexDumpEncoder enc = new HexDumpEncoder(); StringBuilder sb = new StringBuilder(); sb.append("PolicyQualifierInfo: [\n"); - sb.append(" qualifierID: " + mId + "\n"); - sb.append(" qualifier: " + - (mData == null ? "null" : enc.encodeBuffer(mData)) + "\n"); + sb.append(" qualifierID: ").append(mId).append("\n"); + sb.append(" qualifier: ").append(mData == null ? "null" : enc.encodeBuffer(mData)).append("\n"); sb.append("]"); pqiString = sb.toString(); return pqiString; diff -r dde9f5cfde5f src/share/classes/java/security/cert/TrustAnchor.java --- a/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/TrustAnchor.java Sun Aug 10 18:01:59 2014 -0300 @@ -320,14 +320,13 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); if (pubKey != null) { - sb.append(" Trusted CA Public Key: " + pubKey.toString() + "\n"); - sb.append(" Trusted CA Issuer Name: " - + String.valueOf(caName) + "\n"); + sb.append(" Trusted CA Public Key: ").append(pubKey.toString()).append("\n"); + sb.append(" Trusted CA Issuer Name: ").append(String.valueOf(caName)).append("\n"); } else { - sb.append(" Trusted CA cert: " + trustedCert.toString() + "\n"); + sb.append(" Trusted CA cert: ").append(trustedCert.toString()).append("\n"); } if (nc != null) - sb.append(" Name Constraints: " + nc.toString() + "\n"); + sb.append(" Name Constraints: ").append(nc.toString()).append("\n"); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CRLSelector.java --- a/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CRLSelector.java Sun Aug 10 18:01:59 2014 -0300 @@ -572,16 +572,16 @@ sb.append(" IssuerNames:\n"); Iterator i = issuerNames.iterator(); while (i.hasNext()) - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append("\n"); } if (minCRL != null) - sb.append(" minCRLNumber: " + minCRL + "\n"); + sb.append(" minCRLNumber: ").append(minCRL).append("\n"); if (maxCRL != null) - sb.append(" maxCRLNumber: " + maxCRL + "\n"); + sb.append(" maxCRLNumber: ").append(maxCRL).append("\n"); if (dateAndTime != null) - sb.append(" dateAndTime: " + dateAndTime + "\n"); + sb.append(" dateAndTime: ").append(dateAndTime).append("\n"); if (certChecking != null) - sb.append(" Certificate being checked: " + certChecking + "\n"); + sb.append(" Certificate being checked: ").append(certChecking).append("\n"); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CertSelector.java --- a/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CertSelector.java Sun Aug 10 18:01:59 2014 -0300 @@ -1814,69 +1814,62 @@ StringBuilder sb = new StringBuilder(); sb.append("X509CertSelector: [\n"); if (x509Cert != null) { - sb.append(" Certificate: " + x509Cert.toString() + "\n"); + sb.append(" Certificate: ").append(x509Cert.toString()).append("\n"); } if (serialNumber != null) { - sb.append(" Serial Number: " + serialNumber.toString() + "\n"); + sb.append(" Serial Number: ").append(serialNumber.toString()).append("\n"); } if (issuer != null) { - sb.append(" Issuer: " + getIssuerAsString() + "\n"); + sb.append(" Issuer: ").append(getIssuerAsString()).append("\n"); } if (subject != null) { - sb.append(" Subject: " + getSubjectAsString() + "\n"); + sb.append(" Subject: ").append(getSubjectAsString()).append("\n"); } - sb.append(" matchAllSubjectAltNames flag: " - + String.valueOf(matchAllSubjectAltNames) + "\n"); + sb.append(" matchAllSubjectAltNames flag: ") + .append(String.valueOf(matchAllSubjectAltNames)) + .append("\n"); if (subjectAlternativeNames != null) { sb.append(" SubjectAlternativeNames:\n"); Iterator> i = subjectAlternativeNames.iterator(); while (i.hasNext()) { List list = i.next(); - sb.append(" type " + list.get(0) + - ", name " + list.get(1) + "\n"); + sb.append(" type ").append(list.get(0)).append(", name ").append(list.get(1)).append("\n"); } } if (subjectKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Subject Key Identifier: " + - enc.encodeBuffer(subjectKeyID) + "\n"); + sb.append(" Subject Key Identifier: ").append(enc.encodeBuffer(subjectKeyID)).append("\n"); } if (authorityKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Authority Key Identifier: " + - enc.encodeBuffer(authorityKeyID) + "\n"); + sb.append(" Authority Key Identifier: ").append(enc.encodeBuffer(authorityKeyID)).append("\n"); } if (certificateValid != null) { - sb.append(" Certificate Valid: " + - certificateValid.toString() + "\n"); + sb.append(" Certificate Valid: ").append(certificateValid.toString()).append("\n"); } if (privateKeyValid != null) { - sb.append(" Private Key Valid: " + - privateKeyValid.toString() + "\n"); + sb.append(" Private Key Valid: ").append(privateKeyValid.toString()).append("\n"); } if (subjectPublicKeyAlgID != null) { - sb.append(" Subject Public Key AlgID: " + - subjectPublicKeyAlgID.toString() + "\n"); + sb.append(" Subject Public Key AlgID: ").append(subjectPublicKeyAlgID.toString()).append("\n"); } if (subjectPublicKey != null) { - sb.append(" Subject Public Key: " + - subjectPublicKey.toString() + "\n"); + sb.append(" Subject Public Key: ").append(subjectPublicKey.toString()).append("\n"); } if (keyUsage != null) { - sb.append(" Key Usage: " + keyUsageToString(keyUsage) + "\n"); + sb.append(" Key Usage: ").append(keyUsageToString(keyUsage)).append("\n"); } if (keyPurposeSet != null) { - sb.append(" Extended Key Usage: " + - keyPurposeSet.toString() + "\n"); + sb.append(" Extended Key Usage: ").append(keyPurposeSet.toString()).append("\n"); } if (policy != null) { - sb.append(" Policy: " + policy.toString() + "\n"); + sb.append(" Policy: ").append(policy.toString()).append("\n"); } if (pathToGeneralNames != null) { sb.append(" Path to names:\n"); Iterator i = pathToGeneralNames.iterator(); while (i.hasNext()) { - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append("\n"); } } sb.append("]"); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/rmi/dgc/VMID.java --- a/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/rmi/dgc/VMID.java Sun Aug 10 18:01:59 2014 -0300 @@ -124,8 +124,7 @@ if (addr != null) for (int i = 0; i < addr.length; ++ i) { int x = addr[i] & 0xFF; - sb.append((x < 0x10 ? "0" : "") + - Integer.toString(x, 16)); + sb.append(x < 0x10 ? "0" : "").append(Integer.toString(x, 16)); } sb.append(':'); sb.append(uid.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/lang/management/MemoryUsage.java --- a/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/MemoryUsage.java Sun Aug 10 18:01:59 2014 -0300 @@ -238,11 +238,10 @@ */ public String toString() { StringBuilder buf = new StringBuilder(); - buf.append("init = " + init + "(" + (init >> 10) + "K) "); - buf.append("used = " + used + "(" + (used >> 10) + "K) "); - buf.append("committed = " + committed + "(" + - (committed >> 10) + "K) " ); - buf.append("max = " + max + "(" + (max >> 10) + "K)"); + buf.append("init = ").append(init).append("(").append(init >> 10).append("K) "); + buf.append("used = ").append(used).append("(").append(used >> 10).append("K) "); + buf.append("committed = ").append(committed).append("(").append(committed >> 10).append("K) "); + buf.append("max = ").append(max).append("(").append(max >> 10).append("K)"); return buf.toString(); } diff -r dde9f5cfde5f src/share/classes/java/lang/management/ThreadInfo.java --- a/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/ThreadInfo.java Sun Aug 10 18:01:59 2014 -0300 @@ -583,11 +583,11 @@ " Id=" + getThreadId() + " " + getThreadState()); if (getLockName() != null) { - sb.append(" on " + getLockName()); + sb.append(" on ").append(getLockName()); } if (getLockOwnerName() != null) { - sb.append(" owned by \"" + getLockOwnerName() + - "\" Id=" + getLockOwnerId()); + sb.append(" owned by \"").append(getLockOwnerName()) + .append("\" Id=").append(getLockOwnerId()); } if (isSuspended()) { sb.append(" (suspended)"); @@ -599,21 +599,21 @@ int i = 0; for (; i < stackTrace.length && i < MAX_FRAMES; i++) { StackTraceElement ste = stackTrace[i]; - sb.append("\tat " + ste.toString()); + sb.append("\tat ").append(ste.toString()); sb.append('\n'); if (i == 0 && getLockInfo() != null) { Thread.State ts = getThreadState(); switch (ts) { case BLOCKED: - sb.append("\t- blocked on " + getLockInfo()); + sb.append("\t- blocked on ").append(getLockInfo()); sb.append('\n'); break; case WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; case TIMED_WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; default: @@ -622,7 +622,7 @@ for (MonitorInfo mi : lockedMonitors) { if (mi.getLockedStackDepth() == i) { - sb.append("\t- locked " + mi); + sb.append("\t- locked ").append(mi); sb.append('\n'); } } @@ -634,10 +634,10 @@ LockInfo[] locks = getLockedSynchronizers(); if (locks.length > 0) { - sb.append("\n\tNumber of locked synchronizers = " + locks.length); + sb.append("\n\tNumber of locked synchronizers = ").append(locks.length); sb.append('\n'); for (LockInfo li : locks) { - sb.append("\t- " + li); + sb.append("\t- ").append(li); sb.append('\n'); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHParameters.java --- a/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHParameters.java Sun Aug 10 18:01:59 2014 -0300 @@ -138,7 +138,7 @@ + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + sb.append(LINE_SEP).append("l:").append(LINE_SEP).append(" ").append(this.l); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHPublicKey.java --- a/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Sun Aug 10 18:01:59 2014 -0300 @@ -269,7 +269,7 @@ + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + sb.append(LINE_SEP).append("l:").append(LINE_SEP).append(" ").append(this.l); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/GCMParameters.java --- a/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/GCMParameters.java Sun Aug 10 18:01:59 2014 -0300 @@ -140,7 +140,7 @@ = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "[" + encoder.encodeBuffer(iv) + "]"); - sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP); + sb.append(LINE_SEP).append("tLen(bits):").append(LINE_SEP).append(tLen * 8).append(LINE_SEP); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/OAEPParameters.java --- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Sun Aug 10 18:01:59 2014 -0300 @@ -239,10 +239,9 @@ protected String engineToString() { StringBuilder sb = new StringBuilder(); - sb.append("MD: " + mdName + "\n"); - sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n"); - sb.append("PSource: PSpecified " + - (p.length==0? "":Debug.toHexString(new BigInteger(p))) + "\n"); + sb.append("MD: ").append(mdName).append("\n"); + sb.append("MGF: MGF1").append(mgfSpec.getDigestAlgorithm()).append("\n"); + sb.append("PSource: PSpecified ").append(p.length == 0 ? "" : Debug.toHexString(new BigInteger(p))).append("\n"); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/RC2Parameters.java --- a/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Sun Aug 10 18:01:59 2014 -0300 @@ -221,8 +221,9 @@ + encoder.encodeBuffer(iv) + "]"); if (version != 0) { - sb.append(LINE_SEP + "version:" + LINE_SEP - + version + LINE_SEP); + sb.append(LINE_SEP).append("version:") + .append(LINE_SEP).append(version) + .append(LINE_SEP); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Sun Aug 10 18:01:59 2014 -0300 @@ -65,7 +65,7 @@ "extractSubNet", "BINARY ARRAY :"); StringBuilder sb = new StringBuilder(); for(int i =0; i < addrLength; i++) { - sb.append((b[i] & 0xFF) + ":"); + sb.append(b[i] & 0xFF).append(":"); } SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", sb.toString()); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Sun Aug 10 18:01:59 2014 -0300 @@ -204,7 +204,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Sun Aug 10 18:01:59 2014 -0300 @@ -379,7 +379,7 @@ } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); - jjtn000.name.append( "." + t.image); + jjtn000.name.append(".").append(t.image); } } finally { if (jjtc000) { @@ -408,7 +408,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append(".").append(t.image); } } finally { if (jjtc000) { @@ -454,7 +454,7 @@ } jj_consume_token(MARK); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append(".").append(t.image); } } finally { if (jjtc000) { @@ -483,7 +483,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append(".").append(t.image); } jj_consume_token(MASK); t = jj_consume_token(INTEGER_LITERAL); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Sun Aug 10 18:01:59 2014 -0300 @@ -99,7 +99,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java --- a/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Sun Aug 10 18:01:59 2014 -0300 @@ -479,10 +479,10 @@ */ public String printMessage() { StringBuilder sb = new StringBuilder(); - sb.append("msgId : " + msgId + "\n"); - sb.append("msgMaxSize : " + msgMaxSize + "\n"); - sb.append("msgFlags : " + msgFlags + "\n"); - sb.append("msgSecurityModel : " + msgSecurityModel + "\n"); + sb.append("msgId : ").append(msgId).append("\n"); + sb.append("msgMaxSize : ").append(msgMaxSize).append("\n"); + sb.append("msgFlags : ").append(msgFlags).append("\n"); + sb.append("msgSecurityModel : ").append(msgSecurityModel).append("\n"); if (contextEngineId == null) { sb.append("contextEngineId : null"); diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java --- a/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Sun Aug 10 18:01:59 2014 -0300 @@ -256,7 +256,7 @@ private static String stringifyComponent(NameComponent comp) { StringBuilder one = new StringBuilder(escape(comp.id)); if (comp.kind != null && !comp.kind.equals("")) { - one.append(kindSeparator + escape(comp.kind)); + one.append(kindSeparator).append(escape(comp.kind)); } if (one.length() == 0) { return ""+kindSeparator; // if neither id nor kind specified diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java --- a/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Sun Aug 10 18:01:59 2014 -0300 @@ -90,7 +90,7 @@ if (selected == -1) { StringBuilder allChoices = new StringBuilder(); for (int j = 0; j < choices.length; j++) { - allChoices.append(choices[j] + ","); + allChoices.append(choices[j]).append(","); } throw new IOException("Cannot match " + "'java.naming.security.sasl.realm' property value, '" + diff -r dde9f5cfde5f src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java --- a/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Sun Aug 10 18:01:59 2014 -0300 @@ -167,9 +167,9 @@ for (int i = 0; i < allchannelnames.length; i++) { if ((channelmask & m) != 0L) { if (i < channelnames.length) { - sb.append(channelnames[i] + " "); + sb.append(channelnames[i]).append(" "); } else { - sb.append(allchannelnames[i] + " "); + sb.append(allchannelnames[i]).append(" "); } } m *= 2L; diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Sun Aug 10 18:01:59 2014 -0300 @@ -235,14 +235,14 @@ String nodeName = att.getNodeName(); if ((nodeName.equals("xmlns") || nodeName.startsWith("xmlns:")) && !storedNamespaces.containsKey(att.getNodeName())) { - sb.append(" " + nodeName + "=\"" + att.getNodeValue() + "\""); + sb.append(" ").append(nodeName).append("=\"").append(att.getNodeValue()).append("\""); storedNamespaces.put(nodeName, att.getNodeValue()); } } } wk = wk.getParentNode(); } - sb.append(">" + source + ""); + sb.append(">").append(source).append(""); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Sun Aug 10 18:01:59 2014 -0300 @@ -85,7 +85,7 @@ if (prefix.equals("xmlns")) { sb.append("#default "); } else { - sb.append(prefix + " "); + sb.append(prefix).append(" "); } } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Sun Aug 10 18:01:59 2014 -0300 @@ -88,7 +88,7 @@ l += countQuotes(DN, j, k); if ((k > 0) && (DN.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseRDN(DN.substring(i, k).trim(), toXml) + ","); + sb.append(parseRDN(DN.substring(i, k).trim(), toXml)).append(","); i = k + 1; l = 0; @@ -121,7 +121,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseATAV(trim(str.substring(i, k)), toXml) + "+"); + sb.append(parseATAV(trim(str.substring(i, k)), toXml)).append("+"); i = k + 1; l = 0; @@ -369,7 +369,7 @@ int k; for (int j = 0; (k = string.indexOf("\\20", j)) >= 0; j = k + 3) { - sb.append(trim(string.substring(i, k)) + "\\ "); + sb.append(trim(string.substring(i, k))).append("\\ "); i = k + 3; } @@ -418,7 +418,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(trim(str.substring(i, k)) + replace); + sb.append(trim(str.substring(i, k))).append(replace); i = k + 1; l = 0; diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/CramMD5Base.java --- a/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/CramMD5Base.java Sun Aug 10 18:01:59 2014 -0300 @@ -196,8 +196,7 @@ for (i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append("0").append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java --- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Sun Aug 10 18:01:59 2014 -0300 @@ -391,8 +391,7 @@ for (int i = 0; i < digest.length; i ++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0"+ - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append("0").append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/ParseException.java --- a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Sun Aug 10 18:01:59 2014 -0300 @@ -198,7 +198,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java --- a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Sun Aug 10 18:01:59 2014 -0300 @@ -107,7 +107,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java --- a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Sun Aug 10 18:01:59 2014 -0300 @@ -338,10 +338,10 @@ if (classpath.isEmpty()) { String envcp = System.getProperty("env.class.path"); if ((envcp != null) && (envcp.length() > 0)) { - munged.append(" -classpath " + envcp); + munged.append(" -classpath ").append(envcp); } } else { - munged.append(" -classpath " + classpath.asString()); + munged.append(" -classpath ").append(classpath.asString()); } return munged.toString(); } else { diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Sun Aug 10 18:01:59 2014 -0300 @@ -386,37 +386,37 @@ } case 'B': { int val = 0xFF & byteAt(i, value); - result.append("0x" + Integer.toString(val, 16)); + result.append("0x").append(Integer.toString(val, 16)); i++; break; } case 'S': { short val = shortAt(i, value); i += 2; - result.append("" + val); + result.append("").append(val); break; } case 'I': { int val = intAt(i, value); i += 4; - result.append("" + val); + result.append("").append(val); break; } case 'J': { // long long val = longAt(i, value); - result.append("" + val); + result.append("").append(val); i += 8; break; } case 'F': { float val = floatAt(i, value); - result.append("" + val); + result.append("").append(val); i += 4; break; } case 'D': { // double double val = doubleAt(i, value); - result.append("" + val); + result.append("").append(val); i += 8; break; } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/util/Misc.java --- a/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Sun Aug 10 18:01:59 2014 -0300 @@ -97,11 +97,11 @@ } else if (ch == '&') { sb.append("&"); } else if (ch < ' ') { - sb.append("&#" + Integer.toString(ch) + ";"); + sb.append("&#").append(Integer.toString(ch)).append(";"); } else { int c = (ch & 0xFFFF); if (c > 127) { - sb.append("&#" + Integer.toString(c) + ";"); + sb.append("&#").append(Integer.toString(c)).append(";"); } else { sb.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java --- a/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Sun Aug 10 18:01:59 2014 -0300 @@ -881,12 +881,12 @@ } else if (tag == JDWP.TypeTag.ARRAY) { sb.append("ArrayType"); } else { - sb.append("UNKNOWN TAG: " + tag); + sb.append("UNKNOWN TAG: ").append(tag); } if (signature != null) { - sb.append(", signature='" + signature + "'"); + sb.append(", signature='").append(signature).append("'"); } - sb.append(", id=" + id); + sb.append(", id=").append(id); vm.printTrace(sb.toString()); } if (id == 0) { From Ulf.Zibis at CoSoCo.de Sun Aug 10 22:24:59 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Mon, 11 Aug 2014 00:24:59 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: Message-ID: <53E7F13B.2050801@CoSoCo.de> Hi Ot?vio, this is a great proposal. Little nit: In cases where only 1 character is to append, I guess append(char) would be faster and at least will save footprint in contrast to append(String). -Ulf Am 10.08.2014 um 23:33 schrieb Ot?vio Gon?alves de Santana: > *Motivation:* Make another append instead of concat String inside of append > parameter in StringBuilder class. To avoid an extra StringBuilder created > for the purpose of concatenating. So it will save memory and will faster > than concat String. > Doing a code to benchMark[1], the result is: > > Benchmark Mode Samples > Mean Mean error Units > m.StringBuilderConcatBenchMark.stringBuilder thrpt 10 > 6317444.705 108673.584 ops/s > m.StringBuilderConcatBenchMark.stringBuilderWithConcat thrpt 10 > 3354554.435 68353.924 ops/s > > The webrev of all code is: > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat.zip > > > [1] > > @State(Scope.Thread) > @OutputTimeUnit(TimeUnit.SECONDS) > public class StringBuilderConcatBenchMark { > > > private static final String F = "!!!!"; > private static final String E = " running in Java "; > private static final String D = " in the code "; > private static final String C = " to try impact "; > private static final String B = " with some text "; > private static final String A = "Doing a test"; > > @GenerateMicroBenchmark > public void stringBuilder(BlackHole bh) { > bh.consume(createBuilder(A, B, C, D, E, F)); > } > > @GenerateMicroBenchmark > public void stringBuilderWithConcat(BlackHole bh) { > bh.consume(createBuilderWithConcat(A, B, C, D, E, F)); > } > > private StringBuilder createBuilder(String... values) { > StringBuilder text = new StringBuilder(); > text.append(values[0]).append(values[1]) > .append(values[2]).append(values[3]) > .append(values[4]).append(values[5]); > return text; > } > private StringBuilder createBuilderWithConcat(String... values) { > StringBuilder text = new StringBuilder(); > text.append(values[0] + values[1]) > .append(values[2] + values[3]) > .append(values[4]+ values[5]); > return text; > } > } > From claes.redestad at oracle.com Sun Aug 10 23:03:32 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 11 Aug 2014 01:03:32 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: Message-ID: <53E7FA44.9050207@oracle.com> +1 Some suggestions (mostly nits): - in places like src/share/classes/java/util/regex/Pattern.java you introducesingle-char strings which might use a char instead: - result.append("|"+next); + result.append('|').append(next); - in places like src/share/classes/sun/security/provider/PolicyFile.java you end up with a sequence of String literal appends which could be merged into one: - sb.append(principalInfo[i][0] + " " + - "\"" + principalInfo[i][1] + "\""); + sb.append(principalInfo[i][0]).append(" \"") + .append(principalInfo[i][1]).append('"'); - in some places like src/share/classes/java/text/ChoiceFormat.java you end up doing append(""). I guess the empty string concatenation was used as a form of primitive-to-string coercion and was probably always redundant already, but care needs to be taken that doing the append directly behave as intended. I think it should be safe to just remove the empty string append in most cases: - result.append(""+choiceLimits[i]); + result.append(choiceLimits[i]); Thanks! /Claes On 2014-08-10 23:33, Ot?vio Gon?alves de Santana wrote: > *Motivation:* Make another append instead of concat String inside of append > parameter in StringBuilder class. To avoid an extra StringBuilder created > for the purpose of concatenating. So it will save memory and will faster > than concat String. > Doing a code to benchMark[1], the result is: > > Benchmark Mode Samples > Mean Mean error Units > m.StringBuilderConcatBenchMark.stringBuilder thrpt 10 > 6317444.705 108673.584 ops/s > m.StringBuilderConcatBenchMark.stringBuilderWithConcat thrpt 10 > 3354554.435 68353.924 ops/s > > The webrev of all code is: > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat.zip > > > [1] > > @State(Scope.Thread) > @OutputTimeUnit(TimeUnit.SECONDS) > public class StringBuilderConcatBenchMark { > > > private static final String F = "!!!!"; > private static final String E = " running in Java "; > private static final String D = " in the code "; > private static final String C = " to try impact "; > private static final String B = " with some text "; > private static final String A = "Doing a test"; > > @GenerateMicroBenchmark > public void stringBuilder(BlackHole bh) { > bh.consume(createBuilder(A, B, C, D, E, F)); > } > > @GenerateMicroBenchmark > public void stringBuilderWithConcat(BlackHole bh) { > bh.consume(createBuilderWithConcat(A, B, C, D, E, F)); > } > > private StringBuilder createBuilder(String... values) { > StringBuilder text = new StringBuilder(); > text.append(values[0]).append(values[1]) > .append(values[2]).append(values[3]) > .append(values[4]).append(values[5]); > return text; > } > private StringBuilder createBuilderWithConcat(String... values) { > StringBuilder text = new StringBuilder(); > text.append(values[0] + values[1]) > .append(values[2] + values[3]) > .append(values[4]+ values[5]); > return text; > } > } > From Ulf.Zibis at CoSoCo.de Mon Aug 11 00:59:08 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Mon, 11 Aug 2014 02:59:08 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53E7FA44.9050207@oracle.com> References: <53E7FA44.9050207@oracle.com> Message-ID: <53E8155C.7000405@CoSoCo.de> Am 11.08.2014 um 01:03 schrieb Claes Redestad: > - in places like src/share/classes/sun/security/provider/PolicyFile.java > you end up with a sequence of String literal appends which could be merged into one: > > - sb.append(principalInfo[i][0] + " " + > - "\"" + principalInfo[i][1] + "\""); > + sb.append(principalInfo[i][0]).append(" \"") > + .append(principalInfo[i][1]).append('"'); In cases of only 2 chars, I can imagine, that .append(' ').append('\"') would have better performance. -Ulf From david.holmes at oracle.com Mon Aug 11 02:16:24 2014 From: david.holmes at oracle.com (David Holmes) Date: Mon, 11 Aug 2014 12:16:24 +1000 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E5D582.3070300@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> Message-ID: <53E82778.3020400@oracle.com> Hi Ioi, We seem to have lost core-libs-dev so I added them back. A couple of minor follow ups. On 9/08/2014 6:02 PM, Ioi Lam wrote: > Hi, > > Thanks a lot to everyone for the very useful comments. I have updated > the webrev > > Just the delta from the previous round of review: > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3_delta_from_v2/ JDK changes: URLClassLoader.java: Doesn't this Note + * + * NOTE: the logic used here has been duplicated in the VM native code + * (search for invocation of definePackageInternal in the HotSpot sources). + * If this is changed, the VM code also need to be modified. belong on definePackageInternal, not defineClass ?? --- hotspot changes: hotspot/src/share/vm/classfile/classLoader.cpp The scoping of the ResourceMark doesn't look right: 592 // Iterate over class path entries 593 for (int start = 0; start < len; start = end) { 594 while (class_path[end] && class_path[end] != os::path_separator()[0]) { 595 end++; 596 } 597 EXCEPTION_MARK; 598 ResourceMark rm(THREAD); 599 char* path = NEW_RESOURCE_ARRAY(char, end-start+1); 600 strncpy(path, &class_path[start], end-start); 601 path[end-start] = '\0'; 602 update_class_path_entry_list(path, false); 603 #if INCLUDE_CDS 604 if (DumpSharedSpaces) { 605 check_shared_classpath(path); 606 } 607 #endif 608 while (class_path[end] == os::path_separator()[0]) { 609 end++; 610 } 611 } Doesn't the RESOURCE_ARRAY need to be freed within the ResourceMark block? --- src/share/vm/runtime/arguments.cpp 3340 // This causes problems with CDS, which requires that all directories specified in the classpath 3341 // must be empty. Should that be "must not be empty"? Or did you mean directory names? --- src/share/vm/runtime/javaCalls.cpp + // may cause undesriable side-effect in the class metadata. Typo: undesriable; also side-effects --- David ----- > All the changes: > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ > > Thanks > - Ioi > > On 7/28/14, 4:09 PM, Ioi Lam wrote: >> Hi Folks, >> >> Please review the following clean up and refactoring of the CDS code, >> for JDK9 >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >> https://bugs.openjdk.java.net/browse/JDK-8046070 >> >> Summary of fix: >> >> Clean up and refactor the Class Data Sharing (CDS) code, including: >> >> + Improve archive integrity checking >> + Support bytecode verification during archive dumping time >> + Allow the user to configure the CDS class list and archive file. >> + Allow future extension of the CDS class loading mechanism. >> >> Tests: >> >> JPRT >> UTE (vm.runtime.testlist, vm.quick.testlist, >> vm.parallel_class_loading.testlist) >> Various adhoc SQE tests on Aurora >> JCK >> >> Thanks >> - Ioi > From otaviojava at java.net Mon Aug 11 03:29:39 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Mon, 11 Aug 2014 00:29:39 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53E7FA44.9050207@oracle.com> References: <53E7FA44.9050207@oracle.com> Message-ID: Done. https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_2.zip obs: stay the 2 chars to better performance. On Sun, Aug 10, 2014 at 8:03 PM, Claes Redestad wrote: > +1 > > Some suggestions (mostly nits): > > - in places like src/share/classes/java/util/regex/Pattern.java you > introducesingle-char > strings which might use a char instead: > > - result.append("|"+next); > + result.append('|').append(next); > > - in places like src/share/classes/sun/security/provider/PolicyFile.java > you end up with a sequence of String literal appends which could be > merged into one: > > - sb.append(principalInfo[i][0] + " " + > - "\"" + principalInfo[i][1] + "\""); > + sb.append(principalInfo[i][0]).append(" \"") > + .append(principalInfo[i][1]).append('"'); > > - in some places like src/share/classes/java/text/ChoiceFormat.java > you end up doing append(""). I guess the empty string concatenation was > used as a form > of primitive-to-string coercion and was probably always redundant > already, but care needs > to be taken that doing the append directly behave as intended. > > I think it should be safe to just remove the empty string append in most > cases: > > - result.append(""+choiceLimits[i]); > + result.append(choiceLimits[i]); > > Thanks! > > /Claes > > On 2014-08-10 23:33, Ot?vio Gon?alves de Santana wrote: > >> *Motivation:* Make another append instead of concat String inside of >> append >> >> parameter in StringBuilder class. To avoid an extra StringBuilder created >> for the purpose of concatenating. So it will save memory and will faster >> than concat String. >> Doing a code to benchMark[1], the result is: >> >> Benchmark Mode Samples >> Mean Mean error Units >> m.StringBuilderConcatBenchMark.stringBuilder thrpt 10 >> 6317444.705 108673.584 ops/s >> m.StringBuilderConcatBenchMark.stringBuilderWithConcat thrpt 10 >> 3354554.435 68353.924 ops/s >> >> The webrev of all code is: >> https://dl.dropboxusercontent.com/u/16109193/open_jdk/ >> string_builder_concat.zip >> > builder_concat.zip> >> >> [1] >> >> @State(Scope.Thread) >> @OutputTimeUnit(TimeUnit.SECONDS) >> public class StringBuilderConcatBenchMark { >> >> >> private static final String F = "!!!!"; >> private static final String E = " running in Java "; >> private static final String D = " in the code "; >> private static final String C = " to try impact "; >> private static final String B = " with some text "; >> private static final String A = "Doing a test"; >> >> @GenerateMicroBenchmark >> public void stringBuilder(BlackHole bh) { >> bh.consume(createBuilder(A, B, C, D, E, F)); >> } >> >> @GenerateMicroBenchmark >> public void stringBuilderWithConcat(BlackHole bh) { >> bh.consume(createBuilderWithConcat(A, B, C, D, E, F)); >> } >> >> private StringBuilder createBuilder(String... values) { >> StringBuilder text = new StringBuilder(); >> text.append(values[0]).append(values[1]) >> .append(values[2]).append(values[3]) >> .append(values[4]).append(values[5]); >> return text; >> } >> private StringBuilder createBuilderWithConcat(String... values) { >> StringBuilder text = new StringBuilder(); >> text.append(values[0] + values[1]) >> .append(values[2] + values[3]) >> .append(values[4]+ values[5]); >> return text; >> } >> } >> >> > -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/ThreadTab.java --- a/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java Sun Aug 10 22:07:00 2014 -0300 @@ -368,7 +368,7 @@ sb.append(Messages.STACK_TRACE); int index = 0; for (StackTraceElement e : ti.getStackTrace()) { - sb.append(e.toString()+"\n"); + sb.append(e.toString()).append('\n'); if (monitors != null) { for (MonitorInfo mi : monitors) { if (mi.getLockedStackDepth() == index) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java --- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Sun Aug 10 22:07:00 2014 -0300 @@ -79,25 +79,24 @@ String textColor = String.format("%06x", foreground.getRGB() & 0xFFFFFF); StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append("
    "); for (int i = 0; i < arr.length; i++) { if (i % 2 == 0) { - sb.append(""); + sb.append(""); } else { - sb.append(""); + sb.append(""); } } if (arr.length == 0) { - sb.append(""); + sb.append(""); } sb.append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    "); arrayEditor.setText(sb.toString()); diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XTree.java --- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java Sun Aug 10 22:07:00 2014 -0300 @@ -507,13 +507,13 @@ // key order defined by the "orderedKeyPropertyList" for (String key : orderedKeyPropertyList) { if (map.containsKey(key)) { - sb.append(key + "=" + map.get(key) + ","); + sb.append(key).append('=').append(map.get(key)).append(','); map.remove(key); } } // Add the remaining key/value pairs to the buffer for (Map.Entry entry : map.entrySet()) { - sb.append(entry.getKey() + "=" + entry.getValue() + ","); + sb.append(entry.getKey()).append('=').append(entry.getValue()).append(','); } String orderedKeyPropertyListString = sb.toString(); orderedKeyPropertyListString = orderedKeyPropertyListString.substring( @@ -622,7 +622,7 @@ // StringBuilder sb = new StringBuilder(); for (MBeanParameterInfo mbpi : mboi.getSignature()) { - sb.append(mbpi.getType() + ","); + sb.append(mbpi.getType()).append(','); } String signature = sb.toString(); if (signature.length() > 0) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jps/Jps.java --- a/src/share/classes/sun/tools/jps/Jps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jps/Jps.java Sun Aug 10 22:07:00 2014 -0300 @@ -92,28 +92,28 @@ vm = monitoredHost.getMonitoredVm(id, 0); errorString = " -- main class information unavailable"; - output.append(" " + MonitoredVmUtil.mainClass(vm, + output.append(' ').append(MonitoredVmUtil.mainClass(vm, arguments.showLongPaths())); if (arguments.showMainArgs()) { errorString = " -- main args information unavailable"; String mainArgs = MonitoredVmUtil.mainArgs(vm); if (mainArgs != null && mainArgs.length() > 0) { - output.append(" " + mainArgs); + output.append(' ').append(mainArgs); } } if (arguments.showVmArgs()) { errorString = " -- jvm args information unavailable"; String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) { - output.append(" " + jvmArgs); + output.append(' ').append(jvmArgs); } } if (arguments.showVmFlags()) { errorString = " -- jvm flags information unavailable"; String jvmFlags = MonitoredVmUtil.jvmFlags(vm); if (jvmFlags != null && jvmFlags.length() > 0) { - output.append(" " + jvmFlags); + output.append(' ').append(jvmFlags); } } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/RawOutputFormatter.java --- a/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Sun Aug 10 22:07:00 2014 -0300 @@ -50,7 +50,7 @@ StringBuilder headerBuilder = new StringBuilder(); for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { Monitor m = i.next(); - headerBuilder.append(m.getName() + " "); + headerBuilder.append(m.getName()).append(' '); } header = headerBuilder.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/SyntaxException.java --- a/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/SyntaxException.java Sun Aug 10 22:07:00 2014 -0300 @@ -65,7 +65,7 @@ public SyntaxException(int lineno, Set expected, Token found) { StringBuilder msg = new StringBuilder(); - msg.append("Syntax error at line " + lineno + ": Expected one of \'"); + msg.append("Syntax error at line ").append(lineno).append(": Expected one of \'"); boolean first = true; for (Iterator i = expected.iterator(); i.hasNext(); /* empty */) { @@ -74,11 +74,11 @@ msg.append(keyWord); first = false; } else { - msg.append("|" + keyWord); + msg.append('|').append(keyWord); } } - msg.append("\', Found " + found.toMessage()); + msg.append("\', Found ").append(found.toMessage()); message = msg.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/Token.java --- a/src/share/classes/sun/tools/jstat/Token.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/Token.java Sun Aug 10 22:07:00 2014 -0300 @@ -89,18 +89,18 @@ sb.append("ttype=TT_EOF"); break; case StreamTokenizer.TT_NUMBER: - sb.append("ttype=TT_NUM,").append("nval="+nval); + sb.append("ttype=TT_NUM,").append("nval=").append(nval); break; case StreamTokenizer.TT_WORD: if (sval == null) { sb.append("ttype=TT_WORD:IDENTIFIER"); } else { - sb.append("ttype=TT_WORD:").append("sval="+sval); + sb.append("ttype=TT_WORD:").append("sval=").append(sval); } break; default: if (ttype == (int)'"') { - sb.append("ttype=TT_STRING:").append("sval="+sval); + sb.append("ttype=TT_STRING:").append("sval=").append(sval); } else { sb.append("ttype=TT_CHAR:").append((char)ttype); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstatd/RemoteHostImpl.java --- a/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Sun Aug 10 22:07:00 2014 -0300 @@ -68,7 +68,7 @@ sb.append("local://").append(lvmid).append("@localhost"); if (mode != null) { - sb.append("?mode=" + mode); + sb.append("?mode=").append(mode); } String vmidStr = sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/security/acl/AclEntryImpl.java --- a/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/acl/AclEntryImpl.java Sun Aug 10 22:07:00 2014 -0300 @@ -147,13 +147,13 @@ s.append("Group."); else s.append("User."); - s.append(user + "="); + s.append(user).append('='); Enumeration e = permissions(); while(e.hasMoreElements()) { Permission p = e.nextElement(); s.append(p); if (e.hasMoreElements()) - s.append(","); + s.append(','); } return new String(s); } diff -r dde9f5cfde5f src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java --- a/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Sun Aug 10 22:07:00 2014 -0300 @@ -640,8 +640,7 @@ for (int i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs/SigningCertificateInfo.java --- a/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Sun Aug 10 22:07:00 2014 -0300 @@ -158,8 +158,8 @@ } sb.append(hexDumper.encode(certHash)); if (issuer != null && serialNumber != null) { - sb.append("\n\tIssuer: " + issuer + "\n"); - sb.append("\t" + serialNumber); + sb.append("\n\tIssuer: ").append(issuer).append('\n'); + sb.append('\t').append(serialNumber); } sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs11/P11KeyStore.java --- a/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs11/P11KeyStore.java Sun Aug 10 22:07:00 2014 -0300 @@ -196,24 +196,24 @@ } else if (type == ATTR_CLASS_CERT) { sb.append("\ttype=[trusted cert]\n"); } - sb.append("\tlabel=[" + label + "]\n"); + sb.append("\tlabel=[").append(label).append("]\n"); if (id == null) { sb.append("\tid=[null]\n"); } else { - sb.append("\tid=" + P11KeyStore.getID(id) + "\n"); + sb.append("\tid=").append(P11KeyStore.getID(id)).append('\n'); } - sb.append("\ttrusted=[" + trusted + "]\n"); - sb.append("\tmatched=[" + matched + "]\n"); + sb.append("\ttrusted=[").append(trusted).append("]\n"); + sb.append("\tmatched=[").append(matched).append("]\n"); if (cert == null) { sb.append("\tcert=[null]\n"); } else { - sb.append("\tcert=[\tsubject: " + - cert.getSubjectX500Principal() + - "\n\t\tissuer: " + - cert.getIssuerX500Principal() + - "\n\t\tserialNum: " + - cert.getSerialNumber().toString() + - "]"); + sb.append("\tcert=[\tsubject: ") + .append(cert.getSubjectX500Principal()) + .append("\n\t\tissuer: ") + .append(cert.getIssuerX500Principal()) + .append("\n\t\tserialNum: ") + .append(cert.getSerialNumber().toString()) + .append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/PolicyFile.java --- a/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/PolicyFile.java Sun Aug 10 22:07:00 2014 -0300 @@ -1500,8 +1500,7 @@ if (i != 0) { sb.append(", "); } - sb.append(principalInfo[i][0] + " " + - "\"" + principalInfo[i][1] + "\""); + sb.append(principalInfo[i][0]).append(' ').append('\"').append(principalInfo[i][1]).append('\"'); } if (pli.hasNext()) { sb.append(", "); @@ -1776,13 +1775,13 @@ if (principals != null && principals.length > 0) { StringBuilder palBuf = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palBuf.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('\"'); if (i < principals.length-1) palBuf.append(", "); else - palBuf.append(")"); + palBuf.append(')'); } pals = palBuf.toString(); } @@ -1884,7 +1883,7 @@ throw new Exception(form.format(source)); } - sb.append(X500PRINCIPAL + " \"" + suffix + "\""); + sb.append(X500PRINCIPAL).append(" \"").append(suffix).append('\"'); startIndex = e+2; } else { MessageFormat form = new MessageFormat diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/CertId.java --- a/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/CertId.java Sun Aug 10 22:07:00 2014 -0300 @@ -223,13 +223,13 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertId \n"); - sb.append("Algorithm: " + hashAlgId.toString() +"\n"); + sb.append("Algorithm: ").append(hashAlgId.toString()).append('\n'); sb.append("issuerNameHash \n"); HexDumpEncoder encoder = new HexDumpEncoder(); sb.append(encoder.encode(issuerNameHash)); sb.append("\nissuerKeyHash: \n"); sb.append(encoder.encode(issuerKeyHash)); - sb.append("\n" + certSerialNumber.toString()); + sb.append('\n').append(certSerialNumber.toString()); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/OCSPResponse.java --- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Sun Aug 10 22:07:00 2014 -0300 @@ -812,14 +812,14 @@ StringBuilder sb = new StringBuilder(); sb.append("SingleResponse: \n"); sb.append(certId); - sb.append("\nCertStatus: "+ certStatus + "\n"); + sb.append("\nCertStatus: ").append(certStatus).append('\n'); if (certStatus == CertStatus.REVOKED) { - sb.append("revocationTime is " + revocationTime + "\n"); - sb.append("revocationReason is " + revocationReason + "\n"); + sb.append("revocationTime is ").append(revocationTime).append('\n'); + sb.append("revocationReason is ").append(revocationReason).append('\n'); } - sb.append("thisUpdate is " + thisUpdate + "\n"); + sb.append("thisUpdate is ").append(thisUpdate).append('\n'); if (nextUpdate != null) { - sb.append("nextUpdate is " + nextUpdate + "\n"); + sb.append("nextUpdate is ").append(nextUpdate).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java --- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Sun Aug 10 22:07:00 2014 -0300 @@ -124,7 +124,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Build Forward Flag: " + String.valueOf(buildForward) + "\n"); + sb.append(" Build Forward Flag: ").append(String.valueOf(buildForward)).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/HandshakeMessage.java --- a/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java Sun Aug 10 22:07:00 2014 -0300 @@ -1478,7 +1478,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/ServerNameExtension.java --- a/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/ServerNameExtension.java Sun Aug 10 22:07:00 2014 -0300 @@ -268,7 +268,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); for (SNIServerName sniName : sniMap.values()) { - sb.append("[" + sniName + "]"); + sb.append('[').append(sniName).append(']'); } return "Extension " + type + ", server_name: " + sb; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java --- a/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Sun Aug 10 22:07:00 2014 -0300 @@ -122,7 +122,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Sun Aug 10 22:07:00 2014 -0300 @@ -113,7 +113,7 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Extension " + type + ", curve names: {"); + sb.append("Extension ").append(type).append(", curve names: {"); boolean first = true; for (int curveId : curveIds) { if (first) { @@ -138,7 +138,7 @@ } else if (curveId == ARBITRARY_CHAR2) { sb.append("arbitrary_explicit_char2_curves"); } else { - sb.append("unknown curve " + curveId); + sb.append("unknown curve ").append(curveId); } } sb.append("}"); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/jarsigner/Main.java --- a/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/jarsigner/Main.java Sun Aug 10 22:07:00 2014 -0300 @@ -676,14 +676,13 @@ ((man.getAttributes(name) != null) || (man.getAttributes("./"+name) != null) || (man.getAttributes("/"+name) != null)); - sb.append( - (isSigned ? rb.getString("s") : rb.getString("SPACE")) + - (inManifest ? rb.getString("m") : rb.getString("SPACE")) + - (inStore ? rb.getString("k") : rb.getString("SPACE")) + - (inScope ? rb.getString("i") : rb.getString("SPACE")) + - ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") + - rb.getString("SPACE")); - sb.append("|"); + sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE")) + .append(inManifest ? rb.getString("m") : rb.getString("SPACE")) + .append(inStore ? rb.getString("k") : rb.getString("SPACE")) + .append(inScope ? rb.getString("i") : rb.getString("SPACE")) + .append((inStoreOrScope & NOT_ALIAS) != 0 ? 'X' : ' ') + .append(rb.getString("SPACE")); + sb.append('|'); } // When -certs provided, display info has extra empty @@ -704,11 +703,11 @@ // Print no info for unsigned entries when -verbose:all, // to be consistent with old behavior. if (signatureRelated(name)) { - sb.append("\n" + tab + rb.getString( - ".Signature.related.entries.") + "\n\n"); + sb.append('\n').append(tab).append(rb.getString( + ".Signature.related.entries.")).append("\n\n"); } else { - sb.append("\n" + tab + rb.getString( - ".Unsigned.entries.") + "\n\n"); + sb.append('\n').append(tab).append(rb.getString( + ".Unsigned.entries.")).append("\n\n"); } } @@ -1605,8 +1604,8 @@ // No more warning, we alreay have hasExpiredCert or notYetValidCert } else { chainNotValidated = true; - sb.append(tab + rb.getString(".CertPath.not.validated.") + - e.getLocalizedMessage() + "]\n"); // TODO + sb.append(tab).append(rb.getString(".CertPath.not.validated.")) + .append(e.getLocalizedMessage()).append("]\n"); // TODO } } String result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/policytool/PolicyTool.java --- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java Sun Aug 10 22:07:00 2014 -0300 @@ -980,8 +980,9 @@ grantEntry.principals.listIterator(); while (list.hasNext()) { PolicyParser.PrincipalEntry pppe = list.next(); - sb.append(" Principal " + pppe.getDisplayClass() + " " + - pppe.getDisplayName(true)); + sb.append(" Principal ").append(pppe.getDisplayClass()) + .append(' ') + .append(pppe.getDisplayName(true)); if (list.hasNext()) sb.append(", "); } result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/AVA.java --- a/src/share/classes/sun/security/x509/AVA.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/AVA.java Sun Aug 10 22:07:00 2014 -0300 @@ -1147,7 +1147,7 @@ // Emit the string ... quote it if needed // if string is already quoted, don't re-quote if (!alreadyQuoted && quoteNeeded) { - retval.append("\"" + sbuffer.toString() + "\""); + retval.append('\"').append(sbuffer.toString()).append('\"'); } else { retval.append(sbuffer.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPoint.java --- a/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPoint.java Sun Aug 10 22:07:00 2014 -0300 @@ -381,22 +381,22 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPoint:\n " + fullName + "\n"); + sb.append("DistributionPoint:\n ").append(fullName).append('\n'); } if (relativeName != null) { - sb.append("DistributionPoint:\n " + relativeName + "\n"); + sb.append("DistributionPoint:\n ").append(relativeName).append('\n'); } if (reasonFlags != null) { sb.append(" ReasonFlags:\n"); for (int i = 0; i < reasonFlags.length; i++) { if (reasonFlags[i]) { - sb.append(" " + reasonToString(i) + "\n"); + sb.append(" ").append(reasonToString(i)).append('\n'); } } } if (crlIssuer != null) { - sb.append(" CRLIssuer:" + crlIssuer + "\n"); + sb.append(" CRLIssuer:").append(crlIssuer).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPointName.java --- a/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPointName.java Sun Aug 10 22:07:00 2014 -0300 @@ -231,10 +231,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPointName:\n " + fullName + "\n"); + sb.append("DistributionPointName:\n ").append(fullName).append('\n'); } else { - sb.append("DistributionPointName:\n " + relativeName + "\n"); + sb.append("DistributionPointName:\n ").append(relativeName).append('\n'); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/PolicyInformation.java --- a/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/PolicyInformation.java Sun Aug 10 22:07:00 2014 -0300 @@ -259,7 +259,7 @@ */ public String toString() { StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString()); - s.append(policyQualifiers + " ]\n"); + s.append(policyQualifiers).append(" ]\n"); return s.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLEntryImpl.java --- a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Sun Aug 10 22:07:00 2014 -0300 @@ -292,17 +292,17 @@ StringBuilder sb = new StringBuilder(); sb.append(serialNumber.toString()); - sb.append(" On: " + revocationDate.toString()); + sb.append(" On: ").append(revocationDate.toString()); if (certIssuer != null) { - sb.append("\n Certificate issuer: " + certIssuer); + sb.append("\n Certificate issuer: ").append(certIssuer); } if (extensions != null) { Collection allEntryExts = extensions.getAllExtensions(); Extension[] exts = allEntryExts.toArray(new Extension[0]); - sb.append("\n CRL Entry Extensions: " + exts.length); + sb.append("\n CRL Entry Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n [" + (i+1) + "]: "); + sb.append("\n [").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -313,9 +313,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLImpl.java --- a/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLImpl.java Sun Aug 10 22:07:00 2014 -0300 @@ -537,31 +537,32 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("X.509 CRL v" + (version+1) + "\n"); + sb.append("X.509 CRL v").append(version + 1).append("\n"); if (sigAlgId != null) - sb.append("Signature Algorithm: " + sigAlgId.toString() + - ", OID=" + (sigAlgId.getOID()).toString() + "\n"); + sb.append("Signature Algorithm: ").append(sigAlgId.toString()) + .append(", OID=") + .append((sigAlgId.getOID()).toString()).append('\n'); if (issuer != null) - sb.append("Issuer: " + issuer.toString() + "\n"); + sb.append("Issuer: ").append(issuer.toString()).append('\n'); if (thisUpdate != null) - sb.append("\nThis Update: " + thisUpdate.toString() + "\n"); + sb.append("\nThis Update: ").append(thisUpdate.toString()).append('\n'); if (nextUpdate != null) - sb.append("Next Update: " + nextUpdate.toString() + "\n"); + sb.append("Next Update: ").append(nextUpdate.toString()).append('\n'); if (revokedList.isEmpty()) sb.append("\nNO certificates have been revoked\n"); else { - sb.append("\nRevoked Certificates: " + revokedList.size()); + sb.append("\nRevoked Certificates: ").append(revokedList.size()); int i = 1; for (X509CRLEntry entry: revokedList) { - sb.append("\n[" + i++ + "] " + entry.toString()); + sb.append("\n[").append(i++).append("] ").append(entry.toString()); } } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Object[] objs = allExts.toArray(); - sb.append("\nCRL Extensions: " + objs.length); + sb.append("\nCRL Extensions: ").append(objs.length); for (int i = 0; i < objs.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = (Extension)objs[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -572,9 +573,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); // sub-class exists @@ -585,8 +585,7 @@ } if (signature != null) { HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) - + "\n"); + sb.append("\nSignature:\n").append(encoder.encodeBuffer(signature)).append('\n'); } else sb.append("NOT signed yet\n"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertImpl.java --- a/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertImpl.java Sun Aug 10 22:07:00 2014 -0300 @@ -802,11 +802,11 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(info.toString() + "\n"); - sb.append(" Algorithm: [" + algId.toString() + "]\n"); + sb.append(info.toString()).append('\n'); + sb.append(" Algorithm: [").append(algId.toString()).append("]\n"); HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); + sb.append(" Signature:\n").append(encoder.encodeBuffer(signature)); sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertInfo.java --- a/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertInfo.java Sun Aug 10 22:07:00 2014 -0300 @@ -298,27 +298,27 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(" " + version.toString() + "\n"); - sb.append(" Subject: " + subject.toString() + "\n"); - sb.append(" Signature Algorithm: " + algId.toString() + "\n"); - sb.append(" Key: " + pubKey.toString() + "\n"); - sb.append(" " + interval.toString() + "\n"); - sb.append(" Issuer: " + issuer.toString() + "\n"); - sb.append(" " + serialNum.toString() + "\n"); + sb.append(" ").append(version.toString()).append('\n'); + sb.append(" Subject: ").append(subject.toString()).append('\n'); + sb.append(" Signature Algorithm: ").append(algId.toString()).append('\n'); + sb.append(" Key: ").append(pubKey.toString()).append('\n'); + sb.append(" ").append(interval.toString()).append('\n'); + sb.append(" Issuer: ").append(issuer.toString()).append('\n'); + sb.append(" ").append(serialNum.toString()).append('\n'); // optional v2, v3 extras if (issuerUniqueId != null) { - sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n"); + sb.append(" Issuer Id:\n").append(issuerUniqueId.toString()).append('\n'); } if (subjectUniqueId != null) { - sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n"); + sb.append(" Subject Id:\n").append(subjectUniqueId.toString()).append('\n'); } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Extension[] exts = allExts.toArray(new Extension[0]); - sb.append("\nCertificate Extensions: " + exts.length); + sb.append("\nCertificate Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -329,9 +329,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists @@ -341,10 +340,10 @@ } Map invalid = extensions.getUnparseableExtensions(); if (invalid.isEmpty() == false) { - sb.append("\nUnparseable certificate extensions: " + invalid.size()); + sb.append("\nUnparseable certificate extensions: ").append(invalid.size()); int i = 1; for (Extension ext : invalid.values()) { - sb.append("\n[" + (i++) + "]: "); + sb.append("\n[").append(i++).append("]: "); sb.append(ext); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java --- a/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Sun Aug 10 22:07:00 2014 -0300 @@ -465,10 +465,10 @@ private static void appendIfLiteralAddress(String addr, StringBuffer sb) { if (IPAddressUtil.isIPv4LiteralAddress(addr)) { - sb.append("dns://" + addr + " "); + sb.append("dns://").append(addr).append(' '); } else { if (IPAddressUtil.isIPv6LiteralAddress(addr)) { - sb.append("dns://[" + addr + "] "); + sb.append("dns://[").append(addr).append("] "); } } } diff -r dde9f5cfde5f src/share/classes/sun/net/www/HeaderParser.java --- a/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/HeaderParser.java Sun Aug 10 22:07:00 2014 -0300 @@ -221,16 +221,16 @@ public String toString () { Iterator k = keys(); StringBuffer sbuf = new StringBuffer(); - sbuf.append ("{size="+asize+" nkeys="+nkeys+" "); + sbuf.append("{size=").append(asize).append(" nkeys=").append(nkeys).append(' '); for (int i=0; k.hasNext(); i++) { String key = k.next(); String val = findValue (i); if (val != null && "".equals (val)) { val = null; } - sbuf.append (" {"+key+(val==null?"":","+val)+"}"); + sbuf.append(" {").append(key).append(val == null ? "" : "," + val).append('}'); if (k.hasNext()) { - sbuf.append (","); + sbuf.append (','); } } sbuf.append (" }"); diff -r dde9f5cfde5f src/share/classes/sun/net/www/MimeEntry.java --- a/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/MimeEntry.java Sun Aug 10 22:07:00 2014 -0300 @@ -288,7 +288,7 @@ int action = getAction(); if (action != MimeEntry.UNKNOWN) { - sb.append("action=" + actionKeywords[action]); + sb.append("action=").append(actionKeywords[action]); needSeparator = true; } @@ -297,7 +297,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("application=" + command); + sb.append("application=").append(command); needSeparator = true; } @@ -305,7 +305,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("icon=" + getImageFileName()); + sb.append("icon=").append(getImageFileName()); needSeparator = true; } @@ -314,7 +314,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("file_extensions=" + extensions); + sb.append("file_extensions=").append(extensions); needSeparator = true; } @@ -323,7 +323,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("description=" + description); + sb.append("description=").append(description); } return sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/management/Agent.java --- a/src/share/classes/sun/management/Agent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/Agent.java Sun Aug 10 22:07:00 2014 -0300 @@ -502,7 +502,7 @@ } else { StringBuilder message = new StringBuilder(params[0]); for (int i = 1; i < params.length; i++) { - message.append(" " + params[i]); + message.append(' ').append(params[i]); } error(key, message.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/management/MappedMXBeanType.java --- a/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/MappedMXBeanType.java Sun Aug 10 22:07:00 2014 -0300 @@ -289,7 +289,7 @@ if (et.isPrimitive()) { className = new StringBuilder(c.getName()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); @@ -385,7 +385,7 @@ if (elementType instanceof Class && ((Class) elementType).isPrimitive()) { className = new StringBuilder(gat.toString()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/launcher/LauncherHelper.java --- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Sun Aug 10 22:07:00 2014 -0300 @@ -370,8 +370,7 @@ outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1", vm)); outBuf = (isServerClass) - ? outBuf.append(",\n" + - getLocalizedMessage("java.launcher.ergo.message2") + "\n\n") + ? outBuf.append(",\n").append(getLocalizedMessage("java.launcher.ergo.message2")).append("\n\n") : outBuf.append(".\n\n"); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/font/AttributeValues.java --- a/src/share/classes/sun/font/AttributeValues.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/AttributeValues.java Sun Aug 10 22:06:59 2014 -0300 @@ -542,7 +542,7 @@ } } } - b.append("[btx=" + baselineTransform + ", ctx=" + charTransform + "]"); + b.append("[btx=").append(baselineTransform).append(", ctx=").append(charTransform).append(']'); b.append('}'); return b.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/Decoration.java --- a/src/share/classes/sun/font/Decoration.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/Decoration.java Sun Aug 10 22:06:59 2014 -0300 @@ -431,12 +431,12 @@ StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); - if (fgPaint != null) sb.append("fgPaint: " + fgPaint); - if (bgPaint != null) sb.append(" bgPaint: " + bgPaint); + if (fgPaint != null) sb.append("fgPaint: ").append(fgPaint); + if (bgPaint != null) sb.append(" bgPaint: ").append(bgPaint); if (swapColors) sb.append(" swapColors: true"); if (strikethrough) sb.append(" strikethrough: true"); - if (stdUnderline != null) sb.append(" stdUnderline: " + stdUnderline); - if (imUnderline != null) sb.append(" imUnderline: " + imUnderline); + if (stdUnderline != null) sb.append(" stdUnderline: ").append(stdUnderline); + if (imUnderline != null) sb.append(" imUnderline: ").append(imUnderline); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/StandardGlyphVector.java --- a/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/StandardGlyphVector.java Sun Aug 10 22:06:59 2014 -0300 @@ -1894,9 +1894,9 @@ } } catch(Exception e) { - buf.append(" " + e.getMessage()); + buf.append(' ').append(e.getMessage()); } - buf.append("}"); + buf.append('}'); return buf; } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/swing/GroupLayout.java --- a/src/share/classes/javax/swing/GroupLayout.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/GroupLayout.java Sun Aug 10 22:06:59 2014 -0300 @@ -1239,15 +1239,12 @@ padding = ", userCreated=" + paddingSpring.getUserCreated() + ", matches=" + paddingSpring.getMatchDescription(); } - buffer.append(indent + spring.getClass().getName() + " " + - Integer.toHexString(spring.hashCode()) + " " + - origin + - ", size=" + spring.getSize() + - ", alignment=" + spring.getAlignment() + - " prefs=[" + spring.getMinimumSize(axis) + - " " + spring.getPreferredSize(axis) + - " " + spring.getMaximumSize(axis) + - padding + "]\n"); + buffer.append(indent).append(spring.getClass().getName()) + .append(' ').append(Integer.toHexString(spring.hashCode())).append(' ') + .append(origin).append(", size=").append(spring.getSize()).append(", alignment=") + .append(spring.getAlignment()).append(" prefs=[").append(spring.getMinimumSize(axis)).append(' ') + .append(spring.getPreferredSize(axis)).append(' ').append(spring.getMaximumSize(axis)) + .append(padding).append("]\n"); if (spring instanceof Group) { List springs = ((Group)spring).springs; indent += " "; diff -r dde9f5cfde5f src/share/classes/javax/swing/JColorChooser.java --- a/src/share/classes/javax/swing/JColorChooser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/JColorChooser.java Sun Aug 10 22:06:59 2014 -0300 @@ -545,8 +545,7 @@ protected String paramString() { StringBuilder chooserPanelsString = new StringBuilder(""); for (int i=0; i keys = keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); - sb.append(key + "=" + get(key) + ", "); + sb.append(key).append('=').append(get(key)).append(", "); } int length = sb.length(); if (length > 1) { sb.delete(length-2, length); } - sb.append("}"); + sb.append('}'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/RepaintManager.java --- a/src/share/classes/javax/swing/RepaintManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/RepaintManager.java Sun Aug 10 22:06:59 2014 -0300 @@ -992,7 +992,7 @@ public synchronized String toString() { StringBuilder sb = new StringBuilder(); if(dirtyComponents != null) - sb.append("" + dirtyComponents); + sb.append(dirtyComponents); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/swing/event/TreeModelEvent.java --- a/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/event/TreeModelEvent.java Sun Aug 10 22:06:59 2014 -0300 @@ -294,21 +294,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(getClass().getName() + " " + - Integer.toString(hashCode())); + sb.append(getClass().getName()).append(" ").append(Integer.toString(hashCode())); if(path != null) - sb.append(" path " + path); + sb.append(" path ").append(path); if(childIndices != null) { sb.append(" indices [ "); for(int counter = 0; counter < childIndices.length; counter++) - sb.append(Integer.toString(childIndices[counter])+ " "); - sb.append("]"); + sb.append(Integer.toString(childIndices[counter])).append(' '); + sb.append(']'); } if(children != null) { sb.append(" children [ "); for(int counter = 0; counter < children.length; counter++) - sb.append(children[counter] + " "); - sb.append("]"); + sb.append(children[counter]).append(' '); + sb.append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Sun Aug 10 22:06:59 2014 -0300 @@ -1330,8 +1330,8 @@ for (Object obj : values) { String val = ((obj == null) ? "" : obj.toString()); - plainBuf.append(val + "\n"); - htmlBuf.append("
  • " + val + "\n"); + plainBuf.append(val).append('\n'); + htmlBuf.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicListUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Sun Aug 10 22:06:59 2014 -0300 @@ -2948,8 +2948,8 @@ for (int i = 0; i < values.length; i++) { Object obj = values[i]; String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\n"); - htmlStr.append("
  • " + val + "\n"); + plainStr.append(val).append('\n'); + htmlStr.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTableUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Sun Aug 10 22:06:59 2014 -0300 @@ -2230,11 +2230,11 @@ for (int col = 0; col < cols.length; col++) { Object obj = table.getValueAt(rows[row], cols[col]); String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\t"); - htmlStr.append(" " + val + "\n"); + plainStr.append(val).append('\t'); + htmlStr.append(" ").append(val).append("\n"); } // we want a newline at the end of each line and not a tab - plainStr.deleteCharAt(plainStr.length() - 1).append("\n"); + plainStr.deleteCharAt(plainStr.length() - 1).append('\t'); htmlStr.append("\n"); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Sun Aug 10 22:06:59 2014 -0300 @@ -3618,8 +3618,8 @@ boolean leaf = model.isLeaf(node); String label = getDisplayString(path, true, leaf); - plainStr.append(label + "\n"); - htmlStr.append("
  • " + label + "\n"); + plainStr.append(label).append('\n'); + htmlStr.append("
  • ").append(label).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java --- a/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Sun Aug 10 22:06:59 2014 -0300 @@ -1160,15 +1160,15 @@ rows = rowMapper.getRowsForPaths(selection); else rows = null; - sb.append(getClass().getName() + " " + hashCode() + " [ "); + sb.append(getClass().getName()).append(' ').append(hashCode()).append(" [ "); for(int counter = 0; counter < selCount; counter++) { if(rows != null) - sb.append(selection[counter].toString() + "@" + - Integer.toString(rows[counter])+ " "); + sb.append(selection[counter].toString()).append('@') + .append(Integer.toString(rows[counter])).append(' '); else - sb.append(selection[counter].toString() + " "); + sb.append(selection[counter].toString()).append(' '); } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/AudioFileFormat.java --- a/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/AudioFileFormat.java Sun Aug 10 22:06:59 2014 -0300 @@ -276,19 +276,19 @@ //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() throws unexpected NullPointerException if (type != null) { - buf.append(type.toString() + " (." + type.getExtension() + ") file"); + buf.append(type.toString()).append(" (.").append(type.getExtension()).append(") file"); } else { buf.append("unknown file format"); } if (byteLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", byte length: " + byteLength); + buf.append(", byte length: ").append(byteLength); } - buf.append(", data format: " + format); + buf.append(", data format: ").append(format); if (frameLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", frame length: " + frameLength); + buf.append(", frame length: ").append(frameLength); } return new String(buf); diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/DataLine.java --- a/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/DataLine.java Sun Aug 10 22:06:59 2014 -0300 @@ -473,17 +473,17 @@ StringBuilder sb = new StringBuilder(); if ( (formats.length == 1) && (formats[0] != null) ) { - sb.append(" supporting format " + formats[0]); + sb.append(" supporting format ").append(formats[0]); } else if (getFormats().length > 1) { - sb.append(" supporting " + getFormats().length + " audio formats"); + sb.append(" supporting ").append(getFormats().length).append(" audio formats"); } if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) { - sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes"); + sb.append(", and buffers of ").append(minBufferSize).append(" to ").append(maxBufferSize).append(" bytes"); } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) { - sb.append(", and buffers of at least " + minBufferSize + " bytes"); + sb.append(", and buffers of at least ").append(minBufferSize).append(" bytes"); } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) { - sb.append(", and buffers of up to " + minBufferSize + " bytes"); + sb.append(", and buffers of up to ").append(minBufferSize).append(" bytes"); } return new String(super.toString() + sb); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/security/auth/kerberos/KerberosTicket.java --- a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Sun Aug 10 22:06:59 2014 -0300 @@ -651,8 +651,7 @@ StringBuilder caddrString = new StringBuilder(); if (clientAddresses != null) { for (int i = 0; i < clientAddresses.length; i++) { - caddrString.append("clientAddresses[" + i + "] = " + - clientAddresses[i].toString()); + caddrString.append("clientAddresses[").append(i).append("] = ").append(clientAddresses[i].toString()); } } return ("Ticket (hex) = " + "\n" + -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/naming/BinaryRefAddr.java --- a/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/BinaryRefAddr.java Sun Aug 10 22:06:59 2014 -0300 @@ -165,11 +165,11 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Address Type: " + addrType + "\n"); - + StringBuilder str = new StringBuilder(); + str.append("Address Type: ").append(addrType).append('\n'); str.append("AddressContents: "); for (int i = 0; i= 32) str.append(" ...\n"); diff -r dde9f5cfde5f src/share/classes/javax/naming/NameImpl.java --- a/src/share/classes/javax/naming/NameImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/NameImpl.java Sun Aug 10 22:06:59 2014 -0300 @@ -170,7 +170,7 @@ endQuote = one ? syntaxEndQuote1 : syntaxEndQuote2; i += syntaxTypevalSeparator.length(); - answer.append(syntaxTypevalSeparator+beginQuote); // add back + answer.append(syntaxTypevalSeparator).append(beginQuote); // add back // consume string until matching quote for (i += beginQuote.length(); diff -r dde9f5cfde5f src/share/classes/javax/naming/RefAddr.java --- a/src/share/classes/javax/naming/RefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/RefAddr.java Sun Aug 10 22:06:59 2014 -0300 @@ -139,9 +139,9 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Type: " + addrType + "\n"); - - str.append("Content: " + getContent() + "\n"); + StringBuilder str = new StringBuilder(); + str.append("Type: ").append(addrType).append('\n'); + str.append("Content: ").append(getContent()).append('\n'); return (str.toString()); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/crypto/CryptoPermission.java --- a/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/crypto/CryptoPermission.java Sun Aug 10 22:06:59 2014 -0300 @@ -370,20 +370,18 @@ */ public String toString() { StringBuilder buf = new StringBuilder(100); - buf.append("(CryptoPermission " + alg + " " + maxKeySize); + buf.append("(CryptoPermission ").append(alg).append(' ').append(maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { - buf.append(" , effective " + - ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits()); + buf.append(" , effective ").append(((RC2ParameterSpec) algParamSpec).getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { - buf.append(" , rounds " + - ((RC5ParameterSpec)algParamSpec).getRounds()); + buf.append(" , rounds ").append(((RC5ParameterSpec) algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL - buf.append(" " + exemptionMechanism); + buf.append(' ').append(exemptionMechanism); } - buf.append(")"); + buf.append(')'); return buf.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/management/MBeanPermission.java --- a/src/share/classes/javax/management/MBeanPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/MBeanPermission.java Sun Aug 10 22:06:59 2014 -0300 @@ -455,11 +455,11 @@ name.append(className); if (member == null) member = "-"; - name.append("#" + member); + name.append('#').append(member); if (objectName == null) name.append("[-]"); else - name.append("[").append(objectName.getCanonicalName()).append("]"); + name.append('[').append(objectName.getCanonicalName()).append(']'); /* In the interests of legibility for Permission.toString(), we transform the empty string into "*". */ diff -r dde9f5cfde5f src/share/classes/javax/management/modelmbean/RequiredModelMBean.java --- a/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Sun Aug 10 22:06:59 2014 -0300 @@ -716,15 +716,14 @@ } retStr.append("\nMBeanInfo for ModelMBean is:"); - retStr.append("\nCLASSNAME: \t"+ info.getClassName()); - retStr.append("\nDESCRIPTION: \t"+ info.getDescription()); + retStr.append("\nCLASSNAME: \t").append(info.getClassName()); + retStr.append("\nDESCRIPTION: \t").append(info.getDescription()); try { - retStr.append("\nMBEAN DESCRIPTOR: \t"+ - info.getMBeanDescriptor()); + retStr.append("\nMBEAN DESCRIPTOR: \t").append(info.getMBeanDescriptor()); } catch (Exception e) { - retStr.append("\nMBEAN DESCRIPTOR: \t" + " is invalid"); + retStr.append("\nMBEAN DESCRIPTOR: \t is invalid"); } retStr.append("\nATTRIBUTES"); @@ -734,13 +733,12 @@ for (int i=0; i { /* Serial version */ diff -r dde9f5cfde5f src/share/classes/javax/management/relation/Role.java --- a/src/share/classes/javax/management/relation/Role.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/Role.java Sun Aug 10 22:06:59 2014 -0300 @@ -227,7 +227,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + name + "; role value: "); + result.append("role name: ").append(name).append("; role value: "); for (Iterator objNameIter = objectNameList.iterator(); objNameIter.hasNext();) { ObjectName currObjName = objNameIter.next(); diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleInfo.java --- a/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleInfo.java Sun Aug 10 22:06:59 2014 -0300 @@ -456,13 +456,13 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role info name: " + name); - result.append("; isReadable: " + isReadable); - result.append("; isWritable: " + isWritable); - result.append("; description: " + description); - result.append("; minimum degree: " + minDegree); - result.append("; maximum degree: " + maxDegree); - result.append("; MBean class: " + referencedMBeanClassName); + result.append("role info name: ").append(name); + result.append("; isReadable: ").append(isReadable); + result.append("; isWritable: ").append(isWritable); + result.append("; description: ").append(description); + result.append("; minimum degree: ").append(minDegree); + result.append("; maximum degree: ").append(maxDegree); + result.append("; MBean class: ").append(referencedMBeanClassName); return result.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleUnresolved.java --- a/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleUnresolved.java Sun Aug 10 22:06:59 2014 -0300 @@ -282,7 +282,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + roleName); + result.append("role name: ").append(roleName); if (roleValue != null) { result.append("; value: "); for (Iterator objNameIter = roleValue.iterator(); @@ -294,7 +294,7 @@ } } } - result.append("; problem type: " + problemType); + result.append("; problem type: ").append(problemType); return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/util/Scanner.java --- a/src/share/classes/java/util/Scanner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/Scanner.java Sun Aug 10 22:06:59 2014 -0300 @@ -1304,20 +1304,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.Scanner"); - sb.append("[delimiters=" + delimPattern + "]"); - sb.append("[position=" + position + "]"); - sb.append("[match valid=" + matchValid + "]"); - sb.append("[need input=" + needInput + "]"); - sb.append("[source closed=" + sourceClosed + "]"); - sb.append("[skipped=" + skipped + "]"); - sb.append("[group separator=" + groupSeparator + "]"); - sb.append("[decimal separator=" + decimalSeparator + "]"); - sb.append("[positive prefix=" + positivePrefix + "]"); - sb.append("[negative prefix=" + negativePrefix + "]"); - sb.append("[positive suffix=" + positiveSuffix + "]"); - sb.append("[negative suffix=" + negativeSuffix + "]"); - sb.append("[NaN string=" + nanString + "]"); - sb.append("[infinity string=" + infinityString + "]"); + sb.append("[delimiters=").append(delimPattern).append(']'); + sb.append("[position=").append(position).append(']'); + sb.append("[match valid=").append(matchValid).append(']'); + sb.append("[need input=").append(needInput).append(']'); + sb.append("[source closed=").append(sourceClosed).append(']'); + sb.append("[skipped=").append(skipped).append(']'); + sb.append("[group separator=").append(groupSeparator).append(']'); + sb.append("[decimal separator=").append(decimalSeparator).append(']'); + sb.append("[positive prefix=").append(positivePrefix).append(']'); + sb.append("[negative prefix=").append(negativePrefix).append(']'); + sb.append("[positive suffix=").append(positiveSuffix).append(']'); + sb.append("[negative suffix=").append(negativeSuffix).append(']'); + sb.append("[NaN string=").append(nanString).append(']'); + sb.append("[infinity string=").append(infinityString).append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Matcher.java --- a/src/share/classes/java/util/regex/Matcher.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Matcher.java Sun Aug 10 22:06:59 2014 -0300 @@ -1295,14 +1295,14 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.regex.Matcher"); - sb.append("[pattern=" + pattern()); + sb.append("[pattern=").append(pattern()); sb.append(" region="); - sb.append(regionStart() + "," + regionEnd()); + sb.append(regionStart()).append(',').append(regionEnd()); sb.append(" lastmatch="); if ((first >= 0) && (group() != null)) { sb.append(group()); } - sb.append("]"); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Pattern.java --- a/src/share/classes/java/util/regex/Pattern.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Pattern.java Sun Aug 10 22:06:59 2014 -0300 @@ -1488,10 +1488,10 @@ for(int x=0; x0) - result.append("|"+next); + result.append('|').append(next); next = composeOneStep(next); if (next != null) - result.append("|"+produceEquivalentAlternation(next)); + result.append('|').append(produceEquivalentAlternation(next)); } return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/text/ChoiceFormat.java --- a/src/share/classes/java/text/ChoiceFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/text/ChoiceFormat.java Sun Aug 10 22:06:58 2014 -0300 @@ -272,7 +272,7 @@ double tryLess = Math.abs(Math.IEEEremainder(less, 1.0d)); if (tryLessOrEqual < tryLess) { - result.append(""+choiceLimits[i]); + result.append(choiceLimits[i]); result.append('#'); } else { if (choiceLimits[i] == Double.POSITIVE_INFINITY) { @@ -280,7 +280,7 @@ } else if (choiceLimits[i] == Double.NEGATIVE_INFINITY) { result.append("-\u221E"); } else { - result.append(""+less); + result.append(less); } result.append('<'); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/security/CodeSigner.java --- a/src/share/classes/java/security/CodeSigner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSigner.java Sun Aug 10 22:06:58 2014 -0300 @@ -156,9 +156,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("Signer: " + signerCertPath.getCertificates().get(0)); + sb.append("Signer: ").append(signerCertPath.getCertificates().get(0)); if (timestamp != null) { - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); } sb.append(")"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/java/security/CodeSource.java --- a/src/share/classes/java/security/CodeSource.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSource.java Sun Aug 10 22:06:58 2014 -0300 @@ -468,12 +468,12 @@ if (this.certs != null && this.certs.length > 0) { for (int i = 0; i < this.certs.length; i++) { - sb.append( " " + this.certs[i]); + sb.append(' ').append(this.certs[i]); } } else if (this.signers != null && this.signers.length > 0) { for (int i = 0; i < this.signers.length; i++) { - sb.append( " " + this.signers[i]); + sb.append(' ').append(this.signers[i]); } } else { sb.append(" "); diff -r dde9f5cfde5f src/share/classes/java/security/KeyStore.java --- a/src/share/classes/java/security/KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/KeyStore.java Sun Aug 10 22:06:58 2014 -0300 @@ -610,8 +610,7 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Private key entry and certificate chain with " - + chain.length + " elements:\r\n"); + sb.append("Private key entry and certificate chain with ").append(chain.length).append(" elements:\r\n"); for (Certificate cert : chain) { sb.append(cert); sb.append("\r\n"); diff -r dde9f5cfde5f src/share/classes/java/security/PermissionCollection.java --- a/src/share/classes/java/security/PermissionCollection.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/PermissionCollection.java Sun Aug 10 22:06:58 2014 -0300 @@ -179,12 +179,12 @@ public String toString() { Enumeration enum_ = elements(); StringBuilder sb = new StringBuilder(); - sb.append(super.toString()+" (\n"); + sb.append(super.toString()).append(" (\n"); while (enum_.hasMoreElements()) { try { - sb.append(" "); + sb.append(' '); sb.append(enum_.nextElement().toString()); - sb.append("\n"); + sb.append('\n'); } catch (NoSuchElementException e){ // ignore } diff -r dde9f5cfde5f src/share/classes/java/security/ProtectionDomain.java --- a/src/share/classes/java/security/ProtectionDomain.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/ProtectionDomain.java Sun Aug 10 22:06:58 2014 -0300 @@ -291,9 +291,9 @@ StringBuilder palBuf = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palBuf.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('\"'); if (i < principals.length-1) palBuf.append(",\n"); else diff -r dde9f5cfde5f src/share/classes/java/security/Timestamp.java --- a/src/share/classes/java/security/Timestamp.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/Timestamp.java Sun Aug 10 22:06:58 2014 -0300 @@ -143,10 +143,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); List certs = signerCertPath.getCertificates(); if (!certs.isEmpty()) { - sb.append("TSA: " + certs.get(0)); + sb.append("TSA: ").append(certs.get(0)); } else { sb.append("TSA: "); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CertPath.java --- a/src/share/classes/java/security/cert/CertPath.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CertPath.java Sun Aug 10 22:06:58 2014 -0300 @@ -224,17 +224,16 @@ Iterator stringIterator = getCertificates().iterator(); - sb.append("\n" + type + " Cert Path: length = " - + getCertificates().size() + ".\n"); + sb.append("\n").append(type).append(" Cert Path: length = ").append(getCertificates().size()).append(".\n"); sb.append("[\n"); int i = 1; while (stringIterator.hasNext()) { - sb.append("==========================================" - + "===============Certificate " + i + " start.\n"); + sb.append("==========================================" + "===============Certificate ") + .append(i).append(" start.\n"); Certificate stringCert = stringIterator.next(); sb.append(stringCert.toString()); - sb.append("\n========================================" - + "=================Certificate " + i + " end.\n\n\n"); + sb.append("\n========================================" + "=================Certificate ") + .append(i).append(" end.\n\n\n"); i++; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CollectionCertStoreParameters.java --- a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Sun Aug 10 22:06:58 2014 -0300 @@ -134,8 +134,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CollectionCertStoreParameters: [\n"); - sb.append(" collection: " + coll + "\n"); - sb.append("]"); + sb.append(" collection: ").append(coll).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/LDAPCertStoreParameters.java --- a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Sun Aug 10 22:06:58 2014 -0300 @@ -141,9 +141,9 @@ StringBuilder sb = new StringBuilder(); sb.append("LDAPCertStoreParameters: [\n"); - sb.append(" serverName: " + serverName + "\n"); - sb.append(" port: " + port + "\n"); - sb.append("]"); + sb.append(" serverName: ").append(serverName).append("\n"); + sb.append(" port: ").append(port).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXBuilderParameters.java --- a/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXBuilderParameters.java Sun Aug 10 22:06:58 2014 -0300 @@ -192,7 +192,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Maximum Path Length: " + maxPathLength + "\n"); + sb.append(" Maximum Path Length: ").append(maxPathLength).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Sun Aug 10 22:06:58 2014 -0300 @@ -109,11 +109,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathBuilderResult: [\n"); - sb.append(" Certification Path: " + certPath + "\n"); - sb.append(" Trust Anchor: " + getTrustAnchor().toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(getPolicyTree()) + "\n"); - sb.append(" Subject Public Key: " + getPublicKey() + "\n"); - sb.append("]"); + sb.append(" Certification Path: ").append(certPath).append('\n'); + sb.append(" Trust Anchor: ").append(getTrustAnchor().toString()).append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(getPolicyTree())).append('\n'); + sb.append(" Subject Public Key: ").append(getPublicKey()).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Sun Aug 10 22:06:58 2014 -0300 @@ -150,10 +150,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathValidatorResult: [\n"); - sb.append(" Trust Anchor: " + trustAnchor.toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(policyTree) + "\n"); - sb.append(" Subject Public Key: " + subjectPublicKey + "\n"); - sb.append("]"); + sb.append(" Trust Anchor: ").append(trustAnchor.toString()).append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(policyTree)).append('\n'); + sb.append(" Subject Public Key: ").append(subjectPublicKey).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXParameters.java --- a/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXParameters.java Sun Aug 10 22:06:58 2014 -0300 @@ -698,8 +698,7 @@ /* start with trusted anchor info */ if (unmodTrustAnchors != null) { - sb.append(" Trust Anchors: " + unmodTrustAnchors.toString() - + "\n"); + sb.append(" Trust Anchors: ").append(unmodTrustAnchors.toString()).append('\n'); } /* now, append initial state information */ @@ -707,30 +706,28 @@ if (unmodInitialPolicies.isEmpty()) { sb.append(" Initial Policy OIDs: any\n"); } else { - sb.append(" Initial Policy OIDs: [" - + unmodInitialPolicies.toString() + "]\n"); + sb.append(" Initial Policy OIDs: [").append(unmodInitialPolicies.toString()).append("]\n"); } } /* now, append constraints on all certificates in the path */ - sb.append(" Validity Date: " + String.valueOf(date) + "\n"); - sb.append(" Signature Provider: " + String.valueOf(sigProvider) + "\n"); - sb.append(" Default Revocation Enabled: " + revocationEnabled + "\n"); - sb.append(" Explicit Policy Required: " + explicitPolicyRequired + "\n"); - sb.append(" Policy Mapping Inhibited: " + policyMappingInhibited + "\n"); - sb.append(" Any Policy Inhibited: " + anyPolicyInhibited + "\n"); - sb.append(" Policy Qualifiers Rejected: " + policyQualifiersRejected + "\n"); + sb.append(" Validity Date: ").append(String.valueOf(date)).append('\n'); + sb.append(" Signature Provider: ").append(String.valueOf(sigProvider)).append('\n'); + sb.append(" Default Revocation Enabled: ").append(revocationEnabled).append('\n'); + sb.append(" Explicit Policy Required: ").append(explicitPolicyRequired).append('\n'); + sb.append(" Policy Mapping Inhibited: ").append(policyMappingInhibited).append('\n'); + sb.append(" Any Policy Inhibited: ").append(anyPolicyInhibited).append('\n'); + sb.append(" Policy Qualifiers Rejected: ").append(policyQualifiersRejected).append('\n'); /* now, append target cert requirements */ - sb.append(" Target Cert Constraints: " + String.valueOf(certSelector) + "\n"); + sb.append(" Target Cert Constraints: ").append(String.valueOf(certSelector)).append('\n'); /* finally, append miscellaneous parameters */ if (certPathCheckers != null) - sb.append(" Certification Path Checkers: [" - + certPathCheckers.toString() + "]\n"); + sb.append(" Certification Path Checkers: [").append(certPathCheckers.toString()).append("]\n"); if (certStores != null) - sb.append(" CertStores: [" + certStores.toString() + "]\n"); - sb.append("]"); + sb.append(" CertStores: [").append(certStores.toString()).append("]\n"); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PolicyQualifierInfo.java --- a/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PolicyQualifierInfo.java Sun Aug 10 22:06:58 2014 -0300 @@ -163,10 +163,9 @@ HexDumpEncoder enc = new HexDumpEncoder(); StringBuilder sb = new StringBuilder(); sb.append("PolicyQualifierInfo: [\n"); - sb.append(" qualifierID: " + mId + "\n"); - sb.append(" qualifier: " + - (mData == null ? "null" : enc.encodeBuffer(mData)) + "\n"); - sb.append("]"); + sb.append(" qualifierID: ").append(mId).append('\n'); + sb.append(" qualifier: ").append(mData == null ? "null" : enc.encodeBuffer(mData)).append('\n'); + sb.append(']'); pqiString = sb.toString(); return pqiString; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/TrustAnchor.java --- a/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/TrustAnchor.java Sun Aug 10 22:06:58 2014 -0300 @@ -320,14 +320,13 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); if (pubKey != null) { - sb.append(" Trusted CA Public Key: " + pubKey.toString() + "\n"); - sb.append(" Trusted CA Issuer Name: " - + String.valueOf(caName) + "\n"); + sb.append(" Trusted CA Public Key: ").append(pubKey.toString()).append('\n'); + sb.append(" Trusted CA Issuer Name: ").append(String.valueOf(caName)).append('\n'); } else { - sb.append(" Trusted CA cert: " + trustedCert.toString() + "\n"); + sb.append(" Trusted CA cert: ").append(trustedCert.toString()).append('\n'); } if (nc != null) - sb.append(" Name Constraints: " + nc.toString() + "\n"); + sb.append(" Name Constraints: ").append(nc.toString()).append('\n'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CRLSelector.java --- a/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CRLSelector.java Sun Aug 10 22:06:58 2014 -0300 @@ -572,17 +572,17 @@ sb.append(" IssuerNames:\n"); Iterator i = issuerNames.iterator(); while (i.hasNext()) - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } if (minCRL != null) - sb.append(" minCRLNumber: " + minCRL + "\n"); + sb.append(" minCRLNumber: ").append(minCRL).append('\n'); if (maxCRL != null) - sb.append(" maxCRLNumber: " + maxCRL + "\n"); + sb.append(" maxCRLNumber: ").append(maxCRL).append('\n'); if (dateAndTime != null) - sb.append(" dateAndTime: " + dateAndTime + "\n"); + sb.append(" dateAndTime: ").append(dateAndTime).append('\n'); if (certChecking != null) - sb.append(" Certificate being checked: " + certChecking + "\n"); - sb.append("]"); + sb.append(" Certificate being checked: ").append(certChecking).append('\n'); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CertSelector.java --- a/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CertSelector.java Sun Aug 10 22:06:58 2014 -0300 @@ -1814,72 +1814,65 @@ StringBuilder sb = new StringBuilder(); sb.append("X509CertSelector: [\n"); if (x509Cert != null) { - sb.append(" Certificate: " + x509Cert.toString() + "\n"); + sb.append(" Certificate: ").append(x509Cert.toString()).append('\n'); } if (serialNumber != null) { - sb.append(" Serial Number: " + serialNumber.toString() + "\n"); + sb.append(" Serial Number: ").append(serialNumber.toString()).append('\n'); } if (issuer != null) { - sb.append(" Issuer: " + getIssuerAsString() + "\n"); + sb.append(" Issuer: ").append(getIssuerAsString()).append('\n'); } if (subject != null) { - sb.append(" Subject: " + getSubjectAsString() + "\n"); + sb.append(" Subject: ").append(getSubjectAsString()).append('\n'); } - sb.append(" matchAllSubjectAltNames flag: " - + String.valueOf(matchAllSubjectAltNames) + "\n"); + sb.append(" matchAllSubjectAltNames flag: ") + .append(String.valueOf(matchAllSubjectAltNames)) + .append('\n'); if (subjectAlternativeNames != null) { sb.append(" SubjectAlternativeNames:\n"); Iterator> i = subjectAlternativeNames.iterator(); while (i.hasNext()) { List list = i.next(); - sb.append(" type " + list.get(0) + - ", name " + list.get(1) + "\n"); + sb.append(" type ").append(list.get(0)).append(", name ").append(list.get(1)).append('\n'); } } if (subjectKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Subject Key Identifier: " + - enc.encodeBuffer(subjectKeyID) + "\n"); + sb.append(" Subject Key Identifier: ").append(enc.encodeBuffer(subjectKeyID)).append('\n'); } if (authorityKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Authority Key Identifier: " + - enc.encodeBuffer(authorityKeyID) + "\n"); + sb.append(" Authority Key Identifier: ").append(enc.encodeBuffer(authorityKeyID)).append('\n'); } if (certificateValid != null) { - sb.append(" Certificate Valid: " + - certificateValid.toString() + "\n"); + sb.append(" Certificate Valid: ").append(certificateValid.toString()).append('\n'); } if (privateKeyValid != null) { - sb.append(" Private Key Valid: " + - privateKeyValid.toString() + "\n"); + sb.append(" Private Key Valid: ").append(privateKeyValid.toString()).append('\n'); } if (subjectPublicKeyAlgID != null) { - sb.append(" Subject Public Key AlgID: " + - subjectPublicKeyAlgID.toString() + "\n"); + sb.append(" Subject Public Key AlgID: ").append(subjectPublicKeyAlgID.toString()).append('\n'); } if (subjectPublicKey != null) { - sb.append(" Subject Public Key: " + - subjectPublicKey.toString() + "\n"); + sb.append(" Subject Public Key: ").append(subjectPublicKey.toString()).append('\n'); } if (keyUsage != null) { - sb.append(" Key Usage: " + keyUsageToString(keyUsage) + "\n"); + sb.append(" Key Usage: ").append(keyUsageToString(keyUsage)).append('\n'); } if (keyPurposeSet != null) { - sb.append(" Extended Key Usage: " + - keyPurposeSet.toString() + "\n"); + sb.append(" Extended Key Usage: ").append(keyPurposeSet.toString()).append('\n'); } if (policy != null) { - sb.append(" Policy: " + policy.toString() + "\n"); + sb.append(" Policy: ").append(policy.toString()).append('\n'); } if (pathToGeneralNames != null) { sb.append(" Path to names:\n"); Iterator i = pathToGeneralNames.iterator(); while (i.hasNext()) { - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/rmi/dgc/VMID.java --- a/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/rmi/dgc/VMID.java Sun Aug 10 22:06:58 2014 -0300 @@ -124,8 +124,7 @@ if (addr != null) for (int i = 0; i < addr.length; ++ i) { int x = addr[i] & 0xFF; - sb.append((x < 0x10 ? "0" : "") + - Integer.toString(x, 16)); + sb.append(x < 0x10 ? "0" : "").append(Integer.toString(x, 16)); } sb.append(':'); sb.append(uid.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/lang/management/MemoryUsage.java --- a/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/MemoryUsage.java Sun Aug 10 22:06:58 2014 -0300 @@ -238,11 +238,10 @@ */ public String toString() { StringBuilder buf = new StringBuilder(); - buf.append("init = " + init + "(" + (init >> 10) + "K) "); - buf.append("used = " + used + "(" + (used >> 10) + "K) "); - buf.append("committed = " + committed + "(" + - (committed >> 10) + "K) " ); - buf.append("max = " + max + "(" + (max >> 10) + "K)"); + buf.append("init = ").append(init).append('(').append(init >> 10).append("K) "); + buf.append("used = ").append(used).append('(').append(used >> 10).append("K) "); + buf.append("committed = ").append(committed).append('(').append(committed >> 10).append("K) "); + buf.append("max = ").append(max).append('(').append(max >> 10).append("K)"); return buf.toString(); } diff -r dde9f5cfde5f src/share/classes/java/lang/management/ThreadInfo.java --- a/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/ThreadInfo.java Sun Aug 10 22:06:58 2014 -0300 @@ -579,15 +579,17 @@ * @return a string representation of this thread info. */ public String toString() { - StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" + - " Id=" + getThreadId() + " " + - getThreadState()); + StringBuilder sb = new StringBuilder(); + sb.append('\"').append(getThreadName()).append('\"') + .append(" Id=").append(getThreadId()).append(' ') + .append(getThreadState()); + if (getLockName() != null) { - sb.append(" on " + getLockName()); + sb.append(" on ").append(getLockName()); } if (getLockOwnerName() != null) { - sb.append(" owned by \"" + getLockOwnerName() + - "\" Id=" + getLockOwnerId()); + sb.append(" owned by \"").append(getLockOwnerName()) + .append("\" Id=").append(getLockOwnerId()); } if (isSuspended()) { sb.append(" (suspended)"); @@ -599,21 +601,21 @@ int i = 0; for (; i < stackTrace.length && i < MAX_FRAMES; i++) { StackTraceElement ste = stackTrace[i]; - sb.append("\tat " + ste.toString()); + sb.append("\tat ").append(ste.toString()); sb.append('\n'); if (i == 0 && getLockInfo() != null) { Thread.State ts = getThreadState(); switch (ts) { case BLOCKED: - sb.append("\t- blocked on " + getLockInfo()); + sb.append("\t- blocked on ").append(getLockInfo()); sb.append('\n'); break; case WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; case TIMED_WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; default: @@ -622,7 +624,7 @@ for (MonitorInfo mi : lockedMonitors) { if (mi.getLockedStackDepth() == i) { - sb.append("\t- locked " + mi); + sb.append("\t- locked ").append(mi); sb.append('\n'); } } @@ -634,10 +636,10 @@ LockInfo[] locks = getLockedSynchronizers(); if (locks.length > 0) { - sb.append("\n\tNumber of locked synchronizers = " + locks.length); + sb.append("\n\tNumber of locked synchronizers = ").append(locks.length); sb.append('\n'); for (LockInfo li : locks) { - sb.append("\t- " + li); + sb.append("\t- ").append(li); sb.append('\n'); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHParameters.java --- a/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHParameters.java Sun Aug 10 22:06:58 2014 -0300 @@ -138,7 +138,7 @@ + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + sb.append(LINE_SEP).append("l:").append(LINE_SEP).append(" ").append(this.l); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHPublicKey.java --- a/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Sun Aug 10 22:06:58 2014 -0300 @@ -269,7 +269,7 @@ + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + sb.append(LINE_SEP).append("l:").append(LINE_SEP).append(" ").append(this.l); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/GCMParameters.java --- a/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/GCMParameters.java Sun Aug 10 22:06:58 2014 -0300 @@ -140,7 +140,7 @@ = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "[" + encoder.encodeBuffer(iv) + "]"); - sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP); + sb.append(LINE_SEP).append("tLen(bits):").append(LINE_SEP).append(tLen * 8).append(LINE_SEP); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/OAEPParameters.java --- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Sun Aug 10 22:06:58 2014 -0300 @@ -239,10 +239,9 @@ protected String engineToString() { StringBuilder sb = new StringBuilder(); - sb.append("MD: " + mdName + "\n"); - sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n"); - sb.append("PSource: PSpecified " + - (p.length==0? "":Debug.toHexString(new BigInteger(p))) + "\n"); + sb.append("MD: ").append(mdName).append('\n'); + sb.append("MGF: MGF1").append(mgfSpec.getDigestAlgorithm()).append('\n'); + sb.append("PSource: PSpecified ").append(p.length == 0 ? "" : Debug.toHexString(new BigInteger(p))).append('\n'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/RC2Parameters.java --- a/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Sun Aug 10 22:06:58 2014 -0300 @@ -221,8 +221,9 @@ + encoder.encodeBuffer(iv) + "]"); if (version != 0) { - sb.append(LINE_SEP + "version:" + LINE_SEP - + version + LINE_SEP); + sb.append(LINE_SEP).append("version:") + .append(LINE_SEP).append(version) + .append(LINE_SEP); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Sun Aug 10 22:06:58 2014 -0300 @@ -65,7 +65,7 @@ "extractSubNet", "BINARY ARRAY :"); StringBuilder sb = new StringBuilder(); for(int i =0; i < addrLength; i++) { - sb.append((b[i] & 0xFF) + ":"); + sb.append(b[i] & 0xFF).append(':'); } SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", sb.toString()); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Sun Aug 10 22:06:58 2014 -0300 @@ -204,7 +204,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Sun Aug 10 22:06:58 2014 -0300 @@ -379,7 +379,7 @@ } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); - jjtn000.name.append( "." + t.image); + jjtn000.name.append('.').append(t.image); } } finally { if (jjtc000) { @@ -408,7 +408,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -454,7 +454,7 @@ } jj_consume_token(MARK); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -483,7 +483,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } jj_consume_token(MASK); t = jj_consume_token(INTEGER_LITERAL); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Sun Aug 10 22:06:58 2014 -0300 @@ -99,7 +99,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java --- a/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Sun Aug 10 22:06:58 2014 -0300 @@ -479,10 +479,10 @@ */ public String printMessage() { StringBuilder sb = new StringBuilder(); - sb.append("msgId : " + msgId + "\n"); - sb.append("msgMaxSize : " + msgMaxSize + "\n"); - sb.append("msgFlags : " + msgFlags + "\n"); - sb.append("msgSecurityModel : " + msgSecurityModel + "\n"); + sb.append("msgId : ").append(msgId).append('\n'); + sb.append("msgMaxSize : ").append(msgMaxSize).append('\n'); + sb.append("msgFlags : ").append(msgFlags).append('\n'); + sb.append("msgSecurityModel : ").append(msgSecurityModel).append('\n'); if (contextEngineId == null) { sb.append("contextEngineId : null"); diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java --- a/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Sun Aug 10 22:06:58 2014 -0300 @@ -256,7 +256,7 @@ private static String stringifyComponent(NameComponent comp) { StringBuilder one = new StringBuilder(escape(comp.id)); if (comp.kind != null && !comp.kind.equals("")) { - one.append(kindSeparator + escape(comp.kind)); + one.append(kindSeparator).append(escape(comp.kind)); } if (one.length() == 0) { return ""+kindSeparator; // if neither id nor kind specified diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java --- a/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Sun Aug 10 22:06:58 2014 -0300 @@ -90,7 +90,7 @@ if (selected == -1) { StringBuilder allChoices = new StringBuilder(); for (int j = 0; j < choices.length; j++) { - allChoices.append(choices[j] + ","); + allChoices.append(choices[j]).append(','); } throw new IOException("Cannot match " + "'java.naming.security.sasl.realm' property value, '" + diff -r dde9f5cfde5f src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java --- a/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Sun Aug 10 22:06:58 2014 -0300 @@ -167,9 +167,9 @@ for (int i = 0; i < allchannelnames.length; i++) { if ((channelmask & m) != 0L) { if (i < channelnames.length) { - sb.append(channelnames[i] + " "); + sb.append(channelnames[i]).append(' '); } else { - sb.append(allchannelnames[i] + " "); + sb.append(allchannelnames[i]).append(' '); } } m *= 2L; diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Sun Aug 10 22:06:58 2014 -0300 @@ -235,14 +235,14 @@ String nodeName = att.getNodeName(); if ((nodeName.equals("xmlns") || nodeName.startsWith("xmlns:")) && !storedNamespaces.containsKey(att.getNodeName())) { - sb.append(" " + nodeName + "=\"" + att.getNodeValue() + "\""); + sb.append(' ').append(nodeName).append("=\"").append(att.getNodeValue()).append('\"'); storedNamespaces.put(nodeName, att.getNodeValue()); } } } wk = wk.getParentNode(); } - sb.append(">" + source + ""); + sb.append('>').append(source).append(""); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Sun Aug 10 22:06:58 2014 -0300 @@ -85,7 +85,7 @@ if (prefix.equals("xmlns")) { sb.append("#default "); } else { - sb.append(prefix + " "); + sb.append(prefix).append(' '); } } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Sun Aug 10 22:06:58 2014 -0300 @@ -88,7 +88,7 @@ l += countQuotes(DN, j, k); if ((k > 0) && (DN.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseRDN(DN.substring(i, k).trim(), toXml) + ","); + sb.append(parseRDN(DN.substring(i, k).trim(), toXml)).append(','); i = k + 1; l = 0; @@ -121,7 +121,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseATAV(trim(str.substring(i, k)), toXml) + "+"); + sb.append(parseATAV(trim(str.substring(i, k)), toXml)).append('+'); i = k + 1; l = 0; @@ -369,7 +369,7 @@ int k; for (int j = 0; (k = string.indexOf("\\20", j)) >= 0; j = k + 3) { - sb.append(trim(string.substring(i, k)) + "\\ "); + sb.append(trim(string.substring(i, k))).append("\\ "); i = k + 3; } @@ -418,7 +418,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(trim(str.substring(i, k)) + replace); + sb.append(trim(str.substring(i, k))).append(replace); i = k + 1; l = 0; diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/CramMD5Base.java --- a/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/CramMD5Base.java Sun Aug 10 22:06:58 2014 -0300 @@ -196,8 +196,7 @@ for (i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java --- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Sun Aug 10 22:06:58 2014 -0300 @@ -391,8 +391,7 @@ for (int i = 0; i < digest.length; i ++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0"+ - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/ParseException.java --- a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Sun Aug 10 22:06:58 2014 -0300 @@ -198,7 +198,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java --- a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Sun Aug 10 22:06:58 2014 -0300 @@ -107,7 +107,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java --- a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Sun Aug 10 22:06:58 2014 -0300 @@ -338,10 +338,10 @@ if (classpath.isEmpty()) { String envcp = System.getProperty("env.class.path"); if ((envcp != null) && (envcp.length() > 0)) { - munged.append(" -classpath " + envcp); + munged.append(" -classpath ").append(envcp); } } else { - munged.append(" -classpath " + classpath.asString()); + munged.append(" -classpath ").append(classpath.asString()); } return munged.toString(); } else { diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Sun Aug 10 22:06:58 2014 -0300 @@ -386,37 +386,37 @@ } case 'B': { int val = 0xFF & byteAt(i, value); - result.append("0x" + Integer.toString(val, 16)); + result.append("0x").append(Integer.toString(val, 16)); i++; break; } case 'S': { short val = shortAt(i, value); i += 2; - result.append("" + val); + result.append(val); break; } case 'I': { int val = intAt(i, value); i += 4; - result.append("" + val); + result.append(val); break; } case 'J': { // long long val = longAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } case 'F': { float val = floatAt(i, value); - result.append("" + val); + result.append(val); i += 4; break; } case 'D': { // double double val = doubleAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } @@ -425,7 +425,7 @@ } } } - result.append("}"); + result.append('}'); } return result.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/util/Misc.java --- a/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Sun Aug 10 22:06:58 2014 -0300 @@ -97,11 +97,11 @@ } else if (ch == '&') { sb.append("&"); } else if (ch < ' ') { - sb.append("&#" + Integer.toString(ch) + ";"); + sb.append("&#").append(Integer.toString(ch)).append(';'); } else { int c = (ch & 0xFFFF); if (c > 127) { - sb.append("&#" + Integer.toString(c) + ";"); + sb.append("&#").append(Integer.toString(c)).append(';'); } else { sb.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java --- a/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Sun Aug 10 22:06:58 2014 -0300 @@ -881,12 +881,12 @@ } else if (tag == JDWP.TypeTag.ARRAY) { sb.append("ArrayType"); } else { - sb.append("UNKNOWN TAG: " + tag); + sb.append("UNKNOWN TAG: ").append(tag); } if (signature != null) { - sb.append(", signature='" + signature + "'"); + sb.append(", signature='").append(signature).append('\''); } - sb.append(", id=" + id); + sb.append(", id=").append(id); vm.printTrace(sb.toString()); } if (id == 0) { From weijun.wang at oracle.com Mon Aug 11 07:35:11 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Mon, 11 Aug 2014 15:35:11 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> Message-ID: '\"' can be written as '"': com_sun.diff:209:+ sb.append(' ').append(nodeName).append("=\"").append(att.getNodeValue()).append('\"'); java_lang.diff:31:+ sb.append('\"').append(getThreadName()).append('\"') java_security.diff:78:+ .append('\"'); sun_security.diff:95:+ sb.append(principalInfo[i][0]).append(' ').append('\"').append(principalInfo[i][1]).append('\"'); sun_security.diff:108:+ .append('\"'); sun_security.diff:122:+ sb.append(X500PRINCIPAL).append(" \"").append(suffix).append('\"'); sun_security.diff:312:+ retval.append('\"').append(sbuffer.toString()).append('\"'); Still using append("."): java_security.diff:107:+ sb.append("\n").append(type).append(" Cert Path: length = ").append(getCertificates().size()).append(".\n"); java_security.diff:148:+ sb.append(" serverName: ").append(serverName).append("\n"); javax_swing.diff:79:+ sb.append(getClass().getName()).append(" ").append(Integer.toString(hashCode())); sun_security.diff:419:+ sb.append("X.509 CRL v").append(version + 1).append("\n"); I only read the security related files, but I grep for the two groups above. Also, it's better to put rb.getString(...) to one line sun_security.diff:268:+ sb.append('\n').append(tab).append(rb.getString( sun_security.diff:273:+ sb.append('\n').append(tab).append(rb.getString( And some lines are too long. Thanks Max On Aug 11, 2014, at 11:29, Ot?vio Gon?alves de Santana wrote: > Done. > > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_2.zip > > obs: stay the 2 chars to better performance. > > > On Sun, Aug 10, 2014 at 8:03 PM, Claes Redestad wrote: > +1 > > Some suggestions (mostly nits): > > - in places like src/share/classes/java/util/regex/Pattern.java you introducesingle-char > strings which might use a char instead: > > - result.append("|"+next); > + result.append('|').append(next); > > - in places like src/share/classes/sun/security/provider/PolicyFile.java > you end up with a sequence of String literal appends which could be merged into one: > > - sb.append(principalInfo[i][0] + " " + > - "\"" + principalInfo[i][1] + "\""); > + sb.append(principalInfo[i][0]).append(" \"") > + .append(principalInfo[i][1]).append('"'); > > - in some places like src/share/classes/java/text/ChoiceFormat.java > you end up doing append(""). I guess the empty string concatenation was used as a form > of primitive-to-string coercion and was probably always redundant already, but care needs > to be taken that doing the append directly behave as intended. > > I think it should be safe to just remove the empty string append in most cases: > > - result.append(""+choiceLimits[i]); > + result.append(choiceLimits[i]); > > Thanks! > > /Claes > > On 2014-08-10 23:33, Ot?vio Gon?alves de Santana wrote: > *Motivation:* Make another append instead of concat String inside of append > > parameter in StringBuilder class. To avoid an extra StringBuilder created > for the purpose of concatenating. So it will save memory and will faster > than concat String. > Doing a code to benchMark[1], the result is: > > Benchmark Mode Samples > Mean Mean error Units > m.StringBuilderConcatBenchMark.stringBuilder thrpt 10 > 6317444.705 108673.584 ops/s > m.StringBuilderConcatBenchMark.stringBuilderWithConcat thrpt 10 > 3354554.435 68353.924 ops/s > > The webrev of all code is: > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat.zip > > > [1] > > @State(Scope.Thread) > @OutputTimeUnit(TimeUnit.SECONDS) > public class StringBuilderConcatBenchMark { > > > private static final String F = "!!!!"; > private static final String E = " running in Java "; > private static final String D = " in the code "; > private static final String C = " to try impact "; > private static final String B = " with some text "; > private static final String A = "Doing a test"; > > @GenerateMicroBenchmark > public void stringBuilder(BlackHole bh) { > bh.consume(createBuilder(A, B, C, D, E, F)); > } > > @GenerateMicroBenchmark > public void stringBuilderWithConcat(BlackHole bh) { > bh.consume(createBuilderWithConcat(A, B, C, D, E, F)); > } > > private StringBuilder createBuilder(String... values) { > StringBuilder text = new StringBuilder(); > text.append(values[0]).append(values[1]) > .append(values[2]).append(values[3]) > .append(values[4]).append(values[5]); > return text; > } > private StringBuilder createBuilderWithConcat(String... values) { > StringBuilder text = new StringBuilder(); > text.append(values[0] + values[1]) > .append(values[2] + values[3]) > .append(values[4]+ values[5]); > return text; > } > } > > > > > > -- > Ot?vio Gon?alves de Santana > > blog: http://otaviosantana.blogspot.com.br/ > twitter: http://twitter.com/otaviojava > site: http://about.me/otaviojava > 55 (11) 98255-3513 > From andrej.golovnin at gmail.com Mon Aug 11 09:42:41 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Mon, 11 Aug 2014 11:42:41 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> Message-ID: Hi Ot?vio, the class src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java is generated from the grammar src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Therefore when you are going to change the Parser class, then you must change the grammar files too. In other case your changes maybe overwritten in the future, when someone decides to regenerate the Parser class. The classes src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java are generated from the templates provided by JavaCC https://java.net/projects/javacc/sources/svn/show/trunk/src/main/resources/templates?rev=689 You should consider contributing you changes to the ParseException and TokenMgrError classes to the JavaCC project as well. In the class src/share/classes/javax/management/openmbean/CompositeType.java you have added the annotation @SuppressWarnings("StringConcatenationInsideStringBufferAppend") instead of fixing the concatenation inside the append method. Why? And I would like to suggest to drop explicit usage of StringBuilder in some methods at all to improve code readability. Take look for example at the class src/share/classes/java/lang/management/MemoryUsage.java and its #toString()-method: Before your change: 239 public String toString() { 240 StringBuilder buf = new StringBuilder(); 241 buf.append("init = " + init + "(" + (init >> 10) + "K) "); 242 buf.append("used = " + used + "(" + (used >> 10) + "K) "); 243 buf.append("committed = " + committed + "(" + 244 (committed >> 10) + "K) " ); 245 buf.append("max = " + max + "(" + (max >> 10) + "K)"); 246 return buf.toString(); 247 } After your change: 239 public String toString() { 240 StringBuilder buf = new StringBuilder(); 241 buf.append("init = ").append(init).append('(').append(init >> 10).append("K) "); 242 buf.append("used = ").append(used).append('(').append(used >> 10).append("K) "); 243 buf.append("committed = ").append(committed).append('(').append(committed >> 10).append("K) "); 244 buf.append("max = ").append(max).append('(').append(max >> 10).append("K)"); 245 return buf.toString(); 246 } And if we drop explicit usage of StringBuilder and let the Java compiler do its magic, then it looks like this: 239 public String toString() { 240 return "init = " + init + "(" + (init >> 10) + "K) " 241 + "used = " + used + "(" + (used >> 10) + "K) " 242 + "committed = " + committed + "(" + (committed >> 10) + "K) " 243 + "max = " + max + "(" + (max >> 10) + "K)"; 244 } For me this code is easier to read and understand, then the code before and after your change. But this is only my opinion. Other candidates for such change may be: src/share/classes/com/sun/crypto/provider/DHParameters.java src/share/classes/com/sun/crypto/provider/DHPublicKey.java src/share/classes/com/sun/crypto/provider/GCMParameters.java src/share/classes/com/sun/crypto/provider/OAEPParameters.java src/share/classes/com/sun/crypto/provider/RC2Parameters.java src/share/classes/java/security/CodeSigner.java src/share/classes/java/security/cert/CollectionCertStoreParameters.java src/share/classes/java/security/cert/LDAPCertStoreParameters.java src/share/classes/java/security/cert/PKIXBuilderParameters.java src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java src/share/classes/java/security/cert/PolicyQualifierInfo.java src/share/classes/java/util/Scanner.java src/share/classes/java/util/regex/Matcher.java src/share/classes/javax/management/relation/RoleInfo.java src/share/classes/javax/naming/RefAddr.java src/share/classes/sun/security/pkcs/SigningCertificateInfo.java src/share/classes/sun/security/provider/certpath/CertId.java src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java src/share/classes/sun/security/x509/DistributionPointName.java src/share/classes/sun/security/x509/PolicyInformation.java src/share/classes/sun/security/x509/X509CertImpl.java In the #toString()-method of src/share/classes/javax/swing/RepaintManager.java we can avoid creation of StringBuilder if we change it from: 992 public synchronized String toString() { 993 StringBuilder sb = new StringBuilder(); 994 if(dirtyComponents != null) 995 sb.append(dirtyComponents); 996 return sb.toString(); 997 } to: 992 public synchronized String toString() { 993 return dirtyComponents != null ? dirtyComponents.toString : ""; 994 } In src/share/classes/sun/net/www/HeaderParser.java please change the line 223 to use StringBuilder instead of StringBuffer. In the class src/share/classes/sun/security/ssl/ServerNameExtension.java the #toString()-method can be changed from: 268 public String toString() { 269 StringBuilder sb = new StringBuilder(); 270 for (SNIServerName sniName : sniMap.values()) { 271 sb.append('[').append(sniName).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(type).append(", server_name: "); 271 for (SNIServerName sniName : sniMap.values()) { 272 sb.append('[').append(sniName).append(']'); 273 } 274 275 return sb.toString(); 276 } to avoid creation of an additional StringBuilder-object in the line 274. Similar 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 < otaviojava at java.net> wrote: > Done. > > > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_2.zip > > obs: stay the 2 chars to better performance. > > > On Sun, Aug 10, 2014 at 8:03 PM, Claes Redestad > > wrote: > > > +1 > > > > Some suggestions (mostly nits): > > > > - in places like src/share/classes/java/util/regex/Pattern.java you > > introducesingle-char > > strings which might use a char instead: > > > > - result.append("|"+next); > > + result.append('|').append(next); > > > > - in places like src/share/classes/sun/security/provider/PolicyFile.java > > you end up with a sequence of String literal appends which could be > > merged into one: > > > > - sb.append(principalInfo[i][0] + " " + > > - "\"" + principalInfo[i][1] + "\""); > > + sb.append(principalInfo[i][0]).append(" \"") > > + .append(principalInfo[i][1]).append('"'); > > > > - in some places like src/share/classes/java/text/ChoiceFormat.java > > you end up doing append(""). I guess the empty string concatenation was > > used as a form > > of primitive-to-string coercion and was probably always redundant > > already, but care needs > > to be taken that doing the append directly behave as intended. > > > > I think it should be safe to just remove the empty string append in > most > > cases: > > > > - result.append(""+choiceLimits[i]); > > + result.append(choiceLimits[i]); > > > > Thanks! > > > > /Claes > > > > On 2014-08-10 23:33, Ot?vio Gon?alves de Santana wrote: > > > >> *Motivation:* Make another append instead of concat String inside of > >> append > >> > >> parameter in StringBuilder class. To avoid an extra StringBuilder > created > >> for the purpose of concatenating. So it will save memory and will faster > >> than concat String. > >> Doing a code to benchMark[1], the result is: > >> > >> Benchmark Mode > Samples > >> Mean Mean error Units > >> m.StringBuilderConcatBenchMark.stringBuilder thrpt > 10 > >> 6317444.705 108673.584 ops/s > >> m.StringBuilderConcatBenchMark.stringBuilderWithConcat thrpt > 10 > >> 3354554.435 68353.924 ops/s > >> > >> The webrev of all code is: > >> https://dl.dropboxusercontent.com/u/16109193/open_jdk/ > >> string_builder_concat.zip > >> >> builder_concat.zip> > >> > >> [1] > >> > >> @State(Scope.Thread) > >> @OutputTimeUnit(TimeUnit.SECONDS) > >> public class StringBuilderConcatBenchMark { > >> > >> > >> private static final String F = "!!!!"; > >> private static final String E = " running in Java "; > >> private static final String D = " in the code "; > >> private static final String C = " to try impact "; > >> private static final String B = " with some text "; > >> private static final String A = "Doing a test"; > >> > >> @GenerateMicroBenchmark > >> public void stringBuilder(BlackHole bh) { > >> bh.consume(createBuilder(A, B, C, D, E, F)); > >> } > >> > >> @GenerateMicroBenchmark > >> public void stringBuilderWithConcat(BlackHole bh) { > >> bh.consume(createBuilderWithConcat(A, B, C, D, E, F)); > >> } > >> > >> private StringBuilder createBuilder(String... values) { > >> StringBuilder text = new StringBuilder(); > >> text.append(values[0]).append(values[1]) > >> .append(values[2]).append(values[3]) > >> .append(values[4]).append(values[5]); > >> return text; > >> } > >> private StringBuilder createBuilderWithConcat(String... values) { > >> StringBuilder text = new StringBuilder(); > >> text.append(values[0] + values[1]) > >> .append(values[2] + values[3]) > >> .append(values[4]+ values[5]); > >> return text; > >> } > >> } > >> > >> > > > > > -- > Ot?vio Gon?alves de Santana > > blog: http://otaviosantana.blogspot.com.br/ > twitter: http://twitter.com/otaviojava > site: *http://about.me/otaviojava * > 55 (11) 98255-3513 > From peter.firmstone at zeus.net.au Mon Aug 11 10:12:14 2014 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Mon, 11 Aug 2014 20:12:14 +1000 Subject: The future of Serialization In-Reply-To: <53E6586F.7080906@oracle.com> References: <1407563776.1841.30.camel@Nokia-N900> <53E6586F.7080906@oracle.com> Message-ID: <53E896FE.3030706@zeus.net.au> Brian, Thanks for picking up on my frustration ;) I have something in mind for Serializable2 to address cyclic data structures and the possibility of independant evolution of super and child classes, while retaining a relatively clean public api, with one optional private method. The methods and interfaces proposed are suitable for any alternative ObjectInput and ObjectOutput implementation. An interface exists in Apache River, it's called Startable, it has one method: public void start() throws Exception; It's called by a framework to allow an Object to start threads, publish "this" or throw an exception after construction. The intent is to allow an object to be immutable with final fields and be provided with a thread of execution after construction and before publication. Something similar can be used to wire up circular relations, let met explain: Every class that implements Serializable has one thing in common, the Serialization protocol and every Object instance of a Serializable class has an arbitrary serial form. I propose a final class representing SerialForm for an object, that cannot be extended, requires privilege to instantiate and also performs method guard security checks, for all callers with the exception of a calling class reading or writing its own serial form. SerialForm needs a parameter field key identity represented by the calling Class, the method name and the field's Class type, this key would be used for both writing and retrieving a field entry in SerialForm. SerialForm will also provide a method to advise if a field key contains a circular relation, any field entry in SerialForm that would contain a circular relation is not populated until after construction of the current object is complete. An arbitrary Serializable2 Object instance may be composed of a hierarchy of classes, each belonging to a separate ProtectionDomain. For the following interface: public interface Serializable2 { void writeObject(SerialForm serial) throws IOException; } Implementers of Serializable2 must: 1. Implement writeObject 2. Implement a constructor with the signature: (SerialForm serial). Implementors that need to check invariants, delay throwing an Exception, publish "this" or set a circular reference after construction should: 4. Implement: private void readObjectNoData() throws InvalidObjectException; Child class implementations should: 5. Call their super class writeObject method and superclass constructor, but may call any super class constructor or methods. Compatibility and Evolution: 1. Fields can be included or omitted from SerialForm, by an implementation, without breaking compatibility, provided a null reference is accepted during deserialization. 2. Child classes in a hierarchy; all Serializable2 implementing superclass constructors have the same signature; the superclass implementation can be substituted, without breaking child class deserialization (provided this is the constructor used by the child class). 3. There is no serialVersionUID. 4. Child class Serializable2 implementations can extend a superclass without a zero arg constructor that doesn't itself implement Serializable2. 5. Child classes that do not override writeObject will not be serialized, so can effectively opt out. 6. Because implementations are required to implement public methods, there is no "Magic". 7. Serializable2 shouldn't extend Serializable, allowing classes to implement both interfaces for a period of time (for that reason the signature for readObjectNoData may need to be changed for Serializable2). 8. ObjectInputStream and ObjectOutputStream can be extended to support both implementations for compatibility, however alternative stream implementations would be preferable for Serializable2 to avoid Serializable security issues. The new implementations should be possible to substitute because both types would use the same Stream Protocol, provided the classes being deserialized implement Serializable2. My reasoning for retaining readObjectNoData() and for updating field entry's in SerialForm that contain circular relations after construction, is: 1. An object reference for the object currently being deserialized can be passed to another object's constructor (via a SerialForm instance) after the current Object's constructor completes, allowing safe publication of final field freezes that occur at the end of construction. 2. When the Serialization2 Framework becomes aware of an object that contains a circular relationship while that object is in the process of being deserialized, the second object will not be instantiated until after the constructor of the first object in the relationship completes. Data read in from the stream can be stored in a SerialForm without requiring object instantation. 3. After construction completes, the object that has just been deserialized can retain a copy of its SerialForm and look up the field containing a circular relationship, the Serialization framework will update its SerialForm with the new object that holds a circular relationship, prior to calling readObjectNoData() on the first object. 4. If the developer of the implementing class is not aware of the possibility of a circular relationship, then the worst consequence is a field will be set to null during construction, "this" will not escape. 5. The second Object holding a link to an object that apears earlier in the stream, may not be aware that the object it holds a reference to also needs a reference to it. The first object will not obtain a reference to the second until both Object constructors have completed. The second object may not need to implement readObjectNoData(). 6. readObjectNoData() needs to be called on every class belonging to a single Object's inheritance hierarchy, when defined, after all constructors have completed, it should be called in the order of superclass to child class. Thoughts? Regards, Peter. On 10/08/2014 3:20 AM, Brian Goetz wrote: >> I've noticed there's not much interest in improving Serialization on >> these lists. This makes me wonder if java Serialization has lost >> relevance in recent years with the rise of protocol buffers apache >> thrift and other means of data transfer over byte streams. > > I sense your frustration, but I think you may be reaching the wrong > conclusion. The lack of response is probably not evidence that > there's no interest in fixing serialization; its that fixing > serialization, with all the constraints that "fix" entails, is just > really really hard, and its much easier to complain about it (and even > say "let's just get rid of it") than to fix it. > >> Should Serializable eventually be deprecated? Should Serialization be >> disabled by default? Should a new mechanism be developed? If a new >> mechanism is developed, what about circular object relationships? > > As I delved into my own explorations of serialization, I started to > realize why such a horrible approach was the one that was ultimately > chosen; while serialization is horrible and awful and leaky and > insecure and complex and brittle, it does address problems like cyclic > data structures and independent evolution of subclass and superclass > better than the "clean" models. > > My conclusion is, at best, a new mechanism would have to live > side-by-side with the old one, since it could only handle 95% of the > cases. It might handle those 95% much better -- more cleanly, > securely, and allowing easier schema evolution -- but the hard cases > are still there. Still, reducing the use of the horrible old > mechanism may still be a worthy goal, even if it can't be killed > outright. > From peter.firmstone at zeus.net.au Mon Aug 11 10:18:28 2014 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Mon, 11 Aug 2014 20:18:28 +1000 Subject: The future of Serialization In-Reply-To: <53E896FE.3030706@zeus.net.au> References: <1407563776.1841.30.camel@Nokia-N900> <53E6586F.7080906@oracle.com> <53E896FE.3030706@zeus.net.au> Message-ID: <53E89874.8060902@zeus.net.au> On 11/08/2014 8:12 PM, Peter Firmstone wrote: > Brian, > > Thanks for picking up on my frustration ;) > > I have something in mind for Serializable2 to address cyclic data > structures and the possibility of independant evolution of super and > child classes, while retaining a relatively clean public api, with one > optional private method. The methods and interfaces proposed are > suitable for any alternative ObjectInput and ObjectOutput implementation. > > An interface exists in Apache River, it's called Startable, it has one > method: > > public void start() throws Exception; > > It's called by a framework to allow an Object to start threads, > publish "this" or throw an exception after construction. The intent > is to allow an object to be immutable with final fields and be > provided with a thread of execution after construction and before > publication. > > Something similar can be used to wire up circular relations, let met > explain: > > Every class that implements Serializable has one thing in common, the > Serialization protocol and every Object instance of a Serializable > class has an arbitrary serial form. > > I propose a final class representing SerialForm for an object, that > cannot be extended, requires privilege to instantiate and also > performs method guard security checks, for all callers with the > exception of a calling class reading or writing its own serial form. > SerialForm needs a parameter field key identity represented by the > calling Class, Sorry, that should read "field name", not "method name". > the method name and the field's Class type, this key would be used for > both writing and retrieving a field entry in SerialForm. SerialForm > will also provide a method to advise if a field key contains a > circular relation, any field entry in SerialForm that would contain a > circular relation is not populated until after construction of the > current object is complete. > > An arbitrary Serializable2 Object instance may be composed of a > hierarchy of classes, each belonging to a separate ProtectionDomain. > > For the following interface: > > public interface Serializable2 { > > void writeObject(SerialForm serial) throws IOException; > > } > > Implementers of Serializable2 must: > > 1. Implement writeObject > 2. Implement a constructor with the signature: (SerialForm serial). > > Implementors that need to check invariants, delay throwing an > Exception, publish "this" or set a circular reference after > construction should: > > 4. Implement: private void readObjectNoData() throws > InvalidObjectException; > > Child class implementations should: > > 5. Call their super class writeObject method and superclass > constructor, but may call any super class constructor or methods. > > Compatibility and Evolution: > > 1. Fields can be included or omitted from SerialForm, by an > implementation, without breaking compatibility, provided a null > reference is accepted during deserialization. > 2. Child classes in a hierarchy; all Serializable2 implementing > superclass constructors have the same signature; the superclass > implementation can be substituted, without breaking child class > deserialization (provided this is the constructor used by the > child class). > 3. There is no serialVersionUID. > 4. Child class Serializable2 implementations can extend a superclass > without a zero arg constructor that doesn't itself implement > Serializable2. > 5. Child classes that do not override writeObject will not be > serialized, so can effectively opt out. > 6. Because implementations are required to implement public methods, > there is no "Magic". > 7. Serializable2 shouldn't extend Serializable, allowing classes to > implement both interfaces for a period of time (for that reason > the signature for readObjectNoData may need to be changed for > Serializable2). > 8. ObjectInputStream and ObjectOutputStream can be extended to > support both implementations for compatibility, however > alternative stream implementations would be preferable for > Serializable2 to avoid Serializable security issues. The new > implementations should be possible to substitute because both > types would use the same Stream Protocol, provided the classes > being deserialized implement Serializable2. > > > My reasoning for retaining readObjectNoData() and for updating field > entry's in SerialForm that contain circular relations after > construction, is: > > 1. An object reference for the object currently being deserialized > can be passed to another object's constructor (via a SerialForm > instance) after the current Object's constructor completes, > allowing safe publication of final field freezes that occur at the > end of construction. > 2. When the Serialization2 Framework becomes aware of an object that > contains a circular relationship while that object is in the > process of being deserialized, the second object will not be > instantiated until after the constructor of the first object in > the relationship completes. Data read in from the stream can be > stored in a SerialForm without requiring object instantation. > 3. After construction completes, the object that has just been > deserialized can retain a copy of its SerialForm and look up the > field containing a circular relationship, the Serialization > framework will update its SerialForm with the new object that > holds a circular relationship, prior to calling readObjectNoData() > on the first object. > 4. If the developer of the implementing class is not aware of the > possibility of a circular relationship, then the worst consequence > is a field will be set to null during construction, "this" will > not escape. > 5. The second Object holding a link to an object that apears earlier > in the stream, may not be aware that the object it holds a > reference to also needs a reference to it. The first object will > not obtain a reference to the second until both Object > constructors have completed. The second object may not need to > implement readObjectNoData(). > 6. readObjectNoData() needs to be called on every class belonging to > a single Object's inheritance hierarchy, when defined, after all > constructors have completed, it should be called in the order of > superclass to child class. > > Thoughts? > > Regards, > > Peter. > > On 10/08/2014 3:20 AM, Brian Goetz wrote: >>> I've noticed there's not much interest in improving Serialization on >>> these lists. This makes me wonder if java Serialization has lost >>> relevance in recent years with the rise of protocol buffers apache >>> thrift and other means of data transfer over byte streams. >> >> I sense your frustration, but I think you may be reaching the wrong >> conclusion. The lack of response is probably not evidence that >> there's no interest in fixing serialization; its that fixing >> serialization, with all the constraints that "fix" entails, is just >> really really hard, and its much easier to complain about it (and >> even say "let's just get rid of it") than to fix it. >> >>> Should Serializable eventually be deprecated? Should Serialization be >>> disabled by default? Should a new mechanism be developed? If a new >>> mechanism is developed, what about circular object relationships? >> >> As I delved into my own explorations of serialization, I started to >> realize why such a horrible approach was the one that was ultimately >> chosen; while serialization is horrible and awful and leaky and >> insecure and complex and brittle, it does address problems like >> cyclic data structures and independent evolution of subclass and >> superclass better than the "clean" models. >> >> My conclusion is, at best, a new mechanism would have to live >> side-by-side with the old one, since it could only handle 95% of the >> cases. It might handle those 95% much better -- more cleanly, >> securely, and allowing easier schema evolution -- but the hard cases >> are still there. Still, reducing the use of the horrible old >> mechanism may still be a worthy goal, even if it can't be killed >> outright. >> > From pavel.rappo at oracle.com Mon Aug 11 10:56:05 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Mon, 11 Aug 2014 11:56:05 +0100 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> Message-ID: <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> > In the class > src/share/classes/javax/management/openmbean/CompositeType.java you have > added the > annotation @SuppressWarnings("StringConcatenationInsideStringBufferAppend") > instead of fixing the concatenation inside the append method. Why? +1 Moreover, I wonder where this value comes from? I've never seen it before. Here are warnings that javac supports: all,auxiliaryclass,cast,classfile,deprecation,dep-ann,divzero,empty,fallthrough,finally,options,overloads,overrides,path,processing,rawtypes,serial,static,try,unchecked,varargs It doesn't look like one of Eclipse's warnings either. > And I would like to suggest to drop explicit usage of StringBuilder in some > methods at all to improve code readability. Agree. -Pavel From Alan.Bateman at oracle.com Mon Aug 11 11:21:01 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 11 Aug 2014 12:21:01 +0100 Subject: The future of Serialization In-Reply-To: <1407563776.1841.30.camel@Nokia-N900> References: <1407563776.1841.30.camel@Nokia-N900> Message-ID: <53E8A71D.70407@oracle.com> On 09/08/2014 06:56, Peter Firmstone wrote: > > I've noticed there's not much interest in improving Serialization on > these lists. This makes me wonder if java Serialization has lost > relevance in recent years with the rise of protocol buffers apache > thrift and other means of data transfer over byte streams. > Just to add to Brian's comments, I think part of it is that many people are busy with other things, preparing for JDK 9 for example. So I think there is a lot of support for investigation and proposals that would improve things, it's just that some people are too busy to respond. > > I don't know if isolates will be included with JDK 9 for Jigsaw, or > whether ClassLoaders alone will provide isolation for modules. > > The ability to limit visibility and provide isolation of > implementation classes as well as providing limits on memory and > threads for isolated modules would also improve platform security. > If by "isolates" you mean JSR 121 then I think that would be well beyond the scope, as would resource management. This isn't really the thread to discuss how module boundaries will work but just to say that class loaders and visibility can be weak when it comes to module boundaries. There are other options available, particularly when the ability to extend the access control rules are on the table. So I would suggest not making any assumptions here for now. -Alan. From otaviojava at java.net Mon Aug 11 11:25:41 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Mon, 11 Aug 2014 08:25:41 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> Message-ID: Really thank you everyone. About Warning, sorry my mistake, this warning is from IntelliJ. Removed long lines, replace StringBuffer to StringBuilder and I did the optimizations. About the template in Parser.jjt, TokenMgrError.java, etc. I don't know how can do that. Can anyone help me? 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 use char instead of a single String. https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_3.zip On Mon, Aug 11, 2014 at 7:56 AM, Pavel Rappo wrote: > > In the class > > src/share/classes/javax/management/openmbean/CompositeType.java you have > > added the > > annotation > @SuppressWarnings("StringConcatenationInsideStringBufferAppend") > > instead of fixing the concatenation inside the append method. Why? > > +1 Moreover, I wonder where this value comes from? I've never seen it > before. Here are warnings that javac supports: > > > all,auxiliaryclass,cast,classfile,deprecation,dep-ann,divzero,empty,fallthrough,finally,options,overloads,overrides,path,processing,rawtypes,serial,static,try,unchecked,varargs > > It doesn't look like one of Eclipse's warnings either. > > > And I would like to suggest to drop explicit usage of StringBuilder in > some > > methods at all to improve code readability. > > Agree. > > -Pavel > > -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/ThreadTab.java --- a/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java Mon Aug 11 08:18:34 2014 -0300 @@ -368,7 +368,7 @@ sb.append(Messages.STACK_TRACE); int index = 0; for (StackTraceElement e : ti.getStackTrace()) { - sb.append(e.toString()+"\n"); + sb.append(e.toString()).append('\n'); if (monitors != null) { for (MonitorInfo mi : monitors) { if (mi.getLockedStackDepth() == index) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java --- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Mon Aug 11 08:18:34 2014 -0300 @@ -79,25 +79,25 @@ String textColor = String.format("%06x", foreground.getRGB() & 0xFFFFFF); StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append("
    "); for (int i = 0; i < arr.length; i++) { if (i % 2 == 0) { - sb.append(""); + sb.append(""); } else { - sb.append(""); + sb.append(""); } } if (arr.length == 0) { - sb.append(""); + sb.append(""); } sb.append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    "); arrayEditor.setText(sb.toString()); diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XTree.java --- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java Mon Aug 11 08:18:34 2014 -0300 @@ -507,13 +507,13 @@ // key order defined by the "orderedKeyPropertyList" for (String key : orderedKeyPropertyList) { if (map.containsKey(key)) { - sb.append(key + "=" + map.get(key) + ","); + sb.append(key).append('=').append(map.get(key)).append(','); map.remove(key); } } // Add the remaining key/value pairs to the buffer for (Map.Entry entry : map.entrySet()) { - sb.append(entry.getKey() + "=" + entry.getValue() + ","); + sb.append(entry.getKey()).append('=').append(entry.getValue()).append(','); } String orderedKeyPropertyListString = sb.toString(); orderedKeyPropertyListString = orderedKeyPropertyListString.substring( @@ -622,7 +622,7 @@ // StringBuilder sb = new StringBuilder(); for (MBeanParameterInfo mbpi : mboi.getSignature()) { - sb.append(mbpi.getType() + ","); + sb.append(mbpi.getType()).append(','); } String signature = sb.toString(); if (signature.length() > 0) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jps/Jps.java --- a/src/share/classes/sun/tools/jps/Jps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jps/Jps.java Mon Aug 11 08:18:34 2014 -0300 @@ -92,28 +92,28 @@ vm = monitoredHost.getMonitoredVm(id, 0); errorString = " -- main class information unavailable"; - output.append(" " + MonitoredVmUtil.mainClass(vm, + output.append(' ').append(MonitoredVmUtil.mainClass(vm, arguments.showLongPaths())); if (arguments.showMainArgs()) { errorString = " -- main args information unavailable"; String mainArgs = MonitoredVmUtil.mainArgs(vm); if (mainArgs != null && mainArgs.length() > 0) { - output.append(" " + mainArgs); + output.append(' ').append(mainArgs); } } if (arguments.showVmArgs()) { errorString = " -- jvm args information unavailable"; String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) { - output.append(" " + jvmArgs); + output.append(' ').append(jvmArgs); } } if (arguments.showVmFlags()) { errorString = " -- jvm flags information unavailable"; String jvmFlags = MonitoredVmUtil.jvmFlags(vm); if (jvmFlags != null && jvmFlags.length() > 0) { - output.append(" " + jvmFlags); + output.append(' ').append(jvmFlags); } } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/RawOutputFormatter.java --- a/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Mon Aug 11 08:18:34 2014 -0300 @@ -50,7 +50,7 @@ StringBuilder headerBuilder = new StringBuilder(); for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { Monitor m = i.next(); - headerBuilder.append(m.getName() + " "); + headerBuilder.append(m.getName()).append(' '); } header = headerBuilder.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/SyntaxException.java --- a/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/SyntaxException.java Mon Aug 11 08:18:34 2014 -0300 @@ -65,7 +65,7 @@ public SyntaxException(int lineno, Set expected, Token found) { StringBuilder msg = new StringBuilder(); - msg.append("Syntax error at line " + lineno + ": Expected one of \'"); + msg.append("Syntax error at line ").append(lineno).append(": Expected one of \'"); boolean first = true; for (Iterator i = expected.iterator(); i.hasNext(); /* empty */) { @@ -74,11 +74,11 @@ msg.append(keyWord); first = false; } else { - msg.append("|" + keyWord); + msg.append('|').append(keyWord); } } - msg.append("\', Found " + found.toMessage()); + msg.append("\', Found ").append(found.toMessage()); message = msg.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/Token.java --- a/src/share/classes/sun/tools/jstat/Token.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/Token.java Mon Aug 11 08:18:34 2014 -0300 @@ -89,18 +89,18 @@ sb.append("ttype=TT_EOF"); break; case StreamTokenizer.TT_NUMBER: - sb.append("ttype=TT_NUM,").append("nval="+nval); + sb.append("ttype=TT_NUM,").append("nval=").append(nval); break; case StreamTokenizer.TT_WORD: if (sval == null) { sb.append("ttype=TT_WORD:IDENTIFIER"); } else { - sb.append("ttype=TT_WORD:").append("sval="+sval); + sb.append("ttype=TT_WORD:").append("sval=").append(sval); } break; default: if (ttype == (int)'"') { - sb.append("ttype=TT_STRING:").append("sval="+sval); + sb.append("ttype=TT_STRING:").append("sval=").append(sval); } else { sb.append("ttype=TT_CHAR:").append((char)ttype); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstatd/RemoteHostImpl.java --- a/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Mon Aug 11 08:18:34 2014 -0300 @@ -68,7 +68,7 @@ sb.append("local://").append(lvmid).append("@localhost"); if (mode != null) { - sb.append("?mode=" + mode); + sb.append("?mode=").append(mode); } String vmidStr = sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/security/acl/AclEntryImpl.java --- a/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/acl/AclEntryImpl.java Mon Aug 11 08:18:34 2014 -0300 @@ -147,13 +147,13 @@ s.append("Group."); else s.append("User."); - s.append(user + "="); + s.append(user).append('='); Enumeration e = permissions(); while(e.hasMoreElements()) { Permission p = e.nextElement(); s.append(p); if (e.hasMoreElements()) - s.append(","); + s.append(','); } return new String(s); } diff -r dde9f5cfde5f src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java --- a/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Mon Aug 11 08:18:34 2014 -0300 @@ -640,8 +640,7 @@ for (int i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs/SigningCertificateInfo.java --- a/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Mon Aug 11 08:18:34 2014 -0300 @@ -158,8 +158,8 @@ } sb.append(hexDumper.encode(certHash)); if (issuer != null && serialNumber != null) { - sb.append("\n\tIssuer: " + issuer + "\n"); - sb.append("\t" + serialNumber); + sb.append("\n\tIssuer: ").append(issuer).append('\n'); + sb.append('\t').append(serialNumber); } sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs11/P11KeyStore.java --- a/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs11/P11KeyStore.java Mon Aug 11 08:18:34 2014 -0300 @@ -196,24 +196,24 @@ } else if (type == ATTR_CLASS_CERT) { sb.append("\ttype=[trusted cert]\n"); } - sb.append("\tlabel=[" + label + "]\n"); + sb.append("\tlabel=[").append(label).append("]\n"); if (id == null) { sb.append("\tid=[null]\n"); } else { - sb.append("\tid=" + P11KeyStore.getID(id) + "\n"); + sb.append("\tid=").append(P11KeyStore.getID(id)).append('\n'); } - sb.append("\ttrusted=[" + trusted + "]\n"); - sb.append("\tmatched=[" + matched + "]\n"); + sb.append("\ttrusted=[").append(trusted).append("]\n"); + sb.append("\tmatched=[").append(matched).append("]\n"); if (cert == null) { sb.append("\tcert=[null]\n"); } else { - sb.append("\tcert=[\tsubject: " + - cert.getSubjectX500Principal() + - "\n\t\tissuer: " + - cert.getIssuerX500Principal() + - "\n\t\tserialNum: " + - cert.getSerialNumber().toString() + - "]"); + sb.append("\tcert=[\tsubject: ") + .append(cert.getSubjectX500Principal()) + .append("\n\t\tissuer: ") + .append(cert.getIssuerX500Principal()) + .append("\n\t\tserialNum: ") + .append(cert.getSerialNumber().toString()) + .append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/PolicyFile.java --- a/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/PolicyFile.java Mon Aug 11 08:18:34 2014 -0300 @@ -1500,8 +1500,8 @@ if (i != 0) { sb.append(", "); } - sb.append(principalInfo[i][0] + " " + - "\"" + principalInfo[i][1] + "\""); + sb.append(principalInfo[i][0]).append(' ').append('"') + .append(principalInfo[i][1]).append('"'); } if (pli.hasNext()) { sb.append(", "); @@ -1774,17 +1774,17 @@ Principal[] principals = pd.getPrincipals(); String pals = ""; if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + StringBuilder palSB = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palSB.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); if (i < principals.length-1) - palBuf.append(", "); + palSB.append(", "); else - palBuf.append(")"); + palSB.append(')'); } - pals = palBuf.toString(); + pals = palSB.toString(); } return "PD CodeSource: " + pd.getCodeSource() @@ -1884,7 +1884,7 @@ throw new Exception(form.format(source)); } - sb.append(X500PRINCIPAL + " \"" + suffix + "\""); + sb.append(X500PRINCIPAL).append(" \"").append(suffix).append('"'); startIndex = e+2; } else { MessageFormat form = new MessageFormat diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/CertId.java --- a/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/CertId.java Mon Aug 11 08:18:34 2014 -0300 @@ -223,13 +223,13 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertId \n"); - sb.append("Algorithm: " + hashAlgId.toString() +"\n"); + sb.append("Algorithm: ").append(hashAlgId.toString()).append('\n'); sb.append("issuerNameHash \n"); HexDumpEncoder encoder = new HexDumpEncoder(); sb.append(encoder.encode(issuerNameHash)); sb.append("\nissuerKeyHash: \n"); sb.append(encoder.encode(issuerKeyHash)); - sb.append("\n" + certSerialNumber.toString()); + sb.append('\n').append(certSerialNumber.toString()); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/OCSPResponse.java --- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Mon Aug 11 08:18:34 2014 -0300 @@ -812,14 +812,14 @@ StringBuilder sb = new StringBuilder(); sb.append("SingleResponse: \n"); sb.append(certId); - sb.append("\nCertStatus: "+ certStatus + "\n"); + sb.append("\nCertStatus: ").append(certStatus).append('\n'); if (certStatus == CertStatus.REVOKED) { - sb.append("revocationTime is " + revocationTime + "\n"); - sb.append("revocationReason is " + revocationReason + "\n"); + sb.append("revocationTime is ").append(revocationTime).append('\n'); + sb.append("revocationReason is ").append(revocationReason).append('\n'); } - sb.append("thisUpdate is " + thisUpdate + "\n"); + sb.append("thisUpdate is ").append(thisUpdate).append('\n'); if (nextUpdate != null) { - sb.append("nextUpdate is " + nextUpdate + "\n"); + sb.append("nextUpdate is ").append(nextUpdate).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java --- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Mon Aug 11 08:18:34 2014 -0300 @@ -124,7 +124,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Build Forward Flag: " + String.valueOf(buildForward) + "\n"); + sb.append(" Build Forward Flag: ").append(String.valueOf(buildForward)).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/HandshakeMessage.java --- a/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java Mon Aug 11 08:18:34 2014 -0300 @@ -1478,7 +1478,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/ServerNameExtension.java --- a/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/ServerNameExtension.java Mon Aug 11 08:18:34 2014 -0300 @@ -267,11 +267,11 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", server_name: "); for (SNIServerName sniName : sniMap.values()) { - sb.append("[" + sniName + "]"); + sb.append('[').append(sniName).append(']'); } - - return "Extension " + type + ", server_name: " + sb; + return sb.toString(); } private static class UnknownServerName extends SNIServerName { diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java --- a/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Mon Aug 11 08:18:34 2014 -0300 @@ -119,17 +119,17 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", signature_algorithms: "); boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; } } - - return "Extension " + type + ", signature_algorithms: " + sb; + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Mon Aug 11 08:18:34 2014 -0300 @@ -113,7 +113,7 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Extension " + type + ", curve names: {"); + sb.append("Extension ").append(type).append(", curve names: {"); boolean first = true; for (int curveId : curveIds) { if (first) { @@ -138,7 +138,7 @@ } else if (curveId == ARBITRARY_CHAR2) { sb.append("arbitrary_explicit_char2_curves"); } else { - sb.append("unknown curve " + curveId); + sb.append("unknown curve ").append(curveId); } } sb.append("}"); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/jarsigner/Main.java --- a/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/jarsigner/Main.java Mon Aug 11 08:18:34 2014 -0300 @@ -676,14 +676,13 @@ ((man.getAttributes(name) != null) || (man.getAttributes("./"+name) != null) || (man.getAttributes("/"+name) != null)); - sb.append( - (isSigned ? rb.getString("s") : rb.getString("SPACE")) + - (inManifest ? rb.getString("m") : rb.getString("SPACE")) + - (inStore ? rb.getString("k") : rb.getString("SPACE")) + - (inScope ? rb.getString("i") : rb.getString("SPACE")) + - ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") + - rb.getString("SPACE")); - sb.append("|"); + sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE")) + .append(inManifest ? rb.getString("m") : rb.getString("SPACE")) + .append(inStore ? rb.getString("k") : rb.getString("SPACE")) + .append(inScope ? rb.getString("i") : rb.getString("SPACE")) + .append((inStoreOrScope & NOT_ALIAS) != 0 ? 'X' : ' ') + .append(rb.getString("SPACE")); + sb.append('|'); } // When -certs provided, display info has extra empty @@ -704,11 +703,13 @@ // Print no info for unsigned entries when -verbose:all, // to be consistent with old behavior. if (signatureRelated(name)) { - sb.append("\n" + tab + rb.getString( - ".Signature.related.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Signature.related.entries.")) + .append("\n\n"); } else { - sb.append("\n" + tab + rb.getString( - ".Unsigned.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Unsigned.entries.")) + .append("\n\n"); } } @@ -1605,8 +1606,8 @@ // No more warning, we alreay have hasExpiredCert or notYetValidCert } else { chainNotValidated = true; - sb.append(tab + rb.getString(".CertPath.not.validated.") + - e.getLocalizedMessage() + "]\n"); // TODO + sb.append(tab).append(rb.getString(".CertPath.not.validated.")) + .append(e.getLocalizedMessage()).append("]\n"); // TODO } } String result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/policytool/PolicyTool.java --- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java Mon Aug 11 08:18:34 2014 -0300 @@ -980,8 +980,9 @@ grantEntry.principals.listIterator(); while (list.hasNext()) { PolicyParser.PrincipalEntry pppe = list.next(); - sb.append(" Principal " + pppe.getDisplayClass() + " " + - pppe.getDisplayName(true)); + sb.append(" Principal ").append(pppe.getDisplayClass()) + .append(' ') + .append(pppe.getDisplayName(true)); if (list.hasNext()) sb.append(", "); } result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/AVA.java --- a/src/share/classes/sun/security/x509/AVA.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/AVA.java Mon Aug 11 08:18:34 2014 -0300 @@ -1062,7 +1062,7 @@ } else { boolean quoteNeeded = false; - StringBuilder sbuffer = new StringBuilder(); + StringBuilder sb = new StringBuilder(); boolean previousWhite = false; final String escapees = ",+=\n<>#;\\\""; @@ -1079,7 +1079,7 @@ for (int i = 0; i < length; i++) { char c = valStr.charAt(i); if (alreadyQuoted && (i == 0 || i == length - 1)) { - sbuffer.append(c); + sb.append(c); continue; } if (DerValue.isPrintableStringChar(c) || @@ -1096,7 +1096,7 @@ if (!(c == ' ' || c == '\n')) { // escape '"' and '\' if (c == '"' || c == '\\') { - sbuffer.append('\\'); + sb.append('\\'); } previousWhite = false; } else { @@ -1106,7 +1106,7 @@ previousWhite = true; } - sbuffer.append(c); + sb.append(c); } else if (debug != null && Debug.isOn("ava")) { @@ -1119,26 +1119,26 @@ byte[] valueBytes = Character.toString(c).getBytes("UTF8"); for (int j = 0; j < valueBytes.length; j++) { - sbuffer.append('\\'); + sb.append('\\'); char hexChar = Character.forDigit (0xF & (valueBytes[j] >>> 4), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); hexChar = Character.forDigit (0xF & (valueBytes[j]), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); } } else { // append non-printable/non-escaped char previousWhite = false; - sbuffer.append(c); + sb.append(c); } } // quote if trailing whitespace - if (sbuffer.length() > 0) { - char trailChar = sbuffer.charAt(sbuffer.length() - 1); + if (sb.length() > 0) { + char trailChar = sb.charAt(sb.length() - 1); if (trailChar == ' ' || trailChar == '\n') { quoteNeeded = true; } @@ -1147,9 +1147,9 @@ // Emit the string ... quote it if needed // if string is already quoted, don't re-quote if (!alreadyQuoted && quoteNeeded) { - retval.append("\"" + sbuffer.toString() + "\""); + retval.append('"').append(sb.toString()).append('"'); } else { - retval.append(sbuffer.toString()); + retval.append(sb.toString()); } } } catch (IOException e) { diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPoint.java --- a/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPoint.java Mon Aug 11 08:18:34 2014 -0300 @@ -381,22 +381,22 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPoint:\n " + fullName + "\n"); + sb.append("DistributionPoint:\n ").append(fullName).append('\n'); } if (relativeName != null) { - sb.append("DistributionPoint:\n " + relativeName + "\n"); + sb.append("DistributionPoint:\n ").append(relativeName).append('\n'); } if (reasonFlags != null) { sb.append(" ReasonFlags:\n"); for (int i = 0; i < reasonFlags.length; i++) { if (reasonFlags[i]) { - sb.append(" " + reasonToString(i) + "\n"); + sb.append(" ").append(reasonToString(i)).append('\n'); } } } if (crlIssuer != null) { - sb.append(" CRLIssuer:" + crlIssuer + "\n"); + sb.append(" CRLIssuer:").append(crlIssuer).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPointName.java --- a/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPointName.java Mon Aug 11 08:18:34 2014 -0300 @@ -231,10 +231,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPointName:\n " + fullName + "\n"); + sb.append("DistributionPointName:\n ").append(fullName).append('\n'); } else { - sb.append("DistributionPointName:\n " + relativeName + "\n"); + sb.append("DistributionPointName:\n ").append(relativeName).append('\n'); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/PolicyInformation.java --- a/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/PolicyInformation.java Mon Aug 11 08:18:34 2014 -0300 @@ -258,9 +258,9 @@ * Return a printable representation of the PolicyInformation. */ public String toString() { - StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString()); - s.append(policyQualifiers + " ]\n"); - return s.toString(); + StringBuilder sb = new StringBuilder(" [" + policyIdentifier.toString()); + sb.append(policyQualifiers).append(" ]\n"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLEntryImpl.java --- a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Mon Aug 11 08:18:34 2014 -0300 @@ -292,17 +292,17 @@ StringBuilder sb = new StringBuilder(); sb.append(serialNumber.toString()); - sb.append(" On: " + revocationDate.toString()); + sb.append(" On: ").append(revocationDate.toString()); if (certIssuer != null) { - sb.append("\n Certificate issuer: " + certIssuer); + sb.append("\n Certificate issuer: ").append(certIssuer); } if (extensions != null) { Collection allEntryExts = extensions.getAllExtensions(); Extension[] exts = allEntryExts.toArray(new Extension[0]); - sb.append("\n CRL Entry Extensions: " + exts.length); + sb.append("\n CRL Entry Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n [" + (i+1) + "]: "); + sb.append("\n [").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -313,9 +313,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLImpl.java --- a/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLImpl.java Mon Aug 11 08:18:34 2014 -0300 @@ -537,31 +537,32 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("X.509 CRL v" + (version+1) + "\n"); + sb.append("X.509 CRL v").append(version + 1).append('\n'); if (sigAlgId != null) - sb.append("Signature Algorithm: " + sigAlgId.toString() + - ", OID=" + (sigAlgId.getOID()).toString() + "\n"); + sb.append("Signature Algorithm: ").append(sigAlgId.toString()) + .append(", OID=") + .append((sigAlgId.getOID()).toString()).append('\n'); if (issuer != null) - sb.append("Issuer: " + issuer.toString() + "\n"); + sb.append("Issuer: ").append(issuer.toString()).append('\n'); if (thisUpdate != null) - sb.append("\nThis Update: " + thisUpdate.toString() + "\n"); + sb.append("\nThis Update: ").append(thisUpdate.toString()).append('\n'); if (nextUpdate != null) - sb.append("Next Update: " + nextUpdate.toString() + "\n"); + sb.append("Next Update: ").append(nextUpdate.toString()).append('\n'); if (revokedList.isEmpty()) sb.append("\nNO certificates have been revoked\n"); else { - sb.append("\nRevoked Certificates: " + revokedList.size()); + sb.append("\nRevoked Certificates: ").append(revokedList.size()); int i = 1; for (X509CRLEntry entry: revokedList) { - sb.append("\n[" + i++ + "] " + entry.toString()); + sb.append("\n[").append(i++).append("] ").append(entry.toString()); } } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Object[] objs = allExts.toArray(); - sb.append("\nCRL Extensions: " + objs.length); + sb.append("\nCRL Extensions: ").append(objs.length); for (int i = 0; i < objs.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = (Extension)objs[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -572,9 +573,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); // sub-class exists @@ -585,8 +585,7 @@ } if (signature != null) { HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) - + "\n"); + sb.append("\nSignature:\n").append(encoder.encodeBuffer(signature)).append('\n'); } else sb.append("NOT signed yet\n"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertImpl.java --- a/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertImpl.java Mon Aug 11 08:18:34 2014 -0300 @@ -802,11 +802,11 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(info.toString() + "\n"); - sb.append(" Algorithm: [" + algId.toString() + "]\n"); + sb.append(info.toString()).append('\n'); + sb.append(" Algorithm: [").append(algId.toString()).append("]\n"); HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); + sb.append(" Signature:\n").append(encoder.encodeBuffer(signature)); sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertInfo.java --- a/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertInfo.java Mon Aug 11 08:18:34 2014 -0300 @@ -298,27 +298,27 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(" " + version.toString() + "\n"); - sb.append(" Subject: " + subject.toString() + "\n"); - sb.append(" Signature Algorithm: " + algId.toString() + "\n"); - sb.append(" Key: " + pubKey.toString() + "\n"); - sb.append(" " + interval.toString() + "\n"); - sb.append(" Issuer: " + issuer.toString() + "\n"); - sb.append(" " + serialNum.toString() + "\n"); + sb.append(" ").append(version.toString()).append('\n'); + sb.append(" Subject: ").append(subject.toString()).append('\n'); + sb.append(" Signature Algorithm: ").append(algId.toString()).append('\n'); + sb.append(" Key: ").append(pubKey.toString()).append('\n'); + sb.append(" ").append(interval.toString()).append('\n'); + sb.append(" Issuer: ").append(issuer.toString()).append('\n'); + sb.append(" ").append(serialNum.toString()).append('\n'); // optional v2, v3 extras if (issuerUniqueId != null) { - sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n"); + sb.append(" Issuer Id:\n").append(issuerUniqueId.toString()).append('\n'); } if (subjectUniqueId != null) { - sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n"); + sb.append(" Subject Id:\n").append(subjectUniqueId.toString()).append('\n'); } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Extension[] exts = allExts.toArray(new Extension[0]); - sb.append("\nCertificate Extensions: " + exts.length); + sb.append("\nCertificate Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -329,9 +329,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists @@ -341,10 +340,10 @@ } Map invalid = extensions.getUnparseableExtensions(); if (invalid.isEmpty() == false) { - sb.append("\nUnparseable certificate extensions: " + invalid.size()); + sb.append("\nUnparseable certificate extensions: ").append(invalid.size()); int i = 1; for (Extension ext : invalid.values()) { - sb.append("\n[" + (i++) + "]: "); + sb.append("\n[").append(i++).append("]: "); sb.append(ext); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java --- a/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Mon Aug 11 08:18:33 2014 -0300 @@ -465,10 +465,10 @@ private static void appendIfLiteralAddress(String addr, StringBuffer sb) { if (IPAddressUtil.isIPv4LiteralAddress(addr)) { - sb.append("dns://" + addr + " "); + sb.append("dns://").append(addr).append(' '); } else { if (IPAddressUtil.isIPv6LiteralAddress(addr)) { - sb.append("dns://[" + addr + "] "); + sb.append("dns://[").append(addr).append("] "); } } } diff -r dde9f5cfde5f src/share/classes/sun/net/www/HeaderParser.java --- a/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/HeaderParser.java Mon Aug 11 08:18:33 2014 -0300 @@ -220,21 +220,23 @@ public String toString () { Iterator k = keys(); - StringBuffer sbuf = new StringBuffer(); - sbuf.append ("{size="+asize+" nkeys="+nkeys+" "); + StringBuilder sb = new StringBuilder(); + sb.append("{size=").append(asize).append(" nkeys=").append(nkeys) + .append(' '); for (int i=0; k.hasNext(); i++) { String key = k.next(); String val = findValue (i); if (val != null && "".equals (val)) { val = null; } - sbuf.append (" {"+key+(val==null?"":","+val)+"}"); + sb.append(" {").append(key).append(val == null ? "" : "," + val) + .append('}'); if (k.hasNext()) { - sbuf.append (","); + sb.append (','); } } - sbuf.append (" }"); - return new String (sbuf); + sb.append (" }"); + return new String (sb); } public int findInt(String k, int Default) { diff -r dde9f5cfde5f src/share/classes/sun/net/www/MimeEntry.java --- a/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/MimeEntry.java Mon Aug 11 08:18:33 2014 -0300 @@ -288,7 +288,7 @@ int action = getAction(); if (action != MimeEntry.UNKNOWN) { - sb.append("action=" + actionKeywords[action]); + sb.append("action=").append(actionKeywords[action]); needSeparator = true; } @@ -297,7 +297,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("application=" + command); + sb.append("application=").append(command); needSeparator = true; } @@ -305,7 +305,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("icon=" + getImageFileName()); + sb.append("icon=").append(getImageFileName()); needSeparator = true; } @@ -314,7 +314,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("file_extensions=" + extensions); + sb.append("file_extensions=").append(extensions); needSeparator = true; } @@ -323,7 +323,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("description=" + description); + sb.append("description=").append(description); } return sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/management/Agent.java --- a/src/share/classes/sun/management/Agent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/Agent.java Mon Aug 11 08:18:33 2014 -0300 @@ -502,7 +502,7 @@ } else { StringBuilder message = new StringBuilder(params[0]); for (int i = 1; i < params.length; i++) { - message.append(" " + params[i]); + message.append(' ').append(params[i]); } error(key, message.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/management/MappedMXBeanType.java --- a/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/MappedMXBeanType.java Mon Aug 11 08:18:33 2014 -0300 @@ -289,7 +289,7 @@ if (et.isPrimitive()) { className = new StringBuilder(c.getName()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); @@ -385,7 +385,7 @@ if (elementType instanceof Class && ((Class) elementType).isPrimitive()) { className = new StringBuilder(gat.toString()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/launcher/LauncherHelper.java --- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Mon Aug 11 08:18:33 2014 -0300 @@ -369,10 +369,9 @@ static void appendVmErgoMessage(boolean isServerClass, String vm) { outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1", vm)); - outBuf = (isServerClass) - ? outBuf.append(",\n" + - getLocalizedMessage("java.launcher.ergo.message2") + "\n\n") - : outBuf.append(".\n\n"); + outBuf = (isServerClass) ? outBuf.append(",\n") + .append(getLocalizedMessage("java.launcher.ergo.message2")) + .append("\n\n") : outBuf.append(".\n\n"); } /** -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/font/AttributeValues.java --- a/src/share/classes/sun/font/AttributeValues.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/AttributeValues.java Mon Aug 11 08:18:33 2014 -0300 @@ -542,7 +542,7 @@ } } } - b.append("[btx=" + baselineTransform + ", ctx=" + charTransform + "]"); + b.append("[btx=").append(baselineTransform).append(", ctx=").append(charTransform).append(']'); b.append('}'); return b.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/Decoration.java --- a/src/share/classes/sun/font/Decoration.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/Decoration.java Mon Aug 11 08:18:33 2014 -0300 @@ -431,12 +431,12 @@ StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); - if (fgPaint != null) sb.append("fgPaint: " + fgPaint); - if (bgPaint != null) sb.append(" bgPaint: " + bgPaint); + if (fgPaint != null) sb.append("fgPaint: ").append(fgPaint); + if (bgPaint != null) sb.append(" bgPaint: ").append(bgPaint); if (swapColors) sb.append(" swapColors: true"); if (strikethrough) sb.append(" strikethrough: true"); - if (stdUnderline != null) sb.append(" stdUnderline: " + stdUnderline); - if (imUnderline != null) sb.append(" imUnderline: " + imUnderline); + if (stdUnderline != null) sb.append(" stdUnderline: ").append(stdUnderline); + if (imUnderline != null) sb.append(" imUnderline: ").append(imUnderline); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/StandardGlyphVector.java --- a/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/StandardGlyphVector.java Mon Aug 11 08:18:33 2014 -0300 @@ -1894,9 +1894,9 @@ } } catch(Exception e) { - buf.append(" " + e.getMessage()); + buf.append(' ').append(e.getMessage()); } - buf.append("}"); + buf.append('}'); return buf; } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/swing/GroupLayout.java --- a/src/share/classes/javax/swing/GroupLayout.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/GroupLayout.java Mon Aug 11 08:18:33 2014 -0300 @@ -1239,15 +1239,14 @@ padding = ", userCreated=" + paddingSpring.getUserCreated() + ", matches=" + paddingSpring.getMatchDescription(); } - buffer.append(indent + spring.getClass().getName() + " " + - Integer.toHexString(spring.hashCode()) + " " + - origin + - ", size=" + spring.getSize() + - ", alignment=" + spring.getAlignment() + - " prefs=[" + spring.getMinimumSize(axis) + - " " + spring.getPreferredSize(axis) + - " " + spring.getMaximumSize(axis) + - padding + "]\n"); + buffer.append(indent).append(spring.getClass().getName()).append(' ') + .append(Integer.toHexString(spring.hashCode())).append(' ') + .append(origin).append(", size=").append(spring.getSize()) + .append(", alignment=").append(spring.getAlignment()) + .append(" prefs=[").append(spring.getMinimumSize(axis)) + .append(' ').append(spring.getPreferredSize(axis)).append(' ') + .append(spring.getMaximumSize(axis)).append(padding) + .append("]\n"); if (spring instanceof Group) { List springs = ((Group)spring).springs; indent += " "; diff -r dde9f5cfde5f src/share/classes/javax/swing/JColorChooser.java --- a/src/share/classes/javax/swing/JColorChooser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/JColorChooser.java Mon Aug 11 08:18:33 2014 -0300 @@ -545,8 +545,7 @@ protected String paramString() { StringBuilder chooserPanelsString = new StringBuilder(""); for (int i=0; i keys = keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); - sb.append(key + "=" + get(key) + ", "); + sb.append(key).append('=').append(get(key)).append(", "); } int length = sb.length(); if (length > 1) { sb.delete(length-2, length); } - sb.append("}"); + sb.append('}'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/RepaintManager.java --- a/src/share/classes/javax/swing/RepaintManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/RepaintManager.java Mon Aug 11 08:18:33 2014 -0300 @@ -990,10 +990,7 @@ * @return a String representation of this object */ public synchronized String toString() { - StringBuilder sb = new StringBuilder(); - if(dirtyComponents != null) - sb.append("" + dirtyComponents); - return sb.toString(); + return dirtyComponents != null ? dirtyComponents.toString() : ""; } diff -r dde9f5cfde5f src/share/classes/javax/swing/event/TreeModelEvent.java --- a/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/event/TreeModelEvent.java Mon Aug 11 08:18:33 2014 -0300 @@ -294,21 +294,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(getClass().getName() + " " + - Integer.toString(hashCode())); + sb.append(getClass().getName()).append(' ').append(Integer.toString(hashCode())); if(path != null) - sb.append(" path " + path); + sb.append(" path ").append(path); if(childIndices != null) { sb.append(" indices [ "); for(int counter = 0; counter < childIndices.length; counter++) - sb.append(Integer.toString(childIndices[counter])+ " "); - sb.append("]"); + sb.append(Integer.toString(childIndices[counter])).append(' '); + sb.append(']'); } if(children != null) { sb.append(" children [ "); for(int counter = 0; counter < children.length; counter++) - sb.append(children[counter] + " "); - sb.append("]"); + sb.append(children[counter]).append(' '); + sb.append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Mon Aug 11 08:18:33 2014 -0300 @@ -1330,8 +1330,8 @@ for (Object obj : values) { String val = ((obj == null) ? "" : obj.toString()); - plainBuf.append(val + "\n"); - htmlBuf.append("
  • " + val + "\n"); + plainBuf.append(val).append('\n'); + htmlBuf.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicListUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Mon Aug 11 08:18:33 2014 -0300 @@ -2948,8 +2948,8 @@ for (int i = 0; i < values.length; i++) { Object obj = values[i]; String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\n"); - htmlStr.append("
  • " + val + "\n"); + plainStr.append(val).append('\n'); + htmlStr.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTableUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Mon Aug 11 08:18:33 2014 -0300 @@ -2230,11 +2230,11 @@ for (int col = 0; col < cols.length; col++) { Object obj = table.getValueAt(rows[row], cols[col]); String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\t"); - htmlStr.append(" " + val + "\n"); + plainStr.append(val).append('\t'); + htmlStr.append(" ").append(val).append("\n"); } // we want a newline at the end of each line and not a tab - plainStr.deleteCharAt(plainStr.length() - 1).append("\n"); + plainStr.deleteCharAt(plainStr.length() - 1).append('\t'); htmlStr.append("\n"); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Mon Aug 11 08:18:33 2014 -0300 @@ -3618,8 +3618,8 @@ boolean leaf = model.isLeaf(node); String label = getDisplayString(path, true, leaf); - plainStr.append(label + "\n"); - htmlStr.append("
  • " + label + "\n"); + plainStr.append(label).append('\n'); + htmlStr.append("
  • ").append(label).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java --- a/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Mon Aug 11 08:18:33 2014 -0300 @@ -1160,15 +1160,15 @@ rows = rowMapper.getRowsForPaths(selection); else rows = null; - sb.append(getClass().getName() + " " + hashCode() + " [ "); + sb.append(getClass().getName()).append(' ').append(hashCode()).append(" [ "); for(int counter = 0; counter < selCount; counter++) { if(rows != null) - sb.append(selection[counter].toString() + "@" + - Integer.toString(rows[counter])+ " "); + sb.append(selection[counter].toString()).append('@') + .append(Integer.toString(rows[counter])).append(' '); else - sb.append(selection[counter].toString() + " "); + sb.append(selection[counter].toString()).append(' '); } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/AudioFileFormat.java --- a/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/AudioFileFormat.java Mon Aug 11 08:18:33 2014 -0300 @@ -272,26 +272,25 @@ @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuffer sb = new StringBuffer(); //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() throws unexpected NullPointerException if (type != null) { - buf.append(type.toString() + " (." + type.getExtension() + ") file"); + sb.append(type.toString()).append(" (.").append(type.getExtension()).append(") file"); } else { - buf.append("unknown file format"); + sb.append("unknown file format"); } if (byteLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", byte length: " + byteLength); + sb.append(", byte length: ").append(byteLength); } - buf.append(", data format: " + format); + sb.append(", data format: ").append(format); if (frameLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", frame length: " + frameLength); + sb.append(", frame length: ").append(frameLength); } - - return new String(buf); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/DataLine.java --- a/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/DataLine.java Mon Aug 11 08:18:33 2014 -0300 @@ -473,17 +473,21 @@ StringBuilder sb = new StringBuilder(); if ( (formats.length == 1) && (formats[0] != null) ) { - sb.append(" supporting format " + formats[0]); + sb.append(" supporting format ").append(formats[0]); } else if (getFormats().length > 1) { - sb.append(" supporting " + getFormats().length + " audio formats"); + sb.append(" supporting ").append(getFormats().length) + .append(" audio formats"); } if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) { - sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes"); + sb.append(", and buffers of ").append(minBufferSize) + .append(" to ").append(maxBufferSize).append(" bytes"); } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) { - sb.append(", and buffers of at least " + minBufferSize + " bytes"); + sb.append(", and buffers of at least ").append(minBufferSize) + .append(" bytes"); } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) { - sb.append(", and buffers of up to " + minBufferSize + " bytes"); + sb.append(", and buffers of up to ").append(minBufferSize) + .append(" bytes"); } return new String(super.toString() + sb); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/security/auth/kerberos/KerberosTicket.java --- a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Mon Aug 11 08:18:33 2014 -0300 @@ -651,8 +651,7 @@ StringBuilder caddrString = new StringBuilder(); if (clientAddresses != null) { for (int i = 0; i < clientAddresses.length; i++) { - caddrString.append("clientAddresses[" + i + "] = " + - clientAddresses[i].toString()); + caddrString.append("clientAddresses[").append(i).append("] = ").append(clientAddresses[i].toString()); } } return ("Ticket (hex) = " + "\n" + -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/naming/BinaryRefAddr.java --- a/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/BinaryRefAddr.java Mon Aug 11 08:18:33 2014 -0300 @@ -165,11 +165,11 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Address Type: " + addrType + "\n"); - + StringBuilder str = new StringBuilder(); + str.append("Address Type: ").append(addrType).append('\n'); str.append("AddressContents: "); for (int i = 0; i= 32) str.append(" ...\n"); diff -r dde9f5cfde5f src/share/classes/javax/naming/NameImpl.java --- a/src/share/classes/javax/naming/NameImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/NameImpl.java Mon Aug 11 08:18:33 2014 -0300 @@ -170,7 +170,7 @@ endQuote = one ? syntaxEndQuote1 : syntaxEndQuote2; i += syntaxTypevalSeparator.length(); - answer.append(syntaxTypevalSeparator+beginQuote); // add back + answer.append(syntaxTypevalSeparator).append(beginQuote); // add back // consume string until matching quote for (i += beginQuote.length(); diff -r dde9f5cfde5f src/share/classes/javax/naming/RefAddr.java --- a/src/share/classes/javax/naming/RefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/RefAddr.java Mon Aug 11 08:18:33 2014 -0300 @@ -139,9 +139,9 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Type: " + addrType + "\n"); - - str.append("Content: " + getContent() + "\n"); + StringBuilder str = new StringBuilder(); + str.append("Type: ").append(addrType).append('\n'); + str.append("Content: ").append(getContent()).append('\n'); return (str.toString()); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/crypto/CryptoPermission.java --- a/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/crypto/CryptoPermission.java Mon Aug 11 08:18:32 2014 -0300 @@ -369,22 +369,24 @@ * @return information about this CryptoPermission. */ public String toString() { - StringBuilder buf = new StringBuilder(100); - buf.append("(CryptoPermission " + alg + " " + maxKeySize); + StringBuilder sb = new StringBuilder(100); + sb.append("(CryptoPermission ").append(alg).append(' ') + .append(maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { - buf.append(" , effective " + - ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits()); + sb.append(" , effective ") + .append(((RC2ParameterSpec) algParamSpec) + .getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { - buf.append(" , rounds " + - ((RC5ParameterSpec)algParamSpec).getRounds()); + sb.append(" , rounds ").append( + ((RC5ParameterSpec) algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL - buf.append(" " + exemptionMechanism); + sb.append(' ').append(exemptionMechanism); } - buf.append(")"); - return buf.toString(); + sb.append(')'); + return sb.toString(); } private boolean impliesExemptionMechanism(String exemptionMechanism) { -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/management/MBeanPermission.java --- a/src/share/classes/javax/management/MBeanPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/MBeanPermission.java Mon Aug 11 08:18:32 2014 -0300 @@ -455,11 +455,11 @@ name.append(className); if (member == null) member = "-"; - name.append("#" + member); + name.append('#').append(member); if (objectName == null) name.append("[-]"); else - name.append("[").append(objectName.getCanonicalName()).append("]"); + name.append('[').append(objectName.getCanonicalName()).append(']'); /* In the interests of legibility for Permission.toString(), we transform the empty string into "*". */ diff -r dde9f5cfde5f src/share/classes/javax/management/modelmbean/RequiredModelMBean.java --- a/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Mon Aug 11 08:18:32 2014 -0300 @@ -716,15 +716,14 @@ } retStr.append("\nMBeanInfo for ModelMBean is:"); - retStr.append("\nCLASSNAME: \t"+ info.getClassName()); - retStr.append("\nDESCRIPTION: \t"+ info.getDescription()); + retStr.append("\nCLASSNAME: \t").append(info.getClassName()); + retStr.append("\nDESCRIPTION: \t").append(info.getDescription()); try { - retStr.append("\nMBEAN DESCRIPTOR: \t"+ - info.getMBeanDescriptor()); + retStr.append("\nMBEAN DESCRIPTOR: \t").append(info.getMBeanDescriptor()); } catch (Exception e) { - retStr.append("\nMBEAN DESCRIPTOR: \t" + " is invalid"); + retStr.append("\nMBEAN DESCRIPTOR: \t is invalid"); } retStr.append("\nATTRIBUTES"); @@ -734,13 +733,12 @@ for (int i=0; i objNameIter = objectNameList.iterator(); objNameIter.hasNext();) { ObjectName currObjName = objNameIter.next(); diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleInfo.java --- a/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleInfo.java Mon Aug 11 08:18:32 2014 -0300 @@ -456,13 +456,13 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role info name: " + name); - result.append("; isReadable: " + isReadable); - result.append("; isWritable: " + isWritable); - result.append("; description: " + description); - result.append("; minimum degree: " + minDegree); - result.append("; maximum degree: " + maxDegree); - result.append("; MBean class: " + referencedMBeanClassName); + result.append("role info name: ").append(name); + result.append("; isReadable: ").append(isReadable); + result.append("; isWritable: ").append(isWritable); + result.append("; description: ").append(description); + result.append("; minimum degree: ").append(minDegree); + result.append("; maximum degree: ").append(maxDegree); + result.append("; MBean class: ").append(referencedMBeanClassName); return result.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleUnresolved.java --- a/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleUnresolved.java Mon Aug 11 08:18:32 2014 -0300 @@ -282,7 +282,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + roleName); + result.append("role name: ").append(roleName); if (roleValue != null) { result.append("; value: "); for (Iterator objNameIter = roleValue.iterator(); @@ -294,7 +294,7 @@ } } } - result.append("; problem type: " + problemType); + result.append("; problem type: ").append(problemType); return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/util/Scanner.java --- a/src/share/classes/java/util/Scanner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/Scanner.java Mon Aug 11 08:18:32 2014 -0300 @@ -1304,20 +1304,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.Scanner"); - sb.append("[delimiters=" + delimPattern + "]"); - sb.append("[position=" + position + "]"); - sb.append("[match valid=" + matchValid + "]"); - sb.append("[need input=" + needInput + "]"); - sb.append("[source closed=" + sourceClosed + "]"); - sb.append("[skipped=" + skipped + "]"); - sb.append("[group separator=" + groupSeparator + "]"); - sb.append("[decimal separator=" + decimalSeparator + "]"); - sb.append("[positive prefix=" + positivePrefix + "]"); - sb.append("[negative prefix=" + negativePrefix + "]"); - sb.append("[positive suffix=" + positiveSuffix + "]"); - sb.append("[negative suffix=" + negativeSuffix + "]"); - sb.append("[NaN string=" + nanString + "]"); - sb.append("[infinity string=" + infinityString + "]"); + sb.append("[delimiters=").append(delimPattern).append(']'); + sb.append("[position=").append(position).append(']'); + sb.append("[match valid=").append(matchValid).append(']'); + sb.append("[need input=").append(needInput).append(']'); + sb.append("[source closed=").append(sourceClosed).append(']'); + sb.append("[skipped=").append(skipped).append(']'); + sb.append("[group separator=").append(groupSeparator).append(']'); + sb.append("[decimal separator=").append(decimalSeparator).append(']'); + sb.append("[positive prefix=").append(positivePrefix).append(']'); + sb.append("[negative prefix=").append(negativePrefix).append(']'); + sb.append("[positive suffix=").append(positiveSuffix).append(']'); + sb.append("[negative suffix=").append(negativeSuffix).append(']'); + sb.append("[NaN string=").append(nanString).append(']'); + sb.append("[infinity string=").append(infinityString).append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Matcher.java --- a/src/share/classes/java/util/regex/Matcher.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Matcher.java Mon Aug 11 08:18:32 2014 -0300 @@ -1295,14 +1295,14 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.regex.Matcher"); - sb.append("[pattern=" + pattern()); + sb.append("[pattern=").append(pattern()); sb.append(" region="); - sb.append(regionStart() + "," + regionEnd()); + sb.append(regionStart()).append(',').append(regionEnd()); sb.append(" lastmatch="); if ((first >= 0) && (group() != null)) { sb.append(group()); } - sb.append("]"); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Pattern.java --- a/src/share/classes/java/util/regex/Pattern.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Pattern.java Mon Aug 11 08:18:32 2014 -0300 @@ -1488,10 +1488,10 @@ for(int x=0; x0) - result.append("|"+next); + result.append('|').append(next); next = composeOneStep(next); if (next != null) - result.append("|"+produceEquivalentAlternation(next)); + result.append('|').append(produceEquivalentAlternation(next)); } return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/text/ChoiceFormat.java --- a/src/share/classes/java/text/ChoiceFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/text/ChoiceFormat.java Mon Aug 11 08:18:32 2014 -0300 @@ -272,7 +272,7 @@ double tryLess = Math.abs(Math.IEEEremainder(less, 1.0d)); if (tryLessOrEqual < tryLess) { - result.append(""+choiceLimits[i]); + result.append(choiceLimits[i]); result.append('#'); } else { if (choiceLimits[i] == Double.POSITIVE_INFINITY) { @@ -280,7 +280,7 @@ } else if (choiceLimits[i] == Double.NEGATIVE_INFINITY) { result.append("-\u221E"); } else { - result.append(""+less); + result.append(less); } result.append('<'); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/security/CodeSigner.java --- a/src/share/classes/java/security/CodeSigner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSigner.java Mon Aug 11 08:18:32 2014 -0300 @@ -156,9 +156,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("Signer: " + signerCertPath.getCertificates().get(0)); + sb.append("Signer: ").append(signerCertPath.getCertificates().get(0)); if (timestamp != null) { - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); } sb.append(")"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/java/security/CodeSource.java --- a/src/share/classes/java/security/CodeSource.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSource.java Mon Aug 11 08:18:32 2014 -0300 @@ -468,12 +468,12 @@ if (this.certs != null && this.certs.length > 0) { for (int i = 0; i < this.certs.length; i++) { - sb.append( " " + this.certs[i]); + sb.append(' ').append(this.certs[i]); } } else if (this.signers != null && this.signers.length > 0) { for (int i = 0; i < this.signers.length; i++) { - sb.append( " " + this.signers[i]); + sb.append(' ').append(this.signers[i]); } } else { sb.append(" "); diff -r dde9f5cfde5f src/share/classes/java/security/KeyStore.java --- a/src/share/classes/java/security/KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/KeyStore.java Mon Aug 11 08:18:32 2014 -0300 @@ -610,8 +610,8 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Private key entry and certificate chain with " - + chain.length + " elements:\r\n"); + sb.append("Private key entry and certificate chain with ") + .append(chain.length).append(" elements:\r\n"); for (Certificate cert : chain) { sb.append(cert); sb.append("\r\n"); diff -r dde9f5cfde5f src/share/classes/java/security/PermissionCollection.java --- a/src/share/classes/java/security/PermissionCollection.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/PermissionCollection.java Mon Aug 11 08:18:32 2014 -0300 @@ -179,12 +179,12 @@ public String toString() { Enumeration enum_ = elements(); StringBuilder sb = new StringBuilder(); - sb.append(super.toString()+" (\n"); + sb.append(super.toString()).append(" (\n"); while (enum_.hasMoreElements()) { try { - sb.append(" "); + sb.append(' '); sb.append(enum_.nextElement().toString()); - sb.append("\n"); + sb.append('\n'); } catch (NoSuchElementException e){ // ignore } diff -r dde9f5cfde5f src/share/classes/java/security/ProtectionDomain.java --- a/src/share/classes/java/security/ProtectionDomain.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/ProtectionDomain.java Mon Aug 11 08:18:32 2014 -0300 @@ -291,9 +291,9 @@ StringBuilder palBuf = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palBuf.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); if (i < principals.length-1) palBuf.append(",\n"); else diff -r dde9f5cfde5f src/share/classes/java/security/Timestamp.java --- a/src/share/classes/java/security/Timestamp.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/Timestamp.java Mon Aug 11 08:18:32 2014 -0300 @@ -143,10 +143,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); List certs = signerCertPath.getCertificates(); if (!certs.isEmpty()) { - sb.append("TSA: " + certs.get(0)); + sb.append("TSA: ").append(certs.get(0)); } else { sb.append("TSA: "); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CertPath.java --- a/src/share/classes/java/security/cert/CertPath.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CertPath.java Mon Aug 11 08:18:32 2014 -0300 @@ -224,17 +224,16 @@ Iterator stringIterator = getCertificates().iterator(); - sb.append("\n" + type + " Cert Path: length = " - + getCertificates().size() + ".\n"); + sb.append('\n').append(type).append(" Cert Path: length = ").append(getCertificates().size()).append(".\n"); sb.append("[\n"); int i = 1; while (stringIterator.hasNext()) { - sb.append("==========================================" - + "===============Certificate " + i + " start.\n"); + sb.append("==========================================" + "===============Certificate ") + .append(i).append(" start.\n"); Certificate stringCert = stringIterator.next(); sb.append(stringCert.toString()); - sb.append("\n========================================" - + "=================Certificate " + i + " end.\n\n\n"); + sb.append("\n========================================" + "=================Certificate ") + .append(i).append(" end.\n\n\n"); i++; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CollectionCertStoreParameters.java --- a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Mon Aug 11 08:18:32 2014 -0300 @@ -134,8 +134,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CollectionCertStoreParameters: [\n"); - sb.append(" collection: " + coll + "\n"); - sb.append("]"); + sb.append(" collection: ").append(coll).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/LDAPCertStoreParameters.java --- a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Mon Aug 11 08:18:32 2014 -0300 @@ -141,9 +141,9 @@ StringBuilder sb = new StringBuilder(); sb.append("LDAPCertStoreParameters: [\n"); - sb.append(" serverName: " + serverName + "\n"); - sb.append(" port: " + port + "\n"); - sb.append("]"); + sb.append(" serverName: ").append(serverName).append('\n'); + sb.append(" port: ").append(port).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXBuilderParameters.java --- a/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXBuilderParameters.java Mon Aug 11 08:18:32 2014 -0300 @@ -192,7 +192,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Maximum Path Length: " + maxPathLength + "\n"); + sb.append(" Maximum Path Length: ").append(maxPathLength).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Mon Aug 11 08:18:32 2014 -0300 @@ -108,12 +108,14 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("PKIXCertPathBuilderResult: [\n"); - sb.append(" Certification Path: " + certPath + "\n"); - sb.append(" Trust Anchor: " + getTrustAnchor().toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(getPolicyTree()) + "\n"); - sb.append(" Subject Public Key: " + getPublicKey() + "\n"); - sb.append("]"); + sb.append("PKIXCertPathBuilderResult: [\n"); + sb.append(" Certification Path: ").append(certPath).append('\n'); + sb.append(" Trust Anchor: ").append(getTrustAnchor().toString()) + .append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(getPolicyTree())) + .append('\n'); + sb.append(" Subject Public Key: ").append(getPublicKey()).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Mon Aug 11 08:18:32 2014 -0300 @@ -150,10 +150,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathValidatorResult: [\n"); - sb.append(" Trust Anchor: " + trustAnchor.toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(policyTree) + "\n"); - sb.append(" Subject Public Key: " + subjectPublicKey + "\n"); - sb.append("]"); + sb.append(" Trust Anchor: ").append(trustAnchor.toString()).append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(policyTree)).append('\n'); + sb.append(" Subject Public Key: ").append(subjectPublicKey).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXParameters.java --- a/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXParameters.java Mon Aug 11 08:18:32 2014 -0300 @@ -698,8 +698,7 @@ /* start with trusted anchor info */ if (unmodTrustAnchors != null) { - sb.append(" Trust Anchors: " + unmodTrustAnchors.toString() - + "\n"); + sb.append(" Trust Anchors: ").append(unmodTrustAnchors.toString()).append('\n'); } /* now, append initial state information */ @@ -707,30 +706,37 @@ if (unmodInitialPolicies.isEmpty()) { sb.append(" Initial Policy OIDs: any\n"); } else { - sb.append(" Initial Policy OIDs: [" - + unmodInitialPolicies.toString() + "]\n"); + sb.append(" Initial Policy OIDs: [") + .append(unmodInitialPolicies.toString()).append("]\n"); } } /* now, append constraints on all certificates in the path */ - sb.append(" Validity Date: " + String.valueOf(date) + "\n"); - sb.append(" Signature Provider: " + String.valueOf(sigProvider) + "\n"); - sb.append(" Default Revocation Enabled: " + revocationEnabled + "\n"); - sb.append(" Explicit Policy Required: " + explicitPolicyRequired + "\n"); - sb.append(" Policy Mapping Inhibited: " + policyMappingInhibited + "\n"); - sb.append(" Any Policy Inhibited: " + anyPolicyInhibited + "\n"); - sb.append(" Policy Qualifiers Rejected: " + policyQualifiersRejected + "\n"); + sb.append(" Validity Date: ").append(String.valueOf(date)) + .append('\n'); + sb.append(" Signature Provider: ").append(String.valueOf(sigProvider)) + .append('\n'); + sb.append(" Default Revocation Enabled: ").append(revocationEnabled) + .append('\n'); + sb.append(" Explicit Policy Required: ") + .append(explicitPolicyRequired).append('\n'); + sb.append(" Policy Mapping Inhibited: ") + .append(policyMappingInhibited).append('\n'); + sb.append(" Any Policy Inhibited: ").append(anyPolicyInhibited) + .append('\n'); + sb.append(" Policy Qualifiers Rejected: ") + .append(policyQualifiersRejected).append('\n'); /* now, append target cert requirements */ - sb.append(" Target Cert Constraints: " + String.valueOf(certSelector) + "\n"); + sb.append(" Target Cert Constraints: ") + .append(String.valueOf(certSelector)).append('\n'); /* finally, append miscellaneous parameters */ if (certPathCheckers != null) - sb.append(" Certification Path Checkers: [" - + certPathCheckers.toString() + "]\n"); + sb.append(" Certification Path Checkers: [").append(certPathCheckers.toString()).append("]\n"); if (certStores != null) - sb.append(" CertStores: [" + certStores.toString() + "]\n"); - sb.append("]"); + sb.append(" CertStores: [").append(certStores.toString()).append("]\n"); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PolicyQualifierInfo.java --- a/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PolicyQualifierInfo.java Mon Aug 11 08:18:32 2014 -0300 @@ -163,10 +163,11 @@ HexDumpEncoder enc = new HexDumpEncoder(); StringBuilder sb = new StringBuilder(); sb.append("PolicyQualifierInfo: [\n"); - sb.append(" qualifierID: " + mId + "\n"); - sb.append(" qualifier: " + - (mData == null ? "null" : enc.encodeBuffer(mData)) + "\n"); - sb.append("]"); + sb.append(" qualifierID: ").append(mId).append('\n'); + sb.append(" qualifier: ") + .append(mData == null ? "null" : enc.encodeBuffer(mData)) + .append('\n'); + sb.append(']'); pqiString = sb.toString(); return pqiString; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/TrustAnchor.java --- a/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/TrustAnchor.java Mon Aug 11 08:18:32 2014 -0300 @@ -320,14 +320,18 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); if (pubKey != null) { - sb.append(" Trusted CA Public Key: " + pubKey.toString() + "\n"); - sb.append(" Trusted CA Issuer Name: " - + String.valueOf(caName) + "\n"); + sb.append(" Trusted CA Public Key: ").append(pubKey.toString()) + .append('\n'); + sb.append(" Trusted CA Issuer Name: ") + .append(String.valueOf(caName)).append('\n'); } else { - sb.append(" Trusted CA cert: " + trustedCert.toString() + "\n"); + sb.append(" Trusted CA cert: ").append(trustedCert.toString()) + .append('\n'); } - if (nc != null) - sb.append(" Name Constraints: " + nc.toString() + "\n"); + if (nc != null) { + sb.append(" Name Constraints: ").append(nc.toString()) + .append('\n'); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CRLSelector.java --- a/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CRLSelector.java Mon Aug 11 08:18:32 2014 -0300 @@ -572,17 +572,17 @@ sb.append(" IssuerNames:\n"); Iterator i = issuerNames.iterator(); while (i.hasNext()) - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } if (minCRL != null) - sb.append(" minCRLNumber: " + minCRL + "\n"); + sb.append(" minCRLNumber: ").append(minCRL).append('\n'); if (maxCRL != null) - sb.append(" maxCRLNumber: " + maxCRL + "\n"); + sb.append(" maxCRLNumber: ").append(maxCRL).append('\n'); if (dateAndTime != null) - sb.append(" dateAndTime: " + dateAndTime + "\n"); + sb.append(" dateAndTime: ").append(dateAndTime).append('\n'); if (certChecking != null) - sb.append(" Certificate being checked: " + certChecking + "\n"); - sb.append("]"); + sb.append(" Certificate being checked: ").append(certChecking).append('\n'); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CertSelector.java --- a/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CertSelector.java Mon Aug 11 08:18:32 2014 -0300 @@ -1814,72 +1814,67 @@ StringBuilder sb = new StringBuilder(); sb.append("X509CertSelector: [\n"); if (x509Cert != null) { - sb.append(" Certificate: " + x509Cert.toString() + "\n"); + sb.append(" Certificate: ").append(x509Cert.toString()).append('\n'); } if (serialNumber != null) { - sb.append(" Serial Number: " + serialNumber.toString() + "\n"); + sb.append(" Serial Number: ").append(serialNumber.toString()) + .append('\n'); } if (issuer != null) { - sb.append(" Issuer: " + getIssuerAsString() + "\n"); + sb.append(" Issuer: ").append(getIssuerAsString()).append('\n'); } if (subject != null) { - sb.append(" Subject: " + getSubjectAsString() + "\n"); + sb.append(" Subject: ").append(getSubjectAsString()).append('\n'); } - sb.append(" matchAllSubjectAltNames flag: " - + String.valueOf(matchAllSubjectAltNames) + "\n"); + sb.append(" matchAllSubjectAltNames flag: ") + .append(String.valueOf(matchAllSubjectAltNames)) + .append('\n'); if (subjectAlternativeNames != null) { sb.append(" SubjectAlternativeNames:\n"); Iterator> i = subjectAlternativeNames.iterator(); while (i.hasNext()) { List list = i.next(); - sb.append(" type " + list.get(0) + - ", name " + list.get(1) + "\n"); + sb.append(" type ").append(list.get(0)).append(", name ") + .append(list.get(1)).append('\n'); } } if (subjectKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Subject Key Identifier: " + - enc.encodeBuffer(subjectKeyID) + "\n"); + sb.append(" Subject Key Identifier: ").append(enc.encodeBuffer(subjectKeyID)).append('\n'); } if (authorityKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Authority Key Identifier: " + - enc.encodeBuffer(authorityKeyID) + "\n"); + sb.append(" Authority Key Identifier: ").append(enc.encodeBuffer(authorityKeyID)).append('\n'); } if (certificateValid != null) { - sb.append(" Certificate Valid: " + - certificateValid.toString() + "\n"); + sb.append(" Certificate Valid: ").append(certificateValid.toString()).append('\n'); } if (privateKeyValid != null) { - sb.append(" Private Key Valid: " + - privateKeyValid.toString() + "\n"); + sb.append(" Private Key Valid: ").append(privateKeyValid.toString()).append('\n'); } if (subjectPublicKeyAlgID != null) { - sb.append(" Subject Public Key AlgID: " + - subjectPublicKeyAlgID.toString() + "\n"); + sb.append(" Subject Public Key AlgID: ").append(subjectPublicKeyAlgID.toString()).append('\n'); } if (subjectPublicKey != null) { - sb.append(" Subject Public Key: " + - subjectPublicKey.toString() + "\n"); + sb.append(" Subject Public Key: ").append(subjectPublicKey.toString()).append('\n'); } if (keyUsage != null) { - sb.append(" Key Usage: " + keyUsageToString(keyUsage) + "\n"); + sb.append(" Key Usage: ").append(keyUsageToString(keyUsage)).append('\n'); } if (keyPurposeSet != null) { - sb.append(" Extended Key Usage: " + - keyPurposeSet.toString() + "\n"); + sb.append(" Extended Key Usage: ").append(keyPurposeSet.toString()).append('\n'); } if (policy != null) { - sb.append(" Policy: " + policy.toString() + "\n"); + sb.append(" Policy: ").append(policy.toString()).append('\n'); } if (pathToGeneralNames != null) { sb.append(" Path to names:\n"); Iterator i = pathToGeneralNames.iterator(); while (i.hasNext()) { - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/rmi/dgc/VMID.java --- a/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/rmi/dgc/VMID.java Mon Aug 11 08:18:32 2014 -0300 @@ -124,8 +124,7 @@ if (addr != null) for (int i = 0; i < addr.length; ++ i) { int x = addr[i] & 0xFF; - sb.append((x < 0x10 ? "0" : "") + - Integer.toString(x, 16)); + sb.append(x < 0x10 ? "0" : "").append(Integer.toString(x, 16)); } sb.append(':'); sb.append(uid.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/lang/management/MemoryUsage.java --- a/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/MemoryUsage.java Mon Aug 11 08:18:32 2014 -0300 @@ -237,13 +237,16 @@ * Returns a descriptive representation of this memory usage. */ public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append("init = " + init + "(" + (init >> 10) + "K) "); - buf.append("used = " + used + "(" + (used >> 10) + "K) "); - buf.append("committed = " + committed + "(" + - (committed >> 10) + "K) " ); - buf.append("max = " + max + "(" + (max >> 10) + "K)"); - return buf.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("init = ").append(init).append('(').append(init >> 10) + .append("K) "); + sb.append("used = ").append(used).append('(').append(used >> 10) + .append("K) "); + sb.append("committed = ").append(committed).append('(') + .append(committed >> 10).append("K) "); + sb.append("max = ").append(max).append('(').append(max >> 10) + .append("K)"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/java/lang/management/ThreadInfo.java --- a/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/ThreadInfo.java Mon Aug 11 08:18:32 2014 -0300 @@ -579,15 +579,17 @@ * @return a string representation of this thread info. */ public String toString() { - StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" + - " Id=" + getThreadId() + " " + - getThreadState()); + StringBuilder sb = new StringBuilder(); + sb.append('"').append(getThreadName()).append('"') + .append(" Id=").append(getThreadId()).append(' ') + .append(getThreadState()); + if (getLockName() != null) { - sb.append(" on " + getLockName()); + sb.append(" on ").append(getLockName()); } if (getLockOwnerName() != null) { - sb.append(" owned by \"" + getLockOwnerName() + - "\" Id=" + getLockOwnerId()); + sb.append(" owned by \"").append(getLockOwnerName()) + .append("\" Id=").append(getLockOwnerId()); } if (isSuspended()) { sb.append(" (suspended)"); @@ -599,21 +601,21 @@ int i = 0; for (; i < stackTrace.length && i < MAX_FRAMES; i++) { StackTraceElement ste = stackTrace[i]; - sb.append("\tat " + ste.toString()); + sb.append("\tat ").append(ste.toString()); sb.append('\n'); if (i == 0 && getLockInfo() != null) { Thread.State ts = getThreadState(); switch (ts) { case BLOCKED: - sb.append("\t- blocked on " + getLockInfo()); + sb.append("\t- blocked on ").append(getLockInfo()); sb.append('\n'); break; case WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; case TIMED_WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; default: @@ -622,7 +624,7 @@ for (MonitorInfo mi : lockedMonitors) { if (mi.getLockedStackDepth() == i) { - sb.append("\t- locked " + mi); + sb.append("\t- locked ").append(mi); sb.append('\n'); } } @@ -634,10 +636,10 @@ LockInfo[] locks = getLockedSynchronizers(); if (locks.length > 0) { - sb.append("\n\tNumber of locked synchronizers = " + locks.length); + sb.append("\n\tNumber of locked synchronizers = ").append(locks.length); sb.append('\n'); for (LockInfo li : locks) { - sb.append("\t- " + li); + sb.append("\t- ").append(li); sb.append('\n'); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHParameters.java --- a/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHParameters.java Mon Aug 11 08:18:31 2014 -0300 @@ -137,8 +137,11 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:") + .append(LINE_SEP).append(" ") + .append(this.l); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHPublicKey.java --- a/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Mon Aug 11 08:18:31 2014 -0300 @@ -268,8 +268,10 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:").append(LINE_SEP) + .append(" ").append(this.l); + } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/GCMParameters.java --- a/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/GCMParameters.java Mon Aug 11 08:18:31 2014 -0300 @@ -140,7 +140,8 @@ = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "[" + encoder.encodeBuffer(iv) + "]"); - sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP); + sb.append(LINE_SEP).append("tLen(bits):").append(LINE_SEP) + .append(tLen * 8).append(LINE_SEP); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/OAEPParameters.java --- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Mon Aug 11 08:18:31 2014 -0300 @@ -238,11 +238,12 @@ } protected String engineToString() { - StringBuilder sb = new StringBuilder(); - sb.append("MD: " + mdName + "\n"); - sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n"); - sb.append("PSource: PSpecified " + - (p.length==0? "":Debug.toHexString(new BigInteger(p))) + "\n"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("MD: ").append(mdName).append('\n'); + sb.append("MGF: MGF1").append(mgfSpec.getDigestAlgorithm()) + .append('\n'); + sb.append("PSource: PSpecified ").append(p.length == 0 ? "" : + Debug.toHexString(new BigInteger(p))).append('\n'); + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/RC2Parameters.java --- a/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Mon Aug 11 08:18:31 2014 -0300 @@ -221,8 +221,9 @@ + encoder.encodeBuffer(iv) + "]"); if (version != 0) { - sb.append(LINE_SEP + "version:" + LINE_SEP - + version + LINE_SEP); + sb.append(LINE_SEP).append("version:") + .append(LINE_SEP).append(version) + .append(LINE_SEP); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Mon Aug 11 08:18:31 2014 -0300 @@ -65,7 +65,7 @@ "extractSubNet", "BINARY ARRAY :"); StringBuilder sb = new StringBuilder(); for(int i =0; i < addrLength; i++) { - sb.append((b[i] & 0xFF) + ":"); + sb.append(b[i] & 0xFF).append(':'); } SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", sb.toString()); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Mon Aug 11 08:18:31 2014 -0300 @@ -204,7 +204,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Mon Aug 11 08:18:31 2014 -0300 @@ -379,7 +379,7 @@ } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); - jjtn000.name.append( "." + t.image); + jjtn000.name.append('.').append(t.image); } } finally { if (jjtc000) { @@ -408,7 +408,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -454,7 +454,7 @@ } jj_consume_token(MARK); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -483,7 +483,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } jj_consume_token(MASK); t = jj_consume_token(INTEGER_LITERAL); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Mon Aug 11 08:18:31 2014 -0300 @@ -99,7 +99,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java --- a/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Mon Aug 11 08:18:31 2014 -0300 @@ -479,10 +479,10 @@ */ public String printMessage() { StringBuilder sb = new StringBuilder(); - sb.append("msgId : " + msgId + "\n"); - sb.append("msgMaxSize : " + msgMaxSize + "\n"); - sb.append("msgFlags : " + msgFlags + "\n"); - sb.append("msgSecurityModel : " + msgSecurityModel + "\n"); + sb.append("msgId : ").append(msgId).append('\n'); + sb.append("msgMaxSize : ").append(msgMaxSize).append('\n'); + sb.append("msgFlags : ").append(msgFlags).append('\n'); + sb.append("msgSecurityModel : ").append(msgSecurityModel).append('\n'); if (contextEngineId == null) { sb.append("contextEngineId : null"); diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java --- a/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Mon Aug 11 08:18:31 2014 -0300 @@ -256,7 +256,7 @@ private static String stringifyComponent(NameComponent comp) { StringBuilder one = new StringBuilder(escape(comp.id)); if (comp.kind != null && !comp.kind.equals("")) { - one.append(kindSeparator + escape(comp.kind)); + one.append(kindSeparator).append(escape(comp.kind)); } if (one.length() == 0) { return ""+kindSeparator; // if neither id nor kind specified diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java --- a/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Mon Aug 11 08:18:31 2014 -0300 @@ -90,7 +90,7 @@ if (selected == -1) { StringBuilder allChoices = new StringBuilder(); for (int j = 0; j < choices.length; j++) { - allChoices.append(choices[j] + ","); + allChoices.append(choices[j]).append(','); } throw new IOException("Cannot match " + "'java.naming.security.sasl.realm' property value, '" + diff -r dde9f5cfde5f src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java --- a/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Mon Aug 11 08:18:31 2014 -0300 @@ -167,9 +167,9 @@ for (int i = 0; i < allchannelnames.length; i++) { if ((channelmask & m) != 0L) { if (i < channelnames.length) { - sb.append(channelnames[i] + " "); + sb.append(channelnames[i]).append(' '); } else { - sb.append(allchannelnames[i] + " "); + sb.append(allchannelnames[i]).append(' '); } } m *= 2L; diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Mon Aug 11 08:18:31 2014 -0300 @@ -235,14 +235,15 @@ String nodeName = att.getNodeName(); if ((nodeName.equals("xmlns") || nodeName.startsWith("xmlns:")) && !storedNamespaces.containsKey(att.getNodeName())) { - sb.append(" " + nodeName + "=\"" + att.getNodeValue() + "\""); + sb.append(' ').append(nodeName).append("=\"") + .append(att.getNodeValue()).append('"'); storedNamespaces.put(nodeName, att.getNodeValue()); } } } wk = wk.getParentNode(); } - sb.append(">" + source + ""); + sb.append('>').append(source).append(""); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Mon Aug 11 08:18:31 2014 -0300 @@ -85,7 +85,7 @@ if (prefix.equals("xmlns")) { sb.append("#default "); } else { - sb.append(prefix + " "); + sb.append(prefix).append(' '); } } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Mon Aug 11 08:18:31 2014 -0300 @@ -88,7 +88,7 @@ l += countQuotes(DN, j, k); if ((k > 0) && (DN.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseRDN(DN.substring(i, k).trim(), toXml) + ","); + sb.append(parseRDN(DN.substring(i, k).trim(), toXml)).append(','); i = k + 1; l = 0; @@ -121,7 +121,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseATAV(trim(str.substring(i, k)), toXml) + "+"); + sb.append(parseATAV(trim(str.substring(i, k)), toXml)).append('+'); i = k + 1; l = 0; @@ -369,7 +369,7 @@ int k; for (int j = 0; (k = string.indexOf("\\20", j)) >= 0; j = k + 3) { - sb.append(trim(string.substring(i, k)) + "\\ "); + sb.append(trim(string.substring(i, k))).append("\\ "); i = k + 3; } @@ -418,7 +418,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(trim(str.substring(i, k)) + replace); + sb.append(trim(str.substring(i, k))).append(replace); i = k + 1; l = 0; diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/CramMD5Base.java --- a/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/CramMD5Base.java Mon Aug 11 08:18:31 2014 -0300 @@ -196,8 +196,7 @@ for (i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java --- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Mon Aug 11 08:18:31 2014 -0300 @@ -391,8 +391,7 @@ for (int i = 0; i < digest.length; i ++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0"+ - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/ParseException.java --- a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Mon Aug 11 08:18:31 2014 -0300 @@ -198,7 +198,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java --- a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Mon Aug 11 08:18:31 2014 -0300 @@ -107,7 +107,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java --- a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Mon Aug 11 08:18:31 2014 -0300 @@ -338,10 +338,10 @@ if (classpath.isEmpty()) { String envcp = System.getProperty("env.class.path"); if ((envcp != null) && (envcp.length() > 0)) { - munged.append(" -classpath " + envcp); + munged.append(" -classpath ").append(envcp); } } else { - munged.append(" -classpath " + classpath.asString()); + munged.append(" -classpath ").append(classpath.asString()); } return munged.toString(); } else { diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Mon Aug 11 08:18:31 2014 -0300 @@ -386,37 +386,37 @@ } case 'B': { int val = 0xFF & byteAt(i, value); - result.append("0x" + Integer.toString(val, 16)); + result.append("0x").append(Integer.toString(val, 16)); i++; break; } case 'S': { short val = shortAt(i, value); i += 2; - result.append("" + val); + result.append(val); break; } case 'I': { int val = intAt(i, value); i += 4; - result.append("" + val); + result.append(val); break; } case 'J': { // long long val = longAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } case 'F': { float val = floatAt(i, value); - result.append("" + val); + result.append(val); i += 4; break; } case 'D': { // double double val = doubleAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } @@ -425,7 +425,7 @@ } } } - result.append("}"); + result.append('}'); } return result.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/util/Misc.java --- a/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Mon Aug 11 08:18:31 2014 -0300 @@ -97,11 +97,11 @@ } else if (ch == '&') { sb.append("&"); } else if (ch < ' ') { - sb.append("&#" + Integer.toString(ch) + ";"); + sb.append("&#").append(Integer.toString(ch)).append(';'); } else { int c = (ch & 0xFFFF); if (c > 127) { - sb.append("&#" + Integer.toString(c) + ";"); + sb.append("&#").append(Integer.toString(c)).append(';'); } else { sb.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java --- a/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Mon Aug 11 08:18:31 2014 -0300 @@ -881,12 +881,12 @@ } else if (tag == JDWP.TypeTag.ARRAY) { sb.append("ArrayType"); } else { - sb.append("UNKNOWN TAG: " + tag); + sb.append("UNKNOWN TAG: ").append(tag); } if (signature != null) { - sb.append(", signature='" + signature + "'"); + sb.append(", signature='").append(signature).append('\''); } - sb.append(", id=" + id); + sb.append(", id=").append(id); vm.printTrace(sb.toString()); } if (id == 0) { From andrej.golovnin at gmail.com Mon Aug 11 11:55:47 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Mon, 11 Aug 2014 13:55:47 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> Message-ID: Hi Ot?vio, About the template in Parser.jjt, TokenMgrError.java, etc. I don't know how > can do that. Can anyone help me? > See attached diff for the changes in Parser.jjt and Parser.jj. For the TokenMgrError and ParserException you can just subscribe here: https://java.net/projects/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 beyond be more explicit I can use > char instead of a single String. > > > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_3.zip > > > On Mon, Aug 11, 2014 at 7:56 AM, Pavel Rappo > wrote: > >> > In the class >> > src/share/classes/javax/management/openmbean/CompositeType.java you have >> > added the >> > annotation >> @SuppressWarnings("StringConcatenationInsideStringBufferAppend") >> > instead of fixing the concatenation inside the append method. Why? >> >> +1 Moreover, I wonder where this value comes from? I've never seen it >> before. Here are warnings that javac supports: >> >> >> all,auxiliaryclass,cast,classfile,deprecation,dep-ann,divzero,empty,fallthrough,finally,options,overloads,overrides,path,processing,rawtypes,serial,static,try,unchecked,varargs >> >> It doesn't look like one of Eclipse's warnings either. >> >> > And I would like to suggest to drop explicit usage of StringBuilder in >> some >> > methods at all to improve code readability. >> >> Agree. >> >> -Pavel >> >> > > > -- > Ot?vio Gon?alves de Santana > > blog: http://otaviosantana.blogspot.com.br/ > twitter: http://twitter.com/otaviojava > site: *http://about.me/otaviojava * > 55 (11) 98255-3513 > -------------- next part -------------- diff --git a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj @@ -420,7 +420,7 @@ t= { jjtn000.name.append(t.image); } ( "." t= - {jjtn000.name.append( "." + t.image); } + {jjtn000.name.append('.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -447,7 +447,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append('.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -501,7 +501,7 @@ {jjtn000.address.append(t.image); } ( "!" t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append('.).append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -527,7 +527,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append('.').append(t.image); } )* "/" t= /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); diff --git a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt @@ -213,7 +213,7 @@ t= { jjtThis.name.append(t.image); } ( "." t= - {jjtThis.name.append( "." + t.image); } + {jjtThis.name.append('.').append(t.image); } )* } @@ -228,7 +228,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append('.').append(t.image); } )* } @@ -253,7 +253,7 @@ {jjtThis.address.append(t.image); } ( "!" t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append('.').append(t.image); } )* } @@ -267,7 +267,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append('.').append(t.image); } )* "/" t= {jjtThis.mask = t.image; } } From andrej.golovnin at gmail.com Mon Aug 11 11:58:06 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Mon, 11 Aug 2014 13:58:06 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> Message-ID: 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, etc. I don't know >> how can do that. Can anyone help me? >> > > See attached diff for the changes in Parser.jjt and Parser.jj. For the > TokenMgrError and ParserException you can just subscribe here: > > https://java.net/projects/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 beyond be more explicit I can use >> char instead of a single String. >> >> >> https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_3.zip >> >> >> On Mon, Aug 11, 2014 at 7:56 AM, Pavel Rappo >> wrote: >> >>> > In the class >>> > src/share/classes/javax/management/openmbean/CompositeType.java you >>> have >>> > added the >>> > annotation >>> @SuppressWarnings("StringConcatenationInsideStringBufferAppend") >>> > instead of fixing the concatenation inside the append method. Why? >>> >>> +1 Moreover, I wonder where this value comes from? I've never seen it >>> before. Here are warnings that javac supports: >>> >>> >>> all,auxiliaryclass,cast,classfile,deprecation,dep-ann,divzero,empty,fallthrough,finally,options,overloads,overrides,path,processing,rawtypes,serial,static,try,unchecked,varargs >>> >>> It doesn't look like one of Eclipse's warnings either. >>> >>> > And I would like to suggest to drop explicit usage of StringBuilder in >>> some >>> > methods at all to improve code readability. >>> >>> Agree. >>> >>> -Pavel >>> >>> >> >> >> -- >> Ot?vio Gon?alves de Santana >> >> blog: http://otaviosantana.blogspot.com.br/ >> twitter: http://twitter.com/otaviojava >> site: *http://about.me/otaviojava * >> 55 (11) 98255-3513 >> > > -------------- next part -------------- diff --git a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj @@ -420,7 +420,7 @@ t= { jjtn000.name.append(t.image); } ( "." t= - {jjtn000.name.append( "." + t.image); } + {jjtn000.name.append('.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -447,7 +447,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append('.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -501,7 +501,7 @@ {jjtn000.address.append(t.image); } ( "!" t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append('.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -527,7 +527,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append('.').append(t.image); } )* "/" t= /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); diff --git a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt @@ -213,7 +213,7 @@ t= { jjtThis.name.append(t.image); } ( "." t= - {jjtThis.name.append( "." + t.image); } + {jjtThis.name.append('.').append(t.image); } )* } @@ -228,7 +228,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append('.').append(t.image); } )* } @@ -253,7 +253,7 @@ {jjtThis.address.append(t.image); } ( "!" t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append('.').append(t.image); } )* } @@ -267,7 +267,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append('.').append(t.image); } )* "/" t= {jjtThis.mask = t.image; } } From peter.firmstone at zeus.net.au Mon Aug 11 12:06:48 2014 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Mon, 11 Aug 2014 22:06:48 +1000 Subject: The future of Serialization In-Reply-To: <53E8A71D.70407@oracle.com> References: <1407563776.1841.30.camel@Nokia-N900> <53E8A71D.70407@oracle.com> Message-ID: <53E8B1D8.1000200@zeus.net.au> Thanks Alan, I can relate to time poverty :) I might be assuming too much, but if there's interest in doing something with Serialization, I'd be interested in learning about plans or difficulties involved in deserialization and modules. It can be a little more difficult to find the correct ClassLoader to resolve classes during deserialization when ClassLoader relationships aren't hierarchial. Object streams can be annotated with module information to assist resolution. On the subject of isolates, I found Ribbons interesting: https://www.cs.purdue.edu/homes/peugster/Ribbons/RJ.pdf https://www.cs.purdue.edu/homes/peugster/Ribbons/ Got any links to info on extending access control rules? Regards, Peter. On 11/08/2014 9:21 PM, Alan Bateman wrote: > On 09/08/2014 06:56, Peter Firmstone wrote: >> >> I've noticed there's not much interest in improving Serialization on >> these lists. This makes me wonder if java Serialization has lost >> relevance in recent years with the rise of protocol buffers apache >> thrift and other means of data transfer over byte streams. >> > Just to add to Brian's comments, I think part of it is that many > people are busy with other things, preparing for JDK 9 for example. So > I think there is a lot of support for investigation and proposals that > would improve things, it's just that some people are too busy to respond. > > >> >> I don't know if isolates will be included with JDK 9 for Jigsaw, or >> whether ClassLoaders alone will provide isolation for modules. >> >> The ability to limit visibility and provide isolation of >> implementation classes as well as providing limits on memory and >> threads for isolated modules would also improve platform security. >> > If by "isolates" you mean JSR 121 then I think that would be well > beyond the scope, as would resource management. This isn't really the > thread to discuss how module boundaries will work but just to say that > class loaders and visibility can be weak when it comes to module > boundaries. There are other options available, particularly when the > ability to extend the access control rules are on the table. So I > would suggest not making any assumptions here for now. > > -Alan. From andrej.golovnin at gmail.com Mon Aug 11 13:12:02 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Mon, 11 Aug 2014 15:12:02 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> Message-ID: Hi, About readable of code I just renamed this class to sb instead of buf, > strbuf, etc. > I doubt that renaming variables does really improve the code readability. And you changed the indentation (take look at other classes too): 239 public String toString() { 240 StringBuilder sb = new StringBuilder(); 241 sb.append("init = ").append(init).append('(').append(init >> 10) 242 .append("K) "); 243 sb.append("used = ").append(used).append('(').append(used >> 10) 244 .append("K) "); 245 sb.append("committed = ").append(committed).append('(') 246 .append(committed >> 10).append("K) "); 247 sb.append("max = ").append(max).append('(').append(max >> 10) 248 .append("K)"); 249 return sb.toString(); 250 } Because using StringBuilder beyond be more explicit I can use char instead > of a single String. > In the most classes I mentioned in my previous mail only the #toString()-methods would be affected by the proposal. And in the most cases, maybe in all cases, the #toString()-methods in this classes exists only to provide nice output. I would not consider them performance-critical. Btw. I see here a 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').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/string_builder_concat_3.zip > > > On Mon, Aug 11, 2014 at 7:56 AM, Pavel Rappo > wrote: > >> > In the class >> > src/share/classes/javax/management/openmbean/CompositeType.java you have >> > added the >> > annotation >> @SuppressWarnings("StringConcatenationInsideStringBufferAppend") >> > instead of fixing the concatenation inside the append method. Why? >> >> +1 Moreover, I wonder where this value comes from? I've never seen it >> before. Here are warnings that javac supports: >> >> >> all,auxiliaryclass,cast,classfile,deprecation,dep-ann,divzero,empty,fallthrough,finally,options,overloads,overrides,path,processing,rawtypes,serial,static,try,unchecked,varargs >> >> It doesn't look like one of Eclipse's warnings either. >> >> > And I would like to suggest to drop explicit usage of StringBuilder in >> some >> > methods at all to improve code readability. >> >> Agree. >> >> -Pavel >> >> > > > -- > Ot?vio Gon?alves de Santana > > blog: http://otaviosantana.blogspot.com.br/ > twitter: http://twitter.com/otaviojava > site: *http://about.me/otaviojava * > 55 (11) 98255-3513 > From ivan.gerasimov at oracle.com Mon Aug 11 13:41:45 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 11 Aug 2014 17:41:45 +0400 Subject: RFR [8046339] sun.rmi.transport.DGCAckHandler leaks memory Message-ID: <53E8C819.10705@oracle.com> Hello everyone! It has been reported that under some conditions instances of sun.rmi.transport.DGCAckHandler accumulate and can cause OOM Error. This is because they are stored in the global DGCAckHandler.idTable map, and may fail to be removed if a timeout has expired. The webrev contains a fix proposed by Darryl Mocek back in 2011. Unfortunately I couldn't come up with a regression test for the fix. However, the fix looks obviously correct, especially taking into account the comment to the constructor: * References added to this DGCAckHandler will be held strongly * until its "release" method is invoked or (after the * "startTimer" method has been invoked) the timeout has expired. Would you please help review the fix? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8046339 WEBREV: http://cr.openjdk.java.net/~igerasim/8046339/0/webrev/ Sincerely yours, Ivan From claes.redestad at oracle.com Mon Aug 11 13:52:18 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 11 Aug 2014 15:52:18 +0200 Subject: RFR: 8054828: [TESTBUG] Typos in java/lang/Long/ParsingTest Message-ID: <53E8CA92.7030901@oracle.com> Hi, please review this small patch which resolves a number of typos where java/lang/Long/ParsingTest.java accidentally uses Integer.parseInt instead of Long.parseLong webrev: http://cr.openjdk.java.net/~redestad/8054828/webrev.0/ bug: https://bugs.openjdk.java.net/browse/JDK-8054828 Thanks! /Claes From ivan.gerasimov at oracle.com Mon Aug 11 13:55:55 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 11 Aug 2014 17:55:55 +0400 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: Message-ID: <53E8CB6B.4020406@oracle.com> Hi Ot?vio! A few days ago I've posted another cleanup request, which included modifications to src/share/classes/sun/net/www/MimeEntry.java http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-August/028131.html As our changes overlap, one should be reverted back. I believe using StringJoiner makes MimeEntry#toString() a bit cleaner. What do you think? Sincerely yours, Ivan On 11.08.2014 1:33, Ot?vio Gon?alves de Santana wrote: > *Motivation:* Make another append instead of concat String inside of append > parameter in StringBuilder class. To avoid an extra StringBuilder created > for the purpose of concatenating. So it will save memory and will faster > than concat String. > Doing a code to benchMark[1], the result is: > > Benchmark Mode Samples > Mean Mean error Units > m.StringBuilderConcatBenchMark.stringBuilder thrpt 10 > 6317444.705 108673.584 ops/s > m.StringBuilderConcatBenchMark.stringBuilderWithConcat thrpt 10 > 3354554.435 68353.924 ops/s > > The webrev of all code is: > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat.zip > > > [1] > > @State(Scope.Thread) > @OutputTimeUnit(TimeUnit.SECONDS) > public class StringBuilderConcatBenchMark { > > > private static final String F = "!!!!"; > private static final String E = " running in Java "; > private static final String D = " in the code "; > private static final String C = " to try impact "; > private static final String B = " with some text "; > private static final String A = "Doing a test"; > > @GenerateMicroBenchmark > public void stringBuilder(BlackHole bh) { > bh.consume(createBuilder(A, B, C, D, E, F)); > } > > @GenerateMicroBenchmark > public void stringBuilderWithConcat(BlackHole bh) { > bh.consume(createBuilderWithConcat(A, B, C, D, E, F)); > } > > private StringBuilder createBuilder(String... values) { > StringBuilder text = new StringBuilder(); > text.append(values[0]).append(values[1]) > .append(values[2]).append(values[3]) > .append(values[4]).append(values[5]); > return text; > } > private StringBuilder createBuilderWithConcat(String... values) { > StringBuilder text = new StringBuilder(); > text.append(values[0] + values[1]) > .append(values[2] + values[3]) > .append(values[4]+ values[5]); > return text; > } > } > From Alan.Bateman at oracle.com Mon Aug 11 14:00:51 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 11 Aug 2014 15:00:51 +0100 Subject: RFR: 8054828: [TESTBUG] Typos in java/lang/Long/ParsingTest In-Reply-To: <53E8CA92.7030901@oracle.com> References: <53E8CA92.7030901@oracle.com> Message-ID: <53E8CC93.7090905@oracle.com> On 11/08/2014 14:52, Claes Redestad wrote: > Hi, > > please review this small patch which resolves a number of typos where > java/lang/Long/ParsingTest.java accidentally uses Integer.parseInt > instead of Long.parseLong > > webrev: http://cr.openjdk.java.net/~redestad/8054828/webrev.0/ > bug: https://bugs.openjdk.java.net/browse/JDK-8054828 This looks okay to me. -Alan From Ulf.Zibis at CoSoCo.de Mon Aug 11 14:01:58 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Mon, 11 Aug 2014 16:01:58 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> Message-ID: <53E8CCD6.2090503@CoSoCo.de> Am 11.08.2014 um 15:12 schrieb Andrej Golovnin: > In the most classes I mentioned in my previous mail only the > #toString()-methods would be affected by the proposal. And in the most > cases, maybe in all cases, the #toString()-methods in this classes exists > only to provide nice output. So why not "nice input" from the java sources ...i.e.: use concatenation only if possible. The performance problem occurs, if both strategies are mixed. > Btw. I see here a 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').append(o2).append('\n').toString(); > > instead of: > > String s = new > StringBuilder().append("abc").append(o1).append("c").append(o2).append("\n").toString(); + manual .append("x") should be translated to .append("x") + Javac could avoid to instantiate multiple SBs from mixed concatenation/SB source code. + Javac could calculate a reasonable buffer size init value. -Ulf From Alan.Bateman at oracle.com Mon Aug 11 14:18:20 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 11 Aug 2014 15:18:20 +0100 Subject: The future of Serialization In-Reply-To: <53E8B1D8.1000200@zeus.net.au> References: <1407563776.1841.30.camel@Nokia-N900> <53E8A71D.70407@oracle.com> <53E8B1D8.1000200@zeus.net.au> Message-ID: <53E8D0AC.3060108@oracle.com> On 11/08/2014 13:06, Peter Firmstone wrote: > Thanks Alan, I can relate to time poverty :) > > I might be assuming too much, but if there's interest in doing > something with Serialization, I'd be interested in learning about > plans or difficulties involved in deserialization and modules. It can > be a little more difficult to find the correct ClassLoader to resolve > classes during deserialization when ClassLoader relationships aren't > hierarchial. Object streams can be annotated with module information > to assist resolution. The issues around visibility when deserializing are somewhat independent of modules. The usual way to deal with such matters is to override the resolveClass method. Another long standing suggestion is for ObjectInputStream to define a new constructor that takes a class loader to avoid the stack walk to get the user-defined loader. It remains to seen but if we can avoid changing visibility then we don't change the status quo. > : > > Got any links to info on extending access control rules? Not yet, a future JSR will define the standard module system and there will be a corresponding JEP for the implementation. -Alan. From claes.redestad at oracle.com Mon Aug 11 14:21:44 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 11 Aug 2014 16:21:44 +0200 Subject: RFR: 8054828: [TESTBUG] Typos in java/lang/Long/ParsingTest In-Reply-To: <53E8CC93.7090905@oracle.com> References: <53E8CA92.7030901@oracle.com> <53E8CC93.7090905@oracle.com> Message-ID: <53E8D178.4090405@oracle.com> On 08/11/2014 04:00 PM, Alan Bateman wrote: > On 11/08/2014 14:52, Claes Redestad wrote: >> Hi, >> >> please review this small patch which resolves a number of typos >> where java/lang/Long/ParsingTest.java accidentally uses >> Integer.parseInt instead of Long.parseLong >> >> webrev: http://cr.openjdk.java.net/~redestad/8054828/webrev.0/ >> bug: https://bugs.openjdk.java.net/browse/JDK-8054828 > This looks okay to me. Thanks, Alan! I'll need someone to push this. Any takers? /Claes > > -Alan From Alan.Bateman at oracle.com Mon Aug 11 14:27:59 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 11 Aug 2014 15:27:59 +0100 Subject: RFR: 8054828: [TESTBUG] Typos in java/lang/Long/ParsingTest In-Reply-To: <53E8D178.4090405@oracle.com> References: <53E8CA92.7030901@oracle.com> <53E8CC93.7090905@oracle.com> <53E8D178.4090405@oracle.com> Message-ID: <53E8D2EF.80006@oracle.com> On 11/08/2014 15:21, Claes Redestad wrote: > > Thanks, Alan! > > I'll need someone to push this. Any takers? Okay, I can sponsor this for you. -Alan. From pavel.rappo at oracle.com Mon Aug 11 14:33:14 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Mon, 11 Aug 2014 15:33:14 +0100 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> Message-ID: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> Otavio, Just skimmed through your changes. It looks good. But there are some things we can make a little bit better though. IMO, it's not always a performance that matters (looking around to see if Alexey Shipilev is somewhere near) but readability. It's good to estimate performance requirements of a code before making a decision of whether to sacrifice readability for performance or not. I noticed there are some methods that are screaming for readability improvements. Namely, different versions of joining strings through a separator. You can find them in following methods in your changeset: sun.security.acl.AclEntryImpl::toString sun.security.ssl.HandshakeMessage.CertificateRequest::print javax.swing.MultiUIDefaults::toString (one of the most bizarre one) sun.security.provider.PolicyFile::expandSelf java.security.ProtectionDomain::toString javax.management.relation.Role::toString sun.security.ssl.SupportedEllipticCurvesExtension::toString sun.tools.jstat.SyntaxException::SyntaxException Unfortunately, neither java.util.StringJoiner nor String.join have perfect (but who has?) APIs. So it's up to us to figure out the best way of joining elements. So when the power of those guys is not enough, we can go this way (or maybe some else): Iterable elements = ... StringJoiner j = new StringJoiner(", "); elements.forEach(e -> j.add(e.toString())); or Collection elements = ... String i = elements.stream() .map(Object::toString) .collect(Collectors.joining(", ")); Other than that: 1. It looks like some StringBuffers are still lurking out there. We should change them to StringBuilders, *only if* we can prove they are not exposed to more than one thread: --- dev/jdk/src/share/classes/javax/sound/sampled/AudioFileFormat.java (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) +++ dev/jdk/src/share/classes/javax/sound/sampled/AudioFileFormat.java (revision 10452+:8e501e6bbf1f+) @@ -272,7 +272,7 @@ @Override public String toString() { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() throws unexpected NullPointerException if (type != null) { --- dev/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) +++ dev/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java (revision 10452+:8e501e6bbf1f+) @@ -346,12 +346,12 @@ public String valueString(boolean bigLimit) { // Char arrays deserve special treatment - StringBuffer result; + StringBuilder result; byte[] value = getValue(); int max = value.length; byte elementSignature = getElementType(); if (elementSignature == 'C') { - result = new StringBuffer(); + result = new StringBuilder(); for (int i = 0; i < value.length; ) { char val = charAt(i, value); result.append(val); @@ -362,7 +362,7 @@ if (bigLimit) { limit = 1000; } - result = new StringBuffer("{"); + result = new StringBuilder("{"); int num = 0; for (int i = 0; i < value.length; ) { if (num > 0) { --- dev/jdk/src/share/classes/javax/swing/GroupLayout.java (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) +++ dev/jdk/src/share/classes/javax/swing/GroupLayout.java (revision 10452+:8e501e6bbf1f+) @@ -1213,7 +1213,7 @@ registerComponents(horizontalGroup, HORIZONTAL); registerComponents(verticalGroup, VERTICAL); } - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("HORIZONTAL\n"); createSpringDescription(buffer, horizontalGroup, " ", HORIZONTAL); buffer.append("\nVERTICAL\n"); @@ -1221,7 +1221,7 @@ return buffer.toString(); } - private void createSpringDescription(StringBuffer buffer, Spring spring, + private void createSpringDescription(StringBuilder buffer, Spring spring, String indent, int axis) { String origin = ""; String padding = ""; --- dev/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) +++ dev/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java (revision 10452+:8e501e6bbf1f+) @@ -463,7 +463,7 @@ // --------- - private static void appendIfLiteralAddress(String addr, StringBuffer sb) { + private static void appendIfLiteralAddress(String addr, StringBuilder sb) { if (IPAddressUtil.isIPv4LiteralAddress(addr)) { sb.append("dns://").append(addr).append(' '); } else { @@ -478,10 +478,8 @@ * corresponding to the supplied List of nameservers. */ private static String createProviderURL(List nsList) { - StringBuffer sb = new StringBuffer(); - for (String s: nsList) { - appendIfLiteralAddress(s, sb); - } + StringBuilder sb = new StringBuilder(); + nsList.forEach(s -> appendIfLiteralAddress(s, sb)); return sb.toString(); } @@ -491,7 +489,7 @@ * contained in the provided str. */ private static String createProviderURL(String str) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); StringTokenizer st = new StringTokenizer(str, ","); while (st.hasMoreTokens()) { appendIfLiteralAddress(st.nextToken(), sb); 2. Also there are some minor issues with line width and readability: --- dev/jdk/src/share/classes/java/security/cert/CertPath.java (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) +++ dev/jdk/src/share/classes/java/security/cert/CertPath.java (revision 10452+:8e501e6bbf1f+) @@ -224,16 +224,16 @@ Iterator stringIterator = getCertificates().iterator(); - sb.append('\n').append(type).append(" Cert Path: length = ").append(getCertificates().size()).append(".\n"); - sb.append("[\n"); + sb.append('\n').append(type).append(" Cert Path: length = ") + .append(getCertificates().size()).append(".\n").append("[\n"); int i = 1; while (stringIterator.hasNext()) { - sb.append("==========================================" + "===============Certificate ") - .append(i).append(" start.\n"); + sb.append("==========================================") + .append("===============Certificate ").append(i).append(" start.\n"); Certificate stringCert = stringIterator.next(); - sb.append(stringCert.toString()); - sb.append("\n========================================" + "=================Certificate ") - .append(i).append(" end.\n\n\n"); + sb.append(stringCert.toString()).append('\n'); + sb.append("========================================") + .append("=================Certificate ").append(i).append(" end.\n\n\n"); i++; } --- dev/jdk/src/share/classes/javax/swing/JColorChooser.java (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) +++ dev/jdk/src/share/classes/javax/swing/JColorChooser.java (revision 10452+:8e501e6bbf1f+) @@ -543,7 +543,7 @@ * @return a string representation of this JColorChooser */ protected String paramString() { - StringBuilder chooserPanelsString = new StringBuilder(""); + StringBuilder chooserPanelsString = new StringBuilder(); for (int i=0; i References: <53E8CA92.7030901@oracle.com> <53E8CC93.7090905@oracle.com> <53E8D178.4090405@oracle.com> <53E8D2EF.80006@oracle.com> Message-ID: <53E8D37E.2040100@oracle.com> On 08/11/2014 04:27 PM, Alan Bateman wrote: > On 11/08/2014 15:21, Claes Redestad wrote: >> >> Thanks, Alan! >> >> I'll need someone to push this. Any takers? > Okay, I can sponsor this for you. > Great! Thanks again! /Claes > -Alan. From Ulf.Zibis at CoSoCo.de Mon Aug 11 15:38:14 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Mon, 11 Aug 2014 17:38:14 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> Message-ID: <53E8E366.3060200@CoSoCo.de> Am 11.08.2014 um 16:33 schrieb Pavel Rappo: > Unfortunately, neither java.util.StringJoiner nor String.join have perfect (but who has?) APIs. So it's up to us to figure out the best way of joining elements. Maybe remember my thoughts from here: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-April/016172.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-January/024761.html Would it be possible to inherit StringJoiner from StringBuilder in some way? Then a mixture of concatanation, StringBuilder and StringJoiner after Javac would end up in one StringBuilder instance. We also could profit from StringJoiners initial capacity capability. -Ulf From pavel.rappo at oracle.com Mon Aug 11 16:17:53 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Mon, 11 Aug 2014 17:17:53 +0100 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53E8E366.3060200@CoSoCo.de> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53E8E366.3060200@CoSoCo.de> Message-ID: <313491A7-D4F0-46BA-8D60-7ADDA700040C@oracle.com> Ulf, My point was simply that none of these classes provide methods that accept java.lang.Object. IMO, the scenario when we join elements into a String by calling toString on each element prior to append it -- is the most common scenario (maybe except for when element is a String itself). That is instead of doing this: Iterable whatever = ... String s = String.join(whatever); we have to do (at least) something like this: Iterable whatever = ... whatever.forEach(w -> builder.append(w.toString()); String s = builder.toString(); or this: String s = StreamSupport.stream(whatever.spliterator(), false /* or true */) .map(Object::toString) .collect(Collectors.joining(", ")); That is, it's hardly ever a concise one-liner. An 'addAll' method in j.u.StringJoiner could have saved us, but there isn't one. (I'm sure there were plenty of engineering reasons not to do things I've mentioned) -Pavel On 11 Aug 2014, at 16:38, Ulf Zibis wrote: > > Am 11.08.2014 um 16:33 schrieb Pavel Rappo: >> Unfortunately, neither java.util.StringJoiner nor String.join have perfect (but who has?) APIs. So it's up to us to figure out the best way of joining elements. > > Maybe remember my thoughts from here: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-April/016172.html > http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-January/024761.html > > Would it be possible to inherit StringJoiner from StringBuilder in some way? > Then a mixture of concatanation, StringBuilder and StringJoiner after Javac would end up in one StringBuilder instance. We also could profit from StringJoiners initial capacity capability. > > -Ulf > > From claes.redestad at oracle.com Mon Aug 11 16:15:54 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 11 Aug 2014 18:15:54 +0200 Subject: [8u40] RFR(M): 8050114, 8041972, 8006627 Message-ID: <53E8EC3A.90100@oracle.com> Hi, I want to request backports of 8050114 [1], 8041972 [2] and 8006627[3] to 8u-dev. The patches apply cleanly when pushed in the sequence listed. [1] Expose Integer/Long formatUnsigned methods internally - jdk9 patch appliescleanly to jdk8u-dev https://bugs.openjdk.java.net/browse/JDK-8050114 http://cr.openjdk.java.net/~redestad/8050114/webrev.2 http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/7f056c2a6c54 [2] Add improved parse methods for Long/Integer - public API methods made package private and exposed via JavaLangAccess - rolled typos fixes found and reported under JDK-8054828 into this patch https://bugs.openjdk.java.net/browse/JDK-8041972 http://cr.openjdk.java.net/~redestad/8041972/backport.2 http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/127da56ff224 [3] UUID to/from String performance should be improved by reducing object allocations - non-public parseLong method now accessed via JavaLangAccess https://bugs.openjdk.java.net/browse/JDK-8006627 http://cr.openjdk.java.net/~redestad/8006627/backport.0 http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/3b298c230549 Thanks! /Claes From ivan.gerasimov at oracle.com Mon Aug 11 17:14:55 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 11 Aug 2014 21:14:55 +0400 Subject: RFR [8054841] : (process) ProcessBuilder leaks native memory Message-ID: <53E8FA0F.4080608@oracle.com> Hello! There seems to be a small native memory leak in the ProcessBuilder's code. Would you please help review the trivial fix for that? BUGURL: https://bugs.openjdk.java.net/browse/JDK-8054841 WEBREV: http://cr.openjdk.java.net/~igerasim/8054841/0/webrev/ Sincerely yours, Ivan From pavel.rappo at oracle.com Mon Aug 11 17:31:43 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Mon, 11 Aug 2014 18:31:43 +0100 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <313491A7-D4F0-46BA-8D60-7ADDA700040C@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53E8E366.3060200@CoSoCo.de> <313491A7-D4F0-46BA-8D60-7ADDA700040C@oracle.com> Message-ID: Sorry, I should've written this: Iterable whatever = ... StringJoiner joiner = new StringJoiner(", "); whatever.forEach(w -> joiner.add(w.toString())); String s = joiner.toString(); -Pavel On 11 Aug 2014, at 17:17, Pavel Rappo wrote: > Iterable whatever = ... > whatever.forEach(w -> builder.append(w.toString()); > String s = builder.toString(); From roger.riggs at oracle.com Mon Aug 11 17:48:28 2014 From: roger.riggs at oracle.com (roger riggs) Date: Mon, 11 Aug 2014 13:48:28 -0400 Subject: RFR [8054841] : (process) ProcessBuilder leaks native memory In-Reply-To: <53E8FA0F.4080608@oracle.com> References: <53E8FA0F.4080608@oracle.com> Message-ID: <53E901EC.403@oracle.com> Hi Ivan, The fix looks fine. Roger On 8/11/2014 1:14 PM, Ivan Gerasimov wrote: > Hello! > > There seems to be a small native memory leak in the ProcessBuilder's > code. > > Would you please help review the trivial fix for that? > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8054841 > WEBREV: http://cr.openjdk.java.net/~igerasim/8054841/0/webrev/ > > Sincerely yours, > Ivan From jiangli.zhou at oracle.com Mon Aug 11 18:01:03 2014 From: jiangli.zhou at oracle.com (Jiangli Zhou) Date: Mon, 11 Aug 2014 11:01:03 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E82778.3020400@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> Message-ID: <53E904DF.8090503@oracle.com> Hi David, On 08/10/2014 07:16 PM, David Holmes wrote: > > src/share/vm/runtime/arguments.cpp > > 3340 // This causes problems with CDS, which requires that all > directories specified in the classpath > 3341 // must be empty. > > Should that be "must not be empty"? Or did you mean directory names? > That comments are correct. In CDS, we don't support non-empty directories. In general CDS do not support archiving classes from directories. Only classes from JAR files can be archived. That's way path checking only allow empty directories in the class paths. Thanks, Jiangli From Alan.Bateman at oracle.com Mon Aug 11 18:14:13 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 11 Aug 2014 19:14:13 +0100 Subject: RFR [8054841] : (process) ProcessBuilder leaks native memory In-Reply-To: <53E8FA0F.4080608@oracle.com> References: <53E8FA0F.4080608@oracle.com> Message-ID: <53E907F5.3000303@oracle.com> On 11/08/2014 18:14, Ivan Gerasimov wrote: > Hello! > > There seems to be a small native memory leak in the ProcessBuilder's > code. > > Would you please help review the trivial fix for that? > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8054841 > WEBREV: http://cr.openjdk.java.net/~igerasim/8054841/0/webrev/ Looks okay to me too, you might want to just re-align the 3 parameter to releaseBytes as it looks like they were neatly aligned previously. -Alan From ivan.gerasimov at oracle.com Mon Aug 11 18:39:24 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 11 Aug 2014 22:39:24 +0400 Subject: RFR [8054841] : (process) ProcessBuilder leaks native memory In-Reply-To: <53E907F5.3000303@oracle.com> References: <53E8FA0F.4080608@oracle.com> <53E907F5.3000303@oracle.com> Message-ID: <53E90DDC.6020202@oracle.com> Thanks Roger and Alan! I'll fix alignment before pushing. Sincerely yours, Ivan On 11.08.2014 22:14, Alan Bateman wrote: > On 11/08/2014 18:14, Ivan Gerasimov wrote: >> Hello! >> >> There seems to be a small native memory leak in the ProcessBuilder's >> code. >> >> Would you please help review the trivial fix for that? >> >> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8054841 >> WEBREV: http://cr.openjdk.java.net/~igerasim/8054841/0/webrev/ > Looks okay to me too, you might want to just re-align the 3 parameter > to releaseBytes as it looks like they were neatly aligned previously. > > -Alan > > From mark.sheppard at oracle.com Mon Aug 11 19:41:46 2014 From: mark.sheppard at oracle.com (Mark Sheppard) Date: Mon, 11 Aug 2014 20:41:46 +0100 Subject: RFR: JDK-8038861 [javadoc] broken links in org/omg/CORBA/FloatSeqHelper.html Message-ID: <53E91C7A.2090606@oracle.com> Hi please oblige and review the following change http://cr.openjdk.java.net/~msheppar/8038861/webrev/ which addresses the issue raised in https://bugs.openjdk.java.net/browse/JDK-8038861 HREFs in FloatSeqHelper.java java doc are incorrect, and fix changes cgi.omg.org to www.omg.org regards Mark From pavel.rappo at oracle.com Mon Aug 11 19:48:20 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Mon, 11 Aug 2014 20:48:20 +0100 Subject: RFR JDK-8054857: Fix typos in java.lang.** packages In-Reply-To: <1F65F028-5F02-4608-9221-EF10498CF8A7@oracle.com> References: <1F65F028-5F02-4608-9221-EF10498CF8A7@oracle.com> Message-ID: Hi everyone, Could you please review my change for JDK-8054857? http://cr.openjdk.java.net/~prappo/8054857/webrev.00/ It's just a bunch of misspellings and typos in comments and javadoc. Thanks -Pavel From Alan.Bateman at oracle.com Mon Aug 11 19:50:26 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 11 Aug 2014 20:50:26 +0100 Subject: RFR: JDK-8038861 [javadoc] broken links in org/omg/CORBA/FloatSeqHelper.html In-Reply-To: <53E91C7A.2090606@oracle.com> References: <53E91C7A.2090606@oracle.com> Message-ID: <53E91E82.6040501@oracle.com> On 11/08/2014 20:41, Mark Sheppard wrote: > Hi > please oblige and review the following change > http://cr.openjdk.java.net/~msheppar/8038861/webrev/ > > which addresses the issue raised in > https://bugs.openjdk.java.net/browse/JDK-8038861 > > > HREFs in FloatSeqHelper.java java doc are incorrect, and fix changes > cgi.omg.org to www.omg.org Looks okay. -Alan. From brian.burkhalter at oracle.com Mon Aug 11 19:51:39 2014 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 11 Aug 2014 12:51:39 -0700 Subject: JDK RFR of 8054720: Modifications of I/O methods for instrumentation purposes Message-ID: <10E92003-9963-4942-A261-F0B5D3976F3D@oracle.com> JDK 9 reviewers: I would like to request the review of this patch to address the indicated issue: Issue: https://bugs.openjdk.java.net/browse/JDK-8054720 Patch: http://cr.openjdk.java.net/~bpb/8054720/ This changes passes the jdk_io and jdk_net tests on all platforms. Thanks, Brian From Alan.Bateman at oracle.com Mon Aug 11 19:57:15 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 11 Aug 2014 20:57:15 +0100 Subject: RFR JDK-8054857: Fix typos in java.lang.** packages In-Reply-To: References: <1F65F028-5F02-4608-9221-EF10498CF8A7@oracle.com> Message-ID: <53E9201B.8080502@oracle.com> On 11/08/2014 20:48, Pavel Rappo wrote: > Hi everyone, > > Could you please review my change for JDK-8054857? > > http://cr.openjdk.java.net/~prappo/8054857/webrev.00/ > > It's just a bunch of misspellings and typos in comments and javadoc. > Looks good. -Alan. From mandy.chung at oracle.com Mon Aug 11 20:04:50 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 11 Aug 2014 13:04:50 -0700 Subject: RFR JDK-8054857: Fix typos in java.lang.** packages In-Reply-To: References: <1F65F028-5F02-4608-9221-EF10498CF8A7@oracle.com> Message-ID: <53E921E2.9020107@oracle.com> On 8/11/14 12:48 PM, Pavel Rappo wrote: > Hi everyone, > > Could you please review my change for JDK-8054857? > > http://cr.openjdk.java.net/~prappo/8054857/webrev.00/ > > It's just a bunch of misspellings and typos in comments and javadoc. > Thanks for fixing those. Looks okay to me. Mandy From Alan.Bateman at oracle.com Mon Aug 11 20:10:11 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 11 Aug 2014 21:10:11 +0100 Subject: JDK RFR of 8054720: Modifications of I/O methods for instrumentation purposes In-Reply-To: <10E92003-9963-4942-A261-F0B5D3976F3D@oracle.com> References: <10E92003-9963-4942-A261-F0B5D3976F3D@oracle.com> Message-ID: <53E92323.3010402@oracle.com> On 11/08/2014 20:51, Brian Burkhalter wrote: > JDK 9 reviewers: > > I would like to request the review of this patch to address the indicated issue: > > Issue: https://bugs.openjdk.java.net/browse/JDK-8054720 > Patch: http://cr.openjdk.java.net/~bpb/8054720/ > > This changes passes the jdk_io and jdk_net tests on all platforms. > This looks okay except SSLSocketImpl#isLayered (not clear why the override is needed). -Alan. From ioi.lam at oracle.com Mon Aug 11 21:15:36 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Mon, 11 Aug 2014 14:15:36 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E82778.3020400@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> Message-ID: <53E93278.4090609@oracle.com> Hi David, thanks for the feedback. I will integrate your comments. Everyone, due to upcoming deadlines, we would like to push this change into jdk9/hs-rt by this Thursday. Please send additional comments, thumbs up/down by today if possible. Thanks! - Ioi On 8/10/14, 7:16 PM, David Holmes wrote: > Hi Ioi, > > We seem to have lost core-libs-dev so I added them back. > > A couple of minor follow ups. > > On 9/08/2014 6:02 PM, Ioi Lam wrote: >> Hi, >> >> Thanks a lot to everyone for the very useful comments. I have updated >> the webrev >> >> Just the delta from the previous round of review: >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3_delta_from_v2/ > > JDK changes: > > URLClassLoader.java: > > Doesn't this Note > > + * > + * NOTE: the logic used here has been duplicated in the VM > native code > + * (search for invocation of definePackageInternal in the > HotSpot sources). > + * If this is changed, the VM code also need to be modified. > > belong on definePackageInternal, not defineClass ?? > > --- > > hotspot changes: > > hotspot/src/share/vm/classfile/classLoader.cpp > > The scoping of the ResourceMark doesn't look right: > > 592 // Iterate over class path entries > 593 for (int start = 0; start < len; start = end) { > 594 while (class_path[end] && class_path[end] != > os::path_separator()[0]) { > 595 end++; > 596 } > 597 EXCEPTION_MARK; > 598 ResourceMark rm(THREAD); > 599 char* path = NEW_RESOURCE_ARRAY(char, end-start+1); > 600 strncpy(path, &class_path[start], end-start); > 601 path[end-start] = '\0'; > 602 update_class_path_entry_list(path, false); > 603 #if INCLUDE_CDS > 604 if (DumpSharedSpaces) { > 605 check_shared_classpath(path); > 606 } > 607 #endif > 608 while (class_path[end] == os::path_separator()[0]) { > 609 end++; > 610 } > 611 } > > Doesn't the RESOURCE_ARRAY need to be freed within the ResourceMark > block? > > --- > > src/share/vm/runtime/arguments.cpp > > 3340 // This causes problems with CDS, which requires that all > directories specified in the classpath > 3341 // must be empty. > > Should that be "must not be empty"? Or did you mean directory names? > > --- > > src/share/vm/runtime/javaCalls.cpp > > + // may cause undesriable side-effect in the class metadata. > > Typo: undesriable; also side-effects > > --- > > David > ----- > > >> All the changes: >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ >> >> Thanks >> - Ioi >> >> On 7/28/14, 4:09 PM, Ioi Lam wrote: >>> Hi Folks, >>> >>> Please review the following clean up and refactoring of the CDS code, >>> for JDK9 >>> >>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >>> https://bugs.openjdk.java.net/browse/JDK-8046070 >>> >>> Summary of fix: >>> >>> Clean up and refactor the Class Data Sharing (CDS) code, including: >>> >>> + Improve archive integrity checking >>> + Support bytecode verification during archive dumping time >>> + Allow the user to configure the CDS class list and archive file. >>> + Allow future extension of the CDS class loading mechanism. >>> >>> Tests: >>> >>> JPRT >>> UTE (vm.runtime.testlist, vm.quick.testlist, >>> vm.parallel_class_loading.testlist) >>> Various adhoc SQE tests on Aurora >>> JCK >>> >>> Thanks >>> - Ioi >> From brian.burkhalter at oracle.com Mon Aug 11 21:29:33 2014 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 11 Aug 2014 14:29:33 -0700 Subject: JDK RFR of 8054720: Modifications of I/O methods for instrumentation purposes In-Reply-To: <53E92323.3010402@oracle.com> References: <10E92003-9963-4942-A261-F0B5D3976F3D@oracle.com> <53E92323.3010402@oracle.com> Message-ID: On Aug 11, 2014, at 1:10 PM, Alan Bateman wrote: > This looks okay except SSLSocketImpl#isLayered (not clear why the override is needed). This is needed as it may be required to instrument sun.security.ssl.SSLSocketImpl.closeSocket() in which the knowledge of whether the socket is layered has a bearing on the behavior. Brian From mandy.chung at oracle.com Mon Aug 11 23:01:30 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 11 Aug 2014 16:01:30 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E93278.4090609@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> <53E93278.4090609@oracle.com> Message-ID: <53E94B4A.6060405@oracle.com> On 8/11/14 2:15 PM, Ioi Lam wrote: >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ I would like to avoid adding private methods for VM to call as fewer as possible. SecureClassLoader.getProtectionDomain(URL) Can you use the existing private getProtectionDomain(CodeSource) method instead? The VM can call the public CodeSource(URL, CodeSigner[]) constructor. I doubt an additional up call from the VM to Java may cause performance degradation as much while I think it's a good tradeoff. It also allows this be extended to signed JARs if it's considered. Manifest.getManifest(byte[] buf) Is saving one additional upcall from VM to Java very critical? I prefer the VM to use public APIs to minimize such dependency in the library. Launcher.getFileURL(String) This is a convenient method for VM. If VM calls getFileURL(File), it's still a new dependency. Is there any other way doing it? URLClassLoader.defineClass 438 * NOTE: the logic used here has been duplicated in the VM native code 439 * (search for invocation of definePackageInternal in the HotSpot sources). 440 * If this is changed, the VM code also need to be modified. Is the definePackageInternal only logic duplicated in the VM? I wonder if this comment can be clear what is duplicated. Mandy From otaviojava at java.net Tue Aug 12 00:14:44 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Mon, 11 Aug 2014 21:14:44 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> Message-ID: Done. I understand about StringJoiner, but no one is applicable. Also believe that there are many ways to get the code more readable, but I believe the best strategy is doing it in baby steps. https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_4.zip On Mon, Aug 11, 2014 at 11:33 AM, Pavel Rappo wrote: > Otavio, > > Just skimmed through your changes. It looks good. But there are some > things we can make a little bit better though. IMO, it's not always a > performance that matters (looking around to see if Alexey Shipilev is > somewhere near) but readability. It's good to estimate performance > requirements of a code before making a decision of whether to sacrifice > readability for performance or not. I noticed there are some methods that > are screaming for readability improvements. Namely, different versions of > joining strings through a separator. You can find them in following methods > in your changeset: > > sun.security.acl.AclEntryImpl::toString > sun.security.ssl.HandshakeMessage.CertificateRequest::print > javax.swing.MultiUIDefaults::toString (one of the most bizarre one) > sun.security.provider.PolicyFile::expandSelf > java.security.ProtectionDomain::toString > javax.management.relation.Role::toString > sun.security.ssl.SupportedEllipticCurvesExtension::toString > sun.tools.jstat.SyntaxException::SyntaxException > > Unfortunately, neither java.util.StringJoiner nor String.join have perfect > (but who has?) APIs. So it's up to us to figure out the best way of joining > elements. So when the power of those guys is not enough, we can go this way > (or maybe some else): > > Iterable elements = ... > StringJoiner j = new StringJoiner(", "); > elements.forEach(e -> j.add(e.toString())); > > or > > Collection elements = ... > String i = elements.stream() > .map(Object::toString) > .collect(Collectors.joining(", ")); > > Other than that: > > 1. It looks like some StringBuffers are still lurking out there. We should > change them to StringBuilders, *only if* we can prove they are not exposed > to more than one thread: > > --- dev/jdk/src/share/classes/javax/sound/sampled/AudioFileFormat.java > (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) > +++ dev/jdk/src/share/classes/javax/sound/sampled/AudioFileFormat.java > (revision 10452+:8e501e6bbf1f+) > @@ -272,7 +272,7 @@ > @Override > public String toString() { > > - StringBuffer sb = new StringBuffer(); > + StringBuilder sb = new StringBuilder(); > > //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() > throws unexpected NullPointerException > if (type != null) { > > --- > dev/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java > (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) > +++ > dev/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java > (revision 10452+:8e501e6bbf1f+) > @@ -346,12 +346,12 @@ > > public String valueString(boolean bigLimit) { > // Char arrays deserve special treatment > - StringBuffer result; > + StringBuilder result; > byte[] value = getValue(); > int max = value.length; > byte elementSignature = getElementType(); > if (elementSignature == 'C') { > - result = new StringBuffer(); > + result = new StringBuilder(); > for (int i = 0; i < value.length; ) { > char val = charAt(i, value); > result.append(val); > @@ -362,7 +362,7 @@ > if (bigLimit) { > limit = 1000; > } > - result = new StringBuffer("{"); > + result = new StringBuilder("{"); > int num = 0; > for (int i = 0; i < value.length; ) { > if (num > 0) { > > --- dev/jdk/src/share/classes/javax/swing/GroupLayout.java (revision > 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) > +++ dev/jdk/src/share/classes/javax/swing/GroupLayout.java (revision > 10452+:8e501e6bbf1f+) > @@ -1213,7 +1213,7 @@ > registerComponents(horizontalGroup, HORIZONTAL); > registerComponents(verticalGroup, VERTICAL); > } > - StringBuffer buffer = new StringBuffer(); > + StringBuilder buffer = new StringBuilder(); > buffer.append("HORIZONTAL\n"); > createSpringDescription(buffer, horizontalGroup, " ", > HORIZONTAL); > buffer.append("\nVERTICAL\n"); > @@ -1221,7 +1221,7 @@ > return buffer.toString(); > } > > - private void createSpringDescription(StringBuffer buffer, Spring > spring, > + private void createSpringDescription(StringBuilder buffer, Spring > spring, > String indent, int axis) { > String origin = ""; > String padding = ""; > > --- > dev/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java > (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) > +++ > dev/jdk/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java > (revision 10452+:8e501e6bbf1f+) > @@ -463,7 +463,7 @@ > > // --------- > > - private static void appendIfLiteralAddress(String addr, StringBuffer > sb) { > + private static void appendIfLiteralAddress(String addr, StringBuilder > sb) { > if (IPAddressUtil.isIPv4LiteralAddress(addr)) { > sb.append("dns://").append(addr).append(' '); > } else { > @@ -478,10 +478,8 @@ > * corresponding to the supplied List of nameservers. > */ > private static String createProviderURL(List nsList) { > - StringBuffer sb = new StringBuffer(); > - for (String s: nsList) { > - appendIfLiteralAddress(s, sb); > - } > + StringBuilder sb = new StringBuilder(); > + nsList.forEach(s -> appendIfLiteralAddress(s, sb)); > return sb.toString(); > } > > @@ -491,7 +489,7 @@ > * contained in the provided str. > */ > private static String createProviderURL(String str) { > - StringBuffer sb = new StringBuffer(); > + StringBuilder sb = new StringBuilder(); > StringTokenizer st = new StringTokenizer(str, ","); > while (st.hasMoreTokens()) { > appendIfLiteralAddress(st.nextToken(), sb); > > > 2. Also there are some minor issues with line width and readability: > > --- dev/jdk/src/share/classes/java/security/cert/CertPath.java (revision > 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) > +++ dev/jdk/src/share/classes/java/security/cert/CertPath.java (revision > 10452+:8e501e6bbf1f+) > @@ -224,16 +224,16 @@ > Iterator stringIterator = > getCertificates().iterator(); > > - sb.append('\n').append(type).append(" Cert Path: length = > ").append(getCertificates().size()).append(".\n"); > - sb.append("[\n"); > + sb.append('\n').append(type).append(" Cert Path: length = ") > + .append(getCertificates().size()).append(".\n").append("[\n"); > int i = 1; > while (stringIterator.hasNext()) { > - sb.append("==========================================" + > "===============Certificate ") > - .append(i).append(" start.\n"); > + sb.append("==========================================") > + .append("===============Certificate ").append(i).append(" > start.\n"); > Certificate stringCert = stringIterator.next(); > - sb.append(stringCert.toString()); > - sb.append("\n========================================" + > "=================Certificate ") > - .append(i).append(" end.\n\n\n"); > + sb.append(stringCert.toString()).append('\n'); > + sb.append("========================================") > + .append("=================Certificate ").append(i).append(" > end.\n\n\n"); > i++; > } > > --- dev/jdk/src/share/classes/javax/swing/JColorChooser.java (revision > 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) > +++ dev/jdk/src/share/classes/javax/swing/JColorChooser.java (revision > 10452+:8e501e6bbf1f+) > @@ -543,7 +543,7 @@ > * @return a string representation of this JColorChooser > */ > protected String paramString() { > - StringBuilder chooserPanelsString = new StringBuilder(""); > + StringBuilder chooserPanelsString = new StringBuilder(); > for (int i=0; i > chooserPanelsString.append('[').append(chooserPanels[i].toString()).append(']'); > } > > 3. Btw, I wonder what "try ... catch" is doing here. Haven't we checked > enum_.hasMoreElements() is true? (I guess it's a question to the security > team). > > --- dev/jdk/src/share/classes/java/security/PermissionCollection.java > (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) > +++ dev/jdk/src/share/classes/java/security/PermissionCollection.java > (revision 10452+:8e501e6bbf1f+) > @@ -181,13 +181,9 @@ > StringBuilder sb = new StringBuilder(); > sb.append(super.toString()).append(" (\n"); > while (enum_.hasMoreElements()) { > - try { > - sb.append(' '); > - sb.append(enum_.nextElement().toString()); > - sb.append('\n'); > + sb.append(' '); > + sb.append(enum_.nextElement().toString()); > + sb.append('\n'); > - } catch (NoSuchElementException e){ > - // ignore > - } > } > sb.append(")\n"); > return sb.toString(); > > 4. This method looks dead (not used): > > --- > dev/jdk/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java > (revision 10452:8e501e6bbf1fda1bf9b19bc00fff02074162946f) > +++ > dev/jdk/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java > (revision 10452+:8e501e6bbf1f+) > @@ -348,15 +348,4 @@ > return javaArgs; > } > } > - > - private String appendPath(String path1, String path2) { > - if (path1 == null || path1.length() == 0) { > - return path2 == null ? "." : path2; > - } else if (path2 == null || path2.length() == 0) { > - return path1; > - } else { > - return path1 + File.pathSeparator + path2; > - } > - } > - > } > > -Pavel -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/ThreadTab.java --- a/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java Mon Aug 11 21:07:58 2014 -0300 @@ -368,7 +368,7 @@ sb.append(Messages.STACK_TRACE); int index = 0; for (StackTraceElement e : ti.getStackTrace()) { - sb.append(e.toString()+"\n"); + sb.append(e.toString()).append('\n'); if (monitors != null) { for (MonitorInfo mi : monitors) { if (mi.getLockedStackDepth() == index) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java --- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Mon Aug 11 21:07:58 2014 -0300 @@ -79,25 +79,25 @@ String textColor = String.format("%06x", foreground.getRGB() & 0xFFFFFF); StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append("
    "); for (int i = 0; i < arr.length; i++) { if (i % 2 == 0) { - sb.append(""); + sb.append(""); } else { - sb.append(""); + sb.append(""); } } if (arr.length == 0) { - sb.append(""); + sb.append(""); } sb.append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    "); arrayEditor.setText(sb.toString()); diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XTree.java --- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java Mon Aug 11 21:07:58 2014 -0300 @@ -507,13 +507,13 @@ // key order defined by the "orderedKeyPropertyList" for (String key : orderedKeyPropertyList) { if (map.containsKey(key)) { - sb.append(key + "=" + map.get(key) + ","); + sb.append(key).append('=').append(map.get(key)).append(','); map.remove(key); } } // Add the remaining key/value pairs to the buffer for (Map.Entry entry : map.entrySet()) { - sb.append(entry.getKey() + "=" + entry.getValue() + ","); + sb.append(entry.getKey()).append('=').append(entry.getValue()).append(','); } String orderedKeyPropertyListString = sb.toString(); orderedKeyPropertyListString = orderedKeyPropertyListString.substring( @@ -622,7 +622,7 @@ // StringBuilder sb = new StringBuilder(); for (MBeanParameterInfo mbpi : mboi.getSignature()) { - sb.append(mbpi.getType() + ","); + sb.append(mbpi.getType()).append(','); } String signature = sb.toString(); if (signature.length() > 0) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jps/Jps.java --- a/src/share/classes/sun/tools/jps/Jps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jps/Jps.java Mon Aug 11 21:07:58 2014 -0300 @@ -92,28 +92,28 @@ vm = monitoredHost.getMonitoredVm(id, 0); errorString = " -- main class information unavailable"; - output.append(" " + MonitoredVmUtil.mainClass(vm, + output.append(' ').append(MonitoredVmUtil.mainClass(vm, arguments.showLongPaths())); if (arguments.showMainArgs()) { errorString = " -- main args information unavailable"; String mainArgs = MonitoredVmUtil.mainArgs(vm); if (mainArgs != null && mainArgs.length() > 0) { - output.append(" " + mainArgs); + output.append(' ').append(mainArgs); } } if (arguments.showVmArgs()) { errorString = " -- jvm args information unavailable"; String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) { - output.append(" " + jvmArgs); + output.append(' ').append(jvmArgs); } } if (arguments.showVmFlags()) { errorString = " -- jvm flags information unavailable"; String jvmFlags = MonitoredVmUtil.jvmFlags(vm); if (jvmFlags != null && jvmFlags.length() > 0) { - output.append(" " + jvmFlags); + output.append(' ').append(jvmFlags); } } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/RawOutputFormatter.java --- a/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Mon Aug 11 21:07:58 2014 -0300 @@ -50,7 +50,7 @@ StringBuilder headerBuilder = new StringBuilder(); for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { Monitor m = i.next(); - headerBuilder.append(m.getName() + " "); + headerBuilder.append(m.getName()).append(' '); } header = headerBuilder.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/SyntaxException.java --- a/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/SyntaxException.java Mon Aug 11 21:07:58 2014 -0300 @@ -65,7 +65,7 @@ public SyntaxException(int lineno, Set expected, Token found) { StringBuilder msg = new StringBuilder(); - msg.append("Syntax error at line " + lineno + ": Expected one of \'"); + msg.append("Syntax error at line ").append(lineno).append(": Expected one of \'"); boolean first = true; for (Iterator i = expected.iterator(); i.hasNext(); /* empty */) { @@ -74,11 +74,11 @@ msg.append(keyWord); first = false; } else { - msg.append("|" + keyWord); + msg.append('|').append(keyWord); } } - msg.append("\', Found " + found.toMessage()); + msg.append("\', Found ").append(found.toMessage()); message = msg.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/Token.java --- a/src/share/classes/sun/tools/jstat/Token.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/Token.java Mon Aug 11 21:07:58 2014 -0300 @@ -89,18 +89,18 @@ sb.append("ttype=TT_EOF"); break; case StreamTokenizer.TT_NUMBER: - sb.append("ttype=TT_NUM,").append("nval="+nval); + sb.append("ttype=TT_NUM,").append("nval=").append(nval); break; case StreamTokenizer.TT_WORD: if (sval == null) { sb.append("ttype=TT_WORD:IDENTIFIER"); } else { - sb.append("ttype=TT_WORD:").append("sval="+sval); + sb.append("ttype=TT_WORD:").append("sval=").append(sval); } break; default: if (ttype == (int)'"') { - sb.append("ttype=TT_STRING:").append("sval="+sval); + sb.append("ttype=TT_STRING:").append("sval=").append(sval); } else { sb.append("ttype=TT_CHAR:").append((char)ttype); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstatd/RemoteHostImpl.java --- a/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Mon Aug 11 21:07:58 2014 -0300 @@ -68,7 +68,7 @@ sb.append("local://").append(lvmid).append("@localhost"); if (mode != null) { - sb.append("?mode=" + mode); + sb.append("?mode=").append(mode); } String vmidStr = sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/security/acl/AclEntryImpl.java --- a/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/acl/AclEntryImpl.java Mon Aug 11 21:07:58 2014 -0300 @@ -137,26 +137,30 @@ /** * Return a string representation of the contents of the ACL entry. */ - public String toString() { - StringBuffer s = new StringBuffer(); - if (negative) - s.append("-"); - else - s.append("+"); - if (user instanceof Group) - s.append("Group."); - else - s.append("User."); - s.append(user + "="); - Enumeration e = permissions(); - while(e.hasMoreElements()) { - Permission p = e.nextElement(); - s.append(p); - if (e.hasMoreElements()) - s.append(","); - } - return new String(s); - } + public String toString() { + StringBuffer sb = new StringBuffer(); + if (negative) { + sb.append('-'); + } else { + sb.append('+'); + } + if (user instanceof Group) { + sb.append("Group."); + } else { + sb.append("User."); + } + sb.append(user).append('='); + + Enumeration e = permissions(); + while (e.hasMoreElements()) { + Permission p = e.nextElement(); + sb.append(p); + if (e.hasMoreElements()) { + sb.append(','); + } + } + return sb.toString(); + } /** * Clones an AclEntry. diff -r dde9f5cfde5f src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java --- a/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Mon Aug 11 21:07:58 2014 -0300 @@ -640,8 +640,7 @@ for (int i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs/SigningCertificateInfo.java --- a/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Mon Aug 11 21:07:58 2014 -0300 @@ -158,8 +158,8 @@ } sb.append(hexDumper.encode(certHash)); if (issuer != null && serialNumber != null) { - sb.append("\n\tIssuer: " + issuer + "\n"); - sb.append("\t" + serialNumber); + sb.append("\n\tIssuer: ").append(issuer).append('\n'); + sb.append('\t').append(serialNumber); } sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs11/P11KeyStore.java --- a/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs11/P11KeyStore.java Mon Aug 11 21:07:58 2014 -0300 @@ -196,24 +196,24 @@ } else if (type == ATTR_CLASS_CERT) { sb.append("\ttype=[trusted cert]\n"); } - sb.append("\tlabel=[" + label + "]\n"); + sb.append("\tlabel=[").append(label).append("]\n"); if (id == null) { sb.append("\tid=[null]\n"); } else { - sb.append("\tid=" + P11KeyStore.getID(id) + "\n"); + sb.append("\tid=").append(P11KeyStore.getID(id)).append('\n'); } - sb.append("\ttrusted=[" + trusted + "]\n"); - sb.append("\tmatched=[" + matched + "]\n"); + sb.append("\ttrusted=[").append(trusted).append("]\n"); + sb.append("\tmatched=[").append(matched).append("]\n"); if (cert == null) { sb.append("\tcert=[null]\n"); } else { - sb.append("\tcert=[\tsubject: " + - cert.getSubjectX500Principal() + - "\n\t\tissuer: " + - cert.getIssuerX500Principal() + - "\n\t\tserialNum: " + - cert.getSerialNumber().toString() + - "]"); + sb.append("\tcert=[\tsubject: ") + .append(cert.getSubjectX500Principal()) + .append("\n\t\tissuer: ") + .append(cert.getIssuerX500Principal()) + .append("\n\t\tserialNum: ") + .append(cert.getSerialNumber().toString()) + .append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/PolicyFile.java --- a/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/PolicyFile.java Mon Aug 11 21:07:58 2014 -0300 @@ -1485,30 +1485,30 @@ } int startIndex = 0; int v; - StringBuilder sb = new StringBuilder(); - while ((v = sp.getSelfName().indexOf(SELF, startIndex)) != -1) { + StringBuilder sb = new StringBuilder(); + while ((v = sp.getSelfName().indexOf(SELF, startIndex)) != -1) { - // add non-SELF string - sb.append(sp.getSelfName().substring(startIndex, v)); + // add non-SELF string + sb.append(sp.getSelfName().substring(startIndex, v)); - // expand SELF - Iterator pli = entryPs.iterator(); - while (pli.hasNext()) { - PolicyParser.PrincipalEntry pppe = pli.next(); - String[][] principalInfo = getPrincipalInfo(pppe,pdp); - for (int i = 0; i < principalInfo.length; i++) { - if (i != 0) { - sb.append(", "); - } - sb.append(principalInfo[i][0] + " " + - "\"" + principalInfo[i][1] + "\""); - } - if (pli.hasNext()) { - sb.append(", "); - } - } - startIndex = v + SELF.length(); - } + // expand SELF + Iterator pli = entryPs.iterator(); + while (pli.hasNext()) { + PolicyParser.PrincipalEntry pppe = pli.next(); + String[][] principalInfo = getPrincipalInfo(pppe, pdp); + for (int i = 0; i < principalInfo.length; i++) { + if (i != 0) { + sb.append(", "); + } + sb.append(principalInfo[i][0]).append(' ').append('"') + .append(principalInfo[i][1]).append('"'); + } + if (pli.hasNext()) { + sb.append(", "); + } + } + startIndex = v + SELF.length(); + } // add remaining string (might be the entire string) sb.append(sp.getSelfName().substring(startIndex)); @@ -1774,17 +1774,17 @@ Principal[] principals = pd.getPrincipals(); String pals = ""; if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + StringBuilder palSB = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palSB.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); if (i < principals.length-1) - palBuf.append(", "); + palSB.append(", "); else - palBuf.append(")"); + palSB.append(')'); } - pals = palBuf.toString(); + pals = palSB.toString(); } return "PD CodeSource: " + pd.getCodeSource() @@ -1884,7 +1884,7 @@ throw new Exception(form.format(source)); } - sb.append(X500PRINCIPAL + " \"" + suffix + "\""); + sb.append(X500PRINCIPAL).append(" \"").append(suffix).append('"'); startIndex = e+2; } else { MessageFormat form = new MessageFormat diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/CertId.java --- a/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/CertId.java Mon Aug 11 21:07:58 2014 -0300 @@ -223,13 +223,13 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertId \n"); - sb.append("Algorithm: " + hashAlgId.toString() +"\n"); + sb.append("Algorithm: ").append(hashAlgId.toString()).append('\n'); sb.append("issuerNameHash \n"); HexDumpEncoder encoder = new HexDumpEncoder(); sb.append(encoder.encode(issuerNameHash)); sb.append("\nissuerKeyHash: \n"); sb.append(encoder.encode(issuerKeyHash)); - sb.append("\n" + certSerialNumber.toString()); + sb.append('\n').append(certSerialNumber.toString()); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/OCSPResponse.java --- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Mon Aug 11 21:07:58 2014 -0300 @@ -812,14 +812,14 @@ StringBuilder sb = new StringBuilder(); sb.append("SingleResponse: \n"); sb.append(certId); - sb.append("\nCertStatus: "+ certStatus + "\n"); + sb.append("\nCertStatus: ").append(certStatus).append('\n'); if (certStatus == CertStatus.REVOKED) { - sb.append("revocationTime is " + revocationTime + "\n"); - sb.append("revocationReason is " + revocationReason + "\n"); + sb.append("revocationTime is ").append(revocationTime).append('\n'); + sb.append("revocationReason is ").append(revocationReason).append('\n'); } - sb.append("thisUpdate is " + thisUpdate + "\n"); + sb.append("thisUpdate is ").append(thisUpdate).append('\n'); if (nextUpdate != null) { - sb.append("nextUpdate is " + nextUpdate + "\n"); + sb.append("nextUpdate is ").append(nextUpdate).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java --- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Mon Aug 11 21:07:58 2014 -0300 @@ -124,7 +124,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Build Forward Flag: " + String.valueOf(buildForward) + "\n"); + sb.append(" Build Forward Flag: ").append(String.valueOf(buildForward)).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/HandshakeMessage.java --- a/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java Mon Aug 11 21:07:58 2014 -0300 @@ -1478,7 +1478,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/ServerNameExtension.java --- a/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/ServerNameExtension.java Mon Aug 11 21:07:58 2014 -0300 @@ -267,11 +267,11 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", server_name: "); for (SNIServerName sniName : sniMap.values()) { - sb.append("[" + sniName + "]"); + sb.append('[').append(sniName).append(']'); } - - return "Extension " + type + ", server_name: " + sb; + return sb.toString(); } private static class UnknownServerName extends SNIServerName { diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java --- a/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Mon Aug 11 21:07:58 2014 -0300 @@ -119,17 +119,17 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", signature_algorithms: "); boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; } } - - return "Extension " + type + ", signature_algorithms: " + sb; + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Mon Aug 11 21:07:58 2014 -0300 @@ -112,37 +112,37 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Extension " + type + ", curve names: {"); - boolean first = true; - for (int curveId : curveIds) { - if (first) { - first = false; - } else { - sb.append(", "); - } - // first check if it is a known named curve, then try other cases. - String oid = getCurveOid(curveId); - if (oid != null) { - ECParameterSpec spec = JsseJce.getECParameterSpec(oid); - // this toString() output will look nice for the current - // implementation of the ECParameterSpec class in the Sun - // provider, but may not look good for other implementations. - if (spec != null) { - sb.append(spec.toString().split(" ")[0]); - } else { - sb.append(oid); - } - } else if (curveId == ARBITRARY_PRIME) { - sb.append("arbitrary_explicit_prime_curves"); - } else if (curveId == ARBITRARY_CHAR2) { - sb.append("arbitrary_explicit_char2_curves"); - } else { - sb.append("unknown curve " + curveId); - } - } - sb.append("}"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", curve names: {"); + boolean first = true; + for (int curveId : curveIds) { + if (first) { + first = false; + } else { + sb.append(", "); + } + // first check if it is a known named curve, then try other cases. + String oid = getCurveOid(curveId); + if (oid != null) { + ECParameterSpec spec = JsseJce.getECParameterSpec(oid); + // this toString() output will look nice for the current + // implementation of the ECParameterSpec class in the Sun + // provider, but may not look good for other implementations. + if (spec != null) { + sb.append(spec.toString().split(" ")[0]); + } else { + sb.append(oid); + } + } else if (curveId == ARBITRARY_PRIME) { + sb.append("arbitrary_explicit_prime_curves"); + } else if (curveId == ARBITRARY_CHAR2) { + sb.append("arbitrary_explicit_char2_curves"); + } else { + sb.append("unknown curve ").append(curveId); + } + } + sb.append("}"); + return sb.toString(); } // Test whether we support the curve with the given index. diff -r dde9f5cfde5f src/share/classes/sun/security/tools/jarsigner/Main.java --- a/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/jarsigner/Main.java Mon Aug 11 21:07:58 2014 -0300 @@ -676,14 +676,13 @@ ((man.getAttributes(name) != null) || (man.getAttributes("./"+name) != null) || (man.getAttributes("/"+name) != null)); - sb.append( - (isSigned ? rb.getString("s") : rb.getString("SPACE")) + - (inManifest ? rb.getString("m") : rb.getString("SPACE")) + - (inStore ? rb.getString("k") : rb.getString("SPACE")) + - (inScope ? rb.getString("i") : rb.getString("SPACE")) + - ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") + - rb.getString("SPACE")); - sb.append("|"); + sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE")) + .append(inManifest ? rb.getString("m") : rb.getString("SPACE")) + .append(inStore ? rb.getString("k") : rb.getString("SPACE")) + .append(inScope ? rb.getString("i") : rb.getString("SPACE")) + .append((inStoreOrScope & NOT_ALIAS) != 0 ? 'X' : ' ') + .append(rb.getString("SPACE")); + sb.append('|'); } // When -certs provided, display info has extra empty @@ -704,11 +703,13 @@ // Print no info for unsigned entries when -verbose:all, // to be consistent with old behavior. if (signatureRelated(name)) { - sb.append("\n" + tab + rb.getString( - ".Signature.related.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Signature.related.entries.")) + .append("\n\n"); } else { - sb.append("\n" + tab + rb.getString( - ".Unsigned.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Unsigned.entries.")) + .append("\n\n"); } } @@ -1605,8 +1606,8 @@ // No more warning, we alreay have hasExpiredCert or notYetValidCert } else { chainNotValidated = true; - sb.append(tab + rb.getString(".CertPath.not.validated.") + - e.getLocalizedMessage() + "]\n"); // TODO + sb.append(tab).append(rb.getString(".CertPath.not.validated.")) + .append(e.getLocalizedMessage()).append("]\n"); // TODO } } String result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/policytool/PolicyTool.java --- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java Mon Aug 11 21:07:58 2014 -0300 @@ -980,8 +980,9 @@ grantEntry.principals.listIterator(); while (list.hasNext()) { PolicyParser.PrincipalEntry pppe = list.next(); - sb.append(" Principal " + pppe.getDisplayClass() + " " + - pppe.getDisplayName(true)); + sb.append(" Principal ").append(pppe.getDisplayClass()) + .append(' ') + .append(pppe.getDisplayName(true)); if (list.hasNext()) sb.append(", "); } result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/AVA.java --- a/src/share/classes/sun/security/x509/AVA.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/AVA.java Mon Aug 11 21:07:58 2014 -0300 @@ -1062,7 +1062,7 @@ } else { boolean quoteNeeded = false; - StringBuilder sbuffer = new StringBuilder(); + StringBuilder sb = new StringBuilder(); boolean previousWhite = false; final String escapees = ",+=\n<>#;\\\""; @@ -1079,7 +1079,7 @@ for (int i = 0; i < length; i++) { char c = valStr.charAt(i); if (alreadyQuoted && (i == 0 || i == length - 1)) { - sbuffer.append(c); + sb.append(c); continue; } if (DerValue.isPrintableStringChar(c) || @@ -1096,7 +1096,7 @@ if (!(c == ' ' || c == '\n')) { // escape '"' and '\' if (c == '"' || c == '\\') { - sbuffer.append('\\'); + sb.append('\\'); } previousWhite = false; } else { @@ -1106,7 +1106,7 @@ previousWhite = true; } - sbuffer.append(c); + sb.append(c); } else if (debug != null && Debug.isOn("ava")) { @@ -1119,26 +1119,26 @@ byte[] valueBytes = Character.toString(c).getBytes("UTF8"); for (int j = 0; j < valueBytes.length; j++) { - sbuffer.append('\\'); + sb.append('\\'); char hexChar = Character.forDigit (0xF & (valueBytes[j] >>> 4), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); hexChar = Character.forDigit (0xF & (valueBytes[j]), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); } } else { // append non-printable/non-escaped char previousWhite = false; - sbuffer.append(c); + sb.append(c); } } // quote if trailing whitespace - if (sbuffer.length() > 0) { - char trailChar = sbuffer.charAt(sbuffer.length() - 1); + if (sb.length() > 0) { + char trailChar = sb.charAt(sb.length() - 1); if (trailChar == ' ' || trailChar == '\n') { quoteNeeded = true; } @@ -1147,9 +1147,9 @@ // Emit the string ... quote it if needed // if string is already quoted, don't re-quote if (!alreadyQuoted && quoteNeeded) { - retval.append("\"" + sbuffer.toString() + "\""); + retval.append('"').append(sb.toString()).append('"'); } else { - retval.append(sbuffer.toString()); + retval.append(sb.toString()); } } } catch (IOException e) { diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPoint.java --- a/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPoint.java Mon Aug 11 21:07:58 2014 -0300 @@ -381,22 +381,22 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPoint:\n " + fullName + "\n"); + sb.append("DistributionPoint:\n ").append(fullName).append('\n'); } if (relativeName != null) { - sb.append("DistributionPoint:\n " + relativeName + "\n"); + sb.append("DistributionPoint:\n ").append(relativeName).append('\n'); } if (reasonFlags != null) { sb.append(" ReasonFlags:\n"); for (int i = 0; i < reasonFlags.length; i++) { if (reasonFlags[i]) { - sb.append(" " + reasonToString(i) + "\n"); + sb.append(" ").append(reasonToString(i)).append('\n'); } } } if (crlIssuer != null) { - sb.append(" CRLIssuer:" + crlIssuer + "\n"); + sb.append(" CRLIssuer:").append(crlIssuer).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPointName.java --- a/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPointName.java Mon Aug 11 21:07:58 2014 -0300 @@ -231,10 +231,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPointName:\n " + fullName + "\n"); + sb.append("DistributionPointName:\n ").append(fullName).append('\n'); } else { - sb.append("DistributionPointName:\n " + relativeName + "\n"); + sb.append("DistributionPointName:\n ").append(relativeName).append('\n'); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/PolicyInformation.java --- a/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/PolicyInformation.java Mon Aug 11 21:07:58 2014 -0300 @@ -258,9 +258,9 @@ * Return a printable representation of the PolicyInformation. */ public String toString() { - StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString()); - s.append(policyQualifiers + " ]\n"); - return s.toString(); + StringBuilder sb = new StringBuilder(" [" + policyIdentifier.toString()); + sb.append(policyQualifiers).append(" ]\n"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLEntryImpl.java --- a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Mon Aug 11 21:07:58 2014 -0300 @@ -292,17 +292,17 @@ StringBuilder sb = new StringBuilder(); sb.append(serialNumber.toString()); - sb.append(" On: " + revocationDate.toString()); + sb.append(" On: ").append(revocationDate.toString()); if (certIssuer != null) { - sb.append("\n Certificate issuer: " + certIssuer); + sb.append("\n Certificate issuer: ").append(certIssuer); } if (extensions != null) { Collection allEntryExts = extensions.getAllExtensions(); Extension[] exts = allEntryExts.toArray(new Extension[0]); - sb.append("\n CRL Entry Extensions: " + exts.length); + sb.append("\n CRL Entry Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n [" + (i+1) + "]: "); + sb.append("\n [").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -313,9 +313,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLImpl.java --- a/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLImpl.java Mon Aug 11 21:07:58 2014 -0300 @@ -537,31 +537,32 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("X.509 CRL v" + (version+1) + "\n"); + sb.append("X.509 CRL v").append(version + 1).append('\n'); if (sigAlgId != null) - sb.append("Signature Algorithm: " + sigAlgId.toString() + - ", OID=" + (sigAlgId.getOID()).toString() + "\n"); + sb.append("Signature Algorithm: ").append(sigAlgId.toString()) + .append(", OID=") + .append((sigAlgId.getOID()).toString()).append('\n'); if (issuer != null) - sb.append("Issuer: " + issuer.toString() + "\n"); + sb.append("Issuer: ").append(issuer.toString()).append('\n'); if (thisUpdate != null) - sb.append("\nThis Update: " + thisUpdate.toString() + "\n"); + sb.append("\nThis Update: ").append(thisUpdate.toString()).append('\n'); if (nextUpdate != null) - sb.append("Next Update: " + nextUpdate.toString() + "\n"); + sb.append("Next Update: ").append(nextUpdate.toString()).append('\n'); if (revokedList.isEmpty()) sb.append("\nNO certificates have been revoked\n"); else { - sb.append("\nRevoked Certificates: " + revokedList.size()); + sb.append("\nRevoked Certificates: ").append(revokedList.size()); int i = 1; for (X509CRLEntry entry: revokedList) { - sb.append("\n[" + i++ + "] " + entry.toString()); + sb.append("\n[").append(i++).append("] ").append(entry.toString()); } } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Object[] objs = allExts.toArray(); - sb.append("\nCRL Extensions: " + objs.length); + sb.append("\nCRL Extensions: ").append(objs.length); for (int i = 0; i < objs.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = (Extension)objs[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -572,9 +573,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); // sub-class exists @@ -585,8 +585,7 @@ } if (signature != null) { HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) - + "\n"); + sb.append("\nSignature:\n").append(encoder.encodeBuffer(signature)).append('\n'); } else sb.append("NOT signed yet\n"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertImpl.java --- a/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertImpl.java Mon Aug 11 21:07:58 2014 -0300 @@ -802,11 +802,11 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(info.toString() + "\n"); - sb.append(" Algorithm: [" + algId.toString() + "]\n"); + sb.append(info.toString()).append('\n'); + sb.append(" Algorithm: [").append(algId.toString()).append("]\n"); HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); + sb.append(" Signature:\n").append(encoder.encodeBuffer(signature)); sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertInfo.java --- a/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertInfo.java Mon Aug 11 21:07:58 2014 -0300 @@ -298,27 +298,27 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(" " + version.toString() + "\n"); - sb.append(" Subject: " + subject.toString() + "\n"); - sb.append(" Signature Algorithm: " + algId.toString() + "\n"); - sb.append(" Key: " + pubKey.toString() + "\n"); - sb.append(" " + interval.toString() + "\n"); - sb.append(" Issuer: " + issuer.toString() + "\n"); - sb.append(" " + serialNum.toString() + "\n"); + sb.append(" ").append(version.toString()).append('\n'); + sb.append(" Subject: ").append(subject.toString()).append('\n'); + sb.append(" Signature Algorithm: ").append(algId.toString()).append('\n'); + sb.append(" Key: ").append(pubKey.toString()).append('\n'); + sb.append(" ").append(interval.toString()).append('\n'); + sb.append(" Issuer: ").append(issuer.toString()).append('\n'); + sb.append(" ").append(serialNum.toString()).append('\n'); // optional v2, v3 extras if (issuerUniqueId != null) { - sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n"); + sb.append(" Issuer Id:\n").append(issuerUniqueId.toString()).append('\n'); } if (subjectUniqueId != null) { - sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n"); + sb.append(" Subject Id:\n").append(subjectUniqueId.toString()).append('\n'); } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Extension[] exts = allExts.toArray(new Extension[0]); - sb.append("\nCertificate Extensions: " + exts.length); + sb.append("\nCertificate Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -329,9 +329,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists @@ -341,10 +340,10 @@ } Map invalid = extensions.getUnparseableExtensions(); if (invalid.isEmpty() == false) { - sb.append("\nUnparseable certificate extensions: " + invalid.size()); + sb.append("\nUnparseable certificate extensions: ").append(invalid.size()); int i = 1; for (Extension ext : invalid.values()) { - sb.append("\n[" + (i++) + "]: "); + sb.append("\n[").append(i++).append("]: "); sb.append(ext); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java --- a/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Mon Aug 11 21:07:58 2014 -0300 @@ -463,12 +463,12 @@ // --------- - private static void appendIfLiteralAddress(String addr, StringBuffer sb) { + private static void appendIfLiteralAddress(String addr, StringBuilder sb) { if (IPAddressUtil.isIPv4LiteralAddress(addr)) { - sb.append("dns://" + addr + " "); + sb.append("dns://").append(addr).append(' '); } else { if (IPAddressUtil.isIPv6LiteralAddress(addr)) { - sb.append("dns://[" + addr + "] "); + sb.append("dns://[").append(addr).append("] "); } } } @@ -478,7 +478,7 @@ * corresponding to the supplied List of nameservers. */ private static String createProviderURL(List nsList) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (String s: nsList) { appendIfLiteralAddress(s, sb); } @@ -491,7 +491,7 @@ * contained in the provided str. */ private static String createProviderURL(String str) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); StringTokenizer st = new StringTokenizer(str, ","); while (st.hasMoreTokens()) { appendIfLiteralAddress(st.nextToken(), sb); diff -r dde9f5cfde5f src/share/classes/sun/net/www/HeaderParser.java --- a/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/HeaderParser.java Mon Aug 11 21:07:58 2014 -0300 @@ -220,21 +220,23 @@ public String toString () { Iterator k = keys(); - StringBuffer sbuf = new StringBuffer(); - sbuf.append ("{size="+asize+" nkeys="+nkeys+" "); + StringBuilder sb = new StringBuilder(); + sb.append("{size=").append(asize).append(" nkeys=").append(nkeys) + .append(' '); for (int i=0; k.hasNext(); i++) { String key = k.next(); String val = findValue (i); if (val != null && "".equals (val)) { val = null; } - sbuf.append (" {"+key+(val==null?"":","+val)+"}"); + sb.append(" {").append(key).append(val == null ? "" : "," + val) + .append('}'); if (k.hasNext()) { - sbuf.append (","); + sb.append (','); } } - sbuf.append (" }"); - return new String (sbuf); + sb.append (" }"); + return new String (sb); } public int findInt(String k, int Default) { diff -r dde9f5cfde5f src/share/classes/sun/net/www/MimeEntry.java --- a/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/MimeEntry.java Mon Aug 11 21:07:58 2014 -0300 @@ -288,7 +288,7 @@ int action = getAction(); if (action != MimeEntry.UNKNOWN) { - sb.append("action=" + actionKeywords[action]); + sb.append("action=").append(actionKeywords[action]); needSeparator = true; } @@ -297,7 +297,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("application=" + command); + sb.append("application=").append(command); needSeparator = true; } @@ -305,7 +305,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("icon=" + getImageFileName()); + sb.append("icon=").append(getImageFileName()); needSeparator = true; } @@ -314,7 +314,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("file_extensions=" + extensions); + sb.append("file_extensions=").append(extensions); needSeparator = true; } @@ -323,7 +323,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("description=" + description); + sb.append("description=").append(description); } return sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/management/Agent.java --- a/src/share/classes/sun/management/Agent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/Agent.java Mon Aug 11 21:07:58 2014 -0300 @@ -502,7 +502,7 @@ } else { StringBuilder message = new StringBuilder(params[0]); for (int i = 1; i < params.length; i++) { - message.append(" " + params[i]); + message.append(' ').append(params[i]); } error(key, message.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/management/MappedMXBeanType.java --- a/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/MappedMXBeanType.java Mon Aug 11 21:07:58 2014 -0300 @@ -289,7 +289,7 @@ if (et.isPrimitive()) { className = new StringBuilder(c.getName()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); @@ -385,7 +385,7 @@ if (elementType instanceof Class && ((Class) elementType).isPrimitive()) { className = new StringBuilder(gat.toString()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/launcher/LauncherHelper.java --- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Mon Aug 11 21:07:58 2014 -0300 @@ -369,10 +369,9 @@ static void appendVmErgoMessage(boolean isServerClass, String vm) { outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1", vm)); - outBuf = (isServerClass) - ? outBuf.append(",\n" + - getLocalizedMessage("java.launcher.ergo.message2") + "\n\n") - : outBuf.append(".\n\n"); + outBuf = (isServerClass) ? outBuf.append(",\n") + .append(getLocalizedMessage("java.launcher.ergo.message2")) + .append("\n\n") : outBuf.append(".\n\n"); } /** -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/font/AttributeValues.java --- a/src/share/classes/sun/font/AttributeValues.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/AttributeValues.java Mon Aug 11 21:07:57 2014 -0300 @@ -542,7 +542,7 @@ } } } - b.append("[btx=" + baselineTransform + ", ctx=" + charTransform + "]"); + b.append("[btx=").append(baselineTransform).append(", ctx=").append(charTransform).append(']'); b.append('}'); return b.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/Decoration.java --- a/src/share/classes/sun/font/Decoration.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/Decoration.java Mon Aug 11 21:07:57 2014 -0300 @@ -431,12 +431,12 @@ StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); - if (fgPaint != null) sb.append("fgPaint: " + fgPaint); - if (bgPaint != null) sb.append(" bgPaint: " + bgPaint); + if (fgPaint != null) sb.append("fgPaint: ").append(fgPaint); + if (bgPaint != null) sb.append(" bgPaint: ").append(bgPaint); if (swapColors) sb.append(" swapColors: true"); if (strikethrough) sb.append(" strikethrough: true"); - if (stdUnderline != null) sb.append(" stdUnderline: " + stdUnderline); - if (imUnderline != null) sb.append(" imUnderline: " + imUnderline); + if (stdUnderline != null) sb.append(" stdUnderline: ").append(stdUnderline); + if (imUnderline != null) sb.append(" imUnderline: ").append(imUnderline); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/StandardGlyphVector.java --- a/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/StandardGlyphVector.java Mon Aug 11 21:07:57 2014 -0300 @@ -1894,9 +1894,9 @@ } } catch(Exception e) { - buf.append(" " + e.getMessage()); + buf.append(' ').append(e.getMessage()); } - buf.append("}"); + buf.append('}'); return buf; } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/swing/GroupLayout.java --- a/src/share/classes/javax/swing/GroupLayout.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/GroupLayout.java Mon Aug 11 21:07:57 2014 -0300 @@ -1213,15 +1213,15 @@ registerComponents(horizontalGroup, HORIZONTAL); registerComponents(verticalGroup, VERTICAL); } - StringBuffer buffer = new StringBuffer(); - buffer.append("HORIZONTAL\n"); - createSpringDescription(buffer, horizontalGroup, " ", HORIZONTAL); - buffer.append("\nVERTICAL\n"); - createSpringDescription(buffer, verticalGroup, " ", VERTICAL); - return buffer.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("HORIZONTAL\n"); + createSpringDescription(sb, horizontalGroup, " ", HORIZONTAL); + sb.append("\nVERTICAL\n"); + createSpringDescription(sb, verticalGroup, " ", VERTICAL); + return sb.toString(); } - private void createSpringDescription(StringBuffer buffer, Spring spring, + private void createSpringDescription(StringBuilder sb, Spring spring, String indent, int axis) { String origin = ""; String padding = ""; @@ -1239,20 +1239,19 @@ padding = ", userCreated=" + paddingSpring.getUserCreated() + ", matches=" + paddingSpring.getMatchDescription(); } - buffer.append(indent + spring.getClass().getName() + " " + - Integer.toHexString(spring.hashCode()) + " " + - origin + - ", size=" + spring.getSize() + - ", alignment=" + spring.getAlignment() + - " prefs=[" + spring.getMinimumSize(axis) + - " " + spring.getPreferredSize(axis) + - " " + spring.getMaximumSize(axis) + - padding + "]\n"); + sb.append(indent).append(spring.getClass().getName()).append(' ') + .append(Integer.toHexString(spring.hashCode())).append(' ') + .append(origin).append(", size=").append(spring.getSize()) + .append(", alignment=").append(spring.getAlignment()) + .append(" prefs=[").append(spring.getMinimumSize(axis)) + .append(' ').append(spring.getPreferredSize(axis)).append(' ') + .append(spring.getMaximumSize(axis)).append(padding) + .append("]\n"); if (spring instanceof Group) { List springs = ((Group)spring).springs; indent += " "; for (int counter = 0; counter < springs.size(); counter++) { - createSpringDescription(buffer, springs.get(counter), indent, + createSpringDescription(sb, springs.get(counter), indent, axis); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/JColorChooser.java --- a/src/share/classes/javax/swing/JColorChooser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/JColorChooser.java Mon Aug 11 21:07:57 2014 -0300 @@ -542,19 +542,19 @@ * * @return a string representation of this JColorChooser */ - protected String paramString() { - StringBuilder chooserPanelsString = new StringBuilder(""); - for (int i=0; i keys = keys(); - while (keys.hasMoreElements()) { - Object key = keys.nextElement(); - sb.append(key + "=" + get(key) + ", "); - } - int length = sb.length(); - if (length > 1) { - sb.delete(length-2, length); - } - sb.append("}"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("{"); + Enumeration keys = keys(); + while (keys.hasMoreElements()) { + Object key = keys.nextElement(); + sb.append(key).append('=').append(get(key)).append(", "); + } + int length = sb.length(); + if (length > 1) { + sb.delete(length - 2, length); + } + sb.append('}'); + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/RepaintManager.java --- a/src/share/classes/javax/swing/RepaintManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/RepaintManager.java Mon Aug 11 21:07:57 2014 -0300 @@ -990,10 +990,7 @@ * @return a String representation of this object */ public synchronized String toString() { - StringBuilder sb = new StringBuilder(); - if(dirtyComponents != null) - sb.append("" + dirtyComponents); - return sb.toString(); + return dirtyComponents != null ? dirtyComponents.toString() : ""; } diff -r dde9f5cfde5f src/share/classes/javax/swing/event/TreeModelEvent.java --- a/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/event/TreeModelEvent.java Mon Aug 11 21:07:57 2014 -0300 @@ -294,21 +294,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(getClass().getName() + " " + - Integer.toString(hashCode())); + sb.append(getClass().getName()).append(' ').append(Integer.toString(hashCode())); if(path != null) - sb.append(" path " + path); + sb.append(" path ").append(path); if(childIndices != null) { sb.append(" indices [ "); for(int counter = 0; counter < childIndices.length; counter++) - sb.append(Integer.toString(childIndices[counter])+ " "); - sb.append("]"); + sb.append(Integer.toString(childIndices[counter])).append(' '); + sb.append(']'); } if(children != null) { sb.append(" children [ "); for(int counter = 0; counter < children.length; counter++) - sb.append(children[counter] + " "); - sb.append("]"); + sb.append(children[counter]).append(' '); + sb.append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Mon Aug 11 21:07:57 2014 -0300 @@ -1330,8 +1330,8 @@ for (Object obj : values) { String val = ((obj == null) ? "" : obj.toString()); - plainBuf.append(val + "\n"); - htmlBuf.append("
  • " + val + "\n"); + plainBuf.append(val).append('\n'); + htmlBuf.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicListUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Mon Aug 11 21:07:57 2014 -0300 @@ -2948,8 +2948,8 @@ for (int i = 0; i < values.length; i++) { Object obj = values[i]; String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\n"); - htmlStr.append("
  • " + val + "\n"); + plainStr.append(val).append('\n'); + htmlStr.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTableUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Mon Aug 11 21:07:57 2014 -0300 @@ -2230,11 +2230,11 @@ for (int col = 0; col < cols.length; col++) { Object obj = table.getValueAt(rows[row], cols[col]); String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\t"); - htmlStr.append(" " + val + "\n"); + plainStr.append(val).append('\t'); + htmlStr.append(" ").append(val).append("\n"); } // we want a newline at the end of each line and not a tab - plainStr.deleteCharAt(plainStr.length() - 1).append("\n"); + plainStr.deleteCharAt(plainStr.length() - 1).append('\t'); htmlStr.append("\n"); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Mon Aug 11 21:07:57 2014 -0300 @@ -3618,8 +3618,8 @@ boolean leaf = model.isLeaf(node); String label = getDisplayString(path, true, leaf); - plainStr.append(label + "\n"); - htmlStr.append("
  • " + label + "\n"); + plainStr.append(label).append('\n'); + htmlStr.append("
  • ").append(label).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java --- a/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Mon Aug 11 21:07:57 2014 -0300 @@ -1160,15 +1160,15 @@ rows = rowMapper.getRowsForPaths(selection); else rows = null; - sb.append(getClass().getName() + " " + hashCode() + " [ "); + sb.append(getClass().getName()).append(' ').append(hashCode()).append(" [ "); for(int counter = 0; counter < selCount; counter++) { if(rows != null) - sb.append(selection[counter].toString() + "@" + - Integer.toString(rows[counter])+ " "); + sb.append(selection[counter].toString()).append('@') + .append(Integer.toString(rows[counter])).append(' '); else - sb.append(selection[counter].toString() + " "); + sb.append(selection[counter].toString()).append(' '); } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/AudioFileFormat.java --- a/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/AudioFileFormat.java Mon Aug 11 21:07:57 2014 -0300 @@ -272,26 +272,25 @@ @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder sb = new StringBuilder(); //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() throws unexpected NullPointerException if (type != null) { - buf.append(type.toString() + " (." + type.getExtension() + ") file"); + sb.append(type.toString()).append(" (.").append(type.getExtension()).append(") file"); } else { - buf.append("unknown file format"); + sb.append("unknown file format"); } if (byteLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", byte length: " + byteLength); + sb.append(", byte length: ").append(byteLength); } - buf.append(", data format: " + format); + sb.append(", data format: ").append(format); if (frameLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", frame length: " + frameLength); + sb.append(", frame length: ").append(frameLength); } - - return new String(buf); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/DataLine.java --- a/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/DataLine.java Mon Aug 11 21:07:57 2014 -0300 @@ -473,17 +473,21 @@ StringBuilder sb = new StringBuilder(); if ( (formats.length == 1) && (formats[0] != null) ) { - sb.append(" supporting format " + formats[0]); + sb.append(" supporting format ").append(formats[0]); } else if (getFormats().length > 1) { - sb.append(" supporting " + getFormats().length + " audio formats"); + sb.append(" supporting ").append(getFormats().length) + .append(" audio formats"); } if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) { - sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes"); + sb.append(", and buffers of ").append(minBufferSize) + .append(" to ").append(maxBufferSize).append(" bytes"); } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) { - sb.append(", and buffers of at least " + minBufferSize + " bytes"); + sb.append(", and buffers of at least ").append(minBufferSize) + .append(" bytes"); } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) { - sb.append(", and buffers of up to " + minBufferSize + " bytes"); + sb.append(", and buffers of up to ").append(minBufferSize) + .append(" bytes"); } return new String(super.toString() + sb); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/security/auth/kerberos/KerberosTicket.java --- a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Mon Aug 11 21:07:57 2014 -0300 @@ -651,8 +651,7 @@ StringBuilder caddrString = new StringBuilder(); if (clientAddresses != null) { for (int i = 0; i < clientAddresses.length; i++) { - caddrString.append("clientAddresses[" + i + "] = " + - clientAddresses[i].toString()); + caddrString.append("clientAddresses[").append(i).append("] = ").append(clientAddresses[i].toString()); } } return ("Ticket (hex) = " + "\n" + -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/naming/BinaryRefAddr.java --- a/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/BinaryRefAddr.java Mon Aug 11 21:07:57 2014 -0300 @@ -165,11 +165,11 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Address Type: " + addrType + "\n"); - + StringBuilder str = new StringBuilder(); + str.append("Address Type: ").append(addrType).append('\n'); str.append("AddressContents: "); for (int i = 0; i= 32) str.append(" ...\n"); diff -r dde9f5cfde5f src/share/classes/javax/naming/NameImpl.java --- a/src/share/classes/javax/naming/NameImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/NameImpl.java Mon Aug 11 21:07:57 2014 -0300 @@ -170,7 +170,7 @@ endQuote = one ? syntaxEndQuote1 : syntaxEndQuote2; i += syntaxTypevalSeparator.length(); - answer.append(syntaxTypevalSeparator+beginQuote); // add back + answer.append(syntaxTypevalSeparator).append(beginQuote); // add back // consume string until matching quote for (i += beginQuote.length(); diff -r dde9f5cfde5f src/share/classes/javax/naming/RefAddr.java --- a/src/share/classes/javax/naming/RefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/RefAddr.java Mon Aug 11 21:07:57 2014 -0300 @@ -139,9 +139,9 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Type: " + addrType + "\n"); - - str.append("Content: " + getContent() + "\n"); + StringBuilder str = new StringBuilder(); + str.append("Type: ").append(addrType).append('\n'); + str.append("Content: ").append(getContent()).append('\n'); return (str.toString()); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/crypto/CryptoPermission.java --- a/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/crypto/CryptoPermission.java Mon Aug 11 21:07:56 2014 -0300 @@ -369,22 +369,24 @@ * @return information about this CryptoPermission. */ public String toString() { - StringBuilder buf = new StringBuilder(100); - buf.append("(CryptoPermission " + alg + " " + maxKeySize); + StringBuilder sb = new StringBuilder(100); + sb.append("(CryptoPermission ").append(alg).append(' ') + .append(maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { - buf.append(" , effective " + - ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits()); + sb.append(" , effective ") + .append(((RC2ParameterSpec) algParamSpec) + .getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { - buf.append(" , rounds " + - ((RC5ParameterSpec)algParamSpec).getRounds()); + sb.append(" , rounds ").append( + ((RC5ParameterSpec) algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL - buf.append(" " + exemptionMechanism); + sb.append(' ').append(exemptionMechanism); } - buf.append(")"); - return buf.toString(); + sb.append(')'); + return sb.toString(); } private boolean impliesExemptionMechanism(String exemptionMechanism) { -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/management/MBeanPermission.java --- a/src/share/classes/javax/management/MBeanPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/MBeanPermission.java Mon Aug 11 21:07:57 2014 -0300 @@ -455,11 +455,11 @@ name.append(className); if (member == null) member = "-"; - name.append("#" + member); + name.append('#').append(member); if (objectName == null) name.append("[-]"); else - name.append("[").append(objectName.getCanonicalName()).append("]"); + name.append('[').append(objectName.getCanonicalName()).append(']'); /* In the interests of legibility for Permission.toString(), we transform the empty string into "*". */ diff -r dde9f5cfde5f src/share/classes/javax/management/modelmbean/RequiredModelMBean.java --- a/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Mon Aug 11 21:07:57 2014 -0300 @@ -716,15 +716,14 @@ } retStr.append("\nMBeanInfo for ModelMBean is:"); - retStr.append("\nCLASSNAME: \t"+ info.getClassName()); - retStr.append("\nDESCRIPTION: \t"+ info.getDescription()); + retStr.append("\nCLASSNAME: \t").append(info.getClassName()); + retStr.append("\nDESCRIPTION: \t").append(info.getDescription()); try { - retStr.append("\nMBEAN DESCRIPTOR: \t"+ - info.getMBeanDescriptor()); + retStr.append("\nMBEAN DESCRIPTOR: \t").append(info.getMBeanDescriptor()); } catch (Exception e) { - retStr.append("\nMBEAN DESCRIPTOR: \t" + " is invalid"); + retStr.append("\nMBEAN DESCRIPTOR: \t is invalid"); } retStr.append("\nATTRIBUTES"); @@ -734,13 +733,12 @@ for (int i=0; i objNameIter = objectNameList.iterator(); - objNameIter.hasNext();) { - ObjectName currObjName = objNameIter.next(); - result.append(currObjName.toString()); - if (objNameIter.hasNext()) { - result.append(", "); - } - } - return result.toString(); - } + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("role name: ").append(name).append("; role value: "); + for (Iterator objNameIter = objectNameList.iterator(); objNameIter + .hasNext();) { + ObjectName currObjName = objNameIter.next(); + sb.append(currObjName.toString()); + if (objNameIter.hasNext()) { + sb.append(", "); + } + } + return sb.toString(); + } // // Misc diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleInfo.java --- a/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleInfo.java Mon Aug 11 21:07:57 2014 -0300 @@ -456,13 +456,13 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role info name: " + name); - result.append("; isReadable: " + isReadable); - result.append("; isWritable: " + isWritable); - result.append("; description: " + description); - result.append("; minimum degree: " + minDegree); - result.append("; maximum degree: " + maxDegree); - result.append("; MBean class: " + referencedMBeanClassName); + result.append("role info name: ").append(name); + result.append("; isReadable: ").append(isReadable); + result.append("; isWritable: ").append(isWritable); + result.append("; description: ").append(description); + result.append("; minimum degree: ").append(minDegree); + result.append("; maximum degree: ").append(maxDegree); + result.append("; MBean class: ").append(referencedMBeanClassName); return result.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleUnresolved.java --- a/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleUnresolved.java Mon Aug 11 21:07:57 2014 -0300 @@ -282,7 +282,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + roleName); + result.append("role name: ").append(roleName); if (roleValue != null) { result.append("; value: "); for (Iterator objNameIter = roleValue.iterator(); @@ -294,7 +294,7 @@ } } } - result.append("; problem type: " + problemType); + result.append("; problem type: ").append(problemType); return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/util/Scanner.java --- a/src/share/classes/java/util/Scanner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/Scanner.java Mon Aug 11 21:07:56 2014 -0300 @@ -1304,20 +1304,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.Scanner"); - sb.append("[delimiters=" + delimPattern + "]"); - sb.append("[position=" + position + "]"); - sb.append("[match valid=" + matchValid + "]"); - sb.append("[need input=" + needInput + "]"); - sb.append("[source closed=" + sourceClosed + "]"); - sb.append("[skipped=" + skipped + "]"); - sb.append("[group separator=" + groupSeparator + "]"); - sb.append("[decimal separator=" + decimalSeparator + "]"); - sb.append("[positive prefix=" + positivePrefix + "]"); - sb.append("[negative prefix=" + negativePrefix + "]"); - sb.append("[positive suffix=" + positiveSuffix + "]"); - sb.append("[negative suffix=" + negativeSuffix + "]"); - sb.append("[NaN string=" + nanString + "]"); - sb.append("[infinity string=" + infinityString + "]"); + sb.append("[delimiters=").append(delimPattern).append(']'); + sb.append("[position=").append(position).append(']'); + sb.append("[match valid=").append(matchValid).append(']'); + sb.append("[need input=").append(needInput).append(']'); + sb.append("[source closed=").append(sourceClosed).append(']'); + sb.append("[skipped=").append(skipped).append(']'); + sb.append("[group separator=").append(groupSeparator).append(']'); + sb.append("[decimal separator=").append(decimalSeparator).append(']'); + sb.append("[positive prefix=").append(positivePrefix).append(']'); + sb.append("[negative prefix=").append(negativePrefix).append(']'); + sb.append("[positive suffix=").append(positiveSuffix).append(']'); + sb.append("[negative suffix=").append(negativeSuffix).append(']'); + sb.append("[NaN string=").append(nanString).append(']'); + sb.append("[infinity string=").append(infinityString).append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Matcher.java --- a/src/share/classes/java/util/regex/Matcher.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Matcher.java Mon Aug 11 21:07:56 2014 -0300 @@ -1295,14 +1295,14 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.regex.Matcher"); - sb.append("[pattern=" + pattern()); + sb.append("[pattern=").append(pattern()); sb.append(" region="); - sb.append(regionStart() + "," + regionEnd()); + sb.append(regionStart()).append(',').append(regionEnd()); sb.append(" lastmatch="); if ((first >= 0) && (group() != null)) { sb.append(group()); } - sb.append("]"); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Pattern.java --- a/src/share/classes/java/util/regex/Pattern.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Pattern.java Mon Aug 11 21:07:56 2014 -0300 @@ -1488,10 +1488,10 @@ for(int x=0; x0) - result.append("|"+next); + result.append('|').append(next); next = composeOneStep(next); if (next != null) - result.append("|"+produceEquivalentAlternation(next)); + result.append('|').append(produceEquivalentAlternation(next)); } return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/text/ChoiceFormat.java --- a/src/share/classes/java/text/ChoiceFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/text/ChoiceFormat.java Mon Aug 11 21:07:56 2014 -0300 @@ -272,7 +272,7 @@ double tryLess = Math.abs(Math.IEEEremainder(less, 1.0d)); if (tryLessOrEqual < tryLess) { - result.append(""+choiceLimits[i]); + result.append(choiceLimits[i]); result.append('#'); } else { if (choiceLimits[i] == Double.POSITIVE_INFINITY) { @@ -280,7 +280,7 @@ } else if (choiceLimits[i] == Double.NEGATIVE_INFINITY) { result.append("-\u221E"); } else { - result.append(""+less); + result.append(less); } result.append('<'); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/security/CodeSigner.java --- a/src/share/classes/java/security/CodeSigner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSigner.java Mon Aug 11 21:07:56 2014 -0300 @@ -156,9 +156,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("Signer: " + signerCertPath.getCertificates().get(0)); + sb.append("Signer: ").append(signerCertPath.getCertificates().get(0)); if (timestamp != null) { - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); } sb.append(")"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/java/security/CodeSource.java --- a/src/share/classes/java/security/CodeSource.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSource.java Mon Aug 11 21:07:56 2014 -0300 @@ -468,12 +468,12 @@ if (this.certs != null && this.certs.length > 0) { for (int i = 0; i < this.certs.length; i++) { - sb.append( " " + this.certs[i]); + sb.append(' ').append(this.certs[i]); } } else if (this.signers != null && this.signers.length > 0) { for (int i = 0; i < this.signers.length; i++) { - sb.append( " " + this.signers[i]); + sb.append(' ').append(this.signers[i]); } } else { sb.append(" "); diff -r dde9f5cfde5f src/share/classes/java/security/KeyStore.java --- a/src/share/classes/java/security/KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/KeyStore.java Mon Aug 11 21:07:56 2014 -0300 @@ -610,8 +610,8 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Private key entry and certificate chain with " - + chain.length + " elements:\r\n"); + sb.append("Private key entry and certificate chain with ") + .append(chain.length).append(" elements:\r\n"); for (Certificate cert : chain) { sb.append(cert); sb.append("\r\n"); diff -r dde9f5cfde5f src/share/classes/java/security/PermissionCollection.java --- a/src/share/classes/java/security/PermissionCollection.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/PermissionCollection.java Mon Aug 11 21:07:56 2014 -0300 @@ -176,20 +176,20 @@ * as described above. * */ - public String toString() { - Enumeration enum_ = elements(); - StringBuilder sb = new StringBuilder(); - sb.append(super.toString()+" (\n"); - while (enum_.hasMoreElements()) { - try { - sb.append(" "); - sb.append(enum_.nextElement().toString()); - sb.append("\n"); - } catch (NoSuchElementException e){ - // ignore - } - } - sb.append(")\n"); - return sb.toString(); - } + public String toString() { + Enumeration enum_ = elements(); + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()).append(" (\n"); + while (enum_.hasMoreElements()) { + try { + sb.append(' '); + sb.append(enum_.nextElement().toString()); + sb.append('\n'); + } catch (NoSuchElementException e) { + // ignore + } + } + sb.append(")\n"); + return sb.toString(); + } } diff -r dde9f5cfde5f src/share/classes/java/security/ProtectionDomain.java --- a/src/share/classes/java/security/ProtectionDomain.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/ProtectionDomain.java Mon Aug 11 21:07:56 2014 -0300 @@ -285,34 +285,32 @@ /** * Convert a ProtectionDomain to a String. */ - @Override public String toString() { - String pals = ""; - if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + @Override + public String toString() { + String pals = ""; + if (principals != null && principals.length > 0) { + StringBuilder palBuilder = new StringBuilder("(principals "); - for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); - if (i < principals.length-1) - palBuf.append(",\n"); - else - palBuf.append(")\n"); - } - pals = palBuf.toString(); - } + for (int i = 0; i < principals.length; i++) { + palBuilder.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); + if (i < principals.length - 1) { + palBuilder.append(",\n"); + } else { + palBuilder.append(")\n"); + } + } + pals = palBuilder.toString(); + } - // Check if policy is set; we don't want to load - // the policy prematurely here - PermissionCollection pc = Policy.isSet() && seeAllp() ? - mergePermissions(): - getPermissions(); + // Check if policy is set; we don't want to load + // the policy prematurely here + PermissionCollection pc = Policy.isSet() && seeAllp() ? mergePermissions() + : getPermissions(); - return "ProtectionDomain "+ - " "+codesource+"\n"+ - " "+classloader+"\n"+ - " "+pals+"\n"+ - " "+pc+"\n"; + return "ProtectionDomain " + " " + codesource + "\n" + " " + + classloader + "\n" + " " + pals + "\n" + " " + pc + "\n"; } /** diff -r dde9f5cfde5f src/share/classes/java/security/Timestamp.java --- a/src/share/classes/java/security/Timestamp.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/Timestamp.java Mon Aug 11 21:07:56 2014 -0300 @@ -143,10 +143,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); List certs = signerCertPath.getCertificates(); if (!certs.isEmpty()) { - sb.append("TSA: " + certs.get(0)); + sb.append("TSA: ").append(certs.get(0)); } else { sb.append("TSA: "); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CertPath.java --- a/src/share/classes/java/security/cert/CertPath.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CertPath.java Mon Aug 11 21:07:56 2014 -0300 @@ -219,28 +219,24 @@ * * @return a string representation of this certification path */ - public String toString() { - StringBuilder sb = new StringBuilder(); - Iterator stringIterator = - getCertificates().iterator(); + public String toString() { + StringBuilder sb = new StringBuilder(); - sb.append("\n" + type + " Cert Path: length = " - + getCertificates().size() + ".\n"); - sb.append("[\n"); - int i = 1; - while (stringIterator.hasNext()) { - sb.append("==========================================" - + "===============Certificate " + i + " start.\n"); - Certificate stringCert = stringIterator.next(); - sb.append(stringCert.toString()); - sb.append("\n========================================" - + "=================Certificate " + i + " end.\n\n\n"); - i++; - } + sb.append('\n').append(type).append(" Cert Path: length = ") + .append(getCertificates().size()).append(".\n").append("[\n"); + int i = 1; + for (Certificate stringCert : getCertificates()) { + sb.append("==========================================" + + "===============Certificate ").append(i).append(" start.\n"); + sb.append(stringCert.toString()); + sb.append("\n========================================" + + "=================Certificate ").append(i).append(" end.\n\n\n"); + i++; + } - sb.append("\n]"); - return sb.toString(); - } + sb.append("\n]"); + return sb.toString(); + } /** * Returns the encoded form of this certification path, using the default diff -r dde9f5cfde5f src/share/classes/java/security/cert/CollectionCertStoreParameters.java --- a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Mon Aug 11 21:07:56 2014 -0300 @@ -134,8 +134,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CollectionCertStoreParameters: [\n"); - sb.append(" collection: " + coll + "\n"); - sb.append("]"); + sb.append(" collection: ").append(coll).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/LDAPCertStoreParameters.java --- a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Mon Aug 11 21:07:56 2014 -0300 @@ -141,9 +141,9 @@ StringBuilder sb = new StringBuilder(); sb.append("LDAPCertStoreParameters: [\n"); - sb.append(" serverName: " + serverName + "\n"); - sb.append(" port: " + port + "\n"); - sb.append("]"); + sb.append(" serverName: ").append(serverName).append('\n'); + sb.append(" port: ").append(port).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXBuilderParameters.java --- a/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXBuilderParameters.java Mon Aug 11 21:07:56 2014 -0300 @@ -192,7 +192,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Maximum Path Length: " + maxPathLength + "\n"); + sb.append(" Maximum Path Length: ").append(maxPathLength).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Mon Aug 11 21:07:56 2014 -0300 @@ -108,12 +108,14 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("PKIXCertPathBuilderResult: [\n"); - sb.append(" Certification Path: " + certPath + "\n"); - sb.append(" Trust Anchor: " + getTrustAnchor().toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(getPolicyTree()) + "\n"); - sb.append(" Subject Public Key: " + getPublicKey() + "\n"); - sb.append("]"); + sb.append("PKIXCertPathBuilderResult: [\n"); + sb.append(" Certification Path: ").append(certPath).append('\n'); + sb.append(" Trust Anchor: ").append(getTrustAnchor().toString()) + .append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(getPolicyTree())) + .append('\n'); + sb.append(" Subject Public Key: ").append(getPublicKey()).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Mon Aug 11 21:07:56 2014 -0300 @@ -150,10 +150,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathValidatorResult: [\n"); - sb.append(" Trust Anchor: " + trustAnchor.toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(policyTree) + "\n"); - sb.append(" Subject Public Key: " + subjectPublicKey + "\n"); - sb.append("]"); + sb.append(" Trust Anchor: ").append(trustAnchor.toString()).append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(policyTree)).append('\n'); + sb.append(" Subject Public Key: ").append(subjectPublicKey).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXParameters.java --- a/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXParameters.java Mon Aug 11 21:07:56 2014 -0300 @@ -698,8 +698,7 @@ /* start with trusted anchor info */ if (unmodTrustAnchors != null) { - sb.append(" Trust Anchors: " + unmodTrustAnchors.toString() - + "\n"); + sb.append(" Trust Anchors: ").append(unmodTrustAnchors.toString()).append('\n'); } /* now, append initial state information */ @@ -707,30 +706,37 @@ if (unmodInitialPolicies.isEmpty()) { sb.append(" Initial Policy OIDs: any\n"); } else { - sb.append(" Initial Policy OIDs: [" - + unmodInitialPolicies.toString() + "]\n"); + sb.append(" Initial Policy OIDs: [") + .append(unmodInitialPolicies.toString()).append("]\n"); } } /* now, append constraints on all certificates in the path */ - sb.append(" Validity Date: " + String.valueOf(date) + "\n"); - sb.append(" Signature Provider: " + String.valueOf(sigProvider) + "\n"); - sb.append(" Default Revocation Enabled: " + revocationEnabled + "\n"); - sb.append(" Explicit Policy Required: " + explicitPolicyRequired + "\n"); - sb.append(" Policy Mapping Inhibited: " + policyMappingInhibited + "\n"); - sb.append(" Any Policy Inhibited: " + anyPolicyInhibited + "\n"); - sb.append(" Policy Qualifiers Rejected: " + policyQualifiersRejected + "\n"); + sb.append(" Validity Date: ").append(String.valueOf(date)) + .append('\n'); + sb.append(" Signature Provider: ").append(String.valueOf(sigProvider)) + .append('\n'); + sb.append(" Default Revocation Enabled: ").append(revocationEnabled) + .append('\n'); + sb.append(" Explicit Policy Required: ") + .append(explicitPolicyRequired).append('\n'); + sb.append(" Policy Mapping Inhibited: ") + .append(policyMappingInhibited).append('\n'); + sb.append(" Any Policy Inhibited: ").append(anyPolicyInhibited) + .append('\n'); + sb.append(" Policy Qualifiers Rejected: ") + .append(policyQualifiersRejected).append('\n'); /* now, append target cert requirements */ - sb.append(" Target Cert Constraints: " + String.valueOf(certSelector) + "\n"); + sb.append(" Target Cert Constraints: ") + .append(String.valueOf(certSelector)).append('\n'); /* finally, append miscellaneous parameters */ if (certPathCheckers != null) - sb.append(" Certification Path Checkers: [" - + certPathCheckers.toString() + "]\n"); + sb.append(" Certification Path Checkers: [").append(certPathCheckers.toString()).append("]\n"); if (certStores != null) - sb.append(" CertStores: [" + certStores.toString() + "]\n"); - sb.append("]"); + sb.append(" CertStores: [").append(certStores.toString()).append("]\n"); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PolicyQualifierInfo.java --- a/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PolicyQualifierInfo.java Mon Aug 11 21:07:56 2014 -0300 @@ -163,10 +163,11 @@ HexDumpEncoder enc = new HexDumpEncoder(); StringBuilder sb = new StringBuilder(); sb.append("PolicyQualifierInfo: [\n"); - sb.append(" qualifierID: " + mId + "\n"); - sb.append(" qualifier: " + - (mData == null ? "null" : enc.encodeBuffer(mData)) + "\n"); - sb.append("]"); + sb.append(" qualifierID: ").append(mId).append('\n'); + sb.append(" qualifier: ") + .append(mData == null ? "null" : enc.encodeBuffer(mData)) + .append('\n'); + sb.append(']'); pqiString = sb.toString(); return pqiString; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/TrustAnchor.java --- a/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/TrustAnchor.java Mon Aug 11 21:07:56 2014 -0300 @@ -320,14 +320,18 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); if (pubKey != null) { - sb.append(" Trusted CA Public Key: " + pubKey.toString() + "\n"); - sb.append(" Trusted CA Issuer Name: " - + String.valueOf(caName) + "\n"); + sb.append(" Trusted CA Public Key: ").append(pubKey.toString()) + .append('\n'); + sb.append(" Trusted CA Issuer Name: ") + .append(String.valueOf(caName)).append('\n'); } else { - sb.append(" Trusted CA cert: " + trustedCert.toString() + "\n"); + sb.append(" Trusted CA cert: ").append(trustedCert.toString()) + .append('\n'); } - if (nc != null) - sb.append(" Name Constraints: " + nc.toString() + "\n"); + if (nc != null) { + sb.append(" Name Constraints: ").append(nc.toString()) + .append('\n'); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CRLSelector.java --- a/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CRLSelector.java Mon Aug 11 21:07:56 2014 -0300 @@ -572,17 +572,17 @@ sb.append(" IssuerNames:\n"); Iterator i = issuerNames.iterator(); while (i.hasNext()) - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } if (minCRL != null) - sb.append(" minCRLNumber: " + minCRL + "\n"); + sb.append(" minCRLNumber: ").append(minCRL).append('\n'); if (maxCRL != null) - sb.append(" maxCRLNumber: " + maxCRL + "\n"); + sb.append(" maxCRLNumber: ").append(maxCRL).append('\n'); if (dateAndTime != null) - sb.append(" dateAndTime: " + dateAndTime + "\n"); + sb.append(" dateAndTime: ").append(dateAndTime).append('\n'); if (certChecking != null) - sb.append(" Certificate being checked: " + certChecking + "\n"); - sb.append("]"); + sb.append(" Certificate being checked: ").append(certChecking).append('\n'); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CertSelector.java --- a/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CertSelector.java Mon Aug 11 21:07:56 2014 -0300 @@ -1814,72 +1814,67 @@ StringBuilder sb = new StringBuilder(); sb.append("X509CertSelector: [\n"); if (x509Cert != null) { - sb.append(" Certificate: " + x509Cert.toString() + "\n"); + sb.append(" Certificate: ").append(x509Cert.toString()).append('\n'); } if (serialNumber != null) { - sb.append(" Serial Number: " + serialNumber.toString() + "\n"); + sb.append(" Serial Number: ").append(serialNumber.toString()) + .append('\n'); } if (issuer != null) { - sb.append(" Issuer: " + getIssuerAsString() + "\n"); + sb.append(" Issuer: ").append(getIssuerAsString()).append('\n'); } if (subject != null) { - sb.append(" Subject: " + getSubjectAsString() + "\n"); + sb.append(" Subject: ").append(getSubjectAsString()).append('\n'); } - sb.append(" matchAllSubjectAltNames flag: " - + String.valueOf(matchAllSubjectAltNames) + "\n"); + sb.append(" matchAllSubjectAltNames flag: ") + .append(String.valueOf(matchAllSubjectAltNames)) + .append('\n'); if (subjectAlternativeNames != null) { sb.append(" SubjectAlternativeNames:\n"); Iterator> i = subjectAlternativeNames.iterator(); while (i.hasNext()) { List list = i.next(); - sb.append(" type " + list.get(0) + - ", name " + list.get(1) + "\n"); + sb.append(" type ").append(list.get(0)).append(", name ") + .append(list.get(1)).append('\n'); } } if (subjectKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Subject Key Identifier: " + - enc.encodeBuffer(subjectKeyID) + "\n"); + sb.append(" Subject Key Identifier: ").append(enc.encodeBuffer(subjectKeyID)).append('\n'); } if (authorityKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Authority Key Identifier: " + - enc.encodeBuffer(authorityKeyID) + "\n"); + sb.append(" Authority Key Identifier: ").append(enc.encodeBuffer(authorityKeyID)).append('\n'); } if (certificateValid != null) { - sb.append(" Certificate Valid: " + - certificateValid.toString() + "\n"); + sb.append(" Certificate Valid: ").append(certificateValid.toString()).append('\n'); } if (privateKeyValid != null) { - sb.append(" Private Key Valid: " + - privateKeyValid.toString() + "\n"); + sb.append(" Private Key Valid: ").append(privateKeyValid.toString()).append('\n'); } if (subjectPublicKeyAlgID != null) { - sb.append(" Subject Public Key AlgID: " + - subjectPublicKeyAlgID.toString() + "\n"); + sb.append(" Subject Public Key AlgID: ").append(subjectPublicKeyAlgID.toString()).append('\n'); } if (subjectPublicKey != null) { - sb.append(" Subject Public Key: " + - subjectPublicKey.toString() + "\n"); + sb.append(" Subject Public Key: ").append(subjectPublicKey.toString()).append('\n'); } if (keyUsage != null) { - sb.append(" Key Usage: " + keyUsageToString(keyUsage) + "\n"); + sb.append(" Key Usage: ").append(keyUsageToString(keyUsage)).append('\n'); } if (keyPurposeSet != null) { - sb.append(" Extended Key Usage: " + - keyPurposeSet.toString() + "\n"); + sb.append(" Extended Key Usage: ").append(keyPurposeSet.toString()).append('\n'); } if (policy != null) { - sb.append(" Policy: " + policy.toString() + "\n"); + sb.append(" Policy: ").append(policy.toString()).append('\n'); } if (pathToGeneralNames != null) { sb.append(" Path to names:\n"); Iterator i = pathToGeneralNames.iterator(); while (i.hasNext()) { - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/rmi/dgc/VMID.java --- a/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/rmi/dgc/VMID.java Mon Aug 11 21:07:56 2014 -0300 @@ -124,8 +124,7 @@ if (addr != null) for (int i = 0; i < addr.length; ++ i) { int x = addr[i] & 0xFF; - sb.append((x < 0x10 ? "0" : "") + - Integer.toString(x, 16)); + sb.append(x < 0x10 ? "0" : "").append(Integer.toString(x, 16)); } sb.append(':'); sb.append(uid.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/lang/management/MemoryUsage.java --- a/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/MemoryUsage.java Mon Aug 11 21:07:56 2014 -0300 @@ -237,13 +237,16 @@ * Returns a descriptive representation of this memory usage. */ public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append("init = " + init + "(" + (init >> 10) + "K) "); - buf.append("used = " + used + "(" + (used >> 10) + "K) "); - buf.append("committed = " + committed + "(" + - (committed >> 10) + "K) " ); - buf.append("max = " + max + "(" + (max >> 10) + "K)"); - return buf.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("init = ").append(init).append('(').append(init >> 10) + .append("K) "); + sb.append("used = ").append(used).append('(').append(used >> 10) + .append("K) "); + sb.append("committed = ").append(committed).append('(') + .append(committed >> 10).append("K) "); + sb.append("max = ").append(max).append('(').append(max >> 10) + .append("K)"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/java/lang/management/ThreadInfo.java --- a/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/ThreadInfo.java Mon Aug 11 21:07:56 2014 -0300 @@ -579,15 +579,17 @@ * @return a string representation of this thread info. */ public String toString() { - StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" + - " Id=" + getThreadId() + " " + - getThreadState()); + StringBuilder sb = new StringBuilder(); + sb.append('"').append(getThreadName()).append('"') + .append(" Id=").append(getThreadId()).append(' ') + .append(getThreadState()); + if (getLockName() != null) { - sb.append(" on " + getLockName()); + sb.append(" on ").append(getLockName()); } if (getLockOwnerName() != null) { - sb.append(" owned by \"" + getLockOwnerName() + - "\" Id=" + getLockOwnerId()); + sb.append(" owned by \"").append(getLockOwnerName()) + .append("\" Id=").append(getLockOwnerId()); } if (isSuspended()) { sb.append(" (suspended)"); @@ -599,21 +601,21 @@ int i = 0; for (; i < stackTrace.length && i < MAX_FRAMES; i++) { StackTraceElement ste = stackTrace[i]; - sb.append("\tat " + ste.toString()); + sb.append("\tat ").append(ste.toString()); sb.append('\n'); if (i == 0 && getLockInfo() != null) { Thread.State ts = getThreadState(); switch (ts) { case BLOCKED: - sb.append("\t- blocked on " + getLockInfo()); + sb.append("\t- blocked on ").append(getLockInfo()); sb.append('\n'); break; case WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; case TIMED_WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; default: @@ -622,7 +624,7 @@ for (MonitorInfo mi : lockedMonitors) { if (mi.getLockedStackDepth() == i) { - sb.append("\t- locked " + mi); + sb.append("\t- locked ").append(mi); sb.append('\n'); } } @@ -634,10 +636,10 @@ LockInfo[] locks = getLockedSynchronizers(); if (locks.length > 0) { - sb.append("\n\tNumber of locked synchronizers = " + locks.length); + sb.append("\n\tNumber of locked synchronizers = ").append(locks.length); sb.append('\n'); for (LockInfo li : locks) { - sb.append("\t- " + li); + sb.append("\t- ").append(li); sb.append('\n'); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHParameters.java --- a/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHParameters.java Mon Aug 11 21:07:55 2014 -0300 @@ -137,8 +137,11 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:") + .append(LINE_SEP).append(" ") + .append(this.l); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHPublicKey.java --- a/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Mon Aug 11 21:07:55 2014 -0300 @@ -268,8 +268,10 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:").append(LINE_SEP) + .append(" ").append(this.l); + } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/GCMParameters.java --- a/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/GCMParameters.java Mon Aug 11 21:07:55 2014 -0300 @@ -140,7 +140,8 @@ = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "[" + encoder.encodeBuffer(iv) + "]"); - sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP); + sb.append(LINE_SEP).append("tLen(bits):").append(LINE_SEP) + .append(tLen * 8).append(LINE_SEP); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/OAEPParameters.java --- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Mon Aug 11 21:07:55 2014 -0300 @@ -238,11 +238,12 @@ } protected String engineToString() { - StringBuilder sb = new StringBuilder(); - sb.append("MD: " + mdName + "\n"); - sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n"); - sb.append("PSource: PSpecified " + - (p.length==0? "":Debug.toHexString(new BigInteger(p))) + "\n"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("MD: ").append(mdName).append('\n'); + sb.append("MGF: MGF1").append(mgfSpec.getDigestAlgorithm()) + .append('\n'); + sb.append("PSource: PSpecified ").append(p.length == 0 ? "" : + Debug.toHexString(new BigInteger(p))).append('\n'); + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/RC2Parameters.java --- a/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Mon Aug 11 21:07:55 2014 -0300 @@ -221,8 +221,9 @@ + encoder.encodeBuffer(iv) + "]"); if (version != 0) { - sb.append(LINE_SEP + "version:" + LINE_SEP - + version + LINE_SEP); + sb.append(LINE_SEP).append("version:") + .append(LINE_SEP).append(version) + .append(LINE_SEP); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Mon Aug 11 21:07:55 2014 -0300 @@ -65,7 +65,7 @@ "extractSubNet", "BINARY ARRAY :"); StringBuilder sb = new StringBuilder(); for(int i =0; i < addrLength; i++) { - sb.append((b[i] & 0xFF) + ":"); + sb.append(b[i] & 0xFF).append(':'); } SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", sb.toString()); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Mon Aug 11 21:07:55 2014 -0300 @@ -204,7 +204,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Mon Aug 11 21:07:55 2014 -0300 @@ -379,7 +379,7 @@ } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); - jjtn000.name.append( "." + t.image); + jjtn000.name.append('.').append(t.image); } } finally { if (jjtc000) { @@ -408,7 +408,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -454,7 +454,7 @@ } jj_consume_token(MARK); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -483,7 +483,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } jj_consume_token(MASK); t = jj_consume_token(INTEGER_LITERAL); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Mon Aug 11 21:07:55 2014 -0300 @@ -420,7 +420,7 @@ t= { jjtn000.name.append(t.image); } ( "." t= - {jjtn000.name.append( "." + t.image); } + {jjtn000.name.append( '.')append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -447,7 +447,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -501,7 +501,7 @@ {jjtn000.address.append(t.image); } ( "!" t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -527,7 +527,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )* "/" t= /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Mon Aug 11 21:07:55 2014 -0300 @@ -213,7 +213,7 @@ t= { jjtThis.name.append(t.image); } ( "." t= - {jjtThis.name.append( "." + t.image); } + {jjtThis.name.append( '.').append(t.image); } )* } @@ -228,7 +228,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* } @@ -253,7 +253,7 @@ {jjtThis.address.append(t.image); } ( "!" t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* } @@ -267,7 +267,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* "/" t= {jjtThis.mask = t.image; } } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Mon Aug 11 21:07:55 2014 -0300 @@ -99,7 +99,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java --- a/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Mon Aug 11 21:07:55 2014 -0300 @@ -479,10 +479,10 @@ */ public String printMessage() { StringBuilder sb = new StringBuilder(); - sb.append("msgId : " + msgId + "\n"); - sb.append("msgMaxSize : " + msgMaxSize + "\n"); - sb.append("msgFlags : " + msgFlags + "\n"); - sb.append("msgSecurityModel : " + msgSecurityModel + "\n"); + sb.append("msgId : ").append(msgId).append('\n'); + sb.append("msgMaxSize : ").append(msgMaxSize).append('\n'); + sb.append("msgFlags : ").append(msgFlags).append('\n'); + sb.append("msgSecurityModel : ").append(msgSecurityModel).append('\n'); if (contextEngineId == null) { sb.append("contextEngineId : null"); diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java --- a/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Mon Aug 11 21:07:55 2014 -0300 @@ -256,7 +256,7 @@ private static String stringifyComponent(NameComponent comp) { StringBuilder one = new StringBuilder(escape(comp.id)); if (comp.kind != null && !comp.kind.equals("")) { - one.append(kindSeparator + escape(comp.kind)); + one.append(kindSeparator).append(escape(comp.kind)); } if (one.length() == 0) { return ""+kindSeparator; // if neither id nor kind specified diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java --- a/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Mon Aug 11 21:07:55 2014 -0300 @@ -90,7 +90,7 @@ if (selected == -1) { StringBuilder allChoices = new StringBuilder(); for (int j = 0; j < choices.length; j++) { - allChoices.append(choices[j] + ","); + allChoices.append(choices[j]).append(','); } throw new IOException("Cannot match " + "'java.naming.security.sasl.realm' property value, '" + diff -r dde9f5cfde5f src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java --- a/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Mon Aug 11 21:07:55 2014 -0300 @@ -167,9 +167,9 @@ for (int i = 0; i < allchannelnames.length; i++) { if ((channelmask & m) != 0L) { if (i < channelnames.length) { - sb.append(channelnames[i] + " "); + sb.append(channelnames[i]).append(' '); } else { - sb.append(allchannelnames[i] + " "); + sb.append(allchannelnames[i]).append(' '); } } m *= 2L; diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Mon Aug 11 21:07:55 2014 -0300 @@ -235,14 +235,15 @@ String nodeName = att.getNodeName(); if ((nodeName.equals("xmlns") || nodeName.startsWith("xmlns:")) && !storedNamespaces.containsKey(att.getNodeName())) { - sb.append(" " + nodeName + "=\"" + att.getNodeValue() + "\""); + sb.append(' ').append(nodeName).append("=\"") + .append(att.getNodeValue()).append('"'); storedNamespaces.put(nodeName, att.getNodeValue()); } } } wk = wk.getParentNode(); } - sb.append(">" + source + ""); + sb.append('>').append(source).append(""); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Mon Aug 11 21:07:55 2014 -0300 @@ -85,7 +85,7 @@ if (prefix.equals("xmlns")) { sb.append("#default "); } else { - sb.append(prefix + " "); + sb.append(prefix).append(' '); } } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Mon Aug 11 21:07:55 2014 -0300 @@ -88,7 +88,7 @@ l += countQuotes(DN, j, k); if ((k > 0) && (DN.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseRDN(DN.substring(i, k).trim(), toXml) + ","); + sb.append(parseRDN(DN.substring(i, k).trim(), toXml)).append(','); i = k + 1; l = 0; @@ -121,7 +121,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseATAV(trim(str.substring(i, k)), toXml) + "+"); + sb.append(parseATAV(trim(str.substring(i, k)), toXml)).append('+'); i = k + 1; l = 0; @@ -369,7 +369,7 @@ int k; for (int j = 0; (k = string.indexOf("\\20", j)) >= 0; j = k + 3) { - sb.append(trim(string.substring(i, k)) + "\\ "); + sb.append(trim(string.substring(i, k))).append("\\ "); i = k + 3; } @@ -418,7 +418,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(trim(str.substring(i, k)) + replace); + sb.append(trim(str.substring(i, k))).append(replace); i = k + 1; l = 0; diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/CramMD5Base.java --- a/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/CramMD5Base.java Mon Aug 11 21:07:55 2014 -0300 @@ -196,8 +196,7 @@ for (i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java --- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Mon Aug 11 21:07:55 2014 -0300 @@ -391,8 +391,7 @@ for (int i = 0; i < digest.length; i ++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0"+ - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/ParseException.java --- a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Mon Aug 11 21:07:55 2014 -0300 @@ -198,7 +198,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java --- a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Mon Aug 11 21:07:55 2014 -0300 @@ -107,7 +107,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java --- a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Mon Aug 11 21:07:55 2014 -0300 @@ -338,10 +338,10 @@ if (classpath.isEmpty()) { String envcp = System.getProperty("env.class.path"); if ((envcp != null) && (envcp.length() > 0)) { - munged.append(" -classpath " + envcp); + munged.append(" -classpath ").append(envcp); } } else { - munged.append(" -classpath " + classpath.asString()); + munged.append(" -classpath ").append(classpath.asString()); } return munged.toString(); } else { @@ -349,14 +349,4 @@ } } - private String appendPath(String path1, String path2) { - if (path1 == null || path1.length() == 0) { - return path2 == null ? "." : path2; - } else if (path2 == null || path2.length() == 0) { - return path1; - } else { - return path1 + File.pathSeparator + path2; - } - } - } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Mon Aug 11 21:07:55 2014 -0300 @@ -346,12 +346,12 @@ public String valueString(boolean bigLimit) { // Char arrays deserve special treatment - StringBuffer result; + StringBuilder result; byte[] value = getValue(); int max = value.length; byte elementSignature = getElementType(); if (elementSignature == 'C') { - result = new StringBuffer(); + result = new StringBuilder(); for (int i = 0; i < value.length; ) { char val = charAt(i, value); result.append(val); @@ -362,7 +362,7 @@ if (bigLimit) { limit = 1000; } - result = new StringBuffer("{"); + result = new StringBuilder("{"); int num = 0; for (int i = 0; i < value.length; ) { if (num > 0) { @@ -386,37 +386,37 @@ } case 'B': { int val = 0xFF & byteAt(i, value); - result.append("0x" + Integer.toString(val, 16)); + result.append("0x").append(Integer.toString(val, 16)); i++; break; } case 'S': { short val = shortAt(i, value); i += 2; - result.append("" + val); + result.append(val); break; } case 'I': { int val = intAt(i, value); i += 4; - result.append("" + val); + result.append(val); break; } case 'J': { // long long val = longAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } case 'F': { float val = floatAt(i, value); - result.append("" + val); + result.append(val); i += 4; break; } case 'D': { // double double val = doubleAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } @@ -425,7 +425,7 @@ } } } - result.append("}"); + result.append('}'); } return result.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/util/Misc.java --- a/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Mon Aug 11 21:07:55 2014 -0300 @@ -97,11 +97,11 @@ } else if (ch == '&') { sb.append("&"); } else if (ch < ' ') { - sb.append("&#" + Integer.toString(ch) + ";"); + sb.append("&#").append(Integer.toString(ch)).append(';'); } else { int c = (ch & 0xFFFF); if (c > 127) { - sb.append("&#" + Integer.toString(c) + ";"); + sb.append("&#").append(Integer.toString(c)).append(';'); } else { sb.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java --- a/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Mon Aug 11 21:07:55 2014 -0300 @@ -881,12 +881,12 @@ } else if (tag == JDWP.TypeTag.ARRAY) { sb.append("ArrayType"); } else { - sb.append("UNKNOWN TAG: " + tag); + sb.append("UNKNOWN TAG: ").append(tag); } if (signature != null) { - sb.append(", signature='" + signature + "'"); + sb.append(", signature='").append(signature).append('\''); } - sb.append(", id=" + id); + sb.append(", id=").append(id); vm.printTrace(sb.toString()); } if (id == 0) { From ioi.lam at oracle.com Tue Aug 12 06:10:43 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Mon, 11 Aug 2014 23:10:43 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E94B4A.6060405@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> <53E93278.4090609@oracle.com> <53E94B4A.6060405@oracle.com> Message-ID: <53E9AFE3.8060604@oracle.com> On 8/11/14, 4:01 PM, Mandy Chung wrote: > On 8/11/14 2:15 PM, Ioi Lam wrote: > >>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ > > I would like to avoid adding private methods for VM to call > as fewer as possible. > > SecureClassLoader.getProtectionDomain(URL) > Can you use the existing private getProtectionDomain(CodeSource) > method instead? The VM can call the public CodeSource(URL, > CodeSigner[]) > constructor. I doubt an additional up call from the VM to Java > may cause performance degradation as much while I think it's > a good tradeoff. It also allows this be extended to signed JARs > if it's considered. > > Manifest.getManifest(byte[] buf) > Is saving one additional upcall from VM to Java very critical? > I prefer the VM to use public APIs to minimize such dependency > in the library. > > Launcher.getFileURL(String) > This is a convenient method for VM. If VM calls getFileURL(File), > it's still a new dependency. Is there any other way doing it? > Hi Mandy, I agree we should avoid adding new private Java methods if possible. I've rewritten the 3 calls in C. It's a little messy: a single line of Java code needs to be written like: // JAVA: CodeSource cs = new CodeSource(url, null); InstanceKlass* cs_klass = InstanceKlass::cast(SystemDictionary::CodeSource_klass()); Handle cs = cs_klass->allocate_instance_handle(CHECK_(protection_domain)); { JavaValue result(T_VOID); JavaCalls::call_special(&result, cs, KlassHandle(THREAD, cs_klass), vmSymbols::object_initializer_name(), vmSymbols::url_code_signer_array_void_signature(), url, Handle(), CHECK_(protection_domain)); } There's some minimal checking with argument types (default in debug build, -XX:+CheckJNICalls in product build), but I think there's no check if you forget to call the method. We could probably add a new JavaCalls::new_instance() function to make the code a little cleaner (and make sure the is called). I can do this as a separate clean-up bug. > URLClassLoader.defineClass > 438 * NOTE: the logic used here has been duplicated in the VM > native code > 439 * (search for invocation of definePackageInternal in the > HotSpot sources). > 440 * If this is changed, the VM code also need to be modified. > > Is the definePackageInternal only logic duplicated in the VM? > I wonder if this comment can be clear what is duplicated. > I'll reword it and send out a new webrev, along with the rest of the code. Thanks - Ioi > Mandy > From david.holmes at oracle.com Tue Aug 12 06:23:50 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 12 Aug 2014 16:23:50 +1000 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E94B4A.6060405@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> <53E93278.4090609@oracle.com> <53E94B4A.6060405@oracle.com> Message-ID: <53E9B2F6.20603@oracle.com> Hi Mandy, On 12/08/2014 9:01 AM, Mandy Chung wrote: > On 8/11/14 2:15 PM, Ioi Lam wrote: > >>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ > > I would like to avoid adding private methods for VM to call > as fewer as possible. > > SecureClassLoader.getProtectionDomain(URL) > Can you use the existing private getProtectionDomain(CodeSource) > method instead? The VM can call the public CodeSource(URL, > CodeSigner[]) > constructor. I doubt an additional up call from the VM to Java > may cause performance degradation as much while I think it's > a good tradeoff. It also allows this be extended to signed JARs > if it's considered. An extra upcall per class loaded from the archive may indeed be a significant performance degradation! > Manifest.getManifest(byte[] buf) > Is saving one additional upcall from VM to Java very critical? > I prefer the VM to use public APIs to minimize such dependency > in the library. Ditto. David ----- > Launcher.getFileURL(String) > This is a convenient method for VM. If VM calls getFileURL(File), > it's still a new dependency. Is there any other way doing it? > > URLClassLoader.defineClass > 438 * NOTE: the logic used here has been duplicated in the VM > native code > 439 * (search for invocation of definePackageInternal in the > HotSpot sources). > 440 * If this is changed, the VM code also need to be modified. > > Is the definePackageInternal only logic duplicated in the VM? > I wonder if this comment can be clear what is duplicated. > > Mandy > From mandy.chung at oracle.com Tue Aug 12 06:26:22 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 11 Aug 2014 23:26:22 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E9B2F6.20603@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> <53E93278.4090609@oracle.com> <53E94B4A.6060405@oracle.com> <53E9B2F6.20603@oracle.com> Message-ID: <53E9B38E.5070606@oracle.com> On 8/11/2014 11:23 PM, David Holmes wrote: > Hi Mandy, > > On 12/08/2014 9:01 AM, Mandy Chung wrote: >> On 8/11/14 2:15 PM, Ioi Lam wrote: >> >>>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ >> >> I would like to avoid adding private methods for VM to call >> as fewer as possible. >> >> SecureClassLoader.getProtectionDomain(URL) >> Can you use the existing private getProtectionDomain(CodeSource) >> method instead? The VM can call the public CodeSource(URL, >> CodeSigner[]) >> constructor. I doubt an additional up call from the VM to Java >> may cause performance degradation as much while I think it's >> a good tradeoff. It also allows this be extended to signed JARs >> if it's considered. > > An extra upcall per class loaded from the archive may indeed be a > significant performance degradation! > Is it called per URL (jar file)? Same for manifest? Mandy >> Manifest.getManifest(byte[] buf) >> Is saving one additional upcall from VM to Java very critical? >> I prefer the VM to use public APIs to minimize such dependency >> in the library. > > Ditto. > > David > ----- > >> Launcher.getFileURL(String) >> This is a convenient method for VM. If VM calls getFileURL(File), >> it's still a new dependency. Is there any other way doing it? >> >> URLClassLoader.defineClass >> 438 * NOTE: the logic used here has been duplicated in the VM >> native code >> 439 * (search for invocation of definePackageInternal in the >> HotSpot sources). >> 440 * If this is changed, the VM code also need to be modified. >> >> Is the definePackageInternal only logic duplicated in the VM? >> I wonder if this comment can be clear what is duplicated. >> >> Mandy >> From ioi.lam at oracle.com Tue Aug 12 06:29:04 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Mon, 11 Aug 2014 23:29:04 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E82778.3020400@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> Message-ID: <53E9B430.8060006@oracle.com> On 8/10/14, 7:16 PM, David Holmes wrote: > Hi Ioi, > > We seem to have lost core-libs-dev so I added them back. > > A couple of minor follow ups. > > On 9/08/2014 6:02 PM, Ioi Lam wrote: >> Hi, >> >> Thanks a lot to everyone for the very useful comments. I have updated >> the webrev >> >> Just the delta from the previous round of review: >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3_delta_from_v2/ > > JDK changes: > > URLClassLoader.java: > > Doesn't this Note > > + * > + * NOTE: the logic used here has been duplicated in the VM > native code > + * (search for invocation of definePackageInternal in the > HotSpot sources). > + * If this is changed, the VM code also need to be modified. > > belong on definePackageInternal, not defineClass ?? Yes, this is a little confusing since the comment is lacking context ... I will try to reword it. > --- > > hotspot changes: > > hotspot/src/share/vm/classfile/classLoader.cpp > > The scoping of the ResourceMark doesn't look right: > > 592 // Iterate over class path entries > 593 for (int start = 0; start < len; start = end) { > 594 while (class_path[end] && class_path[end] != > os::path_separator()[0]) { > 595 end++; > 596 } > 597 EXCEPTION_MARK; > 598 ResourceMark rm(THREAD); > 599 char* path = NEW_RESOURCE_ARRAY(char, end-start+1); > 600 strncpy(path, &class_path[start], end-start); > 601 path[end-start] = '\0'; > 602 update_class_path_entry_list(path, false); > 603 #if INCLUDE_CDS > 604 if (DumpSharedSpaces) { > 605 check_shared_classpath(path); > 606 } > 607 #endif > 608 while (class_path[end] == os::path_separator()[0]) { > 609 end++; > 610 } > 611 } > > Doesn't the RESOURCE_ARRAY need to be freed within the ResourceMark > block? > I want the path to be freed after each iteration of the "for" loop. Is this the right way to do it? I though the path will be freed once "rm" falls out of scope, which happens after each iteration of the "for" loop is finished. > --- > > src/share/vm/runtime/arguments.cpp > > 3340 // This causes problems with CDS, which requires that all > directories specified in the classpath > 3341 // must be empty. > > Should that be "must not be empty"? Or did you mean directory names? > As mentioned by Jiangli, we want the directory to be empty, so no classes will be loaded from them at run-time. A little history: CDS supports only loading classes from JAR files. This way, we can check if a JAR file has been modified using its timestamp and size. If the JAR file has been modified, the JVM will declare the CDS archive out of date and refuse to use it. This way, we can ensure that the set of loadable classes for our ClassLoader will not change between dump-time and run-time. Directories are more problematic than JAR files -- there's no easy way to check if a class file has been added or deleted (unless you do an expensive directory scan). So since JDK 1.5 we have forbidden the use of non-empty directories for CDS. Empty directories have been allowed since JDK 1.5, probably because the development JDK builds includes $JAVA_HOME/somewhere/classes in its bootclasspath. We are just carrying this vestige forward, although I am thinking of filing a bug to get rid of it. > --- > > src/share/vm/runtime/javaCalls.cpp > > + // may cause undesriable side-effect in the class metadata. > > Typo: undesriable; also side-effects > Fixed. Thanks - Ioi > --- > > David > ----- > > >> All the changes: >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ >> >> Thanks >> - Ioi >> >> On 7/28/14, 4:09 PM, Ioi Lam wrote: >>> Hi Folks, >>> >>> Please review the following clean up and refactoring of the CDS code, >>> for JDK9 >>> >>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >>> https://bugs.openjdk.java.net/browse/JDK-8046070 >>> >>> Summary of fix: >>> >>> Clean up and refactor the Class Data Sharing (CDS) code, including: >>> >>> + Improve archive integrity checking >>> + Support bytecode verification during archive dumping time >>> + Allow the user to configure the CDS class list and archive file. >>> + Allow future extension of the CDS class loading mechanism. >>> >>> Tests: >>> >>> JPRT >>> UTE (vm.runtime.testlist, vm.quick.testlist, >>> vm.parallel_class_loading.testlist) >>> Various adhoc SQE tests on Aurora >>> JCK >>> >>> Thanks >>> - Ioi >> From david.holmes at oracle.com Tue Aug 12 07:09:54 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 12 Aug 2014 17:09:54 +1000 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E9B430.8060006@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> <53E9B430.8060006@oracle.com> Message-ID: <53E9BDC2.2020002@oracle.com> On 12/08/2014 4:29 PM, Ioi Lam wrote: > > On 8/10/14, 7:16 PM, David Holmes wrote: >> Hi Ioi, >> >> We seem to have lost core-libs-dev so I added them back. >> >> A couple of minor follow ups. >> >> On 9/08/2014 6:02 PM, Ioi Lam wrote: >>> Hi, >>> >>> Thanks a lot to everyone for the very useful comments. I have updated >>> the webrev >>> >>> Just the delta from the previous round of review: >>> >>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3_delta_from_v2/ >> >> JDK changes: >> >> URLClassLoader.java: >> >> Doesn't this Note >> >> + * >> + * NOTE: the logic used here has been duplicated in the VM >> native code >> + * (search for invocation of definePackageInternal in the >> HotSpot sources). >> + * If this is changed, the VM code also need to be modified. >> >> belong on definePackageInternal, not defineClass ?? > Yes, this is a little confusing since the comment is lacking context ... > I will try to reword it. >> --- >> >> hotspot changes: >> >> hotspot/src/share/vm/classfile/classLoader.cpp >> >> The scoping of the ResourceMark doesn't look right: >> >> 592 // Iterate over class path entries >> 593 for (int start = 0; start < len; start = end) { >> 594 while (class_path[end] && class_path[end] != >> os::path_separator()[0]) { >> 595 end++; >> 596 } >> 597 EXCEPTION_MARK; >> 598 ResourceMark rm(THREAD); >> 599 char* path = NEW_RESOURCE_ARRAY(char, end-start+1); >> 600 strncpy(path, &class_path[start], end-start); >> 601 path[end-start] = '\0'; >> 602 update_class_path_entry_list(path, false); >> 603 #if INCLUDE_CDS >> 604 if (DumpSharedSpaces) { >> 605 check_shared_classpath(path); >> 606 } >> 607 #endif >> 608 while (class_path[end] == os::path_separator()[0]) { >> 609 end++; >> 610 } >> 611 } >> >> Doesn't the RESOURCE_ARRAY need to be freed within the ResourceMark >> block? >> > I want the path to be freed after each iteration of the "for" loop. Is > this the right way to do it? I though the path will be freed once "rm" > falls out of scope, which happens after each iteration of the "for" loop > is finished. You're right - I'm getting myself confused. (Some of our "marks" do things, while others check things - I thought this was a checker.) >> --- >> >> src/share/vm/runtime/arguments.cpp >> >> 3340 // This causes problems with CDS, which requires that all >> directories specified in the classpath >> 3341 // must be empty. >> >> Should that be "must not be empty"? Or did you mean directory names? >> > As mentioned by Jiangli, we want the directory to be empty, so no > classes will be loaded from them at run-time. Got it. I got confused with the path entry and the directory referred to by a path entry. Thanks, David > A little history: > > CDS supports only loading classes from JAR files. This way, we can check > if a JAR file has been modified using its timestamp and size. If the JAR > file has been modified, the JVM will declare the CDS archive out of date > and refuse to use it. This way, we can ensure that the set of loadable > classes for our ClassLoader will not change between dump-time and run-time. > > Directories are more problematic than JAR files -- there's no easy way > to check if a class file has been added or deleted (unless you do an > expensive directory scan). So since JDK 1.5 we have forbidden the use of > non-empty directories for CDS. > > Empty directories have been allowed since JDK 1.5, probably because the > development JDK builds includes $JAVA_HOME/somewhere/classes in its > bootclasspath. We are just carrying this vestige forward, although I am > thinking of filing a bug to get rid of it. >> --- >> >> src/share/vm/runtime/javaCalls.cpp >> >> + // may cause undesriable side-effect in the class metadata. >> >> Typo: undesriable; also side-effects >> > Fixed. > > Thanks > - Ioi > >> --- >> >> David >> ----- >> >> >>> All the changes: >>> >>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ >>> >>> Thanks >>> - Ioi >>> >>> On 7/28/14, 4:09 PM, Ioi Lam wrote: >>>> Hi Folks, >>>> >>>> Please review the following clean up and refactoring of the CDS code, >>>> for JDK9 >>>> >>>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >>>> https://bugs.openjdk.java.net/browse/JDK-8046070 >>>> >>>> Summary of fix: >>>> >>>> Clean up and refactor the Class Data Sharing (CDS) code, including: >>>> >>>> + Improve archive integrity checking >>>> + Support bytecode verification during archive dumping time >>>> + Allow the user to configure the CDS class list and archive file. >>>> + Allow future extension of the CDS class loading mechanism. >>>> >>>> Tests: >>>> >>>> JPRT >>>> UTE (vm.runtime.testlist, vm.quick.testlist, >>>> vm.parallel_class_loading.testlist) >>>> Various adhoc SQE tests on Aurora >>>> JCK >>>> >>>> Thanks >>>> - Ioi >>> > From andrej.golovnin at gmail.com Tue Aug 12 07:48:00 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Tue, 12 Aug 2014 09:48:00 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> Message-ID: Hi Ot?vio, I think you should fix the indentation in a lot of classes. You use the tab-character for the indentation. As far as I know we should use the space character for the indentation in the JDK sources (Oracle devs feel free to correct me if I'm wrong. And it would be really nice if the style guide for the source code would be a part of the JDK repository. So we don't need to search for it on the internet/wiki. Just clone the repository, read the style guide and follow it. :-) ). Here is the not complete list of classes where you used the tab-character for the indentation: src/share/classes/com/sun/crypto/provider/OAEPParameters.java src/share/classes/java/lang/management/MemoryUsage.java src/share/classes/java/security/KeyStore.java src/share/classes/java/security/PermissionCollection.java src/share/classes/java/security/ProtectionDomain.java src/share/classes/java/security/cert/CertPath.java src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java src/share/classes/java/security/cert/PKIXParameters.java src/share/classes/java/security/cert/PolicyQualifierInfo.java src/share/classes/java/security/cert/TrustAnchor.java src/share/classes/java/security/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); } Best regards, Andrej Golovnin From weijun.wang at oracle.com Tue Aug 12 08:02:55 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Tue, 12 Aug 2014 16:02:55 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> Message-ID: No TAB, no \r, and no trailing space are hard requirements enforced by jcheck. Otherwise it's only styles, including 4-space-indentation. "{" at the end of a line, 8-space wrap indentation... --Max (an Oracle dev) On Aug 12, 2014, at 15:48, Andrej Golovnin wrote: > As far as I know we should use the space character for the indentation in the JDK sources (Oracle devs feel free to correct me if I'm wrong. From peter.firmstone at zeus.net.au Tue Aug 12 09:03:53 2014 From: peter.firmstone at zeus.net.au (Peter Firmstone) Date: Tue, 12 Aug 2014 19:03:53 +1000 Subject: The future of Serialization In-Reply-To: <53E8D0AC.3060108@oracle.com> References: <1407563776.1841.30.camel@Nokia-N900> <53E8A71D.70407@oracle.com> <53E8B1D8.1000200@zeus.net.au> <53E8D0AC.3060108@oracle.com> Message-ID: <1407834233.6396.10.camel@Nokia-N900> Interesting, language features for modules, won't necessarily involve ClassLoader's (my assumptions were based on existing systems) although you'd expect modules to have their own ProtectionDomain. An alternative to isolates, is separate processes with jvm class sharing enabled. I'll keep an eye out for the JSR. When is a better timeframe, roughly, to discuss Serializable? Regards, Peter. ----- Original message ----- > On 11/08/2014 13:06, Peter Firmstone wrote: > > Thanks Alan, I can relate to time poverty :) > > > > I might be assuming too much, but if there's interest in doing > > something with Serialization, I'd be interested in learning about > > plans or difficulties involved in deserialization and modules. It can > > be a little more difficult to find the correct ClassLoader to resolve > > classes during deserialization when ClassLoader relationships aren't > > hierarchial.? Object streams can be annotated with module information > > to assist resolution. > The issues around visibility when deserializing are somewhat independent > of modules. The usual way to deal with such matters is to override the > resolveClass method. Another long standing suggestion is for > ObjectInputStream to define a new constructor that takes a class loader > to avoid the stack walk to get the user-defined loader. It remains to > seen but if we can avoid changing visibility then we don't change the > status quo. > > : > > > > Got any links to info on extending access control rules? > Not yet, a future JSR will define the standard module system and there > will be a corresponding JEP for the implementation. > > -Alan. From claes.redestad at oracle.com Tue Aug 12 11:25:38 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Tue, 12 Aug 2014 13:25:38 +0200 Subject: [8u40] RFR(M): 8050114, 8041972, 8006627 In-Reply-To: <53E8EC3A.90100@oracle.com> References: <53E8EC3A.90100@oracle.com> Message-ID: <53E9F9B2.5080709@oracle.com> Hi, it appears I might have been unclear that this was a (re-)review request - not a request for approval - since we need to make the public API introduced in 8041972 private for 8u. After some confusion on my part, it turns out the appropriate place to re-review these changes are actually on this list[1]. /Claes [1] http://mail.openjdk.java.net/pipermail/jdk8u-dev/2014-August/001642.html On 08/11/2014 06:15 PM, Claes Redestad wrote: > Hi, > > I want to request backports of 8050114 [1], 8041972 [2] and 8006627[3] > to 8u-dev. > The patches apply cleanly when pushed in the sequence listed. > > [1] Expose Integer/Long formatUnsigned methods internally > - jdk9 patch appliescleanly to jdk8u-dev > https://bugs.openjdk.java.net/browse/JDK-8050114 > http://cr.openjdk.java.net/~redestad/8050114/webrev.2 > http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/7f056c2a6c54 > > [2] Add improved parse methods for Long/Integer > - public API methods made package private and exposed via JavaLangAccess > - rolled typos fixes found and reported under JDK-8054828 into this patch > https://bugs.openjdk.java.net/browse/JDK-8041972 > http://cr.openjdk.java.net/~redestad/8041972/backport.2 > http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/127da56ff224 > > [3] UUID to/from String performance should be improved by reducing > object allocations > - non-public parseLong method now accessed via JavaLangAccess > https://bugs.openjdk.java.net/browse/JDK-8006627 > http://cr.openjdk.java.net/~redestad/8006627/backport.0 > http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/3b298c230549 > > Thanks! > > /Claes From otaviojava at java.net Tue Aug 12 11:51:47 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Tue, 12 Aug 2014 08:51:47 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> Message-ID: Thank you Andrej Done. https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_5.zip On Tue, Aug 12, 2014 at 4:48 AM, Andrej Golovnin wrote: > Hi Ot?vio, > > I think you should fix the indentation in a lot of classes. You use the > tab-character for the indentation. As far as I know we should use the space > character for the indentation in the JDK sources (Oracle devs feel free to > correct me if I'm wrong. And it would be really nice if the style guide for > the source code would be a part of the JDK repository. So we don't need to > search for it on the internet/wiki. Just clone the repository, read the > style guide and follow it. :-) ). Here is the not complete list of classes > where you used the tab-character for the indentation: > > src/share/classes/com/sun/crypto/provider/OAEPParameters.java > src/share/classes/java/lang/management/MemoryUsage.java > src/share/classes/java/security/KeyStore.java > src/share/classes/java/security/PermissionCollection.java > src/share/classes/java/security/ProtectionDomain.java > src/share/classes/java/security/cert/CertPath.java > src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java > src/share/classes/java/security/cert/PKIXParameters.java > src/share/classes/java/security/cert/PolicyQualifierInfo.java > src/share/classes/java/security/cert/TrustAnchor.java > src/share/classes/java/security/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); } > > Best regards, > Andrej Golovnin > -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHParameters.java --- a/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 12 08:47:10 2014 -0300 @@ -137,8 +137,11 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:") + .append(LINE_SEP).append(" ") + .append(this.l); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHPublicKey.java --- a/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 12 08:47:10 2014 -0300 @@ -268,8 +268,10 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:").append(LINE_SEP) + .append(" ").append(this.l); + } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/GCMParameters.java --- a/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 12 08:47:10 2014 -0300 @@ -140,7 +140,8 @@ = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "[" + encoder.encodeBuffer(iv) + "]"); - sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP); + sb.append(LINE_SEP).append("tLen(bits):").append(LINE_SEP) + .append(tLen * 8).append(LINE_SEP); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/OAEPParameters.java --- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 12 08:47:10 2014 -0300 @@ -239,10 +239,12 @@ protected String engineToString() { StringBuilder sb = new StringBuilder(); - sb.append("MD: " + mdName + "\n"); - sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n"); - sb.append("PSource: PSpecified " + - (p.length==0? "":Debug.toHexString(new BigInteger(p))) + "\n"); + sb.append("MD: ").append(mdName).append('\n'); + sb.append("MGF: MGF1").append(mgfSpec.getDigestAlgorithm()) + .append('\n'); + sb.append("PSource: PSpecified ") + .append(p.length == 0 ? "" : Debug + .toHexString(new BigInteger(p))).append('\n'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/RC2Parameters.java --- a/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 12 08:47:10 2014 -0300 @@ -221,8 +221,9 @@ + encoder.encodeBuffer(iv) + "]"); if (version != 0) { - sb.append(LINE_SEP + "version:" + LINE_SEP - + version + LINE_SEP); + sb.append(LINE_SEP).append("version:") + .append(LINE_SEP).append(version) + .append(LINE_SEP); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 12 08:47:10 2014 -0300 @@ -65,7 +65,7 @@ "extractSubNet", "BINARY ARRAY :"); StringBuilder sb = new StringBuilder(); for(int i =0; i < addrLength; i++) { - sb.append((b[i] & 0xFF) + ":"); + sb.append(b[i] & 0xFF).append(':'); } SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", sb.toString()); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 12 08:47:10 2014 -0300 @@ -204,7 +204,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 12 08:47:10 2014 -0300 @@ -379,7 +379,7 @@ } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); - jjtn000.name.append( "." + t.image); + jjtn000.name.append('.').append(t.image); } } finally { if (jjtc000) { @@ -408,7 +408,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -454,7 +454,7 @@ } jj_consume_token(MARK); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -483,7 +483,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } jj_consume_token(MASK); t = jj_consume_token(INTEGER_LITERAL); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Tue Aug 12 08:47:10 2014 -0300 @@ -420,7 +420,7 @@ t= { jjtn000.name.append(t.image); } ( "." t= - {jjtn000.name.append( "." + t.image); } + {jjtn000.name.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -447,7 +447,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -501,7 +501,7 @@ {jjtn000.address.append(t.image); } ( "!" t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -527,7 +527,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )* "/" t= /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Tue Aug 12 08:47:10 2014 -0300 @@ -213,7 +213,7 @@ t= { jjtThis.name.append(t.image); } ( "." t= - {jjtThis.name.append( "." + t.image); } + {jjtThis.name.append( '.').append(t.image); } )* } @@ -228,7 +228,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* } @@ -253,7 +253,7 @@ {jjtThis.address.append(t.image); } ( "!" t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* } @@ -267,7 +267,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* "/" t= {jjtThis.mask = t.image; } } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 12 08:47:10 2014 -0300 @@ -99,7 +99,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java --- a/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 12 08:47:10 2014 -0300 @@ -479,10 +479,10 @@ */ public String printMessage() { StringBuilder sb = new StringBuilder(); - sb.append("msgId : " + msgId + "\n"); - sb.append("msgMaxSize : " + msgMaxSize + "\n"); - sb.append("msgFlags : " + msgFlags + "\n"); - sb.append("msgSecurityModel : " + msgSecurityModel + "\n"); + sb.append("msgId : ").append(msgId).append('\n'); + sb.append("msgMaxSize : ").append(msgMaxSize).append('\n'); + sb.append("msgFlags : ").append(msgFlags).append('\n'); + sb.append("msgSecurityModel : ").append(msgSecurityModel).append('\n'); if (contextEngineId == null) { sb.append("contextEngineId : null"); diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java --- a/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 12 08:47:10 2014 -0300 @@ -256,7 +256,7 @@ private static String stringifyComponent(NameComponent comp) { StringBuilder one = new StringBuilder(escape(comp.id)); if (comp.kind != null && !comp.kind.equals("")) { - one.append(kindSeparator + escape(comp.kind)); + one.append(kindSeparator).append(escape(comp.kind)); } if (one.length() == 0) { return ""+kindSeparator; // if neither id nor kind specified diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java --- a/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 12 08:47:10 2014 -0300 @@ -90,7 +90,7 @@ if (selected == -1) { StringBuilder allChoices = new StringBuilder(); for (int j = 0; j < choices.length; j++) { - allChoices.append(choices[j] + ","); + allChoices.append(choices[j]).append(','); } throw new IOException("Cannot match " + "'java.naming.security.sasl.realm' property value, '" + diff -r dde9f5cfde5f src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java --- a/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 12 08:47:10 2014 -0300 @@ -167,9 +167,9 @@ for (int i = 0; i < allchannelnames.length; i++) { if ((channelmask & m) != 0L) { if (i < channelnames.length) { - sb.append(channelnames[i] + " "); + sb.append(channelnames[i]).append(' '); } else { - sb.append(allchannelnames[i] + " "); + sb.append(allchannelnames[i]).append(' '); } } m *= 2L; diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 12 08:47:10 2014 -0300 @@ -235,14 +235,15 @@ String nodeName = att.getNodeName(); if ((nodeName.equals("xmlns") || nodeName.startsWith("xmlns:")) && !storedNamespaces.containsKey(att.getNodeName())) { - sb.append(" " + nodeName + "=\"" + att.getNodeValue() + "\""); + sb.append(' ').append(nodeName).append("=\"") + .append(att.getNodeValue()).append('"'); storedNamespaces.put(nodeName, att.getNodeValue()); } } } wk = wk.getParentNode(); } - sb.append(">" + source + ""); + sb.append('>').append(source).append(""); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 12 08:47:10 2014 -0300 @@ -85,7 +85,7 @@ if (prefix.equals("xmlns")) { sb.append("#default "); } else { - sb.append(prefix + " "); + sb.append(prefix).append(' '); } } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 12 08:47:10 2014 -0300 @@ -88,7 +88,7 @@ l += countQuotes(DN, j, k); if ((k > 0) && (DN.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseRDN(DN.substring(i, k).trim(), toXml) + ","); + sb.append(parseRDN(DN.substring(i, k).trim(), toXml)).append(','); i = k + 1; l = 0; @@ -121,7 +121,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseATAV(trim(str.substring(i, k)), toXml) + "+"); + sb.append(parseATAV(trim(str.substring(i, k)), toXml)).append('+'); i = k + 1; l = 0; @@ -369,7 +369,7 @@ int k; for (int j = 0; (k = string.indexOf("\\20", j)) >= 0; j = k + 3) { - sb.append(trim(string.substring(i, k)) + "\\ "); + sb.append(trim(string.substring(i, k))).append("\\ "); i = k + 3; } @@ -418,7 +418,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(trim(str.substring(i, k)) + replace); + sb.append(trim(str.substring(i, k))).append(replace); i = k + 1; l = 0; diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/CramMD5Base.java --- a/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 12 08:47:10 2014 -0300 @@ -196,8 +196,7 @@ for (i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java --- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 12 08:47:10 2014 -0300 @@ -391,8 +391,7 @@ for (int i = 0; i < digest.length; i ++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0"+ - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/ParseException.java --- a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 12 08:47:10 2014 -0300 @@ -198,7 +198,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java --- a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 12 08:47:10 2014 -0300 @@ -107,7 +107,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java --- a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 12 08:47:10 2014 -0300 @@ -338,10 +338,10 @@ if (classpath.isEmpty()) { String envcp = System.getProperty("env.class.path"); if ((envcp != null) && (envcp.length() > 0)) { - munged.append(" -classpath " + envcp); + munged.append(" -classpath ").append(envcp); } } else { - munged.append(" -classpath " + classpath.asString()); + munged.append(" -classpath ").append(classpath.asString()); } return munged.toString(); } else { @@ -349,14 +349,4 @@ } } - private String appendPath(String path1, String path2) { - if (path1 == null || path1.length() == 0) { - return path2 == null ? "." : path2; - } else if (path2 == null || path2.length() == 0) { - return path1; - } else { - return path1 + File.pathSeparator + path2; - } - } - } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 12 08:47:10 2014 -0300 @@ -346,12 +346,12 @@ public String valueString(boolean bigLimit) { // Char arrays deserve special treatment - StringBuffer result; + StringBuilder result; byte[] value = getValue(); int max = value.length; byte elementSignature = getElementType(); if (elementSignature == 'C') { - result = new StringBuffer(); + result = new StringBuilder(); for (int i = 0; i < value.length; ) { char val = charAt(i, value); result.append(val); @@ -362,7 +362,7 @@ if (bigLimit) { limit = 1000; } - result = new StringBuffer("{"); + result = new StringBuilder("{"); int num = 0; for (int i = 0; i < value.length; ) { if (num > 0) { @@ -386,37 +386,37 @@ } case 'B': { int val = 0xFF & byteAt(i, value); - result.append("0x" + Integer.toString(val, 16)); + result.append("0x").append(Integer.toString(val, 16)); i++; break; } case 'S': { short val = shortAt(i, value); i += 2; - result.append("" + val); + result.append(val); break; } case 'I': { int val = intAt(i, value); i += 4; - result.append("" + val); + result.append(val); break; } case 'J': { // long long val = longAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } case 'F': { float val = floatAt(i, value); - result.append("" + val); + result.append(val); i += 4; break; } case 'D': { // double double val = doubleAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } @@ -425,7 +425,7 @@ } } } - result.append("}"); + result.append('}'); } return result.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/util/Misc.java --- a/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 12 08:47:10 2014 -0300 @@ -97,11 +97,11 @@ } else if (ch == '&') { sb.append("&"); } else if (ch < ' ') { - sb.append("&#" + Integer.toString(ch) + ";"); + sb.append("&#").append(Integer.toString(ch)).append(';'); } else { int c = (ch & 0xFFFF); if (c > 127) { - sb.append("&#" + Integer.toString(c) + ";"); + sb.append("&#").append(Integer.toString(c)).append(';'); } else { sb.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java --- a/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 12 08:47:10 2014 -0300 @@ -881,12 +881,12 @@ } else if (tag == JDWP.TypeTag.ARRAY) { sb.append("ArrayType"); } else { - sb.append("UNKNOWN TAG: " + tag); + sb.append("UNKNOWN TAG: ").append(tag); } if (signature != null) { - sb.append(", signature='" + signature + "'"); + sb.append(", signature='").append(signature).append('\''); } - sb.append(", id=" + id); + sb.append(", id=").append(id); vm.printTrace(sb.toString()); } if (id == 0) { -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/lang/management/MemoryUsage.java --- a/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 12 08:47:10 2014 -0300 @@ -237,13 +237,16 @@ * Returns a descriptive representation of this memory usage. */ public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append("init = " + init + "(" + (init >> 10) + "K) "); - buf.append("used = " + used + "(" + (used >> 10) + "K) "); - buf.append("committed = " + committed + "(" + - (committed >> 10) + "K) " ); - buf.append("max = " + max + "(" + (max >> 10) + "K)"); - return buf.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("init = ").append(init).append('(').append(init >> 10) + .append("K) "); + sb.append("used = ").append(used).append('(').append(used >> 10) + .append("K) "); + sb.append("committed = ").append(committed).append('(') + .append(committed >> 10).append("K) "); + sb.append("max = ").append(max).append('(').append(max >> 10) + .append("K)"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/java/lang/management/ThreadInfo.java --- a/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 12 08:47:10 2014 -0300 @@ -579,15 +579,17 @@ * @return a string representation of this thread info. */ public String toString() { - StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" + - " Id=" + getThreadId() + " " + - getThreadState()); + StringBuilder sb = new StringBuilder(); + sb.append('"').append(getThreadName()).append('"') + .append(" Id=").append(getThreadId()).append(' ') + .append(getThreadState()); + if (getLockName() != null) { - sb.append(" on " + getLockName()); + sb.append(" on ").append(getLockName()); } if (getLockOwnerName() != null) { - sb.append(" owned by \"" + getLockOwnerName() + - "\" Id=" + getLockOwnerId()); + sb.append(" owned by \"").append(getLockOwnerName()) + .append("\" Id=").append(getLockOwnerId()); } if (isSuspended()) { sb.append(" (suspended)"); @@ -599,21 +601,21 @@ int i = 0; for (; i < stackTrace.length && i < MAX_FRAMES; i++) { StackTraceElement ste = stackTrace[i]; - sb.append("\tat " + ste.toString()); + sb.append("\tat ").append(ste.toString()); sb.append('\n'); if (i == 0 && getLockInfo() != null) { Thread.State ts = getThreadState(); switch (ts) { case BLOCKED: - sb.append("\t- blocked on " + getLockInfo()); + sb.append("\t- blocked on ").append(getLockInfo()); sb.append('\n'); break; case WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; case TIMED_WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; default: @@ -622,7 +624,7 @@ for (MonitorInfo mi : lockedMonitors) { if (mi.getLockedStackDepth() == i) { - sb.append("\t- locked " + mi); + sb.append("\t- locked ").append(mi); sb.append('\n'); } } @@ -634,10 +636,10 @@ LockInfo[] locks = getLockedSynchronizers(); if (locks.length > 0) { - sb.append("\n\tNumber of locked synchronizers = " + locks.length); + sb.append("\n\tNumber of locked synchronizers = ").append(locks.length); sb.append('\n'); for (LockInfo li : locks) { - sb.append("\t- " + li); + sb.append("\t- ").append(li); sb.append('\n'); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/rmi/dgc/VMID.java --- a/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 12 08:47:10 2014 -0300 @@ -124,8 +124,7 @@ if (addr != null) for (int i = 0; i < addr.length; ++ i) { int x = addr[i] & 0xFF; - sb.append((x < 0x10 ? "0" : "") + - Integer.toString(x, 16)); + sb.append(x < 0x10 ? "0" : "").append(Integer.toString(x, 16)); } sb.append(':'); sb.append(uid.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/security/CodeSigner.java --- a/src/share/classes/java/security/CodeSigner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSigner.java Tue Aug 12 08:47:10 2014 -0300 @@ -156,9 +156,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("Signer: " + signerCertPath.getCertificates().get(0)); + sb.append("Signer: ").append(signerCertPath.getCertificates().get(0)); if (timestamp != null) { - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); } sb.append(")"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/java/security/CodeSource.java --- a/src/share/classes/java/security/CodeSource.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSource.java Tue Aug 12 08:47:10 2014 -0300 @@ -468,12 +468,12 @@ if (this.certs != null && this.certs.length > 0) { for (int i = 0; i < this.certs.length; i++) { - sb.append( " " + this.certs[i]); + sb.append(' ').append(this.certs[i]); } } else if (this.signers != null && this.signers.length > 0) { for (int i = 0; i < this.signers.length; i++) { - sb.append( " " + this.signers[i]); + sb.append(' ').append(this.signers[i]); } } else { sb.append(" "); diff -r dde9f5cfde5f src/share/classes/java/security/KeyStore.java --- a/src/share/classes/java/security/KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/KeyStore.java Tue Aug 12 08:47:10 2014 -0300 @@ -610,8 +610,8 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Private key entry and certificate chain with " - + chain.length + " elements:\r\n"); + sb.append("Private key entry and certificate chain with ") + .append(chain.length).append(" elements:\r\n"); for (Certificate cert : chain) { sb.append(cert); sb.append("\r\n"); diff -r dde9f5cfde5f src/share/classes/java/security/PermissionCollection.java --- a/src/share/classes/java/security/PermissionCollection.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/PermissionCollection.java Tue Aug 12 08:47:10 2014 -0300 @@ -179,13 +179,13 @@ public String toString() { Enumeration enum_ = elements(); StringBuilder sb = new StringBuilder(); - sb.append(super.toString()+" (\n"); + sb.append(super.toString()).append(" (\n"); while (enum_.hasMoreElements()) { try { - sb.append(" "); + sb.append(' '); sb.append(enum_.nextElement().toString()); - sb.append("\n"); - } catch (NoSuchElementException e){ + sb.append('\n'); + } catch (NoSuchElementException e) { // ignore } } diff -r dde9f5cfde5f src/share/classes/java/security/ProtectionDomain.java --- a/src/share/classes/java/security/ProtectionDomain.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/ProtectionDomain.java Tue Aug 12 08:47:10 2014 -0300 @@ -285,34 +285,32 @@ /** * Convert a ProtectionDomain to a String. */ - @Override public String toString() { + @Override + public String toString() { String pals = ""; if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + StringBuilder palBuilder = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); - if (i < principals.length-1) - palBuf.append(",\n"); - else - palBuf.append(")\n"); + palBuilder.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); + if (i < principals.length - 1) { + palBuilder.append(",\n"); + } else { + palBuilder.append(")\n"); + } } - pals = palBuf.toString(); + pals = palBuilder.toString(); } // Check if policy is set; we don't want to load // the policy prematurely here - PermissionCollection pc = Policy.isSet() && seeAllp() ? - mergePermissions(): - getPermissions(); + PermissionCollection pc = Policy.isSet() && seeAllp() ? mergePermissions() + : getPermissions(); - return "ProtectionDomain "+ - " "+codesource+"\n"+ - " "+classloader+"\n"+ - " "+pals+"\n"+ - " "+pc+"\n"; + return "ProtectionDomain " + " " + codesource + "\n" + " " + + classloader + "\n" + " " + pals + "\n" + " " + pc + "\n"; } /** diff -r dde9f5cfde5f src/share/classes/java/security/Timestamp.java --- a/src/share/classes/java/security/Timestamp.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/Timestamp.java Tue Aug 12 08:47:10 2014 -0300 @@ -143,10 +143,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); List certs = signerCertPath.getCertificates(); if (!certs.isEmpty()) { - sb.append("TSA: " + certs.get(0)); + sb.append("TSA: ").append(certs.get(0)); } else { sb.append("TSA: "); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CertPath.java --- a/src/share/classes/java/security/cert/CertPath.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CertPath.java Tue Aug 12 08:47:10 2014 -0300 @@ -221,20 +221,16 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - Iterator stringIterator = - getCertificates().iterator(); - sb.append("\n" + type + " Cert Path: length = " - + getCertificates().size() + ".\n"); - sb.append("[\n"); + sb.append('\n').append(type).append(" Cert Path: length = ") + .append(getCertificates().size()).append(".\n").append("[\n"); int i = 1; - while (stringIterator.hasNext()) { + for (Certificate stringCert : getCertificates()) { sb.append("==========================================" - + "===============Certificate " + i + " start.\n"); - Certificate stringCert = stringIterator.next(); + + "===============Certificate ").append(i).append(" start.\n"); sb.append(stringCert.toString()); sb.append("\n========================================" - + "=================Certificate " + i + " end.\n\n\n"); + + "=================Certificate ").append(i).append(" end.\n\n\n"); i++; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CollectionCertStoreParameters.java --- a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 12 08:47:10 2014 -0300 @@ -134,8 +134,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CollectionCertStoreParameters: [\n"); - sb.append(" collection: " + coll + "\n"); - sb.append("]"); + sb.append(" collection: ").append(coll).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/LDAPCertStoreParameters.java --- a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 12 08:47:10 2014 -0300 @@ -141,9 +141,9 @@ StringBuilder sb = new StringBuilder(); sb.append("LDAPCertStoreParameters: [\n"); - sb.append(" serverName: " + serverName + "\n"); - sb.append(" port: " + port + "\n"); - sb.append("]"); + sb.append(" serverName: ").append(serverName).append('\n'); + sb.append(" port: ").append(port).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXBuilderParameters.java --- a/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 12 08:47:10 2014 -0300 @@ -192,7 +192,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Maximum Path Length: " + maxPathLength + "\n"); + sb.append(" Maximum Path Length: ").append(maxPathLength).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 12 08:47:10 2014 -0300 @@ -109,11 +109,13 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathBuilderResult: [\n"); - sb.append(" Certification Path: " + certPath + "\n"); - sb.append(" Trust Anchor: " + getTrustAnchor().toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(getPolicyTree()) + "\n"); - sb.append(" Subject Public Key: " + getPublicKey() + "\n"); - sb.append("]"); + sb.append(" Certification Path: ").append(certPath).append('\n'); + sb.append(" Trust Anchor: ").append(getTrustAnchor().toString()) + .append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(getPolicyTree())) + .append('\n'); + sb.append(" Subject Public Key: ").append(getPublicKey()).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 12 08:47:10 2014 -0300 @@ -150,10 +150,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathValidatorResult: [\n"); - sb.append(" Trust Anchor: " + trustAnchor.toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(policyTree) + "\n"); - sb.append(" Subject Public Key: " + subjectPublicKey + "\n"); - sb.append("]"); + sb.append(" Trust Anchor: ").append(trustAnchor.toString()).append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(policyTree)).append('\n'); + sb.append(" Subject Public Key: ").append(subjectPublicKey).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXParameters.java --- a/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 12 08:47:10 2014 -0300 @@ -698,8 +698,8 @@ /* start with trusted anchor info */ if (unmodTrustAnchors != null) { - sb.append(" Trust Anchors: " + unmodTrustAnchors.toString() - + "\n"); + sb.append(" Trust Anchors: ").append(unmodTrustAnchors.toString()) + .append('\n'); } /* now, append initial state information */ @@ -707,30 +707,41 @@ if (unmodInitialPolicies.isEmpty()) { sb.append(" Initial Policy OIDs: any\n"); } else { - sb.append(" Initial Policy OIDs: [" - + unmodInitialPolicies.toString() + "]\n"); + sb.append(" Initial Policy OIDs: [") + .append(unmodInitialPolicies.toString()).append("]\n"); } } /* now, append constraints on all certificates in the path */ - sb.append(" Validity Date: " + String.valueOf(date) + "\n"); - sb.append(" Signature Provider: " + String.valueOf(sigProvider) + "\n"); - sb.append(" Default Revocation Enabled: " + revocationEnabled + "\n"); - sb.append(" Explicit Policy Required: " + explicitPolicyRequired + "\n"); - sb.append(" Policy Mapping Inhibited: " + policyMappingInhibited + "\n"); - sb.append(" Any Policy Inhibited: " + anyPolicyInhibited + "\n"); - sb.append(" Policy Qualifiers Rejected: " + policyQualifiersRejected + "\n"); + sb.append(" Validity Date: ").append(String.valueOf(date)) + .append('\n'); + sb.append(" Signature Provider: ").append(String.valueOf(sigProvider)) + .append('\n'); + sb.append(" Default Revocation Enabled: ").append(revocationEnabled) + .append('\n'); + sb.append(" Explicit Policy Required: ") + .append(explicitPolicyRequired).append('\n'); + sb.append(" Policy Mapping Inhibited: ") + .append(policyMappingInhibited).append('\n'); + sb.append(" Any Policy Inhibited: ").append(anyPolicyInhibited) + .append('\n'); + sb.append(" Policy Qualifiers Rejected: ") + .append(policyQualifiersRejected).append('\n'); /* now, append target cert requirements */ - sb.append(" Target Cert Constraints: " + String.valueOf(certSelector) + "\n"); + sb.append(" Target Cert Constraints: ") + .append(String.valueOf(certSelector)).append('\n'); /* finally, append miscellaneous parameters */ - if (certPathCheckers != null) - sb.append(" Certification Path Checkers: [" - + certPathCheckers.toString() + "]\n"); - if (certStores != null) - sb.append(" CertStores: [" + certStores.toString() + "]\n"); - sb.append("]"); + if (certPathCheckers != null) { + sb.append(" Certification Path Checkers: [") + .append(certPathCheckers.toString()).append("]\n"); + } + if (certStores != null) { + sb.append(" CertStores: [").append(certStores.toString()) + .append("]\n"); + } + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PolicyQualifierInfo.java --- a/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 12 08:47:10 2014 -0300 @@ -158,15 +158,17 @@ * {@code PolicyQualifierInfo} */ public String toString() { - if (pqiString != null) + if (pqiString != null) { return pqiString; + } HexDumpEncoder enc = new HexDumpEncoder(); StringBuilder sb = new StringBuilder(); sb.append("PolicyQualifierInfo: [\n"); - sb.append(" qualifierID: " + mId + "\n"); - sb.append(" qualifier: " + - (mData == null ? "null" : enc.encodeBuffer(mData)) + "\n"); - sb.append("]"); + sb.append(" qualifierID: ").append(mId).append('\n'); + sb.append(" qualifier: ") + .append(mData == null ? "null" : enc.encodeBuffer(mData)) + .append('\n'); + sb.append(']'); pqiString = sb.toString(); return pqiString; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/TrustAnchor.java --- a/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 12 08:47:10 2014 -0300 @@ -320,14 +320,18 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); if (pubKey != null) { - sb.append(" Trusted CA Public Key: " + pubKey.toString() + "\n"); - sb.append(" Trusted CA Issuer Name: " - + String.valueOf(caName) + "\n"); + sb.append(" Trusted CA Public Key: ").append(pubKey.toString()) + .append('\n'); + sb.append(" Trusted CA Issuer Name: ") + .append(String.valueOf(caName)).append('\n'); } else { - sb.append(" Trusted CA cert: " + trustedCert.toString() + "\n"); + sb.append(" Trusted CA cert: ").append(trustedCert.toString()) + .append('\n'); } - if (nc != null) - sb.append(" Name Constraints: " + nc.toString() + "\n"); + if (nc != null) { + sb.append(" Name Constraints: ").append(nc.toString()) + .append('\n'); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CRLSelector.java --- a/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 12 08:47:10 2014 -0300 @@ -572,17 +572,17 @@ sb.append(" IssuerNames:\n"); Iterator i = issuerNames.iterator(); while (i.hasNext()) - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } if (minCRL != null) - sb.append(" minCRLNumber: " + minCRL + "\n"); + sb.append(" minCRLNumber: ").append(minCRL).append('\n'); if (maxCRL != null) - sb.append(" maxCRLNumber: " + maxCRL + "\n"); + sb.append(" maxCRLNumber: ").append(maxCRL).append('\n'); if (dateAndTime != null) - sb.append(" dateAndTime: " + dateAndTime + "\n"); + sb.append(" dateAndTime: ").append(dateAndTime).append('\n'); if (certChecking != null) - sb.append(" Certificate being checked: " + certChecking + "\n"); - sb.append("]"); + sb.append(" Certificate being checked: ").append(certChecking).append('\n'); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CertSelector.java --- a/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 12 08:47:10 2014 -0300 @@ -1814,72 +1814,75 @@ StringBuilder sb = new StringBuilder(); sb.append("X509CertSelector: [\n"); if (x509Cert != null) { - sb.append(" Certificate: " + x509Cert.toString() + "\n"); + sb.append(" Certificate: ").append(x509Cert.toString()) + .append('\n'); } if (serialNumber != null) { - sb.append(" Serial Number: " + serialNumber.toString() + "\n"); + sb.append(" Serial Number: ").append(serialNumber.toString()) + .append('\n'); } if (issuer != null) { - sb.append(" Issuer: " + getIssuerAsString() + "\n"); + sb.append(" Issuer: ").append(getIssuerAsString()).append('\n'); } if (subject != null) { - sb.append(" Subject: " + getSubjectAsString() + "\n"); + sb.append(" Subject: ").append(getSubjectAsString()).append('\n'); } - sb.append(" matchAllSubjectAltNames flag: " - + String.valueOf(matchAllSubjectAltNames) + "\n"); + sb.append(" matchAllSubjectAltNames flag: ") + .append(String.valueOf(matchAllSubjectAltNames)).append('\n'); if (subjectAlternativeNames != null) { sb.append(" SubjectAlternativeNames:\n"); Iterator> i = subjectAlternativeNames.iterator(); while (i.hasNext()) { List list = i.next(); - sb.append(" type " + list.get(0) + - ", name " + list.get(1) + "\n"); + sb.append(" type ").append(list.get(0)).append(", name ") + .append(list.get(1)).append('\n'); } } if (subjectKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Subject Key Identifier: " + - enc.encodeBuffer(subjectKeyID) + "\n"); + sb.append(" Subject Key Identifier: ") + .append(enc.encodeBuffer(subjectKeyID)).append('\n'); } if (authorityKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Authority Key Identifier: " + - enc.encodeBuffer(authorityKeyID) + "\n"); + sb.append(" Authority Key Identifier: ") + .append(enc.encodeBuffer(authorityKeyID)).append('\n'); } if (certificateValid != null) { - sb.append(" Certificate Valid: " + - certificateValid.toString() + "\n"); + sb.append(" Certificate Valid: ") + .append(certificateValid.toString()).append('\n'); } if (privateKeyValid != null) { - sb.append(" Private Key Valid: " + - privateKeyValid.toString() + "\n"); + sb.append(" Private Key Valid: ") + .append(privateKeyValid.toString()).append('\n'); } if (subjectPublicKeyAlgID != null) { - sb.append(" Subject Public Key AlgID: " + - subjectPublicKeyAlgID.toString() + "\n"); + sb.append(" Subject Public Key AlgID: ") + .append(subjectPublicKeyAlgID.toString()).append('\n'); } if (subjectPublicKey != null) { - sb.append(" Subject Public Key: " + - subjectPublicKey.toString() + "\n"); + sb.append(" Subject Public Key: ") + .append(subjectPublicKey.toString()).append('\n'); } if (keyUsage != null) { - sb.append(" Key Usage: " + keyUsageToString(keyUsage) + "\n"); + sb.append(" Key Usage: ").append(keyUsageToString(keyUsage)) + .append('\n'); } if (keyPurposeSet != null) { - sb.append(" Extended Key Usage: " + - keyPurposeSet.toString() + "\n"); + sb.append(" Extended Key Usage: ") + .append(keyPurposeSet.toString()).append('\n'); } if (policy != null) { - sb.append(" Policy: " + policy.toString() + "\n"); + sb.append(" Policy: ").append(policy.toString()).append('\n'); } if (pathToGeneralNames != null) { sb.append(" Path to names:\n"); Iterator i = pathToGeneralNames.iterator(); while (i.hasNext()) { - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/text/ChoiceFormat.java --- a/src/share/classes/java/text/ChoiceFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/text/ChoiceFormat.java Tue Aug 12 08:47:11 2014 -0300 @@ -272,7 +272,7 @@ double tryLess = Math.abs(Math.IEEEremainder(less, 1.0d)); if (tryLessOrEqual < tryLess) { - result.append(""+choiceLimits[i]); + result.append(choiceLimits[i]); result.append('#'); } else { if (choiceLimits[i] == Double.POSITIVE_INFINITY) { @@ -280,7 +280,7 @@ } else if (choiceLimits[i] == Double.NEGATIVE_INFINITY) { result.append("-\u221E"); } else { - result.append(""+less); + result.append(less); } result.append('<'); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/util/Scanner.java --- a/src/share/classes/java/util/Scanner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/Scanner.java Tue Aug 12 08:47:11 2014 -0300 @@ -1304,20 +1304,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.Scanner"); - sb.append("[delimiters=" + delimPattern + "]"); - sb.append("[position=" + position + "]"); - sb.append("[match valid=" + matchValid + "]"); - sb.append("[need input=" + needInput + "]"); - sb.append("[source closed=" + sourceClosed + "]"); - sb.append("[skipped=" + skipped + "]"); - sb.append("[group separator=" + groupSeparator + "]"); - sb.append("[decimal separator=" + decimalSeparator + "]"); - sb.append("[positive prefix=" + positivePrefix + "]"); - sb.append("[negative prefix=" + negativePrefix + "]"); - sb.append("[positive suffix=" + positiveSuffix + "]"); - sb.append("[negative suffix=" + negativeSuffix + "]"); - sb.append("[NaN string=" + nanString + "]"); - sb.append("[infinity string=" + infinityString + "]"); + sb.append("[delimiters=").append(delimPattern).append(']'); + sb.append("[position=").append(position).append(']'); + sb.append("[match valid=").append(matchValid).append(']'); + sb.append("[need input=").append(needInput).append(']'); + sb.append("[source closed=").append(sourceClosed).append(']'); + sb.append("[skipped=").append(skipped).append(']'); + sb.append("[group separator=").append(groupSeparator).append(']'); + sb.append("[decimal separator=").append(decimalSeparator).append(']'); + sb.append("[positive prefix=").append(positivePrefix).append(']'); + sb.append("[negative prefix=").append(negativePrefix).append(']'); + sb.append("[positive suffix=").append(positiveSuffix).append(']'); + sb.append("[negative suffix=").append(negativeSuffix).append(']'); + sb.append("[NaN string=").append(nanString).append(']'); + sb.append("[infinity string=").append(infinityString).append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Matcher.java --- a/src/share/classes/java/util/regex/Matcher.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Matcher.java Tue Aug 12 08:47:11 2014 -0300 @@ -1295,14 +1295,14 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.regex.Matcher"); - sb.append("[pattern=" + pattern()); + sb.append("[pattern=").append(pattern()); sb.append(" region="); - sb.append(regionStart() + "," + regionEnd()); + sb.append(regionStart()).append(',').append(regionEnd()); sb.append(" lastmatch="); if ((first >= 0) && (group() != null)) { sb.append(group()); } - sb.append("]"); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Pattern.java --- a/src/share/classes/java/util/regex/Pattern.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Pattern.java Tue Aug 12 08:47:11 2014 -0300 @@ -1488,10 +1488,10 @@ for(int x=0; x0) - result.append("|"+next); + result.append('|').append(next); next = composeOneStep(next); if (next != null) - result.append("|"+produceEquivalentAlternation(next)); + result.append('|').append(produceEquivalentAlternation(next)); } return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/management/MBeanPermission.java --- a/src/share/classes/javax/management/MBeanPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/MBeanPermission.java Tue Aug 12 08:47:11 2014 -0300 @@ -455,11 +455,11 @@ name.append(className); if (member == null) member = "-"; - name.append("#" + member); + name.append('#').append(member); if (objectName == null) name.append("[-]"); else - name.append("[").append(objectName.getCanonicalName()).append("]"); + name.append('[').append(objectName.getCanonicalName()).append(']'); /* In the interests of legibility for Permission.toString(), we transform the empty string into "*". */ diff -r dde9f5cfde5f src/share/classes/javax/management/modelmbean/RequiredModelMBean.java --- a/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 12 08:47:11 2014 -0300 @@ -716,15 +716,14 @@ } retStr.append("\nMBeanInfo for ModelMBean is:"); - retStr.append("\nCLASSNAME: \t"+ info.getClassName()); - retStr.append("\nDESCRIPTION: \t"+ info.getDescription()); + retStr.append("\nCLASSNAME: \t").append(info.getClassName()); + retStr.append("\nDESCRIPTION: \t").append(info.getDescription()); try { - retStr.append("\nMBEAN DESCRIPTOR: \t"+ - info.getMBeanDescriptor()); + retStr.append("\nMBEAN DESCRIPTOR: \t").append(info.getMBeanDescriptor()); } catch (Exception e) { - retStr.append("\nMBEAN DESCRIPTOR: \t" + " is invalid"); + retStr.append("\nMBEAN DESCRIPTOR: \t is invalid"); } retStr.append("\nATTRIBUTES"); @@ -734,13 +733,12 @@ for (int i=0; i objNameIter = objectNameList.iterator(); - objNameIter.hasNext();) { + StringBuilder sb = new StringBuilder(); + sb.append("role name: ").append(name).append("; role value: "); + for (Iterator objNameIter = objectNameList.iterator(); objNameIter + .hasNext();) { ObjectName currObjName = objNameIter.next(); - result.append(currObjName.toString()); + sb.append(currObjName.toString()); if (objNameIter.hasNext()) { - result.append(", "); + sb.append(", "); } } - return result.toString(); + return sb.toString(); } // diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleInfo.java --- a/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 12 08:47:11 2014 -0300 @@ -456,13 +456,13 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role info name: " + name); - result.append("; isReadable: " + isReadable); - result.append("; isWritable: " + isWritable); - result.append("; description: " + description); - result.append("; minimum degree: " + minDegree); - result.append("; maximum degree: " + maxDegree); - result.append("; MBean class: " + referencedMBeanClassName); + result.append("role info name: ").append(name); + result.append("; isReadable: ").append(isReadable); + result.append("; isWritable: ").append(isWritable); + result.append("; description: ").append(description); + result.append("; minimum degree: ").append(minDegree); + result.append("; maximum degree: ").append(maxDegree); + result.append("; MBean class: ").append(referencedMBeanClassName); return result.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleUnresolved.java --- a/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 12 08:47:11 2014 -0300 @@ -282,7 +282,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + roleName); + result.append("role name: ").append(roleName); if (roleValue != null) { result.append("; value: "); for (Iterator objNameIter = roleValue.iterator(); @@ -294,7 +294,7 @@ } } } - result.append("; problem type: " + problemType); + result.append("; problem type: ").append(problemType); return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/crypto/CryptoPermission.java --- a/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 12 08:47:11 2014 -0300 @@ -369,22 +369,24 @@ * @return information about this CryptoPermission. */ public String toString() { - StringBuilder buf = new StringBuilder(100); - buf.append("(CryptoPermission " + alg + " " + maxKeySize); + StringBuilder sb = new StringBuilder(100); + sb.append("(CryptoPermission ").append(alg).append(' ') + .append(maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { - buf.append(" , effective " + - ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits()); + sb.append(" , effective ") + .append(((RC2ParameterSpec) algParamSpec) + .getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { - buf.append(" , rounds " + - ((RC5ParameterSpec)algParamSpec).getRounds()); + sb.append(" , rounds ").append( + ((RC5ParameterSpec) algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL - buf.append(" " + exemptionMechanism); + sb.append(' ').append(exemptionMechanism); } - buf.append(")"); - return buf.toString(); + sb.append(')'); + return sb.toString(); } private boolean impliesExemptionMechanism(String exemptionMechanism) { -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/naming/BinaryRefAddr.java --- a/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 12 08:47:11 2014 -0300 @@ -165,11 +165,11 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Address Type: " + addrType + "\n"); - + StringBuilder str = new StringBuilder(); + str.append("Address Type: ").append(addrType).append('\n'); str.append("AddressContents: "); for (int i = 0; i= 32) str.append(" ...\n"); diff -r dde9f5cfde5f src/share/classes/javax/naming/NameImpl.java --- a/src/share/classes/javax/naming/NameImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/NameImpl.java Tue Aug 12 08:47:11 2014 -0300 @@ -170,7 +170,7 @@ endQuote = one ? syntaxEndQuote1 : syntaxEndQuote2; i += syntaxTypevalSeparator.length(); - answer.append(syntaxTypevalSeparator+beginQuote); // add back + answer.append(syntaxTypevalSeparator).append(beginQuote); // add back // consume string until matching quote for (i += beginQuote.length(); diff -r dde9f5cfde5f src/share/classes/javax/naming/RefAddr.java --- a/src/share/classes/javax/naming/RefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/RefAddr.java Tue Aug 12 08:47:11 2014 -0300 @@ -139,9 +139,9 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Type: " + addrType + "\n"); - - str.append("Content: " + getContent() + "\n"); + StringBuilder str = new StringBuilder(); + str.append("Type: ").append(addrType).append('\n'); + str.append("Content: ").append(getContent()).append('\n'); return (str.toString()); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/security/auth/kerberos/KerberosTicket.java --- a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 12 08:47:11 2014 -0300 @@ -651,8 +651,7 @@ StringBuilder caddrString = new StringBuilder(); if (clientAddresses != null) { for (int i = 0; i < clientAddresses.length; i++) { - caddrString.append("clientAddresses[" + i + "] = " + - clientAddresses[i].toString()); + caddrString.append("clientAddresses[").append(i).append("] = ").append(clientAddresses[i].toString()); } } return ("Ticket (hex) = " + "\n" + -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/AudioFileFormat.java --- a/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 12 08:47:11 2014 -0300 @@ -272,26 +272,25 @@ @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder sb = new StringBuilder(); //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() throws unexpected NullPointerException if (type != null) { - buf.append(type.toString() + " (." + type.getExtension() + ") file"); + sb.append(type.toString()).append(" (.").append(type.getExtension()).append(") file"); } else { - buf.append("unknown file format"); + sb.append("unknown file format"); } if (byteLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", byte length: " + byteLength); + sb.append(", byte length: ").append(byteLength); } - buf.append(", data format: " + format); + sb.append(", data format: ").append(format); if (frameLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", frame length: " + frameLength); + sb.append(", frame length: ").append(frameLength); } - - return new String(buf); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/DataLine.java --- a/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 12 08:47:11 2014 -0300 @@ -473,17 +473,21 @@ StringBuilder sb = new StringBuilder(); if ( (formats.length == 1) && (formats[0] != null) ) { - sb.append(" supporting format " + formats[0]); + sb.append(" supporting format ").append(formats[0]); } else if (getFormats().length > 1) { - sb.append(" supporting " + getFormats().length + " audio formats"); + sb.append(" supporting ").append(getFormats().length) + .append(" audio formats"); } if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) { - sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes"); + sb.append(", and buffers of ").append(minBufferSize) + .append(" to ").append(maxBufferSize).append(" bytes"); } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) { - sb.append(", and buffers of at least " + minBufferSize + " bytes"); + sb.append(", and buffers of at least ").append(minBufferSize) + .append(" bytes"); } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) { - sb.append(", and buffers of up to " + minBufferSize + " bytes"); + sb.append(", and buffers of up to ").append(minBufferSize) + .append(" bytes"); } return new String(super.toString() + sb); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/swing/GroupLayout.java --- a/src/share/classes/javax/swing/GroupLayout.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/GroupLayout.java Tue Aug 12 08:47:12 2014 -0300 @@ -1213,15 +1213,15 @@ registerComponents(horizontalGroup, HORIZONTAL); registerComponents(verticalGroup, VERTICAL); } - StringBuffer buffer = new StringBuffer(); - buffer.append("HORIZONTAL\n"); - createSpringDescription(buffer, horizontalGroup, " ", HORIZONTAL); - buffer.append("\nVERTICAL\n"); - createSpringDescription(buffer, verticalGroup, " ", VERTICAL); - return buffer.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("HORIZONTAL\n"); + createSpringDescription(sb, horizontalGroup, " ", HORIZONTAL); + sb.append("\nVERTICAL\n"); + createSpringDescription(sb, verticalGroup, " ", VERTICAL); + return sb.toString(); } - private void createSpringDescription(StringBuffer buffer, Spring spring, + private void createSpringDescription(StringBuilder sb, Spring spring, String indent, int axis) { String origin = ""; String padding = ""; @@ -1239,20 +1239,19 @@ padding = ", userCreated=" + paddingSpring.getUserCreated() + ", matches=" + paddingSpring.getMatchDescription(); } - buffer.append(indent + spring.getClass().getName() + " " + - Integer.toHexString(spring.hashCode()) + " " + - origin + - ", size=" + spring.getSize() + - ", alignment=" + spring.getAlignment() + - " prefs=[" + spring.getMinimumSize(axis) + - " " + spring.getPreferredSize(axis) + - " " + spring.getMaximumSize(axis) + - padding + "]\n"); + sb.append(indent).append(spring.getClass().getName()).append(' ') + .append(Integer.toHexString(spring.hashCode())).append(' ') + .append(origin).append(", size=").append(spring.getSize()) + .append(", alignment=").append(spring.getAlignment()) + .append(" prefs=[").append(spring.getMinimumSize(axis)) + .append(' ').append(spring.getPreferredSize(axis)).append(' ') + .append(spring.getMaximumSize(axis)).append(padding) + .append("]\n"); if (spring instanceof Group) { List springs = ((Group)spring).springs; indent += " "; for (int counter = 0; counter < springs.size(); counter++) { - createSpringDescription(buffer, springs.get(counter), indent, + createSpringDescription(sb, springs.get(counter), indent, axis); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/JColorChooser.java --- a/src/share/classes/javax/swing/JColorChooser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/JColorChooser.java Tue Aug 12 08:47:12 2014 -0300 @@ -542,19 +542,19 @@ * * @return a string representation of this JColorChooser */ - protected String paramString() { - StringBuilder chooserPanelsString = new StringBuilder(""); - for (int i=0; i keys = keys(); - while (keys.hasMoreElements()) { - Object key = keys.nextElement(); - sb.append(key + "=" + get(key) + ", "); - } - int length = sb.length(); - if (length > 1) { - sb.delete(length-2, length); - } - sb.append("}"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("{"); + Enumeration keys = keys(); + while (keys.hasMoreElements()) { + Object key = keys.nextElement(); + sb.append(key).append('=').append(get(key)).append(", "); + } + int length = sb.length(); + if (length > 1) { + sb.delete(length - 2, length); + } + sb.append('}'); + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/RepaintManager.java --- a/src/share/classes/javax/swing/RepaintManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/RepaintManager.java Tue Aug 12 08:47:12 2014 -0300 @@ -990,10 +990,7 @@ * @return a String representation of this object */ public synchronized String toString() { - StringBuilder sb = new StringBuilder(); - if(dirtyComponents != null) - sb.append("" + dirtyComponents); - return sb.toString(); + return dirtyComponents != null ? dirtyComponents.toString() : ""; } diff -r dde9f5cfde5f src/share/classes/javax/swing/event/TreeModelEvent.java --- a/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 12 08:47:12 2014 -0300 @@ -294,21 +294,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(getClass().getName() + " " + - Integer.toString(hashCode())); + sb.append(getClass().getName()).append(' ').append(Integer.toString(hashCode())); if(path != null) - sb.append(" path " + path); + sb.append(" path ").append(path); if(childIndices != null) { sb.append(" indices [ "); for(int counter = 0; counter < childIndices.length; counter++) - sb.append(Integer.toString(childIndices[counter])+ " "); - sb.append("]"); + sb.append(Integer.toString(childIndices[counter])).append(' '); + sb.append(']'); } if(children != null) { sb.append(" children [ "); for(int counter = 0; counter < children.length; counter++) - sb.append(children[counter] + " "); - sb.append("]"); + sb.append(children[counter]).append(' '); + sb.append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 12 08:47:12 2014 -0300 @@ -1330,8 +1330,8 @@ for (Object obj : values) { String val = ((obj == null) ? "" : obj.toString()); - plainBuf.append(val + "\n"); - htmlBuf.append("
  • " + val + "\n"); + plainBuf.append(val).append('\n'); + htmlBuf.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicListUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 12 08:47:12 2014 -0300 @@ -2948,8 +2948,8 @@ for (int i = 0; i < values.length; i++) { Object obj = values[i]; String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\n"); - htmlStr.append("
  • " + val + "\n"); + plainStr.append(val).append('\n'); + htmlStr.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTableUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 12 08:47:12 2014 -0300 @@ -2230,11 +2230,11 @@ for (int col = 0; col < cols.length; col++) { Object obj = table.getValueAt(rows[row], cols[col]); String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\t"); - htmlStr.append(" " + val + "\n"); + plainStr.append(val).append('\t'); + htmlStr.append(" ").append(val).append("\n"); } // we want a newline at the end of each line and not a tab - plainStr.deleteCharAt(plainStr.length() - 1).append("\n"); + plainStr.deleteCharAt(plainStr.length() - 1).append('\t'); htmlStr.append("\n"); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 12 08:47:12 2014 -0300 @@ -3618,8 +3618,8 @@ boolean leaf = model.isLeaf(node); String label = getDisplayString(path, true, leaf); - plainStr.append(label + "\n"); - htmlStr.append("
  • " + label + "\n"); + plainStr.append(label).append('\n'); + htmlStr.append("
  • ").append(label).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java --- a/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 12 08:47:12 2014 -0300 @@ -1160,15 +1160,15 @@ rows = rowMapper.getRowsForPaths(selection); else rows = null; - sb.append(getClass().getName() + " " + hashCode() + " [ "); + sb.append(getClass().getName()).append(' ').append(hashCode()).append(" [ "); for(int counter = 0; counter < selCount; counter++) { if(rows != null) - sb.append(selection[counter].toString() + "@" + - Integer.toString(rows[counter])+ " "); + sb.append(selection[counter].toString()).append('@') + .append(Integer.toString(rows[counter])).append(' '); else - sb.append(selection[counter].toString() + " "); + sb.append(selection[counter].toString()).append(' '); } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/font/AttributeValues.java --- a/src/share/classes/sun/font/AttributeValues.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/AttributeValues.java Tue Aug 12 08:47:12 2014 -0300 @@ -542,7 +542,7 @@ } } } - b.append("[btx=" + baselineTransform + ", ctx=" + charTransform + "]"); + b.append("[btx=").append(baselineTransform).append(", ctx=").append(charTransform).append(']'); b.append('}'); return b.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/Decoration.java --- a/src/share/classes/sun/font/Decoration.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/Decoration.java Tue Aug 12 08:47:12 2014 -0300 @@ -431,12 +431,12 @@ StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); - if (fgPaint != null) sb.append("fgPaint: " + fgPaint); - if (bgPaint != null) sb.append(" bgPaint: " + bgPaint); + if (fgPaint != null) sb.append("fgPaint: ").append(fgPaint); + if (bgPaint != null) sb.append(" bgPaint: ").append(bgPaint); if (swapColors) sb.append(" swapColors: true"); if (strikethrough) sb.append(" strikethrough: true"); - if (stdUnderline != null) sb.append(" stdUnderline: " + stdUnderline); - if (imUnderline != null) sb.append(" imUnderline: " + imUnderline); + if (stdUnderline != null) sb.append(" stdUnderline: ").append(stdUnderline); + if (imUnderline != null) sb.append(" imUnderline: ").append(imUnderline); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/StandardGlyphVector.java --- a/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 12 08:47:12 2014 -0300 @@ -1894,9 +1894,9 @@ } } catch(Exception e) { - buf.append(" " + e.getMessage()); + buf.append(' ').append(e.getMessage()); } - buf.append("}"); + buf.append('}'); return buf; } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/launcher/LauncherHelper.java --- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 12 08:47:12 2014 -0300 @@ -369,10 +369,9 @@ static void appendVmErgoMessage(boolean isServerClass, String vm) { outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1", vm)); - outBuf = (isServerClass) - ? outBuf.append(",\n" + - getLocalizedMessage("java.launcher.ergo.message2") + "\n\n") - : outBuf.append(".\n\n"); + outBuf = (isServerClass) ? outBuf.append(",\n") + .append(getLocalizedMessage("java.launcher.ergo.message2")) + .append("\n\n") : outBuf.append(".\n\n"); } /** -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/management/Agent.java --- a/src/share/classes/sun/management/Agent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/Agent.java Tue Aug 12 08:47:12 2014 -0300 @@ -502,7 +502,7 @@ } else { StringBuilder message = new StringBuilder(params[0]); for (int i = 1; i < params.length; i++) { - message.append(" " + params[i]); + message.append(' ').append(params[i]); } error(key, message.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/management/MappedMXBeanType.java --- a/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 12 08:47:12 2014 -0300 @@ -289,7 +289,7 @@ if (et.isPrimitive()) { className = new StringBuilder(c.getName()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); @@ -385,7 +385,7 @@ if (elementType instanceof Class && ((Class) elementType).isPrimitive()) { className = new StringBuilder(gat.toString()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java --- a/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 12 08:47:12 2014 -0300 @@ -463,12 +463,12 @@ // --------- - private static void appendIfLiteralAddress(String addr, StringBuffer sb) { + private static void appendIfLiteralAddress(String addr, StringBuilder sb) { if (IPAddressUtil.isIPv4LiteralAddress(addr)) { - sb.append("dns://" + addr + " "); + sb.append("dns://").append(addr).append(' '); } else { if (IPAddressUtil.isIPv6LiteralAddress(addr)) { - sb.append("dns://[" + addr + "] "); + sb.append("dns://[").append(addr).append("] "); } } } @@ -478,7 +478,7 @@ * corresponding to the supplied List of nameservers. */ private static String createProviderURL(List nsList) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (String s: nsList) { appendIfLiteralAddress(s, sb); } @@ -491,7 +491,7 @@ * contained in the provided str. */ private static String createProviderURL(String str) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); StringTokenizer st = new StringTokenizer(str, ","); while (st.hasMoreTokens()) { appendIfLiteralAddress(st.nextToken(), sb); diff -r dde9f5cfde5f src/share/classes/sun/net/www/HeaderParser.java --- a/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 12 08:47:12 2014 -0300 @@ -220,21 +220,23 @@ public String toString () { Iterator k = keys(); - StringBuffer sbuf = new StringBuffer(); - sbuf.append ("{size="+asize+" nkeys="+nkeys+" "); + StringBuilder sb = new StringBuilder(); + sb.append("{size=").append(asize).append(" nkeys=").append(nkeys) + .append(' '); for (int i=0; k.hasNext(); i++) { String key = k.next(); String val = findValue (i); if (val != null && "".equals (val)) { val = null; } - sbuf.append (" {"+key+(val==null?"":","+val)+"}"); + sb.append(" {").append(key).append(val == null ? "" : "," + val) + .append('}'); if (k.hasNext()) { - sbuf.append (","); + sb.append (','); } } - sbuf.append (" }"); - return new String (sbuf); + sb.append (" }"); + return new String (sb); } public int findInt(String k, int Default) { diff -r dde9f5cfde5f src/share/classes/sun/net/www/MimeEntry.java --- a/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 12 08:47:12 2014 -0300 @@ -288,7 +288,7 @@ int action = getAction(); if (action != MimeEntry.UNKNOWN) { - sb.append("action=" + actionKeywords[action]); + sb.append("action=").append(actionKeywords[action]); needSeparator = true; } @@ -297,7 +297,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("application=" + command); + sb.append("application=").append(command); needSeparator = true; } @@ -305,7 +305,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("icon=" + getImageFileName()); + sb.append("icon=").append(getImageFileName()); needSeparator = true; } @@ -314,7 +314,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("file_extensions=" + extensions); + sb.append("file_extensions=").append(extensions); needSeparator = true; } @@ -323,7 +323,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("description=" + description); + sb.append("description=").append(description); } return sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/security/acl/AclEntryImpl.java --- a/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 12 08:47:12 2014 -0300 @@ -137,26 +137,30 @@ /** * Return a string representation of the contents of the ACL entry. */ - public String toString() { - StringBuffer s = new StringBuffer(); - if (negative) - s.append("-"); - else - s.append("+"); - if (user instanceof Group) - s.append("Group."); - else - s.append("User."); - s.append(user + "="); - Enumeration e = permissions(); - while(e.hasMoreElements()) { - Permission p = e.nextElement(); - s.append(p); - if (e.hasMoreElements()) - s.append(","); - } - return new String(s); - } + public String toString() { + StringBuffer sb = new StringBuffer(); + if (negative) { + sb.append('-'); + } else { + sb.append('+'); + } + if (user instanceof Group) { + sb.append("Group."); + } else { + sb.append("User."); + } + sb.append(user).append('='); + + Enumeration e = permissions(); + while (e.hasMoreElements()) { + Permission p = e.nextElement(); + sb.append(p); + if (e.hasMoreElements()) { + sb.append(','); + } + } + return sb.toString(); + } /** * Clones an AclEntry. diff -r dde9f5cfde5f src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java --- a/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 12 08:47:12 2014 -0300 @@ -640,8 +640,7 @@ for (int i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs/SigningCertificateInfo.java --- a/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 12 08:47:12 2014 -0300 @@ -158,8 +158,8 @@ } sb.append(hexDumper.encode(certHash)); if (issuer != null && serialNumber != null) { - sb.append("\n\tIssuer: " + issuer + "\n"); - sb.append("\t" + serialNumber); + sb.append("\n\tIssuer: ").append(issuer).append('\n'); + sb.append('\t').append(serialNumber); } sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs11/P11KeyStore.java --- a/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 12 08:47:12 2014 -0300 @@ -196,24 +196,24 @@ } else if (type == ATTR_CLASS_CERT) { sb.append("\ttype=[trusted cert]\n"); } - sb.append("\tlabel=[" + label + "]\n"); + sb.append("\tlabel=[").append(label).append("]\n"); if (id == null) { sb.append("\tid=[null]\n"); } else { - sb.append("\tid=" + P11KeyStore.getID(id) + "\n"); + sb.append("\tid=").append(P11KeyStore.getID(id)).append('\n'); } - sb.append("\ttrusted=[" + trusted + "]\n"); - sb.append("\tmatched=[" + matched + "]\n"); + sb.append("\ttrusted=[").append(trusted).append("]\n"); + sb.append("\tmatched=[").append(matched).append("]\n"); if (cert == null) { sb.append("\tcert=[null]\n"); } else { - sb.append("\tcert=[\tsubject: " + - cert.getSubjectX500Principal() + - "\n\t\tissuer: " + - cert.getIssuerX500Principal() + - "\n\t\tserialNum: " + - cert.getSerialNumber().toString() + - "]"); + sb.append("\tcert=[\tsubject: ") + .append(cert.getSubjectX500Principal()) + .append("\n\t\tissuer: ") + .append(cert.getIssuerX500Principal()) + .append("\n\t\tserialNum: ") + .append(cert.getSerialNumber().toString()) + .append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/PolicyFile.java --- a/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 12 08:47:12 2014 -0300 @@ -1485,30 +1485,30 @@ } int startIndex = 0; int v; - StringBuilder sb = new StringBuilder(); - while ((v = sp.getSelfName().indexOf(SELF, startIndex)) != -1) { + StringBuilder sb = new StringBuilder(); + while ((v = sp.getSelfName().indexOf(SELF, startIndex)) != -1) { - // add non-SELF string - sb.append(sp.getSelfName().substring(startIndex, v)); + // add non-SELF string + sb.append(sp.getSelfName().substring(startIndex, v)); - // expand SELF - Iterator pli = entryPs.iterator(); - while (pli.hasNext()) { - PolicyParser.PrincipalEntry pppe = pli.next(); - String[][] principalInfo = getPrincipalInfo(pppe,pdp); - for (int i = 0; i < principalInfo.length; i++) { - if (i != 0) { - sb.append(", "); - } - sb.append(principalInfo[i][0] + " " + - "\"" + principalInfo[i][1] + "\""); - } - if (pli.hasNext()) { - sb.append(", "); - } - } - startIndex = v + SELF.length(); - } + // expand SELF + Iterator pli = entryPs.iterator(); + while (pli.hasNext()) { + PolicyParser.PrincipalEntry pppe = pli.next(); + String[][] principalInfo = getPrincipalInfo(pppe, pdp); + for (int i = 0; i < principalInfo.length; i++) { + if (i != 0) { + sb.append(", "); + } + sb.append(principalInfo[i][0]).append(' ').append('"') + .append(principalInfo[i][1]).append('"'); + } + if (pli.hasNext()) { + sb.append(", "); + } + } + startIndex = v + SELF.length(); + } // add remaining string (might be the entire string) sb.append(sp.getSelfName().substring(startIndex)); @@ -1774,17 +1774,17 @@ Principal[] principals = pd.getPrincipals(); String pals = ""; if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + StringBuilder palSB = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palSB.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); if (i < principals.length-1) - palBuf.append(", "); + palSB.append(", "); else - palBuf.append(")"); + palSB.append(')'); } - pals = palBuf.toString(); + pals = palSB.toString(); } return "PD CodeSource: " + pd.getCodeSource() @@ -1884,7 +1884,7 @@ throw new Exception(form.format(source)); } - sb.append(X500PRINCIPAL + " \"" + suffix + "\""); + sb.append(X500PRINCIPAL).append(" \"").append(suffix).append('"'); startIndex = e+2; } else { MessageFormat form = new MessageFormat diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/CertId.java --- a/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 12 08:47:12 2014 -0300 @@ -223,13 +223,13 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertId \n"); - sb.append("Algorithm: " + hashAlgId.toString() +"\n"); + sb.append("Algorithm: ").append(hashAlgId.toString()).append('\n'); sb.append("issuerNameHash \n"); HexDumpEncoder encoder = new HexDumpEncoder(); sb.append(encoder.encode(issuerNameHash)); sb.append("\nissuerKeyHash: \n"); sb.append(encoder.encode(issuerKeyHash)); - sb.append("\n" + certSerialNumber.toString()); + sb.append('\n').append(certSerialNumber.toString()); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/OCSPResponse.java --- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 12 08:47:12 2014 -0300 @@ -812,14 +812,14 @@ StringBuilder sb = new StringBuilder(); sb.append("SingleResponse: \n"); sb.append(certId); - sb.append("\nCertStatus: "+ certStatus + "\n"); + sb.append("\nCertStatus: ").append(certStatus).append('\n'); if (certStatus == CertStatus.REVOKED) { - sb.append("revocationTime is " + revocationTime + "\n"); - sb.append("revocationReason is " + revocationReason + "\n"); + sb.append("revocationTime is ").append(revocationTime).append('\n'); + sb.append("revocationReason is ").append(revocationReason).append('\n'); } - sb.append("thisUpdate is " + thisUpdate + "\n"); + sb.append("thisUpdate is ").append(thisUpdate).append('\n'); if (nextUpdate != null) { - sb.append("nextUpdate is " + nextUpdate + "\n"); + sb.append("nextUpdate is ").append(nextUpdate).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java --- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 12 08:47:12 2014 -0300 @@ -124,7 +124,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Build Forward Flag: " + String.valueOf(buildForward) + "\n"); + sb.append(" Build Forward Flag: ").append(String.valueOf(buildForward)).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/HandshakeMessage.java --- a/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 12 08:47:12 2014 -0300 @@ -1478,7 +1478,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/ServerNameExtension.java --- a/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 12 08:47:12 2014 -0300 @@ -267,11 +267,11 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", server_name: "); for (SNIServerName sniName : sniMap.values()) { - sb.append("[" + sniName + "]"); + sb.append('[').append(sniName).append(']'); } - - return "Extension " + type + ", server_name: " + sb; + return sb.toString(); } private static class UnknownServerName extends SNIServerName { diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java --- a/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 12 08:47:12 2014 -0300 @@ -119,17 +119,17 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", signature_algorithms: "); boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; } } - - return "Extension " + type + ", signature_algorithms: " + sb; + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 12 08:47:12 2014 -0300 @@ -112,37 +112,37 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Extension " + type + ", curve names: {"); - boolean first = true; - for (int curveId : curveIds) { - if (first) { - first = false; - } else { - sb.append(", "); - } - // first check if it is a known named curve, then try other cases. - String oid = getCurveOid(curveId); - if (oid != null) { - ECParameterSpec spec = JsseJce.getECParameterSpec(oid); - // this toString() output will look nice for the current - // implementation of the ECParameterSpec class in the Sun - // provider, but may not look good for other implementations. - if (spec != null) { - sb.append(spec.toString().split(" ")[0]); - } else { - sb.append(oid); - } - } else if (curveId == ARBITRARY_PRIME) { - sb.append("arbitrary_explicit_prime_curves"); - } else if (curveId == ARBITRARY_CHAR2) { - sb.append("arbitrary_explicit_char2_curves"); - } else { - sb.append("unknown curve " + curveId); - } - } - sb.append("}"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", curve names: {"); + boolean first = true; + for (int curveId : curveIds) { + if (first) { + first = false; + } else { + sb.append(", "); + } + // first check if it is a known named curve, then try other cases. + String oid = getCurveOid(curveId); + if (oid != null) { + ECParameterSpec spec = JsseJce.getECParameterSpec(oid); + // this toString() output will look nice for the current + // implementation of the ECParameterSpec class in the Sun + // provider, but may not look good for other implementations. + if (spec != null) { + sb.append(spec.toString().split(" ")[0]); + } else { + sb.append(oid); + } + } else if (curveId == ARBITRARY_PRIME) { + sb.append("arbitrary_explicit_prime_curves"); + } else if (curveId == ARBITRARY_CHAR2) { + sb.append("arbitrary_explicit_char2_curves"); + } else { + sb.append("unknown curve ").append(curveId); + } + } + sb.append("}"); + return sb.toString(); } // Test whether we support the curve with the given index. diff -r dde9f5cfde5f src/share/classes/sun/security/tools/jarsigner/Main.java --- a/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 12 08:47:12 2014 -0300 @@ -676,14 +676,13 @@ ((man.getAttributes(name) != null) || (man.getAttributes("./"+name) != null) || (man.getAttributes("/"+name) != null)); - sb.append( - (isSigned ? rb.getString("s") : rb.getString("SPACE")) + - (inManifest ? rb.getString("m") : rb.getString("SPACE")) + - (inStore ? rb.getString("k") : rb.getString("SPACE")) + - (inScope ? rb.getString("i") : rb.getString("SPACE")) + - ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") + - rb.getString("SPACE")); - sb.append("|"); + sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE")) + .append(inManifest ? rb.getString("m") : rb.getString("SPACE")) + .append(inStore ? rb.getString("k") : rb.getString("SPACE")) + .append(inScope ? rb.getString("i") : rb.getString("SPACE")) + .append((inStoreOrScope & NOT_ALIAS) != 0 ? 'X' : ' ') + .append(rb.getString("SPACE")); + sb.append('|'); } // When -certs provided, display info has extra empty @@ -704,11 +703,13 @@ // Print no info for unsigned entries when -verbose:all, // to be consistent with old behavior. if (signatureRelated(name)) { - sb.append("\n" + tab + rb.getString( - ".Signature.related.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Signature.related.entries.")) + .append("\n\n"); } else { - sb.append("\n" + tab + rb.getString( - ".Unsigned.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Unsigned.entries.")) + .append("\n\n"); } } @@ -1605,8 +1606,8 @@ // No more warning, we alreay have hasExpiredCert or notYetValidCert } else { chainNotValidated = true; - sb.append(tab + rb.getString(".CertPath.not.validated.") + - e.getLocalizedMessage() + "]\n"); // TODO + sb.append(tab).append(rb.getString(".CertPath.not.validated.")) + .append(e.getLocalizedMessage()).append("]\n"); // TODO } } String result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/policytool/PolicyTool.java --- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 12 08:47:12 2014 -0300 @@ -980,8 +980,9 @@ grantEntry.principals.listIterator(); while (list.hasNext()) { PolicyParser.PrincipalEntry pppe = list.next(); - sb.append(" Principal " + pppe.getDisplayClass() + " " + - pppe.getDisplayName(true)); + sb.append(" Principal ").append(pppe.getDisplayClass()) + .append(' ') + .append(pppe.getDisplayName(true)); if (list.hasNext()) sb.append(", "); } result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/AVA.java --- a/src/share/classes/sun/security/x509/AVA.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/AVA.java Tue Aug 12 08:47:12 2014 -0300 @@ -1062,7 +1062,7 @@ } else { boolean quoteNeeded = false; - StringBuilder sbuffer = new StringBuilder(); + StringBuilder sb = new StringBuilder(); boolean previousWhite = false; final String escapees = ",+=\n<>#;\\\""; @@ -1079,7 +1079,7 @@ for (int i = 0; i < length; i++) { char c = valStr.charAt(i); if (alreadyQuoted && (i == 0 || i == length - 1)) { - sbuffer.append(c); + sb.append(c); continue; } if (DerValue.isPrintableStringChar(c) || @@ -1096,7 +1096,7 @@ if (!(c == ' ' || c == '\n')) { // escape '"' and '\' if (c == '"' || c == '\\') { - sbuffer.append('\\'); + sb.append('\\'); } previousWhite = false; } else { @@ -1106,7 +1106,7 @@ previousWhite = true; } - sbuffer.append(c); + sb.append(c); } else if (debug != null && Debug.isOn("ava")) { @@ -1119,26 +1119,26 @@ byte[] valueBytes = Character.toString(c).getBytes("UTF8"); for (int j = 0; j < valueBytes.length; j++) { - sbuffer.append('\\'); + sb.append('\\'); char hexChar = Character.forDigit (0xF & (valueBytes[j] >>> 4), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); hexChar = Character.forDigit (0xF & (valueBytes[j]), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); } } else { // append non-printable/non-escaped char previousWhite = false; - sbuffer.append(c); + sb.append(c); } } // quote if trailing whitespace - if (sbuffer.length() > 0) { - char trailChar = sbuffer.charAt(sbuffer.length() - 1); + if (sb.length() > 0) { + char trailChar = sb.charAt(sb.length() - 1); if (trailChar == ' ' || trailChar == '\n') { quoteNeeded = true; } @@ -1147,9 +1147,9 @@ // Emit the string ... quote it if needed // if string is already quoted, don't re-quote if (!alreadyQuoted && quoteNeeded) { - retval.append("\"" + sbuffer.toString() + "\""); + retval.append('"').append(sb.toString()).append('"'); } else { - retval.append(sbuffer.toString()); + retval.append(sb.toString()); } } } catch (IOException e) { diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPoint.java --- a/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 12 08:47:12 2014 -0300 @@ -381,22 +381,22 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPoint:\n " + fullName + "\n"); + sb.append("DistributionPoint:\n ").append(fullName).append('\n'); } if (relativeName != null) { - sb.append("DistributionPoint:\n " + relativeName + "\n"); + sb.append("DistributionPoint:\n ").append(relativeName).append('\n'); } if (reasonFlags != null) { sb.append(" ReasonFlags:\n"); for (int i = 0; i < reasonFlags.length; i++) { if (reasonFlags[i]) { - sb.append(" " + reasonToString(i) + "\n"); + sb.append(" ").append(reasonToString(i)).append('\n'); } } } if (crlIssuer != null) { - sb.append(" CRLIssuer:" + crlIssuer + "\n"); + sb.append(" CRLIssuer:").append(crlIssuer).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPointName.java --- a/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 12 08:47:12 2014 -0300 @@ -231,10 +231,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPointName:\n " + fullName + "\n"); + sb.append("DistributionPointName:\n ").append(fullName).append('\n'); } else { - sb.append("DistributionPointName:\n " + relativeName + "\n"); + sb.append("DistributionPointName:\n ").append(relativeName).append('\n'); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/PolicyInformation.java --- a/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 12 08:47:12 2014 -0300 @@ -258,9 +258,9 @@ * Return a printable representation of the PolicyInformation. */ public String toString() { - StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString()); - s.append(policyQualifiers + " ]\n"); - return s.toString(); + StringBuilder sb = new StringBuilder(" [" + policyIdentifier.toString()); + sb.append(policyQualifiers).append(" ]\n"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLEntryImpl.java --- a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 12 08:47:12 2014 -0300 @@ -292,17 +292,17 @@ StringBuilder sb = new StringBuilder(); sb.append(serialNumber.toString()); - sb.append(" On: " + revocationDate.toString()); + sb.append(" On: ").append(revocationDate.toString()); if (certIssuer != null) { - sb.append("\n Certificate issuer: " + certIssuer); + sb.append("\n Certificate issuer: ").append(certIssuer); } if (extensions != null) { Collection allEntryExts = extensions.getAllExtensions(); Extension[] exts = allEntryExts.toArray(new Extension[0]); - sb.append("\n CRL Entry Extensions: " + exts.length); + sb.append("\n CRL Entry Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n [" + (i+1) + "]: "); + sb.append("\n [").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -313,9 +313,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLImpl.java --- a/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 12 08:47:12 2014 -0300 @@ -537,31 +537,32 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("X.509 CRL v" + (version+1) + "\n"); + sb.append("X.509 CRL v").append(version + 1).append('\n'); if (sigAlgId != null) - sb.append("Signature Algorithm: " + sigAlgId.toString() + - ", OID=" + (sigAlgId.getOID()).toString() + "\n"); + sb.append("Signature Algorithm: ").append(sigAlgId.toString()) + .append(", OID=") + .append((sigAlgId.getOID()).toString()).append('\n'); if (issuer != null) - sb.append("Issuer: " + issuer.toString() + "\n"); + sb.append("Issuer: ").append(issuer.toString()).append('\n'); if (thisUpdate != null) - sb.append("\nThis Update: " + thisUpdate.toString() + "\n"); + sb.append("\nThis Update: ").append(thisUpdate.toString()).append('\n'); if (nextUpdate != null) - sb.append("Next Update: " + nextUpdate.toString() + "\n"); + sb.append("Next Update: ").append(nextUpdate.toString()).append('\n'); if (revokedList.isEmpty()) sb.append("\nNO certificates have been revoked\n"); else { - sb.append("\nRevoked Certificates: " + revokedList.size()); + sb.append("\nRevoked Certificates: ").append(revokedList.size()); int i = 1; for (X509CRLEntry entry: revokedList) { - sb.append("\n[" + i++ + "] " + entry.toString()); + sb.append("\n[").append(i++).append("] ").append(entry.toString()); } } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Object[] objs = allExts.toArray(); - sb.append("\nCRL Extensions: " + objs.length); + sb.append("\nCRL Extensions: ").append(objs.length); for (int i = 0; i < objs.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = (Extension)objs[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -572,9 +573,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); // sub-class exists @@ -585,8 +585,7 @@ } if (signature != null) { HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) - + "\n"); + sb.append("\nSignature:\n").append(encoder.encodeBuffer(signature)).append('\n'); } else sb.append("NOT signed yet\n"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertImpl.java --- a/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 12 08:47:12 2014 -0300 @@ -802,11 +802,11 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(info.toString() + "\n"); - sb.append(" Algorithm: [" + algId.toString() + "]\n"); + sb.append(info.toString()).append('\n'); + sb.append(" Algorithm: [").append(algId.toString()).append("]\n"); HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); + sb.append(" Signature:\n").append(encoder.encodeBuffer(signature)); sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertInfo.java --- a/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 12 08:47:12 2014 -0300 @@ -298,27 +298,27 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(" " + version.toString() + "\n"); - sb.append(" Subject: " + subject.toString() + "\n"); - sb.append(" Signature Algorithm: " + algId.toString() + "\n"); - sb.append(" Key: " + pubKey.toString() + "\n"); - sb.append(" " + interval.toString() + "\n"); - sb.append(" Issuer: " + issuer.toString() + "\n"); - sb.append(" " + serialNum.toString() + "\n"); + sb.append(" ").append(version.toString()).append('\n'); + sb.append(" Subject: ").append(subject.toString()).append('\n'); + sb.append(" Signature Algorithm: ").append(algId.toString()).append('\n'); + sb.append(" Key: ").append(pubKey.toString()).append('\n'); + sb.append(" ").append(interval.toString()).append('\n'); + sb.append(" Issuer: ").append(issuer.toString()).append('\n'); + sb.append(" ").append(serialNum.toString()).append('\n'); // optional v2, v3 extras if (issuerUniqueId != null) { - sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n"); + sb.append(" Issuer Id:\n").append(issuerUniqueId.toString()).append('\n'); } if (subjectUniqueId != null) { - sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n"); + sb.append(" Subject Id:\n").append(subjectUniqueId.toString()).append('\n'); } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Extension[] exts = allExts.toArray(new Extension[0]); - sb.append("\nCertificate Extensions: " + exts.length); + sb.append("\nCertificate Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -329,9 +329,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists @@ -341,10 +340,10 @@ } Map invalid = extensions.getUnparseableExtensions(); if (invalid.isEmpty() == false) { - sb.append("\nUnparseable certificate extensions: " + invalid.size()); + sb.append("\nUnparseable certificate extensions: ").append(invalid.size()); int i = 1; for (Extension ext : invalid.values()) { - sb.append("\n[" + (i++) + "]: "); + sb.append("\n[").append(i++).append("]: "); sb.append(ext); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/ThreadTab.java --- a/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 12 08:47:12 2014 -0300 @@ -368,7 +368,7 @@ sb.append(Messages.STACK_TRACE); int index = 0; for (StackTraceElement e : ti.getStackTrace()) { - sb.append(e.toString()+"\n"); + sb.append(e.toString()).append('\n'); if (monitors != null) { for (MonitorInfo mi : monitors) { if (mi.getLockedStackDepth() == index) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java --- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 12 08:47:12 2014 -0300 @@ -79,25 +79,25 @@ String textColor = String.format("%06x", foreground.getRGB() & 0xFFFFFF); StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append("
    "); for (int i = 0; i < arr.length; i++) { if (i % 2 == 0) { - sb.append(""); + sb.append(""); } else { - sb.append(""); + sb.append(""); } } if (arr.length == 0) { - sb.append(""); + sb.append(""); } sb.append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    "); arrayEditor.setText(sb.toString()); diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XTree.java --- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 12 08:47:12 2014 -0300 @@ -507,13 +507,13 @@ // key order defined by the "orderedKeyPropertyList" for (String key : orderedKeyPropertyList) { if (map.containsKey(key)) { - sb.append(key + "=" + map.get(key) + ","); + sb.append(key).append('=').append(map.get(key)).append(','); map.remove(key); } } // Add the remaining key/value pairs to the buffer for (Map.Entry entry : map.entrySet()) { - sb.append(entry.getKey() + "=" + entry.getValue() + ","); + sb.append(entry.getKey()).append('=').append(entry.getValue()).append(','); } String orderedKeyPropertyListString = sb.toString(); orderedKeyPropertyListString = orderedKeyPropertyListString.substring( @@ -622,7 +622,7 @@ // StringBuilder sb = new StringBuilder(); for (MBeanParameterInfo mbpi : mboi.getSignature()) { - sb.append(mbpi.getType() + ","); + sb.append(mbpi.getType()).append(','); } String signature = sb.toString(); if (signature.length() > 0) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jps/Jps.java --- a/src/share/classes/sun/tools/jps/Jps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jps/Jps.java Tue Aug 12 08:47:12 2014 -0300 @@ -92,28 +92,28 @@ vm = monitoredHost.getMonitoredVm(id, 0); errorString = " -- main class information unavailable"; - output.append(" " + MonitoredVmUtil.mainClass(vm, + output.append(' ').append(MonitoredVmUtil.mainClass(vm, arguments.showLongPaths())); if (arguments.showMainArgs()) { errorString = " -- main args information unavailable"; String mainArgs = MonitoredVmUtil.mainArgs(vm); if (mainArgs != null && mainArgs.length() > 0) { - output.append(" " + mainArgs); + output.append(' ').append(mainArgs); } } if (arguments.showVmArgs()) { errorString = " -- jvm args information unavailable"; String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) { - output.append(" " + jvmArgs); + output.append(' ').append(jvmArgs); } } if (arguments.showVmFlags()) { errorString = " -- jvm flags information unavailable"; String jvmFlags = MonitoredVmUtil.jvmFlags(vm); if (jvmFlags != null && jvmFlags.length() > 0) { - output.append(" " + jvmFlags); + output.append(' ').append(jvmFlags); } } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/RawOutputFormatter.java --- a/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 12 08:47:12 2014 -0300 @@ -50,7 +50,7 @@ StringBuilder headerBuilder = new StringBuilder(); for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { Monitor m = i.next(); - headerBuilder.append(m.getName() + " "); + headerBuilder.append(m.getName()).append(' '); } header = headerBuilder.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/SyntaxException.java --- a/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 12 08:47:12 2014 -0300 @@ -65,7 +65,7 @@ public SyntaxException(int lineno, Set expected, Token found) { StringBuilder msg = new StringBuilder(); - msg.append("Syntax error at line " + lineno + ": Expected one of \'"); + msg.append("Syntax error at line ").append(lineno).append(": Expected one of \'"); boolean first = true; for (Iterator i = expected.iterator(); i.hasNext(); /* empty */) { @@ -74,11 +74,11 @@ msg.append(keyWord); first = false; } else { - msg.append("|" + keyWord); + msg.append('|').append(keyWord); } } - msg.append("\', Found " + found.toMessage()); + msg.append("\', Found ").append(found.toMessage()); message = msg.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/Token.java --- a/src/share/classes/sun/tools/jstat/Token.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/Token.java Tue Aug 12 08:47:12 2014 -0300 @@ -89,18 +89,18 @@ sb.append("ttype=TT_EOF"); break; case StreamTokenizer.TT_NUMBER: - sb.append("ttype=TT_NUM,").append("nval="+nval); + sb.append("ttype=TT_NUM,").append("nval=").append(nval); break; case StreamTokenizer.TT_WORD: if (sval == null) { sb.append("ttype=TT_WORD:IDENTIFIER"); } else { - sb.append("ttype=TT_WORD:").append("sval="+sval); + sb.append("ttype=TT_WORD:").append("sval=").append(sval); } break; default: if (ttype == (int)'"') { - sb.append("ttype=TT_STRING:").append("sval="+sval); + sb.append("ttype=TT_STRING:").append("sval=").append(sval); } else { sb.append("ttype=TT_CHAR:").append((char)ttype); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstatd/RemoteHostImpl.java --- a/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 12 08:47:12 2014 -0300 @@ -68,7 +68,7 @@ sb.append("local://").append(lvmid).append("@localhost"); if (mode != null) { - sb.append("?mode=" + mode); + sb.append("?mode=").append(mode); } String vmidStr = sb.toString(); From roger.riggs at oracle.com Tue Aug 12 13:15:40 2014 From: roger.riggs at oracle.com (roger riggs) Date: Tue, 12 Aug 2014 09:15:40 -0400 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> Message-ID: <53EA137C.5020701@oracle.com> fyi, There's a Perl script normalizer.pl that detects/fixes most of the simple tab/white space issues. The script is in the /make/scripts/normalizer.pl Roger On 8/12/2014 3:48 AM, Andrej Golovnin wrote: > Hi Ot?vio, > > I think you should fix the indentation in a lot of classes. You use the > tab-character for the indentation. As far as I know we should use the space > character for the indentation in the JDK sources (Oracle devs feel free to > correct me if I'm wrong. And it would be really nice if the style guide for > the source code would be a part of the JDK repository. So we don't need to > search for it on the internet/wiki. Just clone the repository, read the > style guide and follow it. :-) ). Here is the not complete list of classes > where you used the tab-character for the indentation: > > src/share/classes/com/sun/crypto/provider/OAEPParameters.java > src/share/classes/java/lang/management/MemoryUsage.java > src/share/classes/java/security/KeyStore.java > src/share/classes/java/security/PermissionCollection.java > src/share/classes/java/security/ProtectionDomain.java > src/share/classes/java/security/cert/CertPath.java > src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java > src/share/classes/java/security/cert/PKIXParameters.java > src/share/classes/java/security/cert/PolicyQualifierInfo.java > src/share/classes/java/security/cert/TrustAnchor.java > src/share/classes/java/security/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); } > > Best regards, > Andrej Golovnin From pbenedict at apache.org Tue Aug 12 13:42:26 2014 From: pbenedict at apache.org (Paul Benedict) Date: Tue, 12 Aug 2014 08:42:26 -0500 Subject: JDK RFR of 8054720: Modifications of I/O methods for instrumentation purposes In-Reply-To: References: <10E92003-9963-4942-A261-F0B5D3976F3D@oracle.com> <53E92323.3010402@oracle.com> Message-ID: I'd like to propose some sort of comment (non-javadoc) preceding the methods to explain the pattern. Without the institutional day-to-day knowledge, I don't think it is apparent to an outside reader why these methods are crafted as such. The comment can be as simple as: // wrap native call to allow instrumentation Cheers, Paul On Mon, Aug 11, 2014 at 4:29 PM, Brian Burkhalter < brian.burkhalter at oracle.com> wrote: > > On Aug 11, 2014, at 1:10 PM, Alan Bateman wrote: > > > This looks okay except SSLSocketImpl#isLayered (not clear why the > override is needed). > > This is needed as it may be required to instrument > sun.security.ssl.SSLSocketImpl.closeSocket() in which the knowledge of > whether the socket is layered has a bearing on the behavior. > > Brian From aph at redhat.com Tue Aug 12 15:01:35 2014 From: aph at redhat.com (Andrew Haley) Date: Tue, 12 Aug 2014 16:01:35 +0100 Subject: Does this look like a race? Message-ID: <53EA2C4F.80503@redhat.com> (Please forgive me if this should go to the AWT list or somesuch. It seems to me like this is not really a graphics-related issue, but one of Java concurrency.) This is in JDK9, sun.font.GlyphList. There is a non-volatile boolean inUse, and it is not always written in a synchronized block. It is used to allow exclusive access to a singleton instance. It seems to me that, at a minimum, inUse should be volatile, or e.g. strikelist might be overwritten to null after some other thread has started using this GlyphList. Do you agree? Thanks, Andrew. /* This scheme creates a singleton GlyphList which is checked out * for use. Callers who find its checked out create one that after use * is discarded. This means that in a MT-rendering environment, * there's no need to synchronise except for that one instance. * Fewer threads will then need to synchronise, perhaps helping * throughput on a MP system. If for some reason the reusable * GlyphList is checked out for a long time (or never returned?) then * we would end up always creating new ones. That situation should not * occur and if it did, it would just lead to some extra garbage being * created. private static GlyphList reusableGL = new GlyphList(); private static boolean inUse; ... public static GlyphList getInstance() { /* The following heuristic is that if the reusable instance is * in use, it probably still will be in a micro-second, so avoid * synchronising on the class and just allocate a new instance. * The cost is one extra boolean test for the normal case, and some * small number of cases where we allocate an extra object when * in fact the reusable one would be freed very soon. */ if (inUse) { return new GlyphList(); } else { synchronized(GlyphList.class) { if (inUse) { return new GlyphList(); } else { inUse = true; return reusableGL; } } } } ... /* There's a reference equality test overhead here, but it allows us * to avoid synchronizing for GL's that will just be GC'd. This * helps MP throughput. */ public void dispose() { if (this == reusableGL) { if (graybits != null && graybits.length > MAXGRAYLENGTH) { graybits = null; } usePositions = false; strikelist = null; // remove reference to the strike list inUse = false; } } From jiangli.zhou at oracle.com Tue Aug 12 15:46:10 2014 From: jiangli.zhou at oracle.com (Jiangli Zhou) Date: Tue, 12 Aug 2014 08:46:10 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #3 In-Reply-To: <53E9AFE3.8060604@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53E82778.3020400@oracle.com> <53E93278.4090609@oracle.com> <53E94B4A.6060405@oracle.com> <53E9AFE3.8060604@oracle.com> Message-ID: <53EA36C2.5090407@oracle.com> Hi Ioi and Mandy, Please see comments below. On 08/11/2014 11:10 PM, Ioi Lam wrote: > On 8/11/14, 4:01 PM, Mandy Chung wrote: >> On 8/11/14 2:15 PM, Ioi Lam wrote: >> >>>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ >> >> I would like to avoid adding private methods for VM to call >> as fewer as possible. >> >> SecureClassLoader.getProtectionDomain(URL) >> Can you use the existing private getProtectionDomain(CodeSource) >> method instead? The VM can call the public CodeSource(URL, >> CodeSigner[]) >> constructor. I doubt an additional up call from the VM to Java >> may cause performance degradation as much while I think it's >> a good tradeoff. It also allows this be extended to signed JARs >> if it's considered. >> >> Manifest.getManifest(byte[] buf) >> Is saving one additional upcall from VM to Java very critical? >> I prefer the VM to use public APIs to minimize such dependency >> in the library. >> >> Launcher.getFileURL(String) >> This is a convenient method for VM. If VM calls getFileURL(File), >> it's still a new dependency. Is there any other way doing it? >> > Hi Mandy, > > I agree we should avoid adding new private Java methods if possible. > I've rewritten the 3 calls in C. I also agree we should avoid adding new private Java methods if possible. Just some background why we added the Java code. These new Java methods are in performance critical path. Native->Java->Native->Java are expensive transitions. Doing the logic in C means we will have multiple expensive transitions in the code. Adding a private method and doing it in Java would also allows the JIT to compile the java code and further optimize the performance, while doing it in native prevents that. Thanks, Jiangli > It's a little messy: a single line of Java code needs to be written like: > > // JAVA: CodeSource cs = new CodeSource(url, null); > > InstanceKlass* cs_klass = > InstanceKlass::cast(SystemDictionary::CodeSource_klass()); > Handle cs = > cs_klass->allocate_instance_handle(CHECK_(protection_domain)); > { > JavaValue result(T_VOID); > JavaCalls::call_special(&result, cs, KlassHandle(THREAD, cs_klass), > vmSymbols::object_initializer_name(), > vmSymbols::url_code_signer_array_void_signature(), > url, Handle(), CHECK_(protection_domain)); > } > > There's some minimal checking with argument types (default in debug > build, -XX:+CheckJNICalls in product build), but I think there's no > check if you forget to call the method. > > We could probably add a new JavaCalls::new_instance() function to make > the code a little cleaner (and make sure the is called). I can > do this as a separate clean-up bug. >> URLClassLoader.defineClass >> 438 * NOTE: the logic used here has been duplicated in the VM >> native code >> 439 * (search for invocation of definePackageInternal in the >> HotSpot sources). >> 440 * If this is changed, the VM code also need to be modified. >> >> Is the definePackageInternal only logic duplicated in the VM? >> I wonder if this comment can be clear what is duplicated. >> > I'll reword it and send out a new webrev, along with the rest of the > code. > > Thanks > - Ioi >> Mandy >> > From Alan.Bateman at oracle.com Tue Aug 12 15:46:38 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 12 Aug 2014 16:46:38 +0100 Subject: JDK RFR of 8054720: Modifications of I/O methods for instrumentation purposes In-Reply-To: References: <10E92003-9963-4942-A261-F0B5D3976F3D@oracle.com> <53E92323.3010402@oracle.com> Message-ID: <53EA36DE.5090002@oracle.com> On 11/08/2014 22:29, Brian Burkhalter wrote: > On Aug 11, 2014, at 1:10 PM, Alan Bateman wrote: > >> This looks okay except SSLSocketImpl#isLayered (not clear why the override is needed). > This is needed as it may be required to instrument sun.security.ssl.SSLSocketImpl.closeSocket() in which the knowledge of whether the socket is layered has a bearing on the behavior. So are you instrumenting isLayered in sub-class or just calling it? I ask because just calling it should work. -Alan From daniel.fuchs at oracle.com Tue Aug 12 17:01:47 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 12 Aug 2014 19:01:47 +0200 Subject: RFR: 8054480: Test java/util/logging/TestLoggerBundleSync.java fails: Unexpected bundle name: null Message-ID: <53EA487B.1040101@oracle.com> Hi, Please find below a fix for: 8054480: Test java/util/logging/TestLoggerBundleSync.java fails: Unexpected bundle name: null This test has been reported to fail from time to time with the following stack: java.lang.RuntimeException: Unexpected bundle name: null at TestLoggerBundleSync$GetRB.run(TestLoggerBundleSync.java:257) The issue here is due to a race condition in the test code. The comments in the fix explains the fix & the issue. http://cr.openjdk.java.net/~dfuchs/webrev_8054480/webrev.00/ -- The test creates several GetRB threads which 'read' the resource bundle that will be used by loggers. It does that by publishing a dummy message in a child logger, and checking the resource bundle name stored in the associated LogRecord. The test also creates several SetRB/SetRBName threads which attempts to set the resource bundle on loggers, in parallel with the GetRB threads. The race condition occurs because although each GetRB thread has its own Handler that it uses to get at the ResourceBundle in the LogRecord, it can receive LogRecords that were emitted by other GetRB threads - which (because of thread scheduling) might have been prepared at an earlier time and may contain stale information. What it means is that the following logic from GetRB is flawed: a. gets ResourceBundle from parent logger b. register handler with child logger c. emit dummy message through child logger d. remove handler registered in b. f. check resource bundle that was passed in LogRecord, comparing it with the resource bundle obtained in a. The expectation is that if a. is not null, then the resource bundle name obtained by the handler should not be null, and should be equal to the name obtained in a. This logic is flawed and prone to race conditions, because the following may sometime happens: GetRB#1 logs a message, but gets interrupted after LogRecord is created but before publish() is called. At this point the ResourceBundle has not been set yet, so the record has a null ResourceBundle. SetRB#? sets resource bundle on parent logger GetRB#2 sees the new resource bundle, emit a dummy message, but is interrupted before it removes its handler. At this point the handler has the correct resource bundle and resource bundle name that it found in the LogRecord emitted by GetRB#2 in step c. GetRB#1 is resumed. LogRecord gets published - but since the handler from thread #2 is still present, the 'old' LogRecord from GetRB#1 gets forwarded to GetRB#2's handler where it erases the information previously recorded by the message that was emitted by GetRB#2 GetRB#2 is resumed, and sees the rbName/rb that was present in the old LogRecord emitted by GetRB#1 instead of seeing the newer information that was in the LogRecord emitted by GetRB#2. => the exception gets raised. The fix is relatively simple: the Handler registered by each GetRB thread need simply to ignore messages that were not emitted by its own thread - we do this now by passing 'this' as parameter to the dummy logged message - and by comparing GetRB.this with LogRecord.getParameters()[0]; best regards, -- daniel From brian.burkhalter at oracle.com Tue Aug 12 19:56:22 2014 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 12 Aug 2014 12:56:22 -0700 Subject: JDK RFR of 8054720: Modifications of I/O methods for instrumentation purposes In-Reply-To: References: <10E92003-9963-4942-A261-F0B5D3976F3D@oracle.com> <53E92323.3010402@oracle.com> Message-ID: <80E8D8B7-AEA2-40A9-BCC6-33CA445E9230@oracle.com> Sounds like a good idea. I?ll add something in the next version of the patch. Thanks, Brian On Aug 12, 2014, at 6:42 AM, Paul Benedict wrote: > I'd like to propose some sort of comment (non-javadoc) preceding the methods to explain the pattern. Without the institutional day-to-day knowledge, I don't think it is apparent to an outside reader why these methods are crafted as such. > > The comment can be as simple as: > // wrap native call to allow instrumentation From otaviojava at java.net Tue Aug 12 23:01:07 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Tue, 12 Aug 2014 20:01:07 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53EA137C.5020701@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> Message-ID: Thank you Roger. Done https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_6.zip On Tue, Aug 12, 2014 at 10:15 AM, roger riggs wrote: > fyi, > > There's a Perl script normalizer.pl that detects/fixes most of the simple > tab/white space issues. > The script is in the /make/scripts/normalizer.pl > > Roger > > > On 8/12/2014 3:48 AM, Andrej Golovnin wrote: > >> Hi Ot?vio, >> >> I think you should fix the indentation in a lot of classes. You use the >> tab-character for the indentation. As far as I know we should use the >> space >> character for the indentation in the JDK sources (Oracle devs feel free to >> correct me if I'm wrong. And it would be really nice if the style guide >> for >> the source code would be a part of the JDK repository. So we don't need to >> search for it on the internet/wiki. Just clone the repository, read the >> style guide and follow it. :-) ). Here is the not complete list of classes >> where you used the tab-character for the indentation: >> >> src/share/classes/com/sun/crypto/provider/OAEPParameters.java >> src/share/classes/java/lang/management/MemoryUsage.java >> src/share/classes/java/security/KeyStore.java >> src/share/classes/java/security/PermissionCollection.java >> src/share/classes/java/security/ProtectionDomain.java >> src/share/classes/java/security/cert/CertPath.java >> src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java >> src/share/classes/java/security/cert/PKIXParameters.java >> src/share/classes/java/security/cert/PolicyQualifierInfo.java >> src/share/classes/java/security/cert/TrustAnchor.java >> src/share/classes/java/security/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); } >> >> Best regards, >> Andrej Golovnin >> > > -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/com/sun/awt/AWTUtilities.java --- a/src/share/classes/com/sun/awt/AWTUtilities.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/awt/AWTUtilities.java Tue Aug 12 19:52:29 2014 -0300 @@ -459,4 +459,3 @@ shape); } } - diff -r dde9f5cfde5f src/share/classes/com/sun/awt/SecurityWarning.java --- a/src/share/classes/com/sun/awt/SecurityWarning.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/awt/SecurityWarning.java Tue Aug 12 19:52:29 2014 -0300 @@ -166,4 +166,3 @@ point, alignmentX, alignmentY); } } - diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/AESCipher.java --- a/src/share/classes/com/sun/crypto/provider/AESCipher.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/AESCipher.java Tue Aug 12 19:52:29 2014 -0300 @@ -622,4 +622,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHParameters.java --- a/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 12 19:52:29 2014 -0300 @@ -137,8 +137,11 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:") + .append(LINE_SEP).append(" ") + .append(this.l); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHPublicKey.java --- a/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 12 19:52:29 2014 -0300 @@ -268,8 +268,10 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:").append(LINE_SEP) + .append(" ").append(this.l); + } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/GCMParameters.java --- a/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 12 19:52:29 2014 -0300 @@ -140,7 +140,8 @@ = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "[" + encoder.encodeBuffer(iv) + "]"); - sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP); + sb.append(LINE_SEP).append("tLen(bits):").append(LINE_SEP) + .append(tLen * 8).append(LINE_SEP); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/OAEPParameters.java --- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 12 19:52:29 2014 -0300 @@ -239,10 +239,12 @@ protected String engineToString() { StringBuilder sb = new StringBuilder(); - sb.append("MD: " + mdName + "\n"); - sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n"); - sb.append("PSource: PSpecified " + - (p.length==0? "":Debug.toHexString(new BigInteger(p))) + "\n"); + sb.append("MD: ").append(mdName).append('\n'); + sb.append("MGF: MGF1").append(mgfSpec.getDigestAlgorithm()) + .append('\n'); + sb.append("PSource: PSpecified ") + .append(p.length == 0 ? "" : Debug + .toHexString(new BigInteger(p))).append('\n'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/RC2Parameters.java --- a/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 12 19:52:29 2014 -0300 @@ -221,8 +221,9 @@ + encoder.encodeBuffer(iv) + "]"); if (version != 0) { - sb.append(LINE_SEP + "version:" + LINE_SEP - + version + LINE_SEP); + sb.append(LINE_SEP).append("version:") + .append(LINE_SEP).append(version) + .append(LINE_SEP); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/java/util/jar/pack/FixedList.java --- a/src/share/classes/com/sun/java/util/jar/pack/FixedList.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/java/util/jar/pack/FixedList.java Tue Aug 12 19:52:29 2014 -0300 @@ -171,4 +171,3 @@ return "FixedList{" + "plist=" + flist + '}'; } } - diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java --- a/src/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptor.java Tue Aug 12 19:52:29 2014 -0300 @@ -127,4 +127,3 @@ public ClassLoaderRepository getClassLoaderRepository(); } - diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 12 19:52:29 2014 -0300 @@ -65,7 +65,7 @@ "extractSubNet", "BINARY ARRAY :"); StringBuilder sb = new StringBuilder(); for(int i =0; i < addrLength; i++) { - sb.append((b[i] & 0xFF) + ":"); + sb.append(b[i] & 0xFF).append(':'); } SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", sb.toString()); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 12 19:52:29 2014 -0300 @@ -204,7 +204,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 12 19:52:29 2014 -0300 @@ -379,7 +379,7 @@ } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); - jjtn000.name.append( "." + t.image); + jjtn000.name.append('.').append(t.image); } } finally { if (jjtc000) { @@ -408,7 +408,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -454,7 +454,7 @@ } jj_consume_token(MARK); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -483,7 +483,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } jj_consume_token(MASK); t = jj_consume_token(INTEGER_LITERAL); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Tue Aug 12 19:52:29 2014 -0300 @@ -420,7 +420,7 @@ t= { jjtn000.name.append(t.image); } ( "." t= - {jjtn000.name.append( "." + t.image); } + {jjtn000.name.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -447,7 +447,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -501,7 +501,7 @@ {jjtn000.address.append(t.image); } ( "!" t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -527,7 +527,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )* "/" t= /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Tue Aug 12 19:52:29 2014 -0300 @@ -213,7 +213,7 @@ t= { jjtThis.name.append(t.image); } ( "." t= - {jjtThis.name.append( "." + t.image); } + {jjtThis.name.append( '.').append(t.image); } )* } @@ -228,7 +228,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* } @@ -253,7 +253,7 @@ {jjtThis.address.append(t.image); } ( "!" t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* } @@ -267,7 +267,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* "/" t= {jjtThis.mask = t.image; } } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 12 19:52:29 2014 -0300 @@ -99,7 +99,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java --- a/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 12 19:52:29 2014 -0300 @@ -479,10 +479,10 @@ */ public String printMessage() { StringBuilder sb = new StringBuilder(); - sb.append("msgId : " + msgId + "\n"); - sb.append("msgMaxSize : " + msgMaxSize + "\n"); - sb.append("msgFlags : " + msgFlags + "\n"); - sb.append("msgSecurityModel : " + msgSecurityModel + "\n"); + sb.append("msgId : ").append(msgId).append('\n'); + sb.append("msgMaxSize : ").append(msgMaxSize).append('\n'); + sb.append("msgFlags : ").append(msgFlags).append('\n'); + sb.append("msgSecurityModel : ").append(msgSecurityModel).append('\n'); if (contextEngineId == null) { sb.append("contextEngineId : null"); diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java --- a/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 12 19:52:29 2014 -0300 @@ -256,7 +256,7 @@ private static String stringifyComponent(NameComponent comp) { StringBuilder one = new StringBuilder(escape(comp.id)); if (comp.kind != null && !comp.kind.equals("")) { - one.append(kindSeparator + escape(comp.kind)); + one.append(kindSeparator).append(escape(comp.kind)); } if (one.length() == 0) { return ""+kindSeparator; // if neither id nor kind specified diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java --- a/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 12 19:52:29 2014 -0300 @@ -90,7 +90,7 @@ if (selected == -1) { StringBuilder allChoices = new StringBuilder(); for (int j = 0; j < choices.length; j++) { - allChoices.append(choices[j] + ","); + allChoices.append(choices[j]).append(','); } throw new IOException("Cannot match " + "'java.naming.security.sasl.realm' property value, '" + diff -r dde9f5cfde5f src/share/classes/com/sun/media/sound/SoftReverb.java --- a/src/share/classes/com/sun/media/sound/SoftReverb.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/media/sound/SoftReverb.java Tue Aug 12 19:52:29 2014 -0300 @@ -512,4 +512,3 @@ this.light = light; } } - diff -r dde9f5cfde5f src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java --- a/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 12 19:52:29 2014 -0300 @@ -167,9 +167,9 @@ for (int i = 0; i < allchannelnames.length; i++) { if ((channelmask & m) != 0L) { if (i < channelnames.length) { - sb.append(channelnames[i] + " "); + sb.append(channelnames[i]).append(' '); } else { - sb.append(allchannelnames[i] + " "); + sb.append(allchannelnames[i]).append(' '); } } m *= 2L; diff -r dde9f5cfde5f src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java --- a/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java Tue Aug 12 19:52:29 2014 -0300 @@ -104,4 +104,3 @@ */ public abstract boolean checkCredentials (String username, String password); } - diff -r dde9f5cfde5f src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java --- a/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java Tue Aug 12 19:52:29 2014 -0300 @@ -50,4 +50,3 @@ super(msg); } } - diff -r dde9f5cfde5f src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java --- a/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java Tue Aug 12 19:52:29 2014 -0300 @@ -50,4 +50,3 @@ super(msg); } } - diff -r dde9f5cfde5f src/share/classes/com/sun/nio/sctp/InvalidStreamException.java --- a/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java Tue Aug 12 19:52:29 2014 -0300 @@ -49,4 +49,3 @@ super(msg); } } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/Init.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/Init.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/Init.java Tue Aug 12 19:52:29 2014 -0300 @@ -365,4 +365,3 @@ } } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 12 19:52:29 2014 -0300 @@ -235,14 +235,15 @@ String nodeName = att.getNodeName(); if ((nodeName.equals("xmlns") || nodeName.startsWith("xmlns:")) && !storedNamespaces.containsKey(att.getNodeName())) { - sb.append(" " + nodeName + "=\"" + att.getNodeValue() + "\""); + sb.append(' ').append(nodeName).append("=\"") + .append(att.getNodeValue()).append('"'); storedNamespaces.put(nodeName, att.getNodeValue()); } } } wk = wk.getParentNode(); } - sb.append(">" + source + ""); + sb.append('>').append(source).append(""); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherData.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherData.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherData.java Tue Aug 12 19:52:29 2014 -0300 @@ -92,4 +92,3 @@ */ void setCipherReference(CipherReference reference) throws XMLEncryptionException; } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherReference.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherReference.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherReference.java Tue Aug 12 19:52:29 2014 -0300 @@ -92,4 +92,3 @@ */ void setTransforms(Transforms transforms); } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedData.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedData.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedData.java Tue Aug 12 19:52:29 2014 -0300 @@ -43,4 +43,3 @@ */ public interface EncryptedData extends EncryptedType { } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedKey.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedKey.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedKey.java Tue Aug 12 19:52:29 2014 -0300 @@ -110,4 +110,3 @@ */ void setCarriedName(String name); } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedType.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedType.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedType.java Tue Aug 12 19:52:29 2014 -0300 @@ -194,4 +194,3 @@ */ void setEncryptionProperties(EncryptionProperties properties); } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java Tue Aug 12 19:52:29 2014 -0300 @@ -130,4 +130,3 @@ */ void removeEncryptionMethodInformation(Element information); } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperties.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperties.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperties.java Tue Aug 12 19:52:29 2014 -0300 @@ -84,4 +84,3 @@ */ void removeEncryptionProperty(EncryptionProperty property); } - diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformParam.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformParam.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformParam.java Tue Aug 12 19:52:29 2014 -0300 @@ -24,4 +24,4 @@ package com.sun.org.apache.xml.internal.security.transforms; public interface TransformParam { -} \ No newline at end of file +} diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 12 19:52:29 2014 -0300 @@ -85,7 +85,7 @@ if (prefix.equals("xmlns")) { sb.append("#default "); } else { - sb.append(prefix + " "); + sb.append(prefix).append(' '); } } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 12 19:52:29 2014 -0300 @@ -88,7 +88,7 @@ l += countQuotes(DN, j, k); if ((k > 0) && (DN.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseRDN(DN.substring(i, k).trim(), toXml) + ","); + sb.append(parseRDN(DN.substring(i, k).trim(), toXml)).append(','); i = k + 1; l = 0; @@ -121,7 +121,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseATAV(trim(str.substring(i, k)), toXml) + "+"); + sb.append(parseATAV(trim(str.substring(i, k)), toXml)).append('+'); i = k + 1; l = 0; @@ -369,7 +369,7 @@ int k; for (int j = 0; (k = string.indexOf("\\20", j)) >= 0; j = k + 3) { - sb.append(trim(string.substring(i, k)) + "\\ "); + sb.append(trim(string.substring(i, k))).append("\\ "); i = k + 3; } @@ -418,7 +418,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(trim(str.substring(i, k)) + replace); + sb.append(trim(str.substring(i, k))).append(replace); i = k + 1; l = 0; diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/CramMD5Base.java --- a/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 12 19:52:29 2014 -0300 @@ -196,8 +196,7 @@ for (i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java --- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 12 19:52:29 2014 -0300 @@ -391,8 +391,7 @@ for (int i = 0; i < digest.length; i ++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0"+ - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/ParseException.java --- a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 12 19:52:29 2014 -0300 @@ -198,7 +198,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java --- a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 12 19:52:29 2014 -0300 @@ -107,7 +107,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java --- a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 12 19:52:29 2014 -0300 @@ -338,10 +338,10 @@ if (classpath.isEmpty()) { String envcp = System.getProperty("env.class.path"); if ((envcp != null) && (envcp.length() > 0)) { - munged.append(" -classpath " + envcp); + munged.append(" -classpath ").append(envcp); } } else { - munged.append(" -classpath " + classpath.asString()); + munged.append(" -classpath ").append(classpath.asString()); } return munged.toString(); } else { @@ -349,14 +349,4 @@ } } - private String appendPath(String path1, String path2) { - if (path1 == null || path1.length() == 0) { - return path2 == null ? "." : path2; - } else if (path2 == null || path2.length() == 0) { - return path1; - } else { - return path1 + File.pathSeparator + path2; - } - } - } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/extcheck/Main.java --- a/src/share/classes/com/sun/tools/extcheck/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/extcheck/Main.java Tue Aug 12 19:52:29 2014 -0300 @@ -87,4 +87,3 @@ throw new Exception(msg + "\nUsage: extcheck [-verbose] "); } } - diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 12 19:52:29 2014 -0300 @@ -346,12 +346,12 @@ public String valueString(boolean bigLimit) { // Char arrays deserve special treatment - StringBuffer result; + StringBuilder result; byte[] value = getValue(); int max = value.length; byte elementSignature = getElementType(); if (elementSignature == 'C') { - result = new StringBuffer(); + result = new StringBuilder(); for (int i = 0; i < value.length; ) { char val = charAt(i, value); result.append(val); @@ -362,7 +362,7 @@ if (bigLimit) { limit = 1000; } - result = new StringBuffer("{"); + result = new StringBuilder("{"); int num = 0; for (int i = 0; i < value.length; ) { if (num > 0) { @@ -386,37 +386,37 @@ } case 'B': { int val = 0xFF & byteAt(i, value); - result.append("0x" + Integer.toString(val, 16)); + result.append("0x").append(Integer.toString(val, 16)); i++; break; } case 'S': { short val = shortAt(i, value); i += 2; - result.append("" + val); + result.append(val); break; } case 'I': { int val = intAt(i, value); i += 4; - result.append("" + val); + result.append(val); break; } case 'J': { // long long val = longAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } case 'F': { float val = floatAt(i, value); - result.append("" + val); + result.append(val); i += 4; break; } case 'D': { // double double val = doubleAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } @@ -425,7 +425,7 @@ } } } - result.append("}"); + result.append('}'); } return result.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/util/Misc.java --- a/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 12 19:52:29 2014 -0300 @@ -97,11 +97,11 @@ } else if (ch == '&') { sb.append("&"); } else if (ch < ' ') { - sb.append("&#" + Integer.toString(ch) + ";"); + sb.append("&#").append(Integer.toString(ch)).append(';'); } else { int c = (ch & 0xFFFF); if (c > 127) { - sb.append("&#" + Integer.toString(c) + ";"); + sb.append("&#").append(Integer.toString(c)).append(';'); } else { sb.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java --- a/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java Tue Aug 12 19:52:29 2014 -0300 @@ -140,4 +140,4 @@ // method must be directly in this interface return this.equals(method.declaringType()); } -} \ No newline at end of file +} diff -r dde9f5cfde5f src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java --- a/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 12 19:52:29 2014 -0300 @@ -881,12 +881,12 @@ } else if (tag == JDWP.TypeTag.ARRAY) { sb.append("ArrayType"); } else { - sb.append("UNKNOWN TAG: " + tag); + sb.append("UNKNOWN TAG: ").append(tag); } if (signature != null) { - sb.append(", signature='" + signature + "'"); + sb.append(", signature='").append(signature).append('\''); } - sb.append(", id=" + id); + sb.append(", id=").append(id); vm.printTrace(sb.toString()); } if (id == 0) { diff -r dde9f5cfde5f src/share/classes/com/sun/tracing/ProbeName.java --- a/src/share/classes/com/sun/tracing/ProbeName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tracing/ProbeName.java Tue Aug 12 19:52:29 2014 -0300 @@ -45,4 +45,3 @@ public @interface ProbeName { String value(); } - diff -r dde9f5cfde5f src/share/classes/com/sun/tracing/ProviderFactory.java --- a/src/share/classes/com/sun/tracing/ProviderFactory.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tracing/ProviderFactory.java Tue Aug 12 19:52:29 2014 -0300 @@ -111,4 +111,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/com/sun/tracing/ProviderName.java --- a/src/share/classes/com/sun/tracing/ProviderName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tracing/ProviderName.java Tue Aug 12 19:52:29 2014 -0300 @@ -45,4 +45,3 @@ public @interface ProviderName { String value(); } - diff -r dde9f5cfde5f src/share/classes/com/sun/tracing/dtrace/DependencyClass.java --- a/src/share/classes/com/sun/tracing/dtrace/DependencyClass.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tracing/dtrace/DependencyClass.java Tue Aug 12 19:52:29 2014 -0300 @@ -74,4 +74,3 @@ this.encoding = encoding; } } - diff -r dde9f5cfde5f src/share/classes/com/sun/tracing/dtrace/FunctionName.java --- a/src/share/classes/com/sun/tracing/dtrace/FunctionName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tracing/dtrace/FunctionName.java Tue Aug 12 19:52:29 2014 -0300 @@ -44,4 +44,3 @@ public @interface FunctionName { String value(); } - diff -r dde9f5cfde5f src/share/classes/com/sun/tracing/dtrace/ModuleName.java --- a/src/share/classes/com/sun/tracing/dtrace/ModuleName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tracing/dtrace/ModuleName.java Tue Aug 12 19:52:29 2014 -0300 @@ -44,4 +44,3 @@ public @interface ModuleName { String value(); } - diff -r dde9f5cfde5f src/share/classes/com/sun/tracing/dtrace/StabilityLevel.java --- a/src/share/classes/com/sun/tracing/dtrace/StabilityLevel.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tracing/dtrace/StabilityLevel.java Tue Aug 12 19:52:29 2014 -0300 @@ -85,4 +85,3 @@ this.encoding = encoding; } } - -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/lang/management/MemoryUsage.java --- a/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 12 19:52:29 2014 -0300 @@ -237,13 +237,16 @@ * Returns a descriptive representation of this memory usage. */ public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append("init = " + init + "(" + (init >> 10) + "K) "); - buf.append("used = " + used + "(" + (used >> 10) + "K) "); - buf.append("committed = " + committed + "(" + - (committed >> 10) + "K) " ); - buf.append("max = " + max + "(" + (max >> 10) + "K)"); - return buf.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("init = ").append(init).append('(').append(init >> 10) + .append("K) "); + sb.append("used = ").append(used).append('(').append(used >> 10) + .append("K) "); + sb.append("committed = ").append(committed).append('(') + .append(committed >> 10).append("K) "); + sb.append("max = ").append(max).append('(').append(max >> 10) + .append("K)"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/java/lang/management/ThreadInfo.java --- a/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 12 19:52:29 2014 -0300 @@ -579,15 +579,17 @@ * @return a string representation of this thread info. */ public String toString() { - StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" + - " Id=" + getThreadId() + " " + - getThreadState()); + StringBuilder sb = new StringBuilder(); + sb.append('"').append(getThreadName()).append('"') + .append(" Id=").append(getThreadId()).append(' ') + .append(getThreadState()); + if (getLockName() != null) { - sb.append(" on " + getLockName()); + sb.append(" on ").append(getLockName()); } if (getLockOwnerName() != null) { - sb.append(" owned by \"" + getLockOwnerName() + - "\" Id=" + getLockOwnerId()); + sb.append(" owned by \"").append(getLockOwnerName()) + .append("\" Id=").append(getLockOwnerId()); } if (isSuspended()) { sb.append(" (suspended)"); @@ -599,21 +601,21 @@ int i = 0; for (; i < stackTrace.length && i < MAX_FRAMES; i++) { StackTraceElement ste = stackTrace[i]; - sb.append("\tat " + ste.toString()); + sb.append("\tat ").append(ste.toString()); sb.append('\n'); if (i == 0 && getLockInfo() != null) { Thread.State ts = getThreadState(); switch (ts) { case BLOCKED: - sb.append("\t- blocked on " + getLockInfo()); + sb.append("\t- blocked on ").append(getLockInfo()); sb.append('\n'); break; case WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; case TIMED_WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; default: @@ -622,7 +624,7 @@ for (MonitorInfo mi : lockedMonitors) { if (mi.getLockedStackDepth() == i) { - sb.append("\t- locked " + mi); + sb.append("\t- locked ").append(mi); sb.append('\n'); } } @@ -634,10 +636,10 @@ LockInfo[] locks = getLockedSynchronizers(); if (locks.length > 0) { - sb.append("\n\tNumber of locked synchronizers = " + locks.length); + sb.append("\n\tNumber of locked synchronizers = ").append(locks.length); sb.append('\n'); for (LockInfo li : locks) { - sb.append("\t- " + li); + sb.append("\t- ").append(li); sb.append('\n'); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/rmi/dgc/VMID.java --- a/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 12 19:52:29 2014 -0300 @@ -124,8 +124,7 @@ if (addr != null) for (int i = 0; i < addr.length; ++ i) { int x = addr[i] & 0xFF; - sb.append((x < 0x10 ? "0" : "") + - Integer.toString(x, 16)); + sb.append(x < 0x10 ? "0" : "").append(Integer.toString(x, 16)); } sb.append(':'); sb.append(uid.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/security/CodeSigner.java --- a/src/share/classes/java/security/CodeSigner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSigner.java Tue Aug 12 19:52:29 2014 -0300 @@ -156,9 +156,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("Signer: " + signerCertPath.getCertificates().get(0)); + sb.append("Signer: ").append(signerCertPath.getCertificates().get(0)); if (timestamp != null) { - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); } sb.append(")"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/java/security/CodeSource.java --- a/src/share/classes/java/security/CodeSource.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSource.java Tue Aug 12 19:52:29 2014 -0300 @@ -468,12 +468,12 @@ if (this.certs != null && this.certs.length > 0) { for (int i = 0; i < this.certs.length; i++) { - sb.append( " " + this.certs[i]); + sb.append(' ').append(this.certs[i]); } } else if (this.signers != null && this.signers.length > 0) { for (int i = 0; i < this.signers.length; i++) { - sb.append( " " + this.signers[i]); + sb.append(' ').append(this.signers[i]); } } else { sb.append(" "); diff -r dde9f5cfde5f src/share/classes/java/security/KeyStore.java --- a/src/share/classes/java/security/KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/KeyStore.java Tue Aug 12 19:52:29 2014 -0300 @@ -610,8 +610,8 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Private key entry and certificate chain with " - + chain.length + " elements:\r\n"); + sb.append("Private key entry and certificate chain with ") + .append(chain.length).append(" elements:\r\n"); for (Certificate cert : chain) { sb.append(cert); sb.append("\r\n"); diff -r dde9f5cfde5f src/share/classes/java/security/PermissionCollection.java --- a/src/share/classes/java/security/PermissionCollection.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/PermissionCollection.java Tue Aug 12 19:52:29 2014 -0300 @@ -179,13 +179,13 @@ public String toString() { Enumeration enum_ = elements(); StringBuilder sb = new StringBuilder(); - sb.append(super.toString()+" (\n"); + sb.append(super.toString()).append(" (\n"); while (enum_.hasMoreElements()) { try { - sb.append(" "); + sb.append(' '); sb.append(enum_.nextElement().toString()); - sb.append("\n"); - } catch (NoSuchElementException e){ + sb.append('\n'); + } catch (NoSuchElementException e) { // ignore } } diff -r dde9f5cfde5f src/share/classes/java/security/ProtectionDomain.java --- a/src/share/classes/java/security/ProtectionDomain.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/ProtectionDomain.java Tue Aug 12 19:52:29 2014 -0300 @@ -285,34 +285,32 @@ /** * Convert a ProtectionDomain to a String. */ - @Override public String toString() { + @Override + public String toString() { String pals = ""; if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + StringBuilder palBuilder = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); - if (i < principals.length-1) - palBuf.append(",\n"); - else - palBuf.append(")\n"); + palBuilder.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); + if (i < principals.length - 1) { + palBuilder.append(",\n"); + } else { + palBuilder.append(")\n"); + } } - pals = palBuf.toString(); + pals = palBuilder.toString(); } // Check if policy is set; we don't want to load // the policy prematurely here - PermissionCollection pc = Policy.isSet() && seeAllp() ? - mergePermissions(): - getPermissions(); + PermissionCollection pc = Policy.isSet() && seeAllp() ? mergePermissions() + : getPermissions(); - return "ProtectionDomain "+ - " "+codesource+"\n"+ - " "+classloader+"\n"+ - " "+pals+"\n"+ - " "+pc+"\n"; + return "ProtectionDomain " + " " + codesource + "\n" + " " + + classloader + "\n" + " " + pals + "\n" + " " + pc + "\n"; } /** diff -r dde9f5cfde5f src/share/classes/java/security/Timestamp.java --- a/src/share/classes/java/security/Timestamp.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/Timestamp.java Tue Aug 12 19:52:29 2014 -0300 @@ -143,10 +143,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); List certs = signerCertPath.getCertificates(); if (!certs.isEmpty()) { - sb.append("TSA: " + certs.get(0)); + sb.append("TSA: ").append(certs.get(0)); } else { sb.append("TSA: "); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CertPath.java --- a/src/share/classes/java/security/cert/CertPath.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CertPath.java Tue Aug 12 19:52:29 2014 -0300 @@ -221,20 +221,16 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - Iterator stringIterator = - getCertificates().iterator(); - sb.append("\n" + type + " Cert Path: length = " - + getCertificates().size() + ".\n"); - sb.append("[\n"); + sb.append('\n').append(type).append(" Cert Path: length = ") + .append(getCertificates().size()).append(".\n").append("[\n"); int i = 1; - while (stringIterator.hasNext()) { + for (Certificate stringCert : getCertificates()) { sb.append("==========================================" - + "===============Certificate " + i + " start.\n"); - Certificate stringCert = stringIterator.next(); + + "===============Certificate ").append(i).append(" start.\n"); sb.append(stringCert.toString()); sb.append("\n========================================" - + "=================Certificate " + i + " end.\n\n\n"); + + "=================Certificate ").append(i).append(" end.\n\n\n"); i++; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CollectionCertStoreParameters.java --- a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 12 19:52:29 2014 -0300 @@ -134,8 +134,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CollectionCertStoreParameters: [\n"); - sb.append(" collection: " + coll + "\n"); - sb.append("]"); + sb.append(" collection: ").append(coll).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/LDAPCertStoreParameters.java --- a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 12 19:52:29 2014 -0300 @@ -141,9 +141,9 @@ StringBuilder sb = new StringBuilder(); sb.append("LDAPCertStoreParameters: [\n"); - sb.append(" serverName: " + serverName + "\n"); - sb.append(" port: " + port + "\n"); - sb.append("]"); + sb.append(" serverName: ").append(serverName).append('\n'); + sb.append(" port: ").append(port).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXBuilderParameters.java --- a/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 12 19:52:29 2014 -0300 @@ -192,7 +192,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Maximum Path Length: " + maxPathLength + "\n"); + sb.append(" Maximum Path Length: ").append(maxPathLength).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 12 19:52:29 2014 -0300 @@ -109,11 +109,13 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathBuilderResult: [\n"); - sb.append(" Certification Path: " + certPath + "\n"); - sb.append(" Trust Anchor: " + getTrustAnchor().toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(getPolicyTree()) + "\n"); - sb.append(" Subject Public Key: " + getPublicKey() + "\n"); - sb.append("]"); + sb.append(" Certification Path: ").append(certPath).append('\n'); + sb.append(" Trust Anchor: ").append(getTrustAnchor().toString()) + .append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(getPolicyTree())) + .append('\n'); + sb.append(" Subject Public Key: ").append(getPublicKey()).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 12 19:52:29 2014 -0300 @@ -150,10 +150,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathValidatorResult: [\n"); - sb.append(" Trust Anchor: " + trustAnchor.toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(policyTree) + "\n"); - sb.append(" Subject Public Key: " + subjectPublicKey + "\n"); - sb.append("]"); + sb.append(" Trust Anchor: ").append(trustAnchor.toString()).append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(policyTree)).append('\n'); + sb.append(" Subject Public Key: ").append(subjectPublicKey).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXParameters.java --- a/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 12 19:52:29 2014 -0300 @@ -698,8 +698,8 @@ /* start with trusted anchor info */ if (unmodTrustAnchors != null) { - sb.append(" Trust Anchors: " + unmodTrustAnchors.toString() - + "\n"); + sb.append(" Trust Anchors: ").append(unmodTrustAnchors.toString()) + .append('\n'); } /* now, append initial state information */ @@ -707,30 +707,41 @@ if (unmodInitialPolicies.isEmpty()) { sb.append(" Initial Policy OIDs: any\n"); } else { - sb.append(" Initial Policy OIDs: [" - + unmodInitialPolicies.toString() + "]\n"); + sb.append(" Initial Policy OIDs: [") + .append(unmodInitialPolicies.toString()).append("]\n"); } } /* now, append constraints on all certificates in the path */ - sb.append(" Validity Date: " + String.valueOf(date) + "\n"); - sb.append(" Signature Provider: " + String.valueOf(sigProvider) + "\n"); - sb.append(" Default Revocation Enabled: " + revocationEnabled + "\n"); - sb.append(" Explicit Policy Required: " + explicitPolicyRequired + "\n"); - sb.append(" Policy Mapping Inhibited: " + policyMappingInhibited + "\n"); - sb.append(" Any Policy Inhibited: " + anyPolicyInhibited + "\n"); - sb.append(" Policy Qualifiers Rejected: " + policyQualifiersRejected + "\n"); + sb.append(" Validity Date: ").append(String.valueOf(date)) + .append('\n'); + sb.append(" Signature Provider: ").append(String.valueOf(sigProvider)) + .append('\n'); + sb.append(" Default Revocation Enabled: ").append(revocationEnabled) + .append('\n'); + sb.append(" Explicit Policy Required: ") + .append(explicitPolicyRequired).append('\n'); + sb.append(" Policy Mapping Inhibited: ") + .append(policyMappingInhibited).append('\n'); + sb.append(" Any Policy Inhibited: ").append(anyPolicyInhibited) + .append('\n'); + sb.append(" Policy Qualifiers Rejected: ") + .append(policyQualifiersRejected).append('\n'); /* now, append target cert requirements */ - sb.append(" Target Cert Constraints: " + String.valueOf(certSelector) + "\n"); + sb.append(" Target Cert Constraints: ") + .append(String.valueOf(certSelector)).append('\n'); /* finally, append miscellaneous parameters */ - if (certPathCheckers != null) - sb.append(" Certification Path Checkers: [" - + certPathCheckers.toString() + "]\n"); - if (certStores != null) - sb.append(" CertStores: [" + certStores.toString() + "]\n"); - sb.append("]"); + if (certPathCheckers != null) { + sb.append(" Certification Path Checkers: [") + .append(certPathCheckers.toString()).append("]\n"); + } + if (certStores != null) { + sb.append(" CertStores: [").append(certStores.toString()) + .append("]\n"); + } + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PolicyQualifierInfo.java --- a/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 12 19:52:29 2014 -0300 @@ -158,15 +158,17 @@ * {@code PolicyQualifierInfo} */ public String toString() { - if (pqiString != null) + if (pqiString != null) { return pqiString; + } HexDumpEncoder enc = new HexDumpEncoder(); StringBuilder sb = new StringBuilder(); sb.append("PolicyQualifierInfo: [\n"); - sb.append(" qualifierID: " + mId + "\n"); - sb.append(" qualifier: " + - (mData == null ? "null" : enc.encodeBuffer(mData)) + "\n"); - sb.append("]"); + sb.append(" qualifierID: ").append(mId).append('\n'); + sb.append(" qualifier: ") + .append(mData == null ? "null" : enc.encodeBuffer(mData)) + .append('\n'); + sb.append(']'); pqiString = sb.toString(); return pqiString; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/TrustAnchor.java --- a/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 12 19:52:29 2014 -0300 @@ -320,14 +320,18 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); if (pubKey != null) { - sb.append(" Trusted CA Public Key: " + pubKey.toString() + "\n"); - sb.append(" Trusted CA Issuer Name: " - + String.valueOf(caName) + "\n"); + sb.append(" Trusted CA Public Key: ").append(pubKey.toString()) + .append('\n'); + sb.append(" Trusted CA Issuer Name: ") + .append(String.valueOf(caName)).append('\n'); } else { - sb.append(" Trusted CA cert: " + trustedCert.toString() + "\n"); + sb.append(" Trusted CA cert: ").append(trustedCert.toString()) + .append('\n'); } - if (nc != null) - sb.append(" Name Constraints: " + nc.toString() + "\n"); + if (nc != null) { + sb.append(" Name Constraints: ").append(nc.toString()) + .append('\n'); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CRLSelector.java --- a/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 12 19:52:29 2014 -0300 @@ -572,17 +572,17 @@ sb.append(" IssuerNames:\n"); Iterator i = issuerNames.iterator(); while (i.hasNext()) - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } if (minCRL != null) - sb.append(" minCRLNumber: " + minCRL + "\n"); + sb.append(" minCRLNumber: ").append(minCRL).append('\n'); if (maxCRL != null) - sb.append(" maxCRLNumber: " + maxCRL + "\n"); + sb.append(" maxCRLNumber: ").append(maxCRL).append('\n'); if (dateAndTime != null) - sb.append(" dateAndTime: " + dateAndTime + "\n"); + sb.append(" dateAndTime: ").append(dateAndTime).append('\n'); if (certChecking != null) - sb.append(" Certificate being checked: " + certChecking + "\n"); - sb.append("]"); + sb.append(" Certificate being checked: ").append(certChecking).append('\n'); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CertSelector.java --- a/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 12 19:52:29 2014 -0300 @@ -1814,72 +1814,75 @@ StringBuilder sb = new StringBuilder(); sb.append("X509CertSelector: [\n"); if (x509Cert != null) { - sb.append(" Certificate: " + x509Cert.toString() + "\n"); + sb.append(" Certificate: ").append(x509Cert.toString()) + .append('\n'); } if (serialNumber != null) { - sb.append(" Serial Number: " + serialNumber.toString() + "\n"); + sb.append(" Serial Number: ").append(serialNumber.toString()) + .append('\n'); } if (issuer != null) { - sb.append(" Issuer: " + getIssuerAsString() + "\n"); + sb.append(" Issuer: ").append(getIssuerAsString()).append('\n'); } if (subject != null) { - sb.append(" Subject: " + getSubjectAsString() + "\n"); + sb.append(" Subject: ").append(getSubjectAsString()).append('\n'); } - sb.append(" matchAllSubjectAltNames flag: " - + String.valueOf(matchAllSubjectAltNames) + "\n"); + sb.append(" matchAllSubjectAltNames flag: ") + .append(String.valueOf(matchAllSubjectAltNames)).append('\n'); if (subjectAlternativeNames != null) { sb.append(" SubjectAlternativeNames:\n"); Iterator> i = subjectAlternativeNames.iterator(); while (i.hasNext()) { List list = i.next(); - sb.append(" type " + list.get(0) + - ", name " + list.get(1) + "\n"); + sb.append(" type ").append(list.get(0)).append(", name ") + .append(list.get(1)).append('\n'); } } if (subjectKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Subject Key Identifier: " + - enc.encodeBuffer(subjectKeyID) + "\n"); + sb.append(" Subject Key Identifier: ") + .append(enc.encodeBuffer(subjectKeyID)).append('\n'); } if (authorityKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Authority Key Identifier: " + - enc.encodeBuffer(authorityKeyID) + "\n"); + sb.append(" Authority Key Identifier: ") + .append(enc.encodeBuffer(authorityKeyID)).append('\n'); } if (certificateValid != null) { - sb.append(" Certificate Valid: " + - certificateValid.toString() + "\n"); + sb.append(" Certificate Valid: ") + .append(certificateValid.toString()).append('\n'); } if (privateKeyValid != null) { - sb.append(" Private Key Valid: " + - privateKeyValid.toString() + "\n"); + sb.append(" Private Key Valid: ") + .append(privateKeyValid.toString()).append('\n'); } if (subjectPublicKeyAlgID != null) { - sb.append(" Subject Public Key AlgID: " + - subjectPublicKeyAlgID.toString() + "\n"); + sb.append(" Subject Public Key AlgID: ") + .append(subjectPublicKeyAlgID.toString()).append('\n'); } if (subjectPublicKey != null) { - sb.append(" Subject Public Key: " + - subjectPublicKey.toString() + "\n"); + sb.append(" Subject Public Key: ") + .append(subjectPublicKey.toString()).append('\n'); } if (keyUsage != null) { - sb.append(" Key Usage: " + keyUsageToString(keyUsage) + "\n"); + sb.append(" Key Usage: ").append(keyUsageToString(keyUsage)) + .append('\n'); } if (keyPurposeSet != null) { - sb.append(" Extended Key Usage: " + - keyPurposeSet.toString() + "\n"); + sb.append(" Extended Key Usage: ") + .append(keyPurposeSet.toString()).append('\n'); } if (policy != null) { - sb.append(" Policy: " + policy.toString() + "\n"); + sb.append(" Policy: ").append(policy.toString()).append('\n'); } if (pathToGeneralNames != null) { sb.append(" Path to names:\n"); Iterator i = pathToGeneralNames.iterator(); while (i.hasNext()) { - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/text/ChoiceFormat.java --- a/src/share/classes/java/text/ChoiceFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/text/ChoiceFormat.java Tue Aug 12 19:52:29 2014 -0300 @@ -272,7 +272,7 @@ double tryLess = Math.abs(Math.IEEEremainder(less, 1.0d)); if (tryLessOrEqual < tryLess) { - result.append(""+choiceLimits[i]); + result.append(choiceLimits[i]); result.append('#'); } else { if (choiceLimits[i] == Double.POSITIVE_INFINITY) { @@ -280,7 +280,7 @@ } else if (choiceLimits[i] == Double.NEGATIVE_INFINITY) { result.append("-\u221E"); } else { - result.append(""+less); + result.append(less); } result.append('<'); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/util/Scanner.java --- a/src/share/classes/java/util/Scanner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/Scanner.java Tue Aug 12 19:52:29 2014 -0300 @@ -1304,20 +1304,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.Scanner"); - sb.append("[delimiters=" + delimPattern + "]"); - sb.append("[position=" + position + "]"); - sb.append("[match valid=" + matchValid + "]"); - sb.append("[need input=" + needInput + "]"); - sb.append("[source closed=" + sourceClosed + "]"); - sb.append("[skipped=" + skipped + "]"); - sb.append("[group separator=" + groupSeparator + "]"); - sb.append("[decimal separator=" + decimalSeparator + "]"); - sb.append("[positive prefix=" + positivePrefix + "]"); - sb.append("[negative prefix=" + negativePrefix + "]"); - sb.append("[positive suffix=" + positiveSuffix + "]"); - sb.append("[negative suffix=" + negativeSuffix + "]"); - sb.append("[NaN string=" + nanString + "]"); - sb.append("[infinity string=" + infinityString + "]"); + sb.append("[delimiters=").append(delimPattern).append(']'); + sb.append("[position=").append(position).append(']'); + sb.append("[match valid=").append(matchValid).append(']'); + sb.append("[need input=").append(needInput).append(']'); + sb.append("[source closed=").append(sourceClosed).append(']'); + sb.append("[skipped=").append(skipped).append(']'); + sb.append("[group separator=").append(groupSeparator).append(']'); + sb.append("[decimal separator=").append(decimalSeparator).append(']'); + sb.append("[positive prefix=").append(positivePrefix).append(']'); + sb.append("[negative prefix=").append(negativePrefix).append(']'); + sb.append("[positive suffix=").append(positiveSuffix).append(']'); + sb.append("[negative suffix=").append(negativeSuffix).append(']'); + sb.append("[NaN string=").append(nanString).append(']'); + sb.append("[infinity string=").append(infinityString).append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java --- a/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Tue Aug 12 19:52:29 2014 -0300 @@ -274,4 +274,3 @@ } } - diff -r dde9f5cfde5f src/share/classes/java/util/regex/Matcher.java --- a/src/share/classes/java/util/regex/Matcher.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Matcher.java Tue Aug 12 19:52:29 2014 -0300 @@ -1295,14 +1295,14 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.regex.Matcher"); - sb.append("[pattern=" + pattern()); + sb.append("[pattern=").append(pattern()); sb.append(" region="); - sb.append(regionStart() + "," + regionEnd()); + sb.append(regionStart()).append(',').append(regionEnd()); sb.append(" lastmatch="); if ((first >= 0) && (group() != null)) { sb.append(group()); } - sb.append("]"); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Pattern.java --- a/src/share/classes/java/util/regex/Pattern.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Pattern.java Tue Aug 12 19:52:29 2014 -0300 @@ -1488,10 +1488,10 @@ for(int x=0; x0) - result.append("|"+next); + result.append('|').append(next); next = composeOneStep(next); if (next != null) - result.append("|"+produceEquivalentAlternation(next)); + result.append('|').append(produceEquivalentAlternation(next)); } return result.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/stream/FindOps.java --- a/src/share/classes/java/util/stream/FindOps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/stream/FindOps.java Tue Aug 12 19:52:29 2014 -0300 @@ -315,4 +315,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/java/util/stream/MatchOps.java --- a/src/share/classes/java/util/stream/MatchOps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/stream/MatchOps.java Tue Aug 12 19:52:29 2014 -0300 @@ -315,4 +315,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/java/util/stream/SpinedBuffer.java --- a/src/share/classes/java/util/stream/SpinedBuffer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/stream/SpinedBuffer.java Tue Aug 12 19:52:29 2014 -0300 @@ -1058,4 +1058,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/java/util/stream/StreamSpliterators.java --- a/src/share/classes/java/util/stream/StreamSpliterators.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/stream/StreamSpliterators.java Tue Aug 12 19:52:29 2014 -0300 @@ -1545,4 +1545,3 @@ } } } - -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/management/MBeanPermission.java --- a/src/share/classes/javax/management/MBeanPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/MBeanPermission.java Tue Aug 12 19:52:30 2014 -0300 @@ -455,11 +455,11 @@ name.append(className); if (member == null) member = "-"; - name.append("#" + member); + name.append('#').append(member); if (objectName == null) name.append("[-]"); else - name.append("[").append(objectName.getCanonicalName()).append("]"); + name.append('[').append(objectName.getCanonicalName()).append(']'); /* In the interests of legibility for Permission.toString(), we transform the empty string into "*". */ diff -r dde9f5cfde5f src/share/classes/javax/management/modelmbean/RequiredModelMBean.java --- a/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 12 19:52:30 2014 -0300 @@ -716,15 +716,14 @@ } retStr.append("\nMBeanInfo for ModelMBean is:"); - retStr.append("\nCLASSNAME: \t"+ info.getClassName()); - retStr.append("\nDESCRIPTION: \t"+ info.getDescription()); + retStr.append("\nCLASSNAME: \t").append(info.getClassName()); + retStr.append("\nDESCRIPTION: \t").append(info.getDescription()); try { - retStr.append("\nMBEAN DESCRIPTOR: \t"+ - info.getMBeanDescriptor()); + retStr.append("\nMBEAN DESCRIPTOR: \t").append(info.getMBeanDescriptor()); } catch (Exception e) { - retStr.append("\nMBEAN DESCRIPTOR: \t" + " is invalid"); + retStr.append("\nMBEAN DESCRIPTOR: \t is invalid"); } retStr.append("\nATTRIBUTES"); @@ -734,13 +733,12 @@ for (int i=0; i objNameIter = objectNameList.iterator(); - objNameIter.hasNext();) { + StringBuilder sb = new StringBuilder(); + sb.append("role name: ").append(name).append("; role value: "); + for (Iterator objNameIter = objectNameList.iterator(); objNameIter + .hasNext();) { ObjectName currObjName = objNameIter.next(); - result.append(currObjName.toString()); + sb.append(currObjName.toString()); if (objNameIter.hasNext()) { - result.append(", "); + sb.append(", "); } } - return result.toString(); + return sb.toString(); } // diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleInfo.java --- a/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 12 19:52:30 2014 -0300 @@ -456,13 +456,13 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role info name: " + name); - result.append("; isReadable: " + isReadable); - result.append("; isWritable: " + isWritable); - result.append("; description: " + description); - result.append("; minimum degree: " + minDegree); - result.append("; maximum degree: " + maxDegree); - result.append("; MBean class: " + referencedMBeanClassName); + result.append("role info name: ").append(name); + result.append("; isReadable: ").append(isReadable); + result.append("; isWritable: ").append(isWritable); + result.append("; description: ").append(description); + result.append("; minimum degree: ").append(minDegree); + result.append("; maximum degree: ").append(maxDegree); + result.append("; MBean class: ").append(referencedMBeanClassName); return result.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleUnresolved.java --- a/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 12 19:52:30 2014 -0300 @@ -282,7 +282,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + roleName); + result.append("role name: ").append(roleName); if (roleValue != null) { result.append("; value: "); for (Iterator objNameIter = roleValue.iterator(); @@ -294,7 +294,7 @@ } } } - result.append("; problem type: " + problemType); + result.append("; problem type: ").append(problemType); return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/crypto/CryptoPermission.java --- a/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 12 19:52:29 2014 -0300 @@ -369,22 +369,24 @@ * @return information about this CryptoPermission. */ public String toString() { - StringBuilder buf = new StringBuilder(100); - buf.append("(CryptoPermission " + alg + " " + maxKeySize); + StringBuilder sb = new StringBuilder(100); + sb.append("(CryptoPermission ").append(alg).append(' ') + .append(maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { - buf.append(" , effective " + - ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits()); + sb.append(" , effective ") + .append(((RC2ParameterSpec) algParamSpec) + .getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { - buf.append(" , rounds " + - ((RC5ParameterSpec)algParamSpec).getRounds()); + sb.append(" , rounds ").append( + ((RC5ParameterSpec) algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL - buf.append(" " + exemptionMechanism); + sb.append(' ').append(exemptionMechanism); } - buf.append(")"); - return buf.toString(); + sb.append(')'); + return sb.toString(); } private boolean impliesExemptionMechanism(String exemptionMechanism) { -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/naming/BinaryRefAddr.java --- a/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 12 19:52:30 2014 -0300 @@ -165,11 +165,11 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Address Type: " + addrType + "\n"); - + StringBuilder str = new StringBuilder(); + str.append("Address Type: ").append(addrType).append('\n'); str.append("AddressContents: "); for (int i = 0; i= 32) str.append(" ...\n"); diff -r dde9f5cfde5f src/share/classes/javax/naming/NameImpl.java --- a/src/share/classes/javax/naming/NameImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/NameImpl.java Tue Aug 12 19:52:30 2014 -0300 @@ -170,7 +170,7 @@ endQuote = one ? syntaxEndQuote1 : syntaxEndQuote2; i += syntaxTypevalSeparator.length(); - answer.append(syntaxTypevalSeparator+beginQuote); // add back + answer.append(syntaxTypevalSeparator).append(beginQuote); // add back // consume string until matching quote for (i += beginQuote.length(); diff -r dde9f5cfde5f src/share/classes/javax/naming/RefAddr.java --- a/src/share/classes/javax/naming/RefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/RefAddr.java Tue Aug 12 19:52:30 2014 -0300 @@ -139,9 +139,9 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Type: " + addrType + "\n"); - - str.append("Content: " + getContent() + "\n"); + StringBuilder str = new StringBuilder(); + str.append("Type: ").append(addrType).append('\n'); + str.append("Content: ").append(getContent()).append('\n'); return (str.toString()); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/security/auth/kerberos/KerberosTicket.java --- a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 12 19:52:30 2014 -0300 @@ -651,8 +651,7 @@ StringBuilder caddrString = new StringBuilder(); if (clientAddresses != null) { for (int i = 0; i < clientAddresses.length; i++) { - caddrString.append("clientAddresses[" + i + "] = " + - clientAddresses[i].toString()); + caddrString.append("clientAddresses[").append(i).append("] = ").append(clientAddresses[i].toString()); } } return ("Ticket (hex) = " + "\n" + -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/AudioFileFormat.java --- a/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 12 19:52:30 2014 -0300 @@ -272,26 +272,25 @@ @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder sb = new StringBuilder(); //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() throws unexpected NullPointerException if (type != null) { - buf.append(type.toString() + " (." + type.getExtension() + ") file"); + sb.append(type.toString()).append(" (.").append(type.getExtension()).append(") file"); } else { - buf.append("unknown file format"); + sb.append("unknown file format"); } if (byteLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", byte length: " + byteLength); + sb.append(", byte length: ").append(byteLength); } - buf.append(", data format: " + format); + sb.append(", data format: ").append(format); if (frameLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", frame length: " + frameLength); + sb.append(", frame length: ").append(frameLength); } - - return new String(buf); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/DataLine.java --- a/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 12 19:52:30 2014 -0300 @@ -473,17 +473,21 @@ StringBuilder sb = new StringBuilder(); if ( (formats.length == 1) && (formats[0] != null) ) { - sb.append(" supporting format " + formats[0]); + sb.append(" supporting format ").append(formats[0]); } else if (getFormats().length > 1) { - sb.append(" supporting " + getFormats().length + " audio formats"); + sb.append(" supporting ").append(getFormats().length) + .append(" audio formats"); } if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) { - sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes"); + sb.append(", and buffers of ").append(minBufferSize) + .append(" to ").append(maxBufferSize).append(" bytes"); } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) { - sb.append(", and buffers of at least " + minBufferSize + " bytes"); + sb.append(", and buffers of at least ").append(minBufferSize) + .append(" bytes"); } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) { - sb.append(", and buffers of up to " + minBufferSize + " bytes"); + sb.append(", and buffers of up to ").append(minBufferSize) + .append(" bytes"); } return new String(super.toString() + sb); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/swing/GroupLayout.java --- a/src/share/classes/javax/swing/GroupLayout.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/GroupLayout.java Tue Aug 12 19:52:30 2014 -0300 @@ -1213,15 +1213,15 @@ registerComponents(horizontalGroup, HORIZONTAL); registerComponents(verticalGroup, VERTICAL); } - StringBuffer buffer = new StringBuffer(); - buffer.append("HORIZONTAL\n"); - createSpringDescription(buffer, horizontalGroup, " ", HORIZONTAL); - buffer.append("\nVERTICAL\n"); - createSpringDescription(buffer, verticalGroup, " ", VERTICAL); - return buffer.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("HORIZONTAL\n"); + createSpringDescription(sb, horizontalGroup, " ", HORIZONTAL); + sb.append("\nVERTICAL\n"); + createSpringDescription(sb, verticalGroup, " ", VERTICAL); + return sb.toString(); } - private void createSpringDescription(StringBuffer buffer, Spring spring, + private void createSpringDescription(StringBuilder sb, Spring spring, String indent, int axis) { String origin = ""; String padding = ""; @@ -1239,20 +1239,19 @@ padding = ", userCreated=" + paddingSpring.getUserCreated() + ", matches=" + paddingSpring.getMatchDescription(); } - buffer.append(indent + spring.getClass().getName() + " " + - Integer.toHexString(spring.hashCode()) + " " + - origin + - ", size=" + spring.getSize() + - ", alignment=" + spring.getAlignment() + - " prefs=[" + spring.getMinimumSize(axis) + - " " + spring.getPreferredSize(axis) + - " " + spring.getMaximumSize(axis) + - padding + "]\n"); + sb.append(indent).append(spring.getClass().getName()).append(' ') + .append(Integer.toHexString(spring.hashCode())).append(' ') + .append(origin).append(", size=").append(spring.getSize()) + .append(", alignment=").append(spring.getAlignment()) + .append(" prefs=[").append(spring.getMinimumSize(axis)) + .append(' ').append(spring.getPreferredSize(axis)).append(' ') + .append(spring.getMaximumSize(axis)).append(padding) + .append("]\n"); if (spring instanceof Group) { List springs = ((Group)spring).springs; indent += " "; for (int counter = 0; counter < springs.size(); counter++) { - createSpringDescription(buffer, springs.get(counter), indent, + createSpringDescription(sb, springs.get(counter), indent, axis); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/JColorChooser.java --- a/src/share/classes/javax/swing/JColorChooser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/JColorChooser.java Tue Aug 12 19:52:30 2014 -0300 @@ -542,19 +542,19 @@ * * @return a string representation of this JColorChooser */ - protected String paramString() { - StringBuilder chooserPanelsString = new StringBuilder(""); - for (int i=0; i keys = keys(); - while (keys.hasMoreElements()) { - Object key = keys.nextElement(); - sb.append(key + "=" + get(key) + ", "); - } - int length = sb.length(); - if (length > 1) { - sb.delete(length-2, length); - } - sb.append("}"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("{"); + Enumeration keys = keys(); + while (keys.hasMoreElements()) { + Object key = keys.nextElement(); + sb.append(key).append('=').append(get(key)).append(", "); + } + int length = sb.length(); + if (length > 1) { + sb.delete(length - 2, length); + } + sb.append('}'); + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/RepaintManager.java --- a/src/share/classes/javax/swing/RepaintManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/RepaintManager.java Tue Aug 12 19:52:30 2014 -0300 @@ -990,10 +990,7 @@ * @return a String representation of this object */ public synchronized String toString() { - StringBuilder sb = new StringBuilder(); - if(dirtyComponents != null) - sb.append("" + dirtyComponents); - return sb.toString(); + return dirtyComponents != null ? dirtyComponents.toString() : ""; } diff -r dde9f5cfde5f src/share/classes/javax/swing/event/TreeModelEvent.java --- a/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 12 19:52:30 2014 -0300 @@ -294,21 +294,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(getClass().getName() + " " + - Integer.toString(hashCode())); + sb.append(getClass().getName()).append(' ').append(Integer.toString(hashCode())); if(path != null) - sb.append(" path " + path); + sb.append(" path ").append(path); if(childIndices != null) { sb.append(" indices [ "); for(int counter = 0; counter < childIndices.length; counter++) - sb.append(Integer.toString(childIndices[counter])+ " "); - sb.append("]"); + sb.append(Integer.toString(childIndices[counter])).append(' '); + sb.append(']'); } if(children != null) { sb.append(" children [ "); for(int counter = 0; counter < children.length; counter++) - sb.append(children[counter] + " "); - sb.append("]"); + sb.append(children[counter]).append(' '); + sb.append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 12 19:52:30 2014 -0300 @@ -1330,8 +1330,8 @@ for (Object obj : values) { String val = ((obj == null) ? "" : obj.toString()); - plainBuf.append(val + "\n"); - htmlBuf.append("
  • " + val + "\n"); + plainBuf.append(val).append('\n'); + htmlBuf.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicListUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 12 19:52:30 2014 -0300 @@ -2948,8 +2948,8 @@ for (int i = 0; i < values.length; i++) { Object obj = values[i]; String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\n"); - htmlStr.append("
  • " + val + "\n"); + plainStr.append(val).append('\n'); + htmlStr.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTableUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 12 19:52:30 2014 -0300 @@ -2230,11 +2230,11 @@ for (int col = 0; col < cols.length; col++) { Object obj = table.getValueAt(rows[row], cols[col]); String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\t"); - htmlStr.append(" " + val + "\n"); + plainStr.append(val).append('\t'); + htmlStr.append(" ").append(val).append("\n"); } // we want a newline at the end of each line and not a tab - plainStr.deleteCharAt(plainStr.length() - 1).append("\n"); + plainStr.deleteCharAt(plainStr.length() - 1).append('\t'); htmlStr.append("\n"); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 12 19:52:30 2014 -0300 @@ -3618,8 +3618,8 @@ boolean leaf = model.isLeaf(node); String label = getDisplayString(path, true, leaf); - plainStr.append(label + "\n"); - htmlStr.append("
  • " + label + "\n"); + plainStr.append(label).append('\n'); + htmlStr.append("
  • ").append(label).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java --- a/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java Tue Aug 12 19:52:30 2014 -0300 @@ -199,4 +199,3 @@ Math.min((int)(c.getBlue()/factor), 255)); } } - diff -r dde9f5cfde5f src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java --- a/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 12 19:52:30 2014 -0300 @@ -1160,15 +1160,15 @@ rows = rowMapper.getRowsForPaths(selection); else rows = null; - sb.append(getClass().getName() + " " + hashCode() + " [ "); + sb.append(getClass().getName()).append(' ').append(hashCode()).append(" [ "); for(int counter = 0; counter < selCount; counter++) { if(rows != null) - sb.append(selection[counter].toString() + "@" + - Integer.toString(rows[counter])+ " "); + sb.append(selection[counter].toString()).append('@') + .append(Integer.toString(rows[counter])).append(' '); else - sb.append(selection[counter].toString() + " "); + sb.append(selection[counter].toString()).append(' '); } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/font/AttributeValues.java --- a/src/share/classes/sun/font/AttributeValues.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/AttributeValues.java Tue Aug 12 19:52:30 2014 -0300 @@ -542,7 +542,7 @@ } } } - b.append("[btx=" + baselineTransform + ", ctx=" + charTransform + "]"); + b.append("[btx=").append(baselineTransform).append(", ctx=").append(charTransform).append(']'); b.append('}'); return b.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/Decoration.java --- a/src/share/classes/sun/font/Decoration.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/Decoration.java Tue Aug 12 19:52:30 2014 -0300 @@ -431,12 +431,12 @@ StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); - if (fgPaint != null) sb.append("fgPaint: " + fgPaint); - if (bgPaint != null) sb.append(" bgPaint: " + bgPaint); + if (fgPaint != null) sb.append("fgPaint: ").append(fgPaint); + if (bgPaint != null) sb.append(" bgPaint: ").append(bgPaint); if (swapColors) sb.append(" swapColors: true"); if (strikethrough) sb.append(" strikethrough: true"); - if (stdUnderline != null) sb.append(" stdUnderline: " + stdUnderline); - if (imUnderline != null) sb.append(" imUnderline: " + imUnderline); + if (stdUnderline != null) sb.append(" stdUnderline: ").append(stdUnderline); + if (imUnderline != null) sb.append(" imUnderline: ").append(imUnderline); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/StandardGlyphVector.java --- a/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 12 19:52:30 2014 -0300 @@ -1894,9 +1894,9 @@ } } catch(Exception e) { - buf.append(" " + e.getMessage()); + buf.append(' ').append(e.getMessage()); } - buf.append("}"); + buf.append('}'); return buf; } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/launcher/LauncherHelper.java --- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 12 19:52:30 2014 -0300 @@ -369,10 +369,9 @@ static void appendVmErgoMessage(boolean isServerClass, String vm) { outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1", vm)); - outBuf = (isServerClass) - ? outBuf.append(",\n" + - getLocalizedMessage("java.launcher.ergo.message2") + "\n\n") - : outBuf.append(".\n\n"); + outBuf = (isServerClass) ? outBuf.append(",\n") + .append(getLocalizedMessage("java.launcher.ergo.message2")) + .append("\n\n") : outBuf.append(".\n\n"); } /** -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/management/Agent.java --- a/src/share/classes/sun/management/Agent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/Agent.java Tue Aug 12 19:52:31 2014 -0300 @@ -502,7 +502,7 @@ } else { StringBuilder message = new StringBuilder(params[0]); for (int i = 1; i < params.length; i++) { - message.append(" " + params[i]); + message.append(' ').append(params[i]); } error(key, message.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/management/MappedMXBeanType.java --- a/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 12 19:52:31 2014 -0300 @@ -289,7 +289,7 @@ if (et.isPrimitive()) { className = new StringBuilder(c.getName()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); @@ -385,7 +385,7 @@ if (elementType instanceof Class && ((Class) elementType).isPrimitive()) { className = new StringBuilder(gat.toString()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java --- a/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 12 19:52:31 2014 -0300 @@ -463,12 +463,12 @@ // --------- - private static void appendIfLiteralAddress(String addr, StringBuffer sb) { + private static void appendIfLiteralAddress(String addr, StringBuilder sb) { if (IPAddressUtil.isIPv4LiteralAddress(addr)) { - sb.append("dns://" + addr + " "); + sb.append("dns://").append(addr).append(' '); } else { if (IPAddressUtil.isIPv6LiteralAddress(addr)) { - sb.append("dns://[" + addr + "] "); + sb.append("dns://[").append(addr).append("] "); } } } @@ -478,7 +478,7 @@ * corresponding to the supplied List of nameservers. */ private static String createProviderURL(List nsList) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (String s: nsList) { appendIfLiteralAddress(s, sb); } @@ -491,7 +491,7 @@ * contained in the provided str. */ private static String createProviderURL(String str) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); StringTokenizer st = new StringTokenizer(str, ","); while (st.hasMoreTokens()) { appendIfLiteralAddress(st.nextToken(), sb); diff -r dde9f5cfde5f src/share/classes/sun/net/util/URLUtil.java --- a/src/share/classes/sun/net/util/URLUtil.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/util/URLUtil.java Tue Aug 12 19:52:31 2014 -0300 @@ -77,4 +77,3 @@ return strForm.toString(); } } - diff -r dde9f5cfde5f src/share/classes/sun/net/www/HeaderParser.java --- a/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 12 19:52:31 2014 -0300 @@ -220,21 +220,23 @@ public String toString () { Iterator k = keys(); - StringBuffer sbuf = new StringBuffer(); - sbuf.append ("{size="+asize+" nkeys="+nkeys+" "); + StringBuilder sb = new StringBuilder(); + sb.append("{size=").append(asize).append(" nkeys=").append(nkeys) + .append(' '); for (int i=0; k.hasNext(); i++) { String key = k.next(); String val = findValue (i); if (val != null && "".equals (val)) { val = null; } - sbuf.append (" {"+key+(val==null?"":","+val)+"}"); + sb.append(" {").append(key).append(val == null ? "" : "," + val) + .append('}'); if (k.hasNext()) { - sbuf.append (","); + sb.append (','); } } - sbuf.append (" }"); - return new String (sbuf); + sb.append (" }"); + return new String (sb); } public int findInt(String k, int Default) { diff -r dde9f5cfde5f src/share/classes/sun/net/www/MimeEntry.java --- a/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 12 19:52:31 2014 -0300 @@ -288,7 +288,7 @@ int action = getAction(); if (action != MimeEntry.UNKNOWN) { - sb.append("action=" + actionKeywords[action]); + sb.append("action=").append(actionKeywords[action]); needSeparator = true; } @@ -297,7 +297,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("application=" + command); + sb.append("application=").append(command); needSeparator = true; } @@ -305,7 +305,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("icon=" + getImageFileName()); + sb.append("icon=").append(getImageFileName()); needSeparator = true; } @@ -314,7 +314,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("file_extensions=" + extensions); + sb.append("file_extensions=").append(extensions); needSeparator = true; } @@ -323,7 +323,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("description=" + description); + sb.append("description=").append(description); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/net/www/protocol/http/AuthScheme.java --- a/src/share/classes/sun/net/www/protocol/http/AuthScheme.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/protocol/http/AuthScheme.java Tue Aug 12 19:52:31 2014 -0300 @@ -35,4 +35,3 @@ KERBEROS, UNKNOWN; } - diff -r dde9f5cfde5f src/share/classes/sun/net/www/protocol/http/BasicAuthentication.java --- a/src/share/classes/sun/net/www/protocol/http/BasicAuthentication.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/protocol/http/BasicAuthentication.java Tue Aug 12 19:52:31 2014 -0300 @@ -202,4 +202,3 @@ return npath; } } - diff -r dde9f5cfde5f src/share/classes/sun/net/www/protocol/http/Negotiator.java --- a/src/share/classes/sun/net/www/protocol/http/Negotiator.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/protocol/http/Negotiator.java Tue Aug 12 19:52:31 2014 -0300 @@ -81,4 +81,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/sun/net/www/protocol/http/ntlm/NTLMAuthenticationCallback.java --- a/src/share/classes/sun/net/www/protocol/http/ntlm/NTLMAuthenticationCallback.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/protocol/http/ntlm/NTLMAuthenticationCallback.java Tue Aug 12 19:52:31 2014 -0300 @@ -56,4 +56,3 @@ public boolean isTrustedSite(URL url) { return true; } } } - -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/security/acl/AclEntryImpl.java --- a/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 12 19:52:31 2014 -0300 @@ -137,26 +137,30 @@ /** * Return a string representation of the contents of the ACL entry. */ - public String toString() { - StringBuffer s = new StringBuffer(); - if (negative) - s.append("-"); - else - s.append("+"); - if (user instanceof Group) - s.append("Group."); - else - s.append("User."); - s.append(user + "="); - Enumeration e = permissions(); - while(e.hasMoreElements()) { - Permission p = e.nextElement(); - s.append(p); - if (e.hasMoreElements()) - s.append(","); + public String toString() { + StringBuffer sb = new StringBuffer(); + if (negative) { + sb.append('-'); + } else { + sb.append('+'); + } + if (user instanceof Group) { + sb.append("Group."); + } else { + sb.append("User."); + } + sb.append(user).append('='); + + Enumeration e = permissions(); + while (e.hasMoreElements()) { + Permission p = e.nextElement(); + sb.append(p); + if (e.hasMoreElements()) { + sb.append(','); + } + } + return sb.toString(); } - return new String(s); - } /** * Clones an AclEntry. diff -r dde9f5cfde5f src/share/classes/sun/security/jgss/GSSCaller.java --- a/src/share/classes/sun/security/jgss/GSSCaller.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/jgss/GSSCaller.java Tue Aug 12 19:52:31 2014 -0300 @@ -46,4 +46,3 @@ return "GSSCaller{" + name + '}'; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/jgss/HttpCaller.java --- a/src/share/classes/sun/security/jgss/HttpCaller.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/jgss/HttpCaller.java Tue Aug 12 19:52:31 2014 -0300 @@ -43,4 +43,3 @@ return hci; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/jgss/spnego/SpNegoContext.java --- a/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java Tue Aug 12 19:52:31 2014 -0300 @@ -1231,4 +1231,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/sun/security/krb5/KdcComm.java --- a/src/share/classes/sun/security/krb5/KdcComm.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/krb5/KdcComm.java Tue Aug 12 19:52:31 2014 -0300 @@ -560,4 +560,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java --- a/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 12 19:52:31 2014 -0300 @@ -640,8 +640,7 @@ for (int i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs/SigningCertificateInfo.java --- a/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 12 19:52:31 2014 -0300 @@ -158,8 +158,8 @@ } sb.append(hexDumper.encode(certHash)); if (issuer != null && serialNumber != null) { - sb.append("\n\tIssuer: " + issuer + "\n"); - sb.append("\t" + serialNumber); + sb.append("\n\tIssuer: ").append(issuer).append('\n'); + sb.append('\t').append(serialNumber); } sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs11/P11KeyStore.java --- a/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 12 19:52:31 2014 -0300 @@ -196,24 +196,24 @@ } else if (type == ATTR_CLASS_CERT) { sb.append("\ttype=[trusted cert]\n"); } - sb.append("\tlabel=[" + label + "]\n"); + sb.append("\tlabel=[").append(label).append("]\n"); if (id == null) { sb.append("\tid=[null]\n"); } else { - sb.append("\tid=" + P11KeyStore.getID(id) + "\n"); + sb.append("\tid=").append(P11KeyStore.getID(id)).append('\n'); } - sb.append("\ttrusted=[" + trusted + "]\n"); - sb.append("\tmatched=[" + matched + "]\n"); + sb.append("\ttrusted=[").append(trusted).append("]\n"); + sb.append("\tmatched=[").append(matched).append("]\n"); if (cert == null) { sb.append("\tcert=[null]\n"); } else { - sb.append("\tcert=[\tsubject: " + - cert.getSubjectX500Principal() + - "\n\t\tissuer: " + - cert.getIssuerX500Principal() + - "\n\t\tserialNum: " + - cert.getSerialNumber().toString() + - "]"); + sb.append("\tcert=[\tsubject: ") + .append(cert.getSubjectX500Principal()) + .append("\n\t\tissuer: ") + .append(cert.getIssuerX500Principal()) + .append("\n\t\tserialNum: ") + .append(cert.getSerialNumber().toString()) + .append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/PolicyFile.java --- a/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 12 19:52:31 2014 -0300 @@ -1485,30 +1485,30 @@ } int startIndex = 0; int v; - StringBuilder sb = new StringBuilder(); - while ((v = sp.getSelfName().indexOf(SELF, startIndex)) != -1) { + StringBuilder sb = new StringBuilder(); + while ((v = sp.getSelfName().indexOf(SELF, startIndex)) != -1) { - // add non-SELF string - sb.append(sp.getSelfName().substring(startIndex, v)); + // add non-SELF string + sb.append(sp.getSelfName().substring(startIndex, v)); - // expand SELF - Iterator pli = entryPs.iterator(); - while (pli.hasNext()) { - PolicyParser.PrincipalEntry pppe = pli.next(); - String[][] principalInfo = getPrincipalInfo(pppe,pdp); - for (int i = 0; i < principalInfo.length; i++) { - if (i != 0) { - sb.append(", "); - } - sb.append(principalInfo[i][0] + " " + - "\"" + principalInfo[i][1] + "\""); + // expand SELF + Iterator pli = entryPs.iterator(); + while (pli.hasNext()) { + PolicyParser.PrincipalEntry pppe = pli.next(); + String[][] principalInfo = getPrincipalInfo(pppe, pdp); + for (int i = 0; i < principalInfo.length; i++) { + if (i != 0) { + sb.append(", "); + } + sb.append(principalInfo[i][0]).append(' ').append('"') + .append(principalInfo[i][1]).append('"'); + } + if (pli.hasNext()) { + sb.append(", "); + } + } + startIndex = v + SELF.length(); } - if (pli.hasNext()) { - sb.append(", "); - } - } - startIndex = v + SELF.length(); - } // add remaining string (might be the entire string) sb.append(sp.getSelfName().substring(startIndex)); @@ -1774,17 +1774,17 @@ Principal[] principals = pd.getPrincipals(); String pals = ""; if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + StringBuilder palSB = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palSB.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); if (i < principals.length-1) - palBuf.append(", "); + palSB.append(", "); else - palBuf.append(")"); + palSB.append(')'); } - pals = palBuf.toString(); + pals = palSB.toString(); } return "PD CodeSource: " + pd.getCodeSource() @@ -1884,7 +1884,7 @@ throw new Exception(form.format(source)); } - sb.append(X500PRINCIPAL + " \"" + suffix + "\""); + sb.append(X500PRINCIPAL).append(" \"").append(suffix).append('"'); startIndex = e+2; } else { MessageFormat form = new MessageFormat diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java --- a/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java Tue Aug 12 19:52:31 2014 -0300 @@ -363,4 +363,3 @@ } } - diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/CertId.java --- a/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 12 19:52:31 2014 -0300 @@ -223,13 +223,13 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertId \n"); - sb.append("Algorithm: " + hashAlgId.toString() +"\n"); + sb.append("Algorithm: ").append(hashAlgId.toString()).append('\n'); sb.append("issuerNameHash \n"); HexDumpEncoder encoder = new HexDumpEncoder(); sb.append(encoder.encode(issuerNameHash)); sb.append("\nissuerKeyHash: \n"); sb.append(encoder.encode(issuerKeyHash)); - sb.append("\n" + certSerialNumber.toString()); + sb.append('\n').append(certSerialNumber.toString()); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/OCSPResponse.java --- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 12 19:52:31 2014 -0300 @@ -812,14 +812,14 @@ StringBuilder sb = new StringBuilder(); sb.append("SingleResponse: \n"); sb.append(certId); - sb.append("\nCertStatus: "+ certStatus + "\n"); + sb.append("\nCertStatus: ").append(certStatus).append('\n'); if (certStatus == CertStatus.REVOKED) { - sb.append("revocationTime is " + revocationTime + "\n"); - sb.append("revocationReason is " + revocationReason + "\n"); + sb.append("revocationTime is ").append(revocationTime).append('\n'); + sb.append("revocationReason is ").append(revocationReason).append('\n'); } - sb.append("thisUpdate is " + thisUpdate + "\n"); + sb.append("thisUpdate is ").append(thisUpdate).append('\n'); if (nextUpdate != null) { - sb.append("nextUpdate is " + nextUpdate + "\n"); + sb.append("nextUpdate is ").append(nextUpdate).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java --- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 12 19:52:31 2014 -0300 @@ -124,7 +124,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Build Forward Flag: " + String.valueOf(buildForward) + "\n"); + sb.append(" Build Forward Flag: ").append(String.valueOf(buildForward)).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/UntrustedChecker.java --- a/src/share/classes/sun/security/provider/certpath/UntrustedChecker.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/UntrustedChecker.java Tue Aug 12 19:52:31 2014 -0300 @@ -86,4 +86,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/HandshakeMessage.java --- a/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 12 19:52:31 2014 -0300 @@ -1478,7 +1478,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/MAC.java --- a/src/share/classes/sun/security/ssl/MAC.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/MAC.java Tue Aug 12 19:52:31 2014 -0300 @@ -165,4 +165,3 @@ } } - diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java --- a/src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java Tue Aug 12 19:52:31 2014 -0300 @@ -472,4 +472,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/ServerNameExtension.java --- a/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 12 19:52:31 2014 -0300 @@ -267,11 +267,11 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", server_name: "); for (SNIServerName sniName : sniMap.values()) { - sb.append("[" + sniName + "]"); + sb.append('[').append(sniName).append(']'); } - - return "Extension " + type + ", server_name: " + sb; + return sb.toString(); } private static class UnknownServerName extends SNIServerName { diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java --- a/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 12 19:52:31 2014 -0300 @@ -119,17 +119,16 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", signature_algorithms: "); boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; } } - - return "Extension " + type + ", signature_algorithms: " + sb; + return sb.toString(); } } - diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java --- a/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java Tue Aug 12 19:52:31 2014 -0300 @@ -434,4 +434,3 @@ } } } - diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 12 19:52:31 2014 -0300 @@ -112,37 +112,37 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Extension " + type + ", curve names: {"); - boolean first = true; - for (int curveId : curveIds) { - if (first) { - first = false; - } else { - sb.append(", "); - } - // first check if it is a known named curve, then try other cases. - String oid = getCurveOid(curveId); - if (oid != null) { - ECParameterSpec spec = JsseJce.getECParameterSpec(oid); - // this toString() output will look nice for the current - // implementation of the ECParameterSpec class in the Sun - // provider, but may not look good for other implementations. - if (spec != null) { - sb.append(spec.toString().split(" ")[0]); - } else { - sb.append(oid); + StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", curve names: {"); + boolean first = true; + for (int curveId : curveIds) { + if (first) { + first = false; + } else { + sb.append(", "); + } + // first check if it is a known named curve, then try other cases. + String oid = getCurveOid(curveId); + if (oid != null) { + ECParameterSpec spec = JsseJce.getECParameterSpec(oid); + // this toString() output will look nice for the current + // implementation of the ECParameterSpec class in the Sun + // provider, but may not look good for other implementations. + if (spec != null) { + sb.append(spec.toString().split(" ")[0]); + } else { + sb.append(oid); + } + } else if (curveId == ARBITRARY_PRIME) { + sb.append("arbitrary_explicit_prime_curves"); + } else if (curveId == ARBITRARY_CHAR2) { + sb.append("arbitrary_explicit_char2_curves"); + } else { + sb.append("unknown curve ").append(curveId); + } } - } else if (curveId == ARBITRARY_PRIME) { - sb.append("arbitrary_explicit_prime_curves"); - } else if (curveId == ARBITRARY_CHAR2) { - sb.append("arbitrary_explicit_char2_curves"); - } else { - sb.append("unknown curve " + curveId); - } - } - sb.append("}"); - return sb.toString(); + sb.append("}"); + return sb.toString(); } // Test whether we support the curve with the given index. diff -r dde9f5cfde5f src/share/classes/sun/security/tools/jarsigner/Main.java --- a/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 12 19:52:31 2014 -0300 @@ -676,14 +676,13 @@ ((man.getAttributes(name) != null) || (man.getAttributes("./"+name) != null) || (man.getAttributes("/"+name) != null)); - sb.append( - (isSigned ? rb.getString("s") : rb.getString("SPACE")) + - (inManifest ? rb.getString("m") : rb.getString("SPACE")) + - (inStore ? rb.getString("k") : rb.getString("SPACE")) + - (inScope ? rb.getString("i") : rb.getString("SPACE")) + - ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") + - rb.getString("SPACE")); - sb.append("|"); + sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE")) + .append(inManifest ? rb.getString("m") : rb.getString("SPACE")) + .append(inStore ? rb.getString("k") : rb.getString("SPACE")) + .append(inScope ? rb.getString("i") : rb.getString("SPACE")) + .append((inStoreOrScope & NOT_ALIAS) != 0 ? 'X' : ' ') + .append(rb.getString("SPACE")); + sb.append('|'); } // When -certs provided, display info has extra empty @@ -704,11 +703,13 @@ // Print no info for unsigned entries when -verbose:all, // to be consistent with old behavior. if (signatureRelated(name)) { - sb.append("\n" + tab + rb.getString( - ".Signature.related.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Signature.related.entries.")) + .append("\n\n"); } else { - sb.append("\n" + tab + rb.getString( - ".Unsigned.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Unsigned.entries.")) + .append("\n\n"); } } @@ -1605,8 +1606,8 @@ // No more warning, we alreay have hasExpiredCert or notYetValidCert } else { chainNotValidated = true; - sb.append(tab + rb.getString(".CertPath.not.validated.") + - e.getLocalizedMessage() + "]\n"); // TODO + sb.append(tab).append(rb.getString(".CertPath.not.validated.")) + .append(e.getLocalizedMessage()).append("]\n"); // TODO } } String result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/keytool/Main.java --- a/src/share/classes/sun/security/tools/keytool/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/keytool/Main.java Tue Aug 12 19:52:31 2014 -0300 @@ -4234,4 +4234,3 @@ return new Pair<>(a,b); } } - diff -r dde9f5cfde5f src/share/classes/sun/security/tools/policytool/PolicyTool.java --- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 12 19:52:31 2014 -0300 @@ -980,8 +980,9 @@ grantEntry.principals.listIterator(); while (list.hasNext()) { PolicyParser.PrincipalEntry pppe = list.next(); - sb.append(" Principal " + pppe.getDisplayClass() + " " + - pppe.getDisplayName(true)); + sb.append(" Principal ").append(pppe.getDisplayClass()) + .append(' ') + .append(pppe.getDisplayName(true)); if (list.hasNext()) sb.append(", "); } result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java --- a/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java Tue Aug 12 19:52:31 2014 -0300 @@ -455,4 +455,3 @@ } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/ECParameters.java --- a/src/share/classes/sun/security/util/ECParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/ECParameters.java Tue Aug 12 19:52:31 2014 -0300 @@ -233,4 +233,3 @@ return namedCurve.toString(); } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/KeyUtil.java --- a/src/share/classes/sun/security/util/KeyUtil.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/KeyUtil.java Tue Aug 12 19:52:31 2014 -0300 @@ -303,4 +303,3 @@ } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources.java --- a/src/share/classes/sun/security/util/Resources.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_de.java --- a/src/share/classes/sun/security/util/Resources_de.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_de.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_es.java --- a/src/share/classes/sun/security/util/Resources_es.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_es.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_fr.java --- a/src/share/classes/sun/security/util/Resources_fr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_fr.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_it.java --- a/src/share/classes/sun/security/util/Resources_it.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_it.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_ja.java --- a/src/share/classes/sun/security/util/Resources_ja.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_ja.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_ko.java --- a/src/share/classes/sun/security/util/Resources_ko.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_ko.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_pt_BR.java --- a/src/share/classes/sun/security/util/Resources_pt_BR.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_pt_BR.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_sv.java --- a/src/share/classes/sun/security/util/Resources_sv.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_sv.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_zh_CN.java --- a/src/share/classes/sun/security/util/Resources_zh_CN.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_zh_CN.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/util/Resources_zh_TW.java --- a/src/share/classes/sun/security/util/Resources_zh_TW.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/util/Resources_zh_TW.java Tue Aug 12 19:52:31 2014 -0300 @@ -169,4 +169,3 @@ return contents; } } - diff -r dde9f5cfde5f src/share/classes/sun/security/x509/AVA.java --- a/src/share/classes/sun/security/x509/AVA.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/AVA.java Tue Aug 12 19:52:31 2014 -0300 @@ -1062,7 +1062,7 @@ } else { boolean quoteNeeded = false; - StringBuilder sbuffer = new StringBuilder(); + StringBuilder sb = new StringBuilder(); boolean previousWhite = false; final String escapees = ",+=\n<>#;\\\""; @@ -1079,7 +1079,7 @@ for (int i = 0; i < length; i++) { char c = valStr.charAt(i); if (alreadyQuoted && (i == 0 || i == length - 1)) { - sbuffer.append(c); + sb.append(c); continue; } if (DerValue.isPrintableStringChar(c) || @@ -1096,7 +1096,7 @@ if (!(c == ' ' || c == '\n')) { // escape '"' and '\' if (c == '"' || c == '\\') { - sbuffer.append('\\'); + sb.append('\\'); } previousWhite = false; } else { @@ -1106,7 +1106,7 @@ previousWhite = true; } - sbuffer.append(c); + sb.append(c); } else if (debug != null && Debug.isOn("ava")) { @@ -1119,26 +1119,26 @@ byte[] valueBytes = Character.toString(c).getBytes("UTF8"); for (int j = 0; j < valueBytes.length; j++) { - sbuffer.append('\\'); + sb.append('\\'); char hexChar = Character.forDigit (0xF & (valueBytes[j] >>> 4), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); hexChar = Character.forDigit (0xF & (valueBytes[j]), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); } } else { // append non-printable/non-escaped char previousWhite = false; - sbuffer.append(c); + sb.append(c); } } // quote if trailing whitespace - if (sbuffer.length() > 0) { - char trailChar = sbuffer.charAt(sbuffer.length() - 1); + if (sb.length() > 0) { + char trailChar = sb.charAt(sb.length() - 1); if (trailChar == ' ' || trailChar == '\n') { quoteNeeded = true; } @@ -1147,9 +1147,9 @@ // Emit the string ... quote it if needed // if string is already quoted, don't re-quote if (!alreadyQuoted && quoteNeeded) { - retval.append("\"" + sbuffer.toString() + "\""); + retval.append('"').append(sb.toString()).append('"'); } else { - retval.append(sbuffer.toString()); + retval.append(sb.toString()); } } } catch (IOException e) { diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPoint.java --- a/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 12 19:52:31 2014 -0300 @@ -381,22 +381,22 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPoint:\n " + fullName + "\n"); + sb.append("DistributionPoint:\n ").append(fullName).append('\n'); } if (relativeName != null) { - sb.append("DistributionPoint:\n " + relativeName + "\n"); + sb.append("DistributionPoint:\n ").append(relativeName).append('\n'); } if (reasonFlags != null) { sb.append(" ReasonFlags:\n"); for (int i = 0; i < reasonFlags.length; i++) { if (reasonFlags[i]) { - sb.append(" " + reasonToString(i) + "\n"); + sb.append(" ").append(reasonToString(i)).append('\n'); } } } if (crlIssuer != null) { - sb.append(" CRLIssuer:" + crlIssuer + "\n"); + sb.append(" CRLIssuer:").append(crlIssuer).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPointName.java --- a/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 12 19:52:31 2014 -0300 @@ -231,10 +231,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPointName:\n " + fullName + "\n"); + sb.append("DistributionPointName:\n ").append(fullName).append('\n'); } else { - sb.append("DistributionPointName:\n " + relativeName + "\n"); + sb.append("DistributionPointName:\n ").append(relativeName).append('\n'); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/PolicyInformation.java --- a/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 12 19:52:31 2014 -0300 @@ -258,9 +258,9 @@ * Return a printable representation of the PolicyInformation. */ public String toString() { - StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString()); - s.append(policyQualifiers + " ]\n"); - return s.toString(); + StringBuilder sb = new StringBuilder(" [" + policyIdentifier.toString()); + sb.append(policyQualifiers).append(" ]\n"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLEntryImpl.java --- a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 12 19:52:31 2014 -0300 @@ -292,17 +292,17 @@ StringBuilder sb = new StringBuilder(); sb.append(serialNumber.toString()); - sb.append(" On: " + revocationDate.toString()); + sb.append(" On: ").append(revocationDate.toString()); if (certIssuer != null) { - sb.append("\n Certificate issuer: " + certIssuer); + sb.append("\n Certificate issuer: ").append(certIssuer); } if (extensions != null) { Collection allEntryExts = extensions.getAllExtensions(); Extension[] exts = allEntryExts.toArray(new Extension[0]); - sb.append("\n CRL Entry Extensions: " + exts.length); + sb.append("\n CRL Entry Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n [" + (i+1) + "]: "); + sb.append("\n [").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -313,9 +313,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLImpl.java --- a/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 12 19:52:31 2014 -0300 @@ -537,31 +537,32 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("X.509 CRL v" + (version+1) + "\n"); + sb.append("X.509 CRL v").append(version + 1).append('\n'); if (sigAlgId != null) - sb.append("Signature Algorithm: " + sigAlgId.toString() + - ", OID=" + (sigAlgId.getOID()).toString() + "\n"); + sb.append("Signature Algorithm: ").append(sigAlgId.toString()) + .append(", OID=") + .append((sigAlgId.getOID()).toString()).append('\n'); if (issuer != null) - sb.append("Issuer: " + issuer.toString() + "\n"); + sb.append("Issuer: ").append(issuer.toString()).append('\n'); if (thisUpdate != null) - sb.append("\nThis Update: " + thisUpdate.toString() + "\n"); + sb.append("\nThis Update: ").append(thisUpdate.toString()).append('\n'); if (nextUpdate != null) - sb.append("Next Update: " + nextUpdate.toString() + "\n"); + sb.append("Next Update: ").append(nextUpdate.toString()).append('\n'); if (revokedList.isEmpty()) sb.append("\nNO certificates have been revoked\n"); else { - sb.append("\nRevoked Certificates: " + revokedList.size()); + sb.append("\nRevoked Certificates: ").append(revokedList.size()); int i = 1; for (X509CRLEntry entry: revokedList) { - sb.append("\n[" + i++ + "] " + entry.toString()); + sb.append("\n[").append(i++).append("] ").append(entry.toString()); } } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Object[] objs = allExts.toArray(); - sb.append("\nCRL Extensions: " + objs.length); + sb.append("\nCRL Extensions: ").append(objs.length); for (int i = 0; i < objs.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = (Extension)objs[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -572,9 +573,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); // sub-class exists @@ -585,8 +585,7 @@ } if (signature != null) { HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) - + "\n"); + sb.append("\nSignature:\n").append(encoder.encodeBuffer(signature)).append('\n'); } else sb.append("NOT signed yet\n"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertImpl.java --- a/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 12 19:52:31 2014 -0300 @@ -802,11 +802,11 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(info.toString() + "\n"); - sb.append(" Algorithm: [" + algId.toString() + "]\n"); + sb.append(info.toString()).append('\n'); + sb.append(" Algorithm: [").append(algId.toString()).append("]\n"); HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); + sb.append(" Signature:\n").append(encoder.encodeBuffer(signature)); sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertInfo.java --- a/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 12 19:52:31 2014 -0300 @@ -298,27 +298,27 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(" " + version.toString() + "\n"); - sb.append(" Subject: " + subject.toString() + "\n"); - sb.append(" Signature Algorithm: " + algId.toString() + "\n"); - sb.append(" Key: " + pubKey.toString() + "\n"); - sb.append(" " + interval.toString() + "\n"); - sb.append(" Issuer: " + issuer.toString() + "\n"); - sb.append(" " + serialNum.toString() + "\n"); + sb.append(" ").append(version.toString()).append('\n'); + sb.append(" Subject: ").append(subject.toString()).append('\n'); + sb.append(" Signature Algorithm: ").append(algId.toString()).append('\n'); + sb.append(" Key: ").append(pubKey.toString()).append('\n'); + sb.append(" ").append(interval.toString()).append('\n'); + sb.append(" Issuer: ").append(issuer.toString()).append('\n'); + sb.append(" ").append(serialNum.toString()).append('\n'); // optional v2, v3 extras if (issuerUniqueId != null) { - sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n"); + sb.append(" Issuer Id:\n").append(issuerUniqueId.toString()).append('\n'); } if (subjectUniqueId != null) { - sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n"); + sb.append(" Subject Id:\n").append(subjectUniqueId.toString()).append('\n'); } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Extension[] exts = allExts.toArray(new Extension[0]); - sb.append("\nCertificate Extensions: " + exts.length); + sb.append("\nCertificate Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -329,9 +329,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists @@ -341,10 +340,10 @@ } Map invalid = extensions.getUnparseableExtensions(); if (invalid.isEmpty() == false) { - sb.append("\nUnparseable certificate extensions: " + invalid.size()); + sb.append("\nUnparseable certificate extensions: ").append(invalid.size()); int i = 1; for (Extension ext : invalid.values()) { - sb.append("\n[" + (i++) + "]: "); + sb.append("\n[").append(i++).append("]: "); sb.append(ext); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/ThreadTab.java --- a/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 12 19:52:31 2014 -0300 @@ -368,7 +368,7 @@ sb.append(Messages.STACK_TRACE); int index = 0; for (StackTraceElement e : ti.getStackTrace()) { - sb.append(e.toString()+"\n"); + sb.append(e.toString()).append('\n'); if (monitors != null) { for (MonitorInfo mi : monitors) { if (mi.getLockedStackDepth() == index) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java --- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 12 19:52:31 2014 -0300 @@ -79,25 +79,25 @@ String textColor = String.format("%06x", foreground.getRGB() & 0xFFFFFF); StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append("
    "); for (int i = 0; i < arr.length; i++) { if (i % 2 == 0) { - sb.append(""); + sb.append(""); } else { - sb.append(""); + sb.append(""); } } if (arr.length == 0) { - sb.append(""); + sb.append(""); } sb.append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    "); arrayEditor.setText(sb.toString()); diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XTree.java --- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 12 19:52:31 2014 -0300 @@ -507,13 +507,13 @@ // key order defined by the "orderedKeyPropertyList" for (String key : orderedKeyPropertyList) { if (map.containsKey(key)) { - sb.append(key + "=" + map.get(key) + ","); + sb.append(key).append('=').append(map.get(key)).append(','); map.remove(key); } } // Add the remaining key/value pairs to the buffer for (Map.Entry entry : map.entrySet()) { - sb.append(entry.getKey() + "=" + entry.getValue() + ","); + sb.append(entry.getKey()).append('=').append(entry.getValue()).append(','); } String orderedKeyPropertyListString = sb.toString(); orderedKeyPropertyListString = orderedKeyPropertyListString.substring( @@ -622,7 +622,7 @@ // StringBuilder sb = new StringBuilder(); for (MBeanParameterInfo mbpi : mboi.getSignature()) { - sb.append(mbpi.getType() + ","); + sb.append(mbpi.getType()).append(','); } String signature = sb.toString(); if (signature.length() > 0) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jps/Jps.java --- a/src/share/classes/sun/tools/jps/Jps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jps/Jps.java Tue Aug 12 19:52:31 2014 -0300 @@ -92,28 +92,28 @@ vm = monitoredHost.getMonitoredVm(id, 0); errorString = " -- main class information unavailable"; - output.append(" " + MonitoredVmUtil.mainClass(vm, + output.append(' ').append(MonitoredVmUtil.mainClass(vm, arguments.showLongPaths())); if (arguments.showMainArgs()) { errorString = " -- main args information unavailable"; String mainArgs = MonitoredVmUtil.mainArgs(vm); if (mainArgs != null && mainArgs.length() > 0) { - output.append(" " + mainArgs); + output.append(' ').append(mainArgs); } } if (arguments.showVmArgs()) { errorString = " -- jvm args information unavailable"; String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) { - output.append(" " + jvmArgs); + output.append(' ').append(jvmArgs); } } if (arguments.showVmFlags()) { errorString = " -- jvm flags information unavailable"; String jvmFlags = MonitoredVmUtil.jvmFlags(vm); if (jvmFlags != null && jvmFlags.length() > 0) { - output.append(" " + jvmFlags); + output.append(' ').append(jvmFlags); } } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/RawOutputFormatter.java --- a/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 12 19:52:31 2014 -0300 @@ -50,7 +50,7 @@ StringBuilder headerBuilder = new StringBuilder(); for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { Monitor m = i.next(); - headerBuilder.append(m.getName() + " "); + headerBuilder.append(m.getName()).append(' '); } header = headerBuilder.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/SyntaxException.java --- a/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 12 19:52:31 2014 -0300 @@ -65,7 +65,7 @@ public SyntaxException(int lineno, Set expected, Token found) { StringBuilder msg = new StringBuilder(); - msg.append("Syntax error at line " + lineno + ": Expected one of \'"); + msg.append("Syntax error at line ").append(lineno).append(": Expected one of \'"); boolean first = true; for (Iterator i = expected.iterator(); i.hasNext(); /* empty */) { @@ -74,11 +74,11 @@ msg.append(keyWord); first = false; } else { - msg.append("|" + keyWord); + msg.append('|').append(keyWord); } } - msg.append("\', Found " + found.toMessage()); + msg.append("\', Found ").append(found.toMessage()); message = msg.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/Token.java --- a/src/share/classes/sun/tools/jstat/Token.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/Token.java Tue Aug 12 19:52:31 2014 -0300 @@ -89,18 +89,18 @@ sb.append("ttype=TT_EOF"); break; case StreamTokenizer.TT_NUMBER: - sb.append("ttype=TT_NUM,").append("nval="+nval); + sb.append("ttype=TT_NUM,").append("nval=").append(nval); break; case StreamTokenizer.TT_WORD: if (sval == null) { sb.append("ttype=TT_WORD:IDENTIFIER"); } else { - sb.append("ttype=TT_WORD:").append("sval="+sval); + sb.append("ttype=TT_WORD:").append("sval=").append(sval); } break; default: if (ttype == (int)'"') { - sb.append("ttype=TT_STRING:").append("sval="+sval); + sb.append("ttype=TT_STRING:").append("sval=").append(sval); } else { sb.append("ttype=TT_CHAR:").append((char)ttype); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstatd/RemoteHostImpl.java --- a/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 12 19:52:31 2014 -0300 @@ -68,7 +68,7 @@ sb.append("local://").append(lvmid).append("@localhost"); if (mode != null) { - sb.append("?mode=" + mode); + sb.append("?mode=").append(mode); } String vmidStr = sb.toString(); From stanimir at riflexo.com Wed Aug 13 05:38:08 2014 From: stanimir at riflexo.com (Stanimir Simeonoff) Date: Wed, 13 Aug 2014 08:38:08 +0300 Subject: Does this look like a race? In-Reply-To: <53EA2C4F.80503@redhat.com> References: <53EA2C4F.80503@redhat.com> Message-ID: Hi, The real problem would be fields strikelist, graybits and the like not inUse per se. They are not volatile either and there might not be proper happens before edges, so they could easily be updated out of order. For instance getGrayBits may throw a NPE. IMO, inUse is overall a poor choice to implement the shared singleton, esp since introduces a synchronized block that can be easily avoided. inUse and the sync block can be replaced by an AtomicReference +CAS on get. Something like that: private static final AtomicReference shared=new AtomicReference(reusableGL); public static GlyphList getInstance() { GlyphList result=shared.get(); return result!=null && shared.compareAndSet(result, null)?result:new GlyphList(); } public void dispose(){ if (this==reusableGL){ .... strikelist = null; shared.set(this);//or if (!shared.compareAndSet(null, this)) throw new AssertionError(); } } Regards Stanimir On Tue, Aug 12, 2014 at 6:01 PM, Andrew Haley wrote: > (Please forgive me if this should go to the AWT list or somesuch. It > seems to me like this is not really a graphics-related issue, but one > of Java concurrency.) > > This is in JDK9, sun.font.GlyphList. There is a non-volatile boolean > inUse, and it is not always written in a synchronized block. It is > used to allow exclusive access to a singleton instance. > > It seems to me that, at a minimum, inUse should be volatile, or e.g. > strikelist might be overwritten to null after some other thread has > started using this GlyphList. Do you agree? > > Thanks, > Andrew. > > > /* This scheme creates a singleton GlyphList which is checked out > * for use. Callers who find its checked out create one that after use > * is discarded. This means that in a MT-rendering environment, > * there's no need to synchronise except for that one instance. > * Fewer threads will then need to synchronise, perhaps helping > * throughput on a MP system. If for some reason the reusable > * GlyphList is checked out for a long time (or never returned?) then > * we would end up always creating new ones. That situation should not > * occur and if it did, it would just lead to some extra garbage being > * created. > private static GlyphList reusableGL = new GlyphList(); > private static boolean inUse; > > ... > > public static GlyphList getInstance() { > /* The following heuristic is that if the reusable instance is > * in use, it probably still will be in a micro-second, so avoid > * synchronising on the class and just allocate a new instance. > * The cost is one extra boolean test for the normal case, and some > * small number of cases where we allocate an extra object when > * in fact the reusable one would be freed very soon. > */ > if (inUse) { > return new GlyphList(); > } else { > synchronized(GlyphList.class) { > if (inUse) { > return new GlyphList(); > } else { > inUse = true; > return reusableGL; > } > } > } > } > > ... > > /* There's a reference equality test overhead here, but it allows us > * to avoid synchronizing for GL's that will just be GC'd. This > * helps MP throughput. > */ > public void dispose() { > if (this == reusableGL) { > if (graybits != null && graybits.length > MAXGRAYLENGTH) { > graybits = null; > } > usePositions = false; > strikelist = null; // remove reference to the strike list > inUse = false; > } > } > From ioi.lam at oracle.com Wed Aug 13 06:25:59 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Tue, 12 Aug 2014 23:25:59 -0700 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, final round In-Reply-To: <53E5D582.3070300@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> Message-ID: <53EB04F7.8040000@oracle.com> Hi, Thank you all for the reviews! I have prepared a final version that has incorporated all the comments. http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-vfinal/ - Ioi On 8/9/14, 1:02 AM, Ioi Lam wrote: > Hi, > > Thanks a lot to everyone for the very useful comments. I have updated > the webrev > > Just the delta from the previous round of review: > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3_delta_from_v2/ > > All the changes: > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ > > Thanks > - Ioi > > On 7/28/14, 4:09 PM, Ioi Lam wrote: >> Hi Folks, >> >> Please review the following clean up and refactoring of the CDS code, >> for JDK9 >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >> https://bugs.openjdk.java.net/browse/JDK-8046070 >> >> Summary of fix: >> >> Clean up and refactor the Class Data Sharing (CDS) code, including: >> >> + Improve archive integrity checking >> + Support bytecode verification during archive dumping time >> + Allow the user to configure the CDS class list and archive file. >> + Allow future extension of the CDS class loading mechanism. >> >> Tests: >> >> JPRT >> UTE (vm.runtime.testlist, vm.quick.testlist, >> vm.parallel_class_loading.testlist) >> Various adhoc SQE tests on Aurora >> JCK >> >> Thanks >> - Ioi > From david.holmes at oracle.com Wed Aug 13 07:55:35 2014 From: david.holmes at oracle.com (David Holmes) Date: Wed, 13 Aug 2014 17:55:35 +1000 Subject: Does this look like a race? In-Reply-To: <53EA2C4F.80503@redhat.com> References: <53EA2C4F.80503@redhat.com> Message-ID: <53EB19F7.6090803@oracle.com> On 13/08/2014 1:01 AM, Andrew Haley wrote: > (Please forgive me if this should go to the AWT list or somesuch. It > seems to me like this is not really a graphics-related issue, but one > of Java concurrency.) > > This is in JDK9, sun.font.GlyphList. There is a non-volatile boolean > inUse, and it is not always written in a synchronized block. It is > used to allow exclusive access to a singleton instance. > > It seems to me that, at a minimum, inUse should be volatile, or e.g. > strikelist might be overwritten to null after some other thread has > started using this GlyphList. Do you agree? Yes, either inUse needs to be volatile and used in a way that ensures the correct happens-before relationships, or dispose() needs to do all modifications to the shared instance inside a synchronized block and clear inUse in that block. David > Thanks, > Andrew. > > > /* This scheme creates a singleton GlyphList which is checked out > * for use. Callers who find its checked out create one that after use > * is discarded. This means that in a MT-rendering environment, > * there's no need to synchronise except for that one instance. > * Fewer threads will then need to synchronise, perhaps helping > * throughput on a MP system. If for some reason the reusable > * GlyphList is checked out for a long time (or never returned?) then > * we would end up always creating new ones. That situation should not > * occur and if it did, it would just lead to some extra garbage being > * created. > private static GlyphList reusableGL = new GlyphList(); > private static boolean inUse; > > ... > > public static GlyphList getInstance() { > /* The following heuristic is that if the reusable instance is > * in use, it probably still will be in a micro-second, so avoid > * synchronising on the class and just allocate a new instance. > * The cost is one extra boolean test for the normal case, and some > * small number of cases where we allocate an extra object when > * in fact the reusable one would be freed very soon. > */ > if (inUse) { > return new GlyphList(); > } else { > synchronized(GlyphList.class) { > if (inUse) { > return new GlyphList(); > } else { > inUse = true; > return reusableGL; > } > } > } > } > > ... > > /* There's a reference equality test overhead here, but it allows us > * to avoid synchronizing for GL's that will just be GC'd. This > * helps MP throughput. > */ > public void dispose() { > if (this == reusableGL) { > if (graybits != null && graybits.length > MAXGRAYLENGTH) { > graybits = null; > } > usePositions = false; > strikelist = null; // remove reference to the strike list > inUse = false; > } > } > From aph at redhat.com Wed Aug 13 09:05:56 2014 From: aph at redhat.com (Andrew Haley) Date: Wed, 13 Aug 2014 10:05:56 +0100 Subject: Does this look like a race? In-Reply-To: <53EB19F7.6090803@oracle.com> References: <53EA2C4F.80503@redhat.com> <53EB19F7.6090803@oracle.com> Message-ID: <53EB2A74.2010709@redhat.com> On 08/13/2014 08:55 AM, David Holmes wrote: > On 13/08/2014 1:01 AM, Andrew Haley wrote: >> (Please forgive me if this should go to the AWT list or somesuch. It >> seems to me like this is not really a graphics-related issue, but one >> of Java concurrency.) >> >> This is in JDK9, sun.font.GlyphList. There is a non-volatile boolean >> inUse, and it is not always written in a synchronized block. It is >> used to allow exclusive access to a singleton instance. >> >> It seems to me that, at a minimum, inUse should be volatile, or e.g. >> strikelist might be overwritten to null after some other thread has >> started using this GlyphList. Do you agree? > > Yes, either inUse needs to be volatile and used in a way that ensures > the correct happens-before relationships, or dispose() needs to do all > modifications to the shared instance inside a synchronized block and > clear inUse in that block. Yes, I thought so. There are probably a dozen ways of doing this correctly, but this way is certainly wrong. I created JDK-8054991 - sun.font.GlyphList uses broken double-checked locking Thanks everyone, Andrew. From joel.franck at oracle.com Wed Aug 13 08:54:06 2014 From: joel.franck at oracle.com (Joel Borggren-Franck) Date: Wed, 13 Aug 2014 10:54:06 +0200 Subject: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value In-Reply-To: <9E339B30-A01D-4427-A2D1-A0E96E5A978C@oracle.com> References: <1B51A5CD-A909-42C4-97D1-1F8F5DFE55D2@oracle.com> <9E339B30-A01D-4427-A2D1-A0E96E5A978C@oracle.com> Message-ID: <20140813085406.GD22209@oracle.com> Hi Paul, On 2014-06-24, Paul Sandoz wrote: > > On Jun 17, 2014, at 6:52 PM, Joel Borggr?n-Franck wrote: > > > > Can I get a review for this fix and javadoc clarification for https://bugs.openjdk.java.net/browse/JDK-8044629 > > > > +1 > > I never quite realised just how convoluted it was to determine that a class is an inner class. Neither did I until I had to implement it :) cheers /Joel From joel.franck at oracle.com Wed Aug 13 09:29:51 2014 From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Wed, 13 Aug 2014 11:29:51 +0200 Subject: RFR [8051382] Optimize java.lang.reflect.Modifier.toString() In-Reply-To: <53DF6E23.2010509@oracle.com> References: <53C9A214.1060101@oracle.com> <53C9A640.8030808@oracle.com> <53C9C758.5070203@oracle.com> <53DF6E23.2010509@oracle.com> Message-ID: Hi Ivan, The first version looks good. I think this is desirable even if it is a tiny bit slower. cheers /Joel On 4 aug 2014, at 13:27, Ivan Gerasimov wrote: > Hi Martin! > > Sorry for the pause, I had to take a break. > > Thank you for your StringJoiner rework! > I created a bug to track it: https://bugs.openjdk.java.net/browse/JDK-8054221 > > With your implementation of StringJoiner, the first version of Modifier.toString() [1] became (almost) as fast as original, and a bit clearer. > > [1] http://cr.openjdk.java.net/~igerasim/8051382/0/webrev/ > > Will you approve the change to Modifier.toString? > > Sincerely your, > Ivan > > > On 19.07.2014 19:58, Martin Buchholz wrote: >> StringJoiner seems written in a style suitable for an application, not in a low-level performance-oriented style suitable for a JDK core library. But we can fix that. >> >> http://cr.openjdk.java.net/~martin/webrevs/openjdk9/StringJoiner-optimization/ >> >> >> On Fri, Jul 18, 2014 at 6:18 PM, Ivan Gerasimov > wrote: >> >> >> On 19.07.2014 3:07, Martin Buchholz wrote: >> >> >> I took a quick look at StringJoiner. It looks to me like this >> won't be an optimization, because StringJoiner uses >> StringBuilder internally, and will actually perform more total >> operations. >> >> >> Unfortunately this is true. >> Microbenchmarking shows that StringJoiner makes the things 30% >> slower, which is sad. >> >> Then I propose another simple patch giving +15% to the speed: >> >> http://cr.openjdk.java.net/~igerasim/8051382/1/webrev/ >> >> >> Sincerely yours, >> Inan >> >> > From weijun.wang at oracle.com Wed Aug 13 10:10:27 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Wed, 13 Aug 2014 18:10:27 +0800 Subject: Trusted service? Message-ID: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com> Hi All I'm working on "8038089: TLS optional support for Kerberos cipher suites needs to be re-examine" which will separate the implementation of Kerberos-related TLS ciphersuites from the other TLS codes. I am thinking of defining a ServiceLoader interface called ExternalCipherSuiteProvider inside the TLS module and implement a Krb5CipherSuiteProvider in the JGSS module. Now if the JGSS module is installed, it will be found and thus supports the TLS_KRB5_* ciphersuites. However, it looks like any application can include an implementation and register it by adding its own $CLASSPATH/META-INF/services line. Is there anyway I can find out which is the "trusted" one? I've looked at some ServiceLoader example inside JDK and it looks like they first load an implementation specified by a system property and then do the ServiceLoader.load() loop. Is that system property meant to provide the "trusted" or "builtin" implementation? I wonder if it still works now because even if we define a system property (or security property), the implementation class will be invisible in a different module. Thanks Max From ivan.gerasimov at oracle.com Wed Aug 13 10:29:03 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 13 Aug 2014 14:29:03 +0400 Subject: RFR [8051382] Optimize java.lang.reflect.Modifier.toString() In-Reply-To: References: <53C9A214.1060101@oracle.com> <53C9A640.8030808@oracle.com> <53C9C758.5070203@oracle.com> <53DF6E23.2010509@oracle.com> Message-ID: <53EB3DEF.7040007@oracle.com> Thank you Joel! I had already pushed this fix. When you have a chance, could you please also review the continuation of this, which I sent to core-libs-dev a few days ago? [8054714] Use StringJoiner where it makes the code cleaner http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-August/028131.html Thanks in advance, Ivan On 13.08.2014 13:29, Joel Borggr?n-Franck wrote: > Hi Ivan, > > The first version looks good. > > I think this is desirable even if it is a tiny bit slower. > > cheers > /Joel > > On 4 aug 2014, at 13:27, Ivan Gerasimov wrote: > >> Hi Martin! >> >> Sorry for the pause, I had to take a break. >> >> Thank you for your StringJoiner rework! >> I created a bug to track it: https://bugs.openjdk.java.net/browse/JDK-8054221 >> >> With your implementation of StringJoiner, the first version of Modifier.toString() [1] became (almost) as fast as original, and a bit clearer. >> >> [1] http://cr.openjdk.java.net/~igerasim/8051382/0/webrev/ >> >> Will you approve the change to Modifier.toString? >> >> Sincerely your, >> Ivan >> >> >> On 19.07.2014 19:58, Martin Buchholz wrote: >>> StringJoiner seems written in a style suitable for an application, not in a low-level performance-oriented style suitable for a JDK core library. But we can fix that. >>> >>> http://cr.openjdk.java.net/~martin/webrevs/openjdk9/StringJoiner-optimization/ >>> >>> >>> On Fri, Jul 18, 2014 at 6:18 PM, Ivan Gerasimov > wrote: >>> >>> >>> On 19.07.2014 3:07, Martin Buchholz wrote: >>> >>> >>> I took a quick look at StringJoiner. It looks to me like this >>> won't be an optimization, because StringJoiner uses >>> StringBuilder internally, and will actually perform more total >>> operations. >>> >>> >>> Unfortunately this is true. >>> Microbenchmarking shows that StringJoiner makes the things 30% >>> slower, which is sad. >>> >>> Then I propose another simple patch giving +15% to the speed: >>> >>> http://cr.openjdk.java.net/~igerasim/8051382/1/webrev/ >>> >>> >>> Sincerely yours, >>> Inan >>> >>> > > From jaroslav.tulach at oracle.com Wed Aug 13 11:12:43 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Wed, 13 Aug 2014 13:12:43 +0200 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <49869.208.97.121.124.1407583134.squirrel@altair.cs.oswego.edu> References: <2296697.ZmJV3U9KFH@logouticek> <1750688.xV4r4reA8L@logouticek> <49869.208.97.121.124.1407583134.squirrel@altair.cs.oswego.edu> Message-ID: <2422213.Q7mX0svZJt@logouticek> Dne So 9. srpna 2014 07:18:54, Doug Lea napsal(a): > > Dne P?? 8. srpna 2014 15:02:41, Stanimir Simeonoff napsal(a): > > > > > > According to articles provided by Andrew[1], toString() can be on stack, > > even if obj > > (e.g. this for toString()) is garbage collected. This is a bit surprising > > (an OOP fan > > would expect that this is GC root while its instance method is running), > > but such > > behavior is said to be in accordance to the 1.8 spec. > > > > Question for Doug (as a member of jmm-dev list) then is: would not it be > > wise to > > change the spec to require this to be GC root while its instance method is > > being > > executed? > > Possible changes are being discussed. It is not clear yet > exactly what rules would better match people's expectations > while remaining implementable by JVMs, and/or whether they > would force performance degradations even > for the vast majority of code not using finalizers. It is > very possible the end result will just be to clarify rules and > provide mechanisms allowing better programmer control. > > Any changes would go into effect for JDK9 at the earliest, > so if you can find a way to avoid use of finalizers > here, it would be a better option. I'll do my best to come up with a lightweight alternative to finalization. However: As far as I understand Andrew's inquiry, the problem is not (that much) related to finalizers, rather to question whether following method can ever finish or not: private void gcThis() { Reference ref = new WeakReference<>(this); while (ref.get() != null) { System.gc(); } System.err.println("ref is gone: " + ref); } On Oracle's JDK8 the method has never finished for me. However when I tried IBM's JDK (identification can be found below) the method finished every time! A bit of consistency would be beneficial in this area, imho. -jt PS: While I understand why the two JDKs behave the way they behave, I don't think this is explainable to regular Java developers. But maybe they don't care that much and one day it will be easy to google out solution on stackoverflow to prevent "this" being garbage collected by changing the last method line to System.err.println("ref is gone: " + ref + " for " + this); The version of IBM's Java was: ~/bin/ibmjava7$ ./bin/java -version java version "1.7.0" Java(TM) SE Runtime Environment (build pxa6470_27sr1fp1-20140708_01(SR1 FP1)) IBM J9 VM (build 2.7, JRE 1.7.0 Linux amd64-64 Compressed References 20140707_205525 (JIT enabled, AOT enabled) J9VM - R27_Java727_SR1_20140707_1408_B205525 JIT - tr.r13.java_20140410_61421.07 GC - R27_Java727_SR1_20140707_1408_B205525_CMPRSS J9CL - 20140707_205525) JCL - 20140707_01 based on Oracle 7u65-b16 From joel.franck at oracle.com Wed Aug 13 12:23:06 2014 From: joel.franck at oracle.com (Joel Borggren-Franck) Date: Wed, 13 Aug 2014 14:23:06 +0200 Subject: RFR: JDK-8054987: (reflect) Add sharing of annotations between instances of Executable Message-ID: <20140813122306.GE22209@oracle.com> Hi all, Cleaning out the patch queue, I found this small patch that adds sharing of conceptually immutable annotation maps between instances of Executable representing the same executable. In short, Method/Constructor contain one bit of mutable state, if they have been set accessible or not. Core Reflection keeps a 'root' instance of an executable and copies it whenever you call get(Declared){Method|Constructor}. When using an Executable to look at annotations each copy you query for annotations, for exampel m1.getAnnotations(), gets its own LinkedHashMap containing the annotations. The map is then flattned and handed out to the client as a newly allocated array. This patch queries the root method for its map thus sharing annotation instances. It still hands out a unique array for each invocation but the Map and the instances are shared. Webrev: http://cr.openjdk.java.net/~jfranck/8054987/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8054987 cheers /Joel From daniel.fuchs at oracle.com Wed Aug 13 12:43:12 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 13 Aug 2014 14:43:12 +0200 Subject: RFR: 8052403 java/util/logging/CheckZombieLockTest.java fails with NoSuchFileException Message-ID: <53EB5D60.3080606@oracle.com> Please find below a fix for 8052403: java/util/logging/CheckZombieLockTest.java fails with NoSuchFileException https://bugs.openjdk.java.net/browse/JDK-8052403 The issue here is that CheckZombieLockTest and CheckLockLocationTest use (create and delete) the same writable-dir under /tmp. When jtreg is run with a high concurrency factor this sometimes results in one of the tests deleting the directory that the other is running. I could verify this by triggering the same failure with: jtreg -verbose:all -jdk $MYJDK -conc:12 \ jdk/test/java/util/logging/Check* The fix simply arranges for CheckZombieLockTest to use a different directory than that used by CheckLockLocationTest (and also improves the diagnostic by arranging for setUp() to fail fast if the test lock file cannot be created). Webrev: http://cr.openjdk.java.net/~dfuchs/webrev_8052403/webrev.00/ best regards, -- daniel From claes.redestad at oracle.com Wed Aug 13 12:50:13 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Wed, 13 Aug 2014 14:50:13 +0200 Subject: RFR(S): 8055004: Reduce allocation overhead in java.time.Period/Duration parse methods Message-ID: <53EB5F05.9010709@oracle.com> Hi, can I have a review of this performance improvement to java.time.Period#parse and java.time.Duration#parse? bug: https://bugs.openjdk.java.net/browse/JDK-8055004 webrev: http://cr.openjdk.java.net/~redestad/8055004/webrev.0 The patch avoids String allocation through matcher.group(n) calls, utilizes recently added capability of parsing CharSequence offsets and improves on the rather awkward way fractions of a second was aligned to nanosecond precision in java.time.Duration. Microbenchmarks show a 1.2-1.5x throughput improvement in both cases. Thanks! /Claes From Alan.Bateman at oracle.com Wed Aug 13 13:13:45 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 13 Aug 2014 14:13:45 +0100 Subject: The future of Serialization In-Reply-To: <1407834233.6396.10.camel@Nokia-N900> References: <1407563776.1841.30.camel@Nokia-N900> <53E8A71D.70407@oracle.com> <53E8B1D8.1000200@zeus.net.au> <53E8D0AC.3060108@oracle.com> <1407834233.6396.10.camel@Nokia-N900> Message-ID: <53EB6489.4000309@oracle.com> On 12/08/2014 10:03, Peter Firmstone wrote: > > Interesting, language features for modules, won't necessarily involve > ClassLoader's (my assumptions were based on existing systems) although > you'd expect modules to have their own ProtectionDomain. > I think it would be reasonable to expect to that you should be able to grant permissions to specific modules. This is something for a difference discussion thread of course. > > When is a better timeframe, roughly, to discuss Serializable? > I'm sure there isn't a best time that works for everyone that is interested in this topic. However, in terms of JDK 9 then it seems early enough to do the exploration and prototypes, and get moving on proposals. -Alan. From ecki at zusammenkunft.net Wed Aug 13 14:11:03 2014 From: ecki at zusammenkunft.net (Bernd Eckenfels) Date: Wed, 13 Aug 2014 16:11:03 +0200 Subject: AW: Trusted service? In-Reply-To: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com> References: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com> Message-ID: <53eb7200.2234c20a.1042.ffffcc3b@mx.google.com> Just a BTW: It would be really cool to have a SPI interface for that, so people who need SRP, CCM or shared secret handshakes (or stuff like NPN?) don't need to use a third party SSL engine. -- http://bernd.eckenfels.net ----- Urspr?ngliche Nachricht ----- Von: "Wang Weijun" Gesendet: ?13.?08.?2014 12:20 An: "OpenJDK Dev list" ; "OpenJDK Dev list" Betreff: Trusted service? Hi All I'm working on "8038089: TLS optional support for Kerberos cipher suites needs to be re-examine" which will separate the implementation of Kerberos-related TLS ciphersuites from the other TLS codes. I am thinking of defining a ServiceLoader interface called ExternalCipherSuiteProvider inside the TLS module and implement a Krb5CipherSuiteProvider in the JGSS module. Now if the JGSS module is installed, it will be found and thus supports the TLS_KRB5_* ciphersuites. However, it looks like any application can include an implementation and register it by adding its own $CLASSPATH/META-INF/services line. Is there anyway I can find out which is the "trusted" one? I've looked at some ServiceLoader example inside JDK and it looks like they first load an implementation specified by a system property and then do the ServiceLoader.load() loop. Is that system property meant to provide the "trusted" or "builtin" implementation? I wonder if it still works now because even if we define a system property (or security property), the implementation class will be invisible in a different module. Thanks Max From Alan.Bateman at oracle.com Wed Aug 13 14:20:46 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 13 Aug 2014 15:20:46 +0100 Subject: Trusted service? In-Reply-To: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com> References: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com> Message-ID: <53EB743E.8050809@oracle.com> On 13/08/2014 11:10, Wang Weijun wrote: > Hi All > > I'm working on "8038089: TLS optional support for Kerberos cipher suites needs to be re-examine" which will separate the implementation of Kerberos-related TLS ciphersuites from the other TLS codes. I am thinking of defining a ServiceLoader interface called ExternalCipherSuiteProvider inside the TLS module and implement a Krb5CipherSuiteProvider in the JGSS module. Now if the JGSS module is installed, it will be found and thus supports the TLS_KRB5_* ciphersuites. > > However, it looks like any application can include an implementation and register it by adding its own $CLASSPATH/META-INF/services line. Is there anyway I can find out which is the "trusted" one? I've looked at some ServiceLoader example inside JDK and it looks like they first load an implementation specified by a system property and then do the ServiceLoader.load() loop. Is that system property meant to provide the "trusted" or "builtin" implementation? I wonder if it still works now because even if we define a system property (or security property), the implementation class will be invisible in a different module. > The usual thing is to just have a default implementation that is used when ServiceLoader doesn't locate a useful provider. You'll find many examples of this in the JDK. In those cases then the default is not listed in a services configuration file. From what you describe then this may be what you want too. ServiceLoader does not have a way to configure a preferred provider so this is one reason why you'll see places where a system property can be used to configured the preferred implementation. -Alan. From karen.kinnear at oracle.com Wed Aug 13 14:41:06 2014 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Wed, 13 Aug 2014 10:41:06 -0400 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, final round In-Reply-To: <53EB04F7.8040000@oracle.com> References: <53D6D842.7000103@oracle.com> <53E5D582.3070300@oracle.com> <53EB04F7.8040000@oracle.com> Message-ID: Looks good. Ship it! thank you so much Ioi, Jiangli, Calvin, Yumin and David for all the hard work! Karen On Aug 13, 2014, at 2:25 AM, Ioi Lam wrote: > Hi, > > Thank you all for the reviews! I have prepared a final version that has incorporated all the comments. > > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-vfinal/ > > - Ioi > > On 8/9/14, 1:02 AM, Ioi Lam wrote: >> Hi, >> >> Thanks a lot to everyone for the very useful comments. I have updated the webrev >> >> Just the delta from the previous round of review: >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3_delta_from_v2/ >> >> All the changes: >> >> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v3/ >> >> Thanks >> - Ioi >> >> On 7/28/14, 4:09 PM, Ioi Lam wrote: >>> Hi Folks, >>> >>> Please review the following clean up and refactoring of the CDS code, for JDK9 >>> >>> http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-v2/ >>> https://bugs.openjdk.java.net/browse/JDK-8046070 >>> >>> Summary of fix: >>> >>> Clean up and refactor the Class Data Sharing (CDS) code, including: >>> >>> + Improve archive integrity checking >>> + Support bytecode verification during archive dumping time >>> + Allow the user to configure the CDS class list and archive file. >>> + Allow future extension of the CDS class loading mechanism. >>> >>> Tests: >>> >>> JPRT >>> UTE (vm.runtime.testlist, vm.quick.testlist, vm.parallel_class_loading.testlist) >>> Various adhoc SQE tests on Aurora >>> JCK >>> >>> Thanks >>> - Ioi >> > From mark.reinhold at oracle.com Wed Aug 13 15:31:19 2014 From: mark.reinhold at oracle.com (mark.reinhold at oracle.com) Date: Wed, 13 Aug 2014 08:31:19 -0700 Subject: Trusted service? In-Reply-To: <53EB743E.8050809@oracle.com> References: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com>, <53EB743E.8050809@oracle.com> Message-ID: <20140813083119.502977@eggemoggin.niobe.net> 2014/8/13 7:20 -0700, alan.bateman at oracle.com: > The usual thing is to just have a default implementation that is used > when ServiceLoader doesn't locate a useful provider. You'll find many > examples of this in the JDK. In those cases then the default is not > listed in a services configuration file. From what you describe then > this may be what you want too. > > ServiceLoader does not have a way to configure a preferred provider so > this is one reason why you'll see places where a system property can be > used to configured the preferred implementation. Another alternative is to use the ServiceLoader::loadInstalled method, which will ignore providers on the application class path. - Mark From claes.redestad at oracle.com Wed Aug 13 16:49:17 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Wed, 13 Aug 2014 18:49:17 +0200 Subject: RFR(S): 8055055: Improve numeric parsing in java.sql Message-ID: <53EB970D.80801@oracle.com> Hi, can I have a review of this small patch which improves performance of java.sql.Time::valueOf (~1.3x) and java.sql.Timestamp::valueOf (~1.9x). Uses Integer.parseInt with offset to make intermediary substrings unnecessary and improves the nanosecond fraction calculation to not use String concatenation. bug: https://bugs.openjdk.java.net/browse/JDK-8055055 webrev: http://cr.openjdk.java.net/~redestad/8055055/webrev.0/ Thanks! /Claes From lance.andersen at oracle.com Wed Aug 13 18:14:03 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 13 Aug 2014 14:14:03 -0400 Subject: RFR(S): 8055055: Improve numeric parsing in java.sql In-Reply-To: <53EB970D.80801@oracle.com> References: <53EB970D.80801@oracle.com> Message-ID: <4B9A9590-7EA4-45B3-B9DB-8C0EECFC4664@oracle.com> I will take a look this week. Did you run the unit tests to make sure they still pass? On Aug 13, 2014, at 12:49 PM, Claes Redestad wrote: > Hi, > > can I have a review of this small patch which improves performance of java.sql.Time::valueOf (~1.3x) and java.sql.Timestamp::valueOf (~1.9x). > > Uses Integer.parseInt with offset to make intermediary substrings unnecessary and improves the nanosecond fraction calculation to not use String concatenation. > > bug: https://bugs.openjdk.java.net/browse/JDK-8055055 > webrev: http://cr.openjdk.java.net/~redestad/8055055/webrev.0/ > > Thanks! > > /Claes Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From xueming.shen at oracle.com Wed Aug 13 19:49:20 2014 From: xueming.shen at oracle.com (Xueming Shen) Date: Wed, 13 Aug 2014 12:49:20 -0700 Subject: RFR(S): 8055004: Reduce allocation overhead in java.time.Period/Duration parse methods In-Reply-To: <53EB5F05.9010709@oracle.com> References: <53EB5F05.9010709@oracle.com> Message-ID: <53EBC140.1090505@oracle.com> looks fine. though arguably it might be more correct to do if (dayStart != -1 || hourStart != -1 || minuteStart != -1 || secondStart != -1) { ... } as the regex spec says the start/end return -1 if no match for the group. -Sherman On 08/13/2014 05:50 AM, Claes Redestad wrote: > Hi, > > can I have a review of this performance improvement to java.time.Period#parse and java.time.Duration#parse? > > bug: https://bugs.openjdk.java.net/browse/JDK-8055004 > webrev: http://cr.openjdk.java.net/~redestad/8055004/webrev.0 > > The patch avoids String allocation through matcher.group(n) calls, utilizes recently added > capability of parsing CharSequence offsets and improves on the rather awkward way fractions of a second > was aligned to nanosecond precision in java.time.Duration. > > Microbenchmarks show a 1.2-1.5x throughput improvement in both cases. > > Thanks! > > /Claes From claes.redestad at oracle.com Wed Aug 13 19:42:33 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Wed, 13 Aug 2014 21:42:33 +0200 Subject: RFR(S): 8055055: Improve numeric parsing in java.sql In-Reply-To: <4B9A9590-7EA4-45B3-B9DB-8C0EECFC4664@oracle.com> References: <53EB970D.80801@oracle.com> <4B9A9590-7EA4-45B3-B9DB-8C0EECFC4664@oracle.com> Message-ID: <53EBBFA9.6020307@oracle.com> Thanks, Lance! I only ran the jtreg tests under jdk/test/java/sql locally for this (29 passed). /Claes On 2014-08-13 20:14, Lance Andersen wrote: > I will take a look this week. Did you run the unit tests to make sure > they still pass? > > > On Aug 13, 2014, at 12:49 PM, Claes Redestad > > wrote: > >> Hi, >> >> can I have a review of this small patch which improves performance of >> java.sql.Time::valueOf (~1.3x) and java.sql.Timestamp::valueOf (~1.9x). >> >> Uses Integer.parseInt with offset to make intermediary substrings >> unnecessary and improves the nanosecond fraction calculation to not >> use String concatenation. >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8055055 >> webrev: http://cr.openjdk.java.net/~redestad/8055055/webrev.0/ >> >> >> Thanks! >> >> /Claes > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From claes.redestad at oracle.com Wed Aug 13 23:01:41 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 14 Aug 2014 01:01:41 +0200 Subject: RFR(S): 8055004: Reduce allocation overhead in java.time.Period/Duration parse methods In-Reply-To: <53EBC140.1090505@oracle.com> References: <53EB5F05.9010709@oracle.com> <53EBC140.1090505@oracle.com> Message-ID: <53EBEE55.60406@oracle.com> On 2014-08-13 21:49, Xueming Shen wrote: > looks fine. Thanks for reviewing! > > though arguably it might be more correct to do > > if (dayStart != -1 || hourStart != -1 || minuteStart != -1 || > secondStart != -1) { > ... > } > > as the regex spec says the start/end return -1 if no match for the group. start(int)[1] will return either the start index of the group (0 <= index < text.length(), implying index >= 0) or -1, so I could argue both ways are fine, no? Thanks! /Claes [1] http://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html#start-int- > > -Sherman > > > On 08/13/2014 05:50 AM, Claes Redestad wrote: >> Hi, >> >> can I have a review of this performance improvement to >> java.time.Period#parse and java.time.Duration#parse? >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8055004 >> webrev: http://cr.openjdk.java.net/~redestad/8055004/webrev.0 >> >> The patch avoids String allocation through matcher.group(n) calls, >> utilizes recently added >> capability of parsing CharSequence offsets and improves on the rather >> awkward way fractions of a second >> was aligned to nanosecond precision in java.time.Duration. >> >> Microbenchmarks show a 1.2-1.5x throughput improvement in both cases. >> >> Thanks! >> >> /Claes > From weijun.wang at oracle.com Thu Aug 14 00:34:07 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Thu, 14 Aug 2014 08:34:07 +0800 Subject: Trusted service? In-Reply-To: <53EB743E.8050809@oracle.com> References: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com> <53EB743E.8050809@oracle.com> Message-ID: Yes, I see a lot of places using if (loadProviderFromProperty()) return provider; if (loadProviderAsService()) return provider; The 1st using Class.forName() and 2nd ServiceLoader.load(). I was thinking that the 1st method will not work because Class.forName() on an internal class in another module will not work after module, but now I believe the 2nd method would not work also. Is that right? Or writing the class name in a services file automatically exports it as a service? Now my preferred order will be if (loadProviderFromProperty()) return provider; if (loadProviderAsInstalledService()) return provider; if (loadProviderAsService()) return provider; Thanks Max On Aug 13, 2014, at 22:20, Alan Bateman wrote: > > ServiceLoader does not have a way to configure a preferred provider so this is one reason why you'll see places where a system property can be used to configured the preferred implementation. > > -Alan. From joe.darcy at oracle.com Thu Aug 14 01:05:02 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 13 Aug 2014 18:05:02 -0700 Subject: RFR: JDK-8054987: (reflect) Add sharing of annotations between instances of Executable In-Reply-To: <20140813122306.GE22209@oracle.com> References: <20140813122306.GE22209@oracle.com> Message-ID: <53EC0B3E.3020904@oracle.com> Hi Joel, Does your changeset alter the support (or non-support) of redefining an annotation? -Joe On 08/13/2014 05:23 AM, Joel Borggren-Franck wrote: > Hi all, > > Cleaning out the patch queue, I found this small patch that adds sharing > of conceptually immutable annotation maps between instances of > Executable representing the same executable. > > In short, Method/Constructor contain one bit of mutable state, if they > have been set accessible or not. Core Reflection keeps a 'root' instance > of an executable and copies it whenever you call > get(Declared){Method|Constructor}. When using an Executable to look at annotations each copy > you query for annotations, for exampel m1.getAnnotations(), gets its own > LinkedHashMap containing the annotations. The map is then flattned and > handed out to the client as a newly allocated array. This patch queries > the root method for its map thus sharing annotation instances. It still > hands out a unique array for each invocation but the Map and the > instances are shared. > > Webrev: http://cr.openjdk.java.net/~jfranck/8054987/webrev.00/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8054987 > > cheers > /Joel From joel.franck at oracle.com Thu Aug 14 06:47:08 2014 From: joel.franck at oracle.com (Joel Borggren-Franck) Date: Thu, 14 Aug 2014 08:47:08 +0200 Subject: RFR: JDK-8054987: (reflect) Add sharing of annotations between instances of Executable In-Reply-To: <53EC0B3E.3020904@oracle.com> References: <20140813122306.GE22209@oracle.com> <53EC0B3E.3020904@oracle.com> Message-ID: <20140814064708.GA4360@oracle.com> On 2014-08-13, Joe Darcy wrote: > Hi Joel, > > Does your changeset alter the support (or non-support) of redefining > an annotation? > Hi Joe, It does not interact with the current non-support and I am convinced it wont hinder us in improving the situation. cheers /Joel From weijun.wang at oracle.com Thu Aug 14 08:02:10 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Thu, 14 Aug 2014 16:02:10 +0800 Subject: How to use jvisualvm to find memory leaks? Message-ID: I am looking at "8054896: Loading a KeyStore prevents GC of Classloader" and am now able to reproduce it on my system. I do see the webapp-related classes present in a heapdump created by VisualVM but not sure what the next steps should be to tell why they are not GC'ed. Is there a good tutorial on this? Thanks Max From Alan.Bateman at oracle.com Thu Aug 14 08:03:05 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 14 Aug 2014 09:03:05 +0100 Subject: Trusted service? In-Reply-To: References: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com> <53EB743E.8050809@oracle.com> Message-ID: <53EC6D39.1000701@oracle.com> On 14/08/2014 01:34, Wang Weijun wrote: > Yes, I see a lot of places using > > if (loadProviderFromProperty()) > return provider; > if (loadProviderAsService()) > return provider; > > The 1st using Class.forName() and 2nd ServiceLoader.load(). > > I was thinking that the 1st method will not work because Class.forName() on an internal class in another module will not work after module, but now I believe the 2nd method would not work also. Is that right? It would be a bug if ServiceLoader didn't work with modules. > Or writing the class name in a services file automatically exports it as a service? > > Now my preferred order will be > > if (loadProviderFromProperty()) > return provider; > if (loadProviderAsInstalledService()) > return provider; > if (loadProviderAsService()) > return provider; > Looking at JDK-8038089 again then I'm not sure why loadProviderFromProperty is here. If you are limiting this to just implementations of the Kerberos cipher suites and you only want to use service providers that are in the JDK image then ServiceLoader.loadInstalled should be sufficient. -Alan From weijun.wang at oracle.com Thu Aug 14 08:29:54 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Thu, 14 Aug 2014 16:29:54 +0800 Subject: Trusted service? In-Reply-To: <53EC6D39.1000701@oracle.com> References: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com> <53EB743E.8050809@oracle.com> <53EC6D39.1000701@oracle.com> Message-ID: On Aug 14, 2014, at 16:03, Alan Bateman wrote: > >> Or writing the class name in a services file automatically exports it as a service? >> >> Now my preferred order will be >> >> if (loadProviderFromProperty()) >> return provider; >> if (loadProviderAsInstalledService()) >> return provider; >> if (loadProviderAsService()) >> return provider; >> > Looking at JDK-8038089 again then I'm not sure why loadProviderFromProperty is here. If you are limiting this to just implementations of the Kerberos cipher suites and you only want to use service providers that are in the JDK image then ServiceLoader.loadInstalled should be sufficient. That's just a general preferred order. Here I define no property and do not expect an application providing an impl so yes loadProviderAsInstalledService is enough. --Max > > -Alan From daniel.fuchs at oracle.com Thu Aug 14 08:47:51 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 14 Aug 2014 10:47:51 +0200 Subject: How to use jvisualvm to find memory leaks? In-Reply-To: References: Message-ID: <53EC77B7.5080508@oracle.com> On 8/14/14 10:02 AM, Wang Weijun wrote: > I am looking at "8054896: Loading a KeyStore prevents GC of Classloader" and am now able to reproduce it on my system. I do see the webapp-related classes present in a heapdump created by VisualVM but not sure what the next steps should be to tell why they are not GC'ed. Is there a good tutorial on this? > > Thanks > Max > Hi Max, If you are able to determine which instance of which classes should have been garbage collected but weren't, the next step would be to select one of them and ask jvisualvm to find the nearest GC root. That should give you a hint of who is holding a reference to the instance. The next step - often harder - is to figure out why. http://visualvm.java.net/heapdump.html hope this helps, -- daniel From david.holmes at oracle.com Thu Aug 14 10:44:13 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 14 Aug 2014 20:44:13 +1000 Subject: RFR: 8054480: Test java/util/logging/TestLoggerBundleSync.java fails: Unexpected bundle name: null In-Reply-To: <53EA487B.1040101@oracle.com> References: <53EA487B.1040101@oracle.com> Message-ID: <53EC92FD.3080408@oracle.com> Hi Daniel, This change seems quite reasonable to me. Thanks, David On 13/08/2014 3:01 AM, Daniel Fuchs wrote: > Hi, > > Please find below a fix for: > > 8054480: Test java/util/logging/TestLoggerBundleSync.java fails: > Unexpected bundle name: null > > This test has been reported to fail from time to time with the > following stack: > > java.lang.RuntimeException: Unexpected bundle name: null > at TestLoggerBundleSync$GetRB.run(TestLoggerBundleSync.java:257) > > The issue here is due to a race condition in the test code. > The comments in the fix explains the fix & the issue. > > http://cr.openjdk.java.net/~dfuchs/webrev_8054480/webrev.00/ > > -- > > The test creates several GetRB threads which 'read' the resource > bundle that will be used by loggers. It does that by publishing > a dummy message in a child logger, and checking the resource > bundle name stored in the associated LogRecord. > > The test also creates several SetRB/SetRBName threads which attempts to > set the resource bundle on loggers, in parallel with the GetRB threads. > > The race condition occurs because although each GetRB thread > has its own Handler that it uses to get at the ResourceBundle in > the LogRecord, it can receive LogRecords that were emitted by > other GetRB threads - which (because of thread scheduling) might > have been prepared at an earlier time and may contain stale > information. > > What it means is that the following logic from > GetRB is flawed: > > a. gets ResourceBundle from parent logger > b. register handler with child logger > c. emit dummy message through child logger > d. remove handler registered in b. > f. check resource bundle that was passed in LogRecord, > comparing it with the resource bundle obtained in a. > The expectation is that if a. is not null, then > the resource bundle name obtained by the handler should > not be null, and should be equal to the name obtained > in a. > > This logic is flawed and prone to race conditions, because > the following may sometime happens: > > GetRB#1 logs a message, but gets interrupted after LogRecord > is created but before publish() is called. At this > point the ResourceBundle has not been set yet, so the > record has a null ResourceBundle. > SetRB#? sets resource bundle on parent logger > GetRB#2 sees the new resource bundle, emit a dummy message, but is > interrupted before it removes its handler. > At this point the handler has the correct resource bundle > and resource bundle name that it found in the LogRecord > emitted by GetRB#2 in step c. > GetRB#1 is resumed. LogRecord gets published - but since the > handler from thread #2 is still present, the 'old' > LogRecord from GetRB#1 gets forwarded to GetRB#2's handler > where it erases the information previously recorded by the > message that was emitted by GetRB#2 > GetRB#2 is resumed, and sees the rbName/rb that was present in > the old LogRecord emitted by GetRB#1 instead of seeing > the newer information that was in the LogRecord emitted > by GetRB#2. > > => the exception gets raised. > > The fix is relatively simple: the Handler registered by each > GetRB thread need simply to ignore messages that were not emitted by > its own thread - we do this now by passing 'this' as parameter to > the dummy logged message - and by comparing GetRB.this > with LogRecord.getParameters()[0]; > > best regards, > > -- daniel From joe.darcy at oracle.com Thu Aug 14 16:51:00 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 14 Aug 2014 09:51:00 -0700 Subject: RFR: JDK-8054987: (reflect) Add sharing of annotations between instances of Executable In-Reply-To: <20140814064708.GA4360@oracle.com> References: <20140813122306.GE22209@oracle.com> <53EC0B3E.3020904@oracle.com> <20140814064708.GA4360@oracle.com> Message-ID: <53ECE8F4.6080507@oracle.com> On 08/13/2014 11:47 PM, Joel Borggren-Franck wrote: > On 2014-08-13, Joe Darcy wrote: >> Hi Joel, >> >> Does your changeset alter the support (or non-support) of redefining >> an annotation? >> > Hi Joe, > > It does not interact with the current non-support and I am convinced it > wont hinder us in improving the situation. > > cheers > /Joel Hi Joel, Okay; I approve your patch then. Cheers, -Joe From peter.levart at gmail.com Thu Aug 14 16:54:17 2014 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 14 Aug 2014 18:54:17 +0200 Subject: RFR: JDK-8054987: (reflect) Add sharing of annotations between instances of Executable In-Reply-To: <20140814064708.GA4360@oracle.com> References: <20140813122306.GE22209@oracle.com> <53EC0B3E.3020904@oracle.com> <20140814064708.GA4360@oracle.com> Message-ID: <53ECE9B9.4070000@gmail.com> On 08/14/2014 08:47 AM, Joel Borggren-Franck wrote: > On 2014-08-13, Joe Darcy wrote: >> Hi Joel, >> >> Does your changeset alter the support (or non-support) of redefining >> an annotation? >> > Hi Joe, > > It does not interact with the current non-support and I am convinced it > wont hinder us in improving the situation. > > cheers > /Joel Hi Joel, Good to see this patch. It improves the efficiency of annotations caching on methods/constructors. What about fields? They too are AccessibleObject(s), contain annotations and are copied from root instances when handed over to the user... The difference of behaviour in the presence of class redefinition could be observed though, but I think this is not a problem. For example: Class c = ...; Method m1 = c.getDeclaredMethod("m"); Method m2 = c.getDeclaredMethod("m"); assert m1 != m2; // but they share the same root; Annotation[] anns1 = m1.getDeclaredAnnotations(); // now class 'c' is redefined and annotations changes on method m()... Annotation[] anns2 = m2.getDeclaredAnnotations(); // previously anns1 / anns2 would countain annotations pre / post class redefinition, but with this patch, they would both contain the pre class redefinition annotations. But as I see it this is not a big problem to hold the patch back. Regards, Peter From peter.levart at gmail.com Thu Aug 14 17:10:29 2014 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 14 Aug 2014 19:10:29 +0200 Subject: RFR: JDK-8054987: (reflect) Add sharing of annotations between instances of Executable In-Reply-To: <53ECE9B9.4070000@gmail.com> References: <20140813122306.GE22209@oracle.com> <53EC0B3E.3020904@oracle.com> <20140814064708.GA4360@oracle.com> <53ECE9B9.4070000@gmail.com> Message-ID: <53ECED85.2090201@gmail.com> Hi Joel, If you make Executable.declaredAnnotations field volatile, synchronization is only necessary on the 'root' instance: private transient volatile Map, Annotation> declaredAnnotations; private Map, Annotation> declaredAnnotations() { Map, Annotation> anns = declaredAnnotations; if (anns == null) { Executable root = getRoot(); if (root != null) { declaredAnnotations = anns = root.declaredAnnotations(); } else { synchronized (this) { declaredAnnotations = anns = AnnotationParser.parseAnnotations( getAnnotationBytes(), sun.misc.SharedSecrets.getJavaLangAccess(). getConstantPool(getDeclaringClass()), getDeclaringClass()); } } } return anns; } Regards, Peter On 08/14/2014 06:54 PM, Peter Levart wrote: > On 08/14/2014 08:47 AM, Joel Borggren-Franck wrote: >> On 2014-08-13, Joe Darcy wrote: >>> Hi Joel, >>> >>> Does your changeset alter the support (or non-support) of redefining >>> an annotation? >>> >> Hi Joe, >> >> It does not interact with the current non-support and I am convinced it >> wont hinder us in improving the situation. >> >> cheers >> /Joel > Hi Joel, > > Good to see this patch. It improves the efficiency of annotations > caching on methods/constructors. What about fields? They too are > AccessibleObject(s), contain annotations and are copied from root > instances when handed over to the user... > > The difference of behaviour in the presence of class redefinition > could be observed though, but I think this is not a problem. For example: > > Class c = ...; > > Method m1 = c.getDeclaredMethod("m"); > Method m2 = c.getDeclaredMethod("m"); > > assert m1 != m2; // but they share the same root; > > Annotation[] anns1 = m1.getDeclaredAnnotations(); > > // now class 'c' is redefined and annotations changes on method m()... > > Annotation[] anns2 = m2.getDeclaredAnnotations(); > > // previously anns1 / anns2 would countain annotations pre / post > class redefinition, but with this patch, they would both contain the > pre class redefinition annotations. > > > But as I see it this is not a big problem to hold the patch back. > > > Regards, Peter > From sean.mullan at oracle.com Thu Aug 14 17:31:28 2014 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 14 Aug 2014 13:31:28 -0400 Subject: JEP Review Request: Improve Security Manager Performance Message-ID: <53ECF270.2000205@oracle.com> Hello all, I have submitted a JEP for "Improve Security Manager Performance" that I am seeking further review and feedback: https://bugs.openjdk.java.net/browse/JDK-8043631 This is very similar to a draft I posted earlier [1], but has been re-drafted using the JEP 2.0 process. The JEP is intentionally short on details as it is more of an exploratory JEP at this point and will be updated as potential improvements are prototyped and measured. I want to thank everyone that has provided valuable feedback and ideas so far, especially Peter Firmstone and David M. Lloyd. Please continue to send any more data or ideas you have, no matter how small or trivial you think they may be. This is a great opportunity to gather and share knowledge about this area from the community. Thanks, Sean [1] http://mail.openjdk.java.net/pipermail/security-dev/2014-April/010432.html From peter.levart at gmail.com Thu Aug 14 17:46:58 2014 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 14 Aug 2014 19:46:58 +0200 Subject: RFR: JDK-8054987: (reflect) Add sharing of annotations between instances of Executable In-Reply-To: <53ECED85.2090201@gmail.com> References: <20140813122306.GE22209@oracle.com> <53EC0B3E.3020904@oracle.com> <20140814064708.GA4360@oracle.com> <53ECE9B9.4070000@gmail.com> <53ECED85.2090201@gmail.com> Message-ID: <53ECF612.2030007@gmail.com> Hi again Joel, Looking at the Method and Constructor code, I can't escape the feeling that these classes could use a better way to publish their state. While root instances of Methods and Constructors are always handled correctly and never published using data races, the non-root instances that are handed to the user could be published by the user in a non-safe way so that various fields in the Method or Constructor could be observed by some other thread as half-initialized. Why couldn't the majority of fields in Method and Constructor (Field too) be final including the 'root' field? For example: http://cr.openjdk.java.net/~plevart/jdk9-dev/MemberSharedAnnotations/webrev.01/ Changing constructors would not break anything I think, since VM does not use them to construct root instances... I know that this is off topic, but might it be considered for a separate enhancement? Regards, Peter On 08/14/2014 07:10 PM, Peter Levart wrote: > Hi Joel, > > If you make Executable.declaredAnnotations field volatile, > synchronization is only necessary on the 'root' instance: > > > private transient volatile Map, > Annotation> declaredAnnotations; > > private Map, Annotation> > declaredAnnotations() { > Map, Annotation> anns = > declaredAnnotations; > if (anns == null) { > Executable root = getRoot(); > if (root != null) { > declaredAnnotations = anns = root.declaredAnnotations(); > } else { > synchronized (this) { > declaredAnnotations = anns = > AnnotationParser.parseAnnotations( > getAnnotationBytes(), > sun.misc.SharedSecrets.getJavaLangAccess(). > getConstantPool(getDeclaringClass()), > getDeclaringClass()); > } > } > } > return anns; > } > > > Regards, Peter > > On 08/14/2014 06:54 PM, Peter Levart wrote: >> On 08/14/2014 08:47 AM, Joel Borggren-Franck wrote: >>> On 2014-08-13, Joe Darcy wrote: >>>> Hi Joel, >>>> >>>> Does your changeset alter the support (or non-support) of redefining >>>> an annotation? >>>> >>> Hi Joe, >>> >>> It does not interact with the current non-support and I am convinced it >>> wont hinder us in improving the situation. >>> >>> cheers >>> /Joel >> Hi Joel, >> >> Good to see this patch. It improves the efficiency of annotations >> caching on methods/constructors. What about fields? They too are >> AccessibleObject(s), contain annotations and are copied from root >> instances when handed over to the user... >> >> The difference of behaviour in the presence of class redefinition >> could be observed though, but I think this is not a problem. For >> example: >> >> Class c = ...; >> >> Method m1 = c.getDeclaredMethod("m"); >> Method m2 = c.getDeclaredMethod("m"); >> >> assert m1 != m2; // but they share the same root; >> >> Annotation[] anns1 = m1.getDeclaredAnnotations(); >> >> // now class 'c' is redefined and annotations changes on method m()... >> >> Annotation[] anns2 = m2.getDeclaredAnnotations(); >> >> // previously anns1 / anns2 would countain annotations pre / post >> class redefinition, but with this patch, they would both contain the >> pre class redefinition annotations. >> >> >> But as I see it this is not a big problem to hold the patch back. >> >> >> Regards, Peter >> > From jaroslav.tulach at oracle.com Fri Aug 15 09:34:37 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Fri, 15 Aug 2014 11:34:37 +0200 Subject: Summary of Lightweight finalization for the JDK without any drawbacks In-Reply-To: <2422213.Q7mX0svZJt@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <49869.208.97.121.124.1407583134.squirrel@altair.cs.oswego.edu> <2422213.Q7mX0svZJt@logouticek> Message-ID: <7697971.ecKRQ3Qopq@logouticek> Hi. I'd like to thank everyone in participating in our discussion about lightweight finalization and shaping and sharping my understanding of the problem. I believe the discussion has now slowed down and it is time for another summary. I have added one into the issue (while also changing its subject): https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13539596&p age=com.atlassian.jira.plugin.system.issuetabpanels:comment- tabpanel#comment-13539596[1] I believe our understanding of the problem has been deepen enough to focus on creation of the actual public API for lightweight finalization. It will be my task for up- coming week to start necessary steps to propose such API. -jt PS: I'd like to especially thank to Andrew for pointing out the "this" reference problem and Doug for commenting it. I've reported https://bugs.openjdk.java.net/browse/JDK-8055183[2] to resolve it somehow. I'll be watching from distance eager to know the result. Dne St 13. srpna 2014 13:12:43, Jaroslav Tulach napsal(a): > Dne So 9. srpna 2014 07:18:54, Doug Lea napsal(a): > > > Dne P?? 8. srpna 2014 15:02:41, Stanimir Simeonoff napsal(a): > > > > > > > > > According to articles provided by Andrew[1], toString() can be on stack, > > > even if obj > > > (e.g. this for toString()) is garbage collected. This is a bit > > > surprising > > > (an OOP fan > > > would expect that this is GC root while its instance method is running), > > > but such > > > behavior is said to be in accordance to the 1.8 spec. > > > > > > Question for Doug (as a member of jmm-dev list) then is: would not it be > > > wise to > > > change the spec to require this to be GC root while its instance method > > > is > > > being > > > executed? > > > > Possible changes are being discussed. It is not clear yet > > exactly what rules would better match people's expectations > > while remaining implementable by JVMs, and/or whether they > > would force performance degradations even > > for the vast majority of code not using finalizers. It is > > very possible the end result will just be to clarify rules and > > provide mechanisms allowing better programmer control. > > > > Any changes would go into effect for JDK9 at the earliest, > > so if you can find a way to avoid use of finalizers > > here, it would be a better option. > > I'll do my best to come up with a lightweight alternative to finalization. > However: > > As far as I understand Andrew's inquiry, the problem is not (that much) > related to finalizers, rather to question whether following method can ever > finish or not: > > private void gcThis() { > Reference ref = new WeakReference<>(this); > while (ref.get() != null) { > System.gc(); > } > System.err.println("ref is gone: " + ref); > } > > On Oracle's JDK8 the method has never finished for me. However when I tried > IBM's JDK (identification can be found below) the method finished every > time! A bit of consistency would be beneficial in this area, imho. > > -jt > > PS: While I understand why the two JDKs behave the way they behave, I don't > think this is explainable to regular Java developers. But maybe they don't > care that much and one day it will be easy to google out solution on > stackoverflow to prevent "this" being garbage collected by changing the last > method line to > > System.err.println("ref is gone: " + ref + " for " + this); > > The version of IBM's Java was: > > ~/bin/ibmjava7$ ./bin/java -version > java version "1.7.0" > Java(TM) SE Runtime Environment (build pxa6470_27sr1fp1-20140708_01(SR1 > FP1)) IBM J9 VM (build 2.7, JRE 1.7.0 Linux amd64-64 Compressed References > 20140707_205525 (JIT enabled, AOT enabled) > J9VM - R27_Java727_SR1_20140707_1408_B205525 > JIT - tr.r13.java_20140410_61421.07 > GC - R27_Java727_SR1_20140707_1408_B205525_CMPRSS > J9CL - 20140707_205525) > JCL - 20140707_01 based on Oracle 7u65-b16 -------- [1] https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13539596&p age=com.atlassian.jira.plugin.system.issuetabpanels:comment- tabpanel#comment-13539596 [2] https://bugs.openjdk.java.net/browse/JDK-8055183 From otaviojava at java.net Fri Aug 15 09:41:43 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Fri, 15 Aug 2014 06:41:43 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> Message-ID: Could anyone help me as sponsor, please? On Tue, Aug 12, 2014 at 8:01 PM, Ot?vio Gon?alves de Santana < otaviojava at java.net> wrote: > Thank you Roger. > Done > > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_6.zip > > > On Tue, Aug 12, 2014 at 10:15 AM, roger riggs > wrote: > >> fyi, >> >> There's a Perl script normalizer.pl that detects/fixes most of the >> simple tab/white space issues. >> The script is in the /make/scripts/normalizer.pl >> >> Roger >> >> >> On 8/12/2014 3:48 AM, Andrej Golovnin wrote: >> >>> Hi Ot?vio, >>> >>> I think you should fix the indentation in a lot of classes. You use the >>> tab-character for the indentation. As far as I know we should use the >>> space >>> character for the indentation in the JDK sources (Oracle devs feel free >>> to >>> correct me if I'm wrong. And it would be really nice if the style guide >>> for >>> the source code would be a part of the JDK repository. So we don't need >>> to >>> search for it on the internet/wiki. Just clone the repository, read the >>> style guide and follow it. :-) ). Here is the not complete list of >>> classes >>> where you used the tab-character for the indentation: >>> >>> src/share/classes/com/sun/crypto/provider/OAEPParameters.java >>> src/share/classes/java/lang/management/MemoryUsage.java >>> src/share/classes/java/security/KeyStore.java >>> src/share/classes/java/security/PermissionCollection.java >>> src/share/classes/java/security/ProtectionDomain.java >>> src/share/classes/java/security/cert/CertPath.java >>> src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java >>> src/share/classes/java/security/cert/PKIXParameters.java >>> src/share/classes/java/security/cert/PolicyQualifierInfo.java >>> src/share/classes/java/security/cert/TrustAnchor.java >>> src/share/classes/java/security/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); } >>> >>> Best regards, >>> Andrej Golovnin >>> >> >> > > > -- > Ot?vio Gon?alves de Santana > > blog: http://otaviosantana.blogspot.com.br/ > twitter: http://twitter.com/otaviojava > site: *http://about.me/otaviojava * > 55 (11) 98255-3513 > -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 From peter.levart at gmail.com Fri Aug 15 10:06:32 2014 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 15 Aug 2014 12:06:32 +0200 Subject: Summary of Lightweight finalization for the JDK without any drawbacks In-Reply-To: <7697971.ecKRQ3Qopq@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <49869.208.97.121.124.1407583134.squirrel@altair.cs.oswego.edu> <2422213.Q7mX0svZJt@logouticek> <7697971.ecKRQ3Qopq@logouticek> Message-ID: <53EDDBA8.6040108@gmail.com> Hi Jaroslav, FWIW, I have experimented with adapting sun.misc.Cleaner for external use. For example, it could be used as a NetBeans provided API. The thread management is based on tracking of Cleaner (PhantomReference) objects. When 1st Cleaner object is added to a doubly-linked list, the thread is started, when the last Cleaner object is removed from the list, it is stopped, so this is a kind of reference tracking (not counting). Here's the attempt: http://cr.openjdk.java.net/~plevart/misc/nb.Cleaner/Cleaner.java Would this be an appropriate replacement for ActiveQueue API in NetBeans? Regards, Peter On 08/15/2014 11:34 AM, Jaroslav Tulach wrote: > Hi. > I'd like to thank everyone in participating in our discussion about lightweight > finalization and shaping and sharping my understanding of the problem. I believe the > discussion has now slowed down and it is time for another summary. I have added one > into the issue (while also changing its subject): > > https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13539596&p > age=com.atlassian.jira.plugin.system.issuetabpanels:comment- > tabpanel#comment-13539596[1] > > I believe our understanding of the problem has been deepen enough to focus on > creation of the actual public API for lightweight finalization. It will be my task for up- > coming week to start necessary steps to propose such API. > > -jt > > PS: I'd like to especially thank to Andrew for pointing out the "this" reference problem > and Doug for commenting it. I've reported > https://bugs.openjdk.java.net/browse/JDK-8055183[2] to resolve it somehow. I'll be > watching from distance eager to know the result. > > > Dne St 13. srpna 2014 13:12:43, Jaroslav Tulach napsal(a): >> Dne So 9. srpna 2014 07:18:54, Doug Lea napsal(a): >>>> Dne P?? 8. srpna 2014 15:02:41, Stanimir Simeonoff napsal(a): >>>> >>>> >>>> According to articles provided by Andrew[1], toString() can be on stack, >>>> even if obj >>>> (e.g. this for toString()) is garbage collected. This is a bit >>>> surprising >>>> (an OOP fan >>>> would expect that this is GC root while its instance method is running), >>>> but such >>>> behavior is said to be in accordance to the 1.8 spec. >>>> >>>> Question for Doug (as a member of jmm-dev list) then is: would not it be >>>> wise to >>>> change the spec to require this to be GC root while its instance method >>>> is >>>> being >>>> executed? >>> Possible changes are being discussed. It is not clear yet >>> exactly what rules would better match people's expectations >>> while remaining implementable by JVMs, and/or whether they >>> would force performance degradations even >>> for the vast majority of code not using finalizers. It is >>> very possible the end result will just be to clarify rules and >>> provide mechanisms allowing better programmer control. >>> >>> Any changes would go into effect for JDK9 at the earliest, >>> so if you can find a way to avoid use of finalizers >>> here, it would be a better option. >> I'll do my best to come up with a lightweight alternative to finalization. >> However: >> >> As far as I understand Andrew's inquiry, the problem is not (that much) >> related to finalizers, rather to question whether following method can ever >> finish or not: >> >> private void gcThis() { >> Reference ref = new WeakReference<>(this); >> while (ref.get() != null) { >> System.gc(); >> } >> System.err.println("ref is gone: " + ref); >> } >> >> On Oracle's JDK8 the method has never finished for me. However when I tried >> IBM's JDK (identification can be found below) the method finished every >> time! A bit of consistency would be beneficial in this area, imho. >> >> -jt >> >> PS: While I understand why the two JDKs behave the way they behave, I don't >> think this is explainable to regular Java developers. But maybe they don't >> care that much and one day it will be easy to google out solution on >> stackoverflow to prevent "this" being garbage collected by changing the last >> method line to >> >> System.err.println("ref is gone: " + ref + " for " + this); >> >> The version of IBM's Java was: >> >> ~/bin/ibmjava7$ ./bin/java -version >> java version "1.7.0" >> Java(TM) SE Runtime Environment (build pxa6470_27sr1fp1-20140708_01(SR1 >> FP1)) IBM J9 VM (build 2.7, JRE 1.7.0 Linux amd64-64 Compressed References >> 20140707_205525 (JIT enabled, AOT enabled) >> J9VM - R27_Java727_SR1_20140707_1408_B205525 >> JIT - tr.r13.java_20140410_61421.07 >> GC - R27_Java727_SR1_20140707_1408_B205525_CMPRSS >> J9CL - 20140707_205525) >> JCL - 20140707_01 based on Oracle 7u65-b16 > -------- > [1] > https://bugs.openjdk.java.net/browse/JDK-8051843?focusedCommentId=13539596&p > age=com.atlassian.jira.plugin.system.issuetabpanels:comment- > tabpanel#comment-13539596 > [2] https://bugs.openjdk.java.net/browse/JDK-8055183 From dl at cs.oswego.edu Fri Aug 15 12:39:20 2014 From: dl at cs.oswego.edu (Doug Lea) Date: Fri, 15 Aug 2014 08:39:20 -0400 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <2422213.Q7mX0svZJt@logouticek> References: <2296697.ZmJV3U9KFH@logouticek> <1750688.xV4r4reA8L@logouticek> <49869.208.97.121.124.1407583134.squirrel@altair.cs.oswego.edu> <2422213.Q7mX0svZJt@logouticek> Message-ID: <53EDFF78.9040307@cs.oswego.edu> Sorry for not answering this before you filed JDK-8055183. On 08/13/2014 07:12 AM, Jaroslav Tulach wrote: > > As far as I understand Andrew's inquiry, the problem is not (that much) > related to finalizers, rather to question whether following method can ever > finish or not: > > private void gcThis() { > Reference ref = new WeakReference<>(this); > while (ref.get() != null) { > System.gc(); > } > System.err.println("ref is gone: " + ref); > } > > On Oracle's JDK8 the method has never finished for me. However when I tried > IBM's JDK (identification can be found below) the method finished every time! A > bit of consistency would be beneficial in this area, imho. I believe that either behavior is legal under current JLS specs. See in particular sec 12.6.2 (http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.6.2) Among the few guaranteed ways to ensure that "this" is kept reachable (and not GCable) is to write "this" somewhere after its fields are used. In other cases, a reference may or may not be kept reachable in any given JVM, depending on safepoint schemes, whether the collector is concurrent, etc. The surprisingness of the rules, and the lack of any other means of control have been known issues for years. Because reachability interacts with other memory ordering rules (for example, just to explain what "after" means above), we are discussing changes as part of the JMM revisions. (See archives at http://mail.openjdk.java.net/pipermail/jmm-dev/) These extend some previous discussions and proposals that we never pushed through for JDK7. Minimally, there should be a means of forcing reachability without forcing writes. One (old, unshipped) version of this can be found at http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/atomic/Fences.html As first discovered by Hans Boehm, it just so happens that one way to implement the equivalent of reachabilityFence(x) even now is "synchronized(x) {}". (See Hans's 2005 JavaOne slides at http://hboehm.info/misc_slides/java_finalizers.pdf) But I suspect that a less weird and more efficient intrinsic will be introduced for JDK9. Beyond this, we are discussing prospects for extending reachability without programmers needing to use lots of reachabilityFences, possibly by introducing an @Finalized annotation to automate common cases. I don't think there is consensus on this yet, in part because there does not seem to be a way to do this that eliminates all possible surprises/errors. In the mean time, your RFE JDK-8055183 (https://bugs.openjdk.java.net/browse/JDK-8055183) seems to overlap existing JMM revision efforts. I don't know whether you'd like to keep it open as a reminder, or just close it. -Doug From ivan.gerasimov at oracle.com Fri Aug 15 15:41:02 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 15 Aug 2014 19:41:02 +0400 Subject: [7u-dev] Request for Approval and Review: 8017212: File.createTempFile requires unnecessary "read" permission Message-ID: <53EE2A0E.9040900@oracle.com> Hello! I'd like to ask an approval to backport 8017212 into 7u-dev. The patch does not apply cleanly, however the required modifications are quite small. Nevertheless, I will need a peer review for this. The webrev for jdk7: http://cr.openjdk.java.net/~igerasim/8017212/0/webrev/ The difference, compared to jdk8 is: src/share/classes/java/io/File.java -- curly bracket at the end of the line test/java/io/File/createTempFile/SpecialTempFile.java -- there were conflicts due to backport of 8025128, so the test was just copied verbatim from the latest jdk8u. Bug: https://bugs.openjdk.java.net/browse/JDK-8017212 Jdk8 changeset: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/10d2a4b1e576 Jdk8 review: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018354.html The change was tested with jprt on all supported platforms. All the io tests, including added and updated, passed. Sincerely yours, Ivan From kim.barrett at oracle.com Fri Aug 8 06:59:10 2014 From: kim.barrett at oracle.com (Kim Barrett) Date: Fri, 8 Aug 2014 02:59:10 -0400 Subject: RFR (XL) 8046070 - Class Data Sharing clean up and refactoring, round #2 In-Reply-To: <53DDDDED.8060503@oracle.com> References: <53D6D842.7000103@oracle.com> <53DDAB1B.7000004@oracle.com> <53DDDDED.8060503@oracle.com> Message-ID: On Aug 3, 2014, at 2:59 AM, Ioi Lam wrote: > > David, thanks for the comments. I will fix the code as you suggested. > >> 225 int index = 0; // Defined here for portability! Do not move >> >> ??? Do we have a C compiler that can't declare loop variables? > I probably had two loops using the "index" variable. I remember some old C++ compilers would be confused if you do > > for (int index=0; ...) {} > for (int index=0; ...) {} > > and would complain that "index" was declared twice. In any case, I will remove the comment here and move the declaration of "index" into the "for" statement. gcc has had -ffor-scope for a *very* long time; I found it mentioned in docs for g++ 2.95. -ffor-scope -fno-for-scope If -ffor-scope is specified, the scope of variables declared in a for-init-statement is limited to the ?for? loop itself, as specified by the C++ standard. If -fno-for-scope is specified, the scope of variables declared in a for-init-statement extends to the end of the enclosing scope, as was the case in old versions of G++, and other (traditional) implementations of C++. If neither flag is given, the default is to follow the standard, but to allow and give a warning for old-style code that would otherwise be invalid, or have different behavior. I have no knowledge of other compilers? conformance (or lack thereof) to c++98 for-loop scoping rules. From eaftan at google.com Fri Aug 8 20:53:59 2014 From: eaftan at google.com (Eddie Aftandilian) Date: Fri, 8 Aug 2014 13:53:59 -0700 Subject: new StringBuilder(char) Message-ID: Hi all, We recently realized that calling new StringBuilder(char) does not do what you would think it does. Since there is no char constructor defined, the char is widened to an int and the StringBuffer is presized to the character's encoded value. Thus code like this prints an empty string rather than the expected "a": System.out.println(new StringBuilder('a')); Would it be possible to add a char constructor to StringBuilder to prevent this problem? I understand this would change the behavior of any code that is currently doing this, but it's hard to imagine anyone doing this intentionally. Of the ~20 instances we found in Google's codebase, all were bugs. What is your policy on making changes like this where (a) it will cause a change in behavior, but (b) the currently behavior is clearly wrong? If you're willing to take the change, I'd be happy to send a patch. Thanks, Eddie From claes.redestad at oracle.com Mon Aug 11 19:31:45 2014 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 11 Aug 2014 21:31:45 +0200 Subject: [8u40] RFR(M): 8050114, 8041972, 8006627 In-Reply-To: <53E8EC3A.90100@oracle.com> References: <53E8EC3A.90100@oracle.com> Message-ID: <53E91A21.5040601@oracle.com> Hi, I want to request backports of 8050114 [1], 8041972 [2] and 8006627 [3] to 8u-dev. The three patches are modified to make the API changes of 8041972 non-public, but apply cleanly if pushed in the specified order. [1] Expose Integer/Long formatUnsigned methods internally https://bugs.openjdk.java.net/browse/JDK-8050114 http://cr.openjdk.java.net/~redestad/8050114/webrev.2 http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/7f056c2a6c54 [2] Add improved parse methods for Long/Integer - public API methods made package private and exposed via JavaLangAccess - rolled typos fixes found and reported under JDK-8054828 into this patch https://bugs.openjdk.java.net/browse/JDK-8041972 http://cr.openjdk.java.net/~redestad/8041972/backport.2 http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/127da56ff224 [3] UUID to/from String performance should be improved by reducing object allocations - non-public parseLong method now accessed via JavaLangAccess https://bugs.openjdk.java.net/browse/JDK-8006627 http://cr.openjdk.java.net/~redestad/8006627/backport.0 http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/3b298c230549 Thanks! /Claes From harshad.rj at gmail.com Sat Aug 2 13:40:20 2014 From: harshad.rj at gmail.com (Harshad RJ) Date: Sat, 2 Aug 2014 19:10:20 +0530 Subject: About JDK-8042694 Message-ID: Hi, I hit this bug in my own application today: https://bugs.openjdk.java.net/browse/JDK-8042694 My app uses the h2 database which installs a shutdown hook. Works fine, but while running with JNLP, the shutdown hook thrown an exception, probably because the JAR gets closed too early. I can't find a way to register on the JIRA site, hence posting here. I would like to know why was the bug closed as "won't fix"? ?thanks,? -- *Harshad RJ * From mandy.chung at oracle.com Fri Aug 15 20:32:39 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 15 Aug 2014 13:32:39 -0700 Subject: RFR: 8052403 java/util/logging/CheckZombieLockTest.java fails with NoSuchFileException In-Reply-To: <53EB5D60.3080606@oracle.com> References: <53EB5D60.3080606@oracle.com> Message-ID: <53EE6E67.4020600@oracle.com> Looks good. Nit: adding a space between catch and ( would be good. Mandy On 8/13/2014 5:43 AM, Daniel Fuchs wrote: > Please find below a fix for > > 8052403: java/util/logging/CheckZombieLockTest.java fails > with NoSuchFileException > https://bugs.openjdk.java.net/browse/JDK-8052403 > > The issue here is that CheckZombieLockTest and CheckLockLocationTest use > (create and delete) the same writable-dir under /tmp. > > When jtreg is run with a high concurrency factor this sometimes results > in one of the tests deleting the directory that the other is > running. I could verify this by triggering the same failure with: > > jtreg -verbose:all -jdk $MYJDK -conc:12 \ > jdk/test/java/util/logging/Check* > > > The fix simply arranges for CheckZombieLockTest to use a different > directory than that used by CheckLockLocationTest (and also improves > the diagnostic by arranging for setUp() to fail fast if the test > lock file cannot be created). > > Webrev: > http://cr.openjdk.java.net/~dfuchs/webrev_8052403/webrev.00/ > > best regards, > > -- daniel From jeremymanson at google.com Sat Aug 16 05:38:42 2014 From: jeremymanson at google.com (Jeremy Manson) Date: Fri, 15 Aug 2014 22:38:42 -0700 Subject: new StringBuilder(char) In-Reply-To: References: Message-ID: No love from core-libs-dev? It's backwards-incompatible, but in a way that would unbreak existing broken code. Might be a worthwhile cleanup. Jeremy On Fri, Aug 8, 2014 at 1:53 PM, Eddie Aftandilian wrote: > Hi all, > > We recently realized that calling new StringBuilder(char) does not do what > you would think it does. Since there is no char constructor defined, the > char is widened to an int and the StringBuffer is presized to the > character's encoded value. Thus code like this prints an empty string > rather than the expected "a": > System.out.println(new StringBuilder('a')); > > Would it be possible to add a char constructor to StringBuilder to prevent > this problem? I understand this would change the behavior of any code that > is currently doing this, but it's hard to imagine anyone doing this > intentionally. Of the ~20 instances we found in Google's codebase, all > were bugs. What is your policy on making changes like this where (a) it > will cause a change in behavior, but (b) the currently behavior is clearly > wrong? > > If you're willing to take the change, I'd be happy to send a patch. > > Thanks, > Eddie > From Ulf.Zibis at CoSoCo.de Sat Aug 16 10:11:09 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Sat, 16 Aug 2014 12:11:09 +0200 Subject: new StringBuilder(char) In-Reply-To: References: Message-ID: <53EF2E3D.4050002@CoSoCo.de> Good catch ;-) -Ulf Am 08.08.2014 um 22:53 schrieb Eddie Aftandilian: From lordpixel at me.com Sat Aug 16 12:38:59 2014 From: lordpixel at me.com (Andrew Thompson) Date: Sat, 16 Aug 2014 08:38:59 -0400 Subject: new StringBuilder(char) In-Reply-To: References: Message-ID: I've encountered bugs in production code due to this surprise. A good thing to fix. > On Aug 16, 2014, at 1:38 AM, Jeremy Manson wrote: > > No love from core-libs-dev? It's backwards-incompatible, but in a way that > would unbreak existing broken code. Might be a worthwhile cleanup. > > Jeremy > > >> On Fri, Aug 8, 2014 at 1:53 PM, Eddie Aftandilian wrote: >> >> Hi all, >> >> We recently realized that calling new StringBuilder(char) does not do what >> you would think it does. Since there is no char constructor defined, the >> char is widened to an int and the StringBuffer is presized to the >> character's encoded value. Thus code like this prints an empty string >> rather than the expected "a": >> System.out.println(new StringBuilder('a')); >> >> Would it be possible to add a char constructor to StringBuilder to prevent >> this problem? I understand this would change the behavior of any code that >> is currently doing this, but it's hard to imagine anyone doing this >> intentionally. Of the ~20 instances we found in Google's codebase, all >> were bugs. What is your policy on making changes like this where (a) it >> will cause a change in behavior, but (b) the currently behavior is clearly >> wrong? >> >> If you're willing to take the change, I'd be happy to send a patch. >> >> Thanks, >> Eddie >> From lowasser at google.com Sat Aug 16 19:17:22 2014 From: lowasser at google.com (Louis Wasserman) Date: Sat, 16 Aug 2014 12:17:22 -0700 Subject: new StringBuilder(char) In-Reply-To: References: Message-ID: There are indications this bug has actually occurred in released JDK code before (!!): http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/Formatter.java#2882 To give credit where credit is due, I reported the potential for this issue to Eddie after seeing it on StackOverflow at http://stackoverflow.com/q/25167015. On Aug 16, 2014 5:39 AM, "Andrew Thompson" wrote: > I've encountered bugs in production code due to this surprise. > > A good thing to fix. > > > On Aug 16, 2014, at 1:38 AM, Jeremy Manson > wrote: > > > > No love from core-libs-dev? It's backwards-incompatible, but in a way > that > > would unbreak existing broken code. Might be a worthwhile cleanup. > > > > Jeremy > > > > > >> On Fri, Aug 8, 2014 at 1:53 PM, Eddie Aftandilian > wrote: > >> > >> Hi all, > >> > >> We recently realized that calling new StringBuilder(char) does not do > what > >> you would think it does. Since there is no char constructor defined, > the > >> char is widened to an int and the StringBuffer is presized to the > >> character's encoded value. Thus code like this prints an empty string > >> rather than the expected "a": > >> System.out.println(new StringBuilder('a')); > >> > >> Would it be possible to add a char constructor to StringBuilder to > prevent > >> this problem? I understand this would change the behavior of any code > that > >> is currently doing this, but it's hard to imagine anyone doing this > >> intentionally. Of the ~20 instances we found in Google's codebase, all > >> were bugs. What is your policy on making changes like this where (a) it > >> will cause a change in behavior, but (b) the currently behavior is > clearly > >> wrong? > >> > >> If you're willing to take the change, I'd be happy to send a patch. > >> > >> Thanks, > >> Eddie > >> > From pavel.rappo at oracle.com Sat Aug 16 19:30:50 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Sat, 16 Aug 2014 20:30:50 +0100 Subject: new StringBuilder(char) In-Reply-To: References: Message-ID: <9741D454-346D-4BEE-A1A7-FA1E0860EC3F@oracle.com> Yup, HG: changeset: 4823:194faa6fdb3c user: sherman date: Mon Dec 05 10:50:14 2011 -0800 files: src/share/classes/java/util/Formatter.java test/java/util/MissingFormatArgumentException/GetFormatSpecifier.java description: 5063455: (fmt) MissingFormatArgumentException.getFormatSpecifier() incorrect return value Summary: updated the incorrect StringBuilder constructor usage Reviewed-by: dholmes, sherman Contributed-by: brandon.passanisi at oracle.com JBS: https://bugs.openjdk.java.net/browse/JDK-5063455 -Pavel On 16 Aug 2014, at 20:17, Louis Wasserman wrote: > There are indications this bug has actually occurred in released JDK code > before From mike at saxonica.com Sat Aug 16 22:12:57 2014 From: mike at saxonica.com (Michael Kay) Date: Sat, 16 Aug 2014 23:12:57 +0100 Subject: new StringBuilder(char) In-Reply-To: References: Message-ID: <21AE59FF-01E8-46DC-B4F9-496F7ABA9EDB@saxonica.com> I think the same problem also appears in StringBuffer and has been remarked on repeatedly over the years, e.g. http://osdir.com/ml/java.findbugs.general/2007-02/msg00068.html Michael Kay Saxonica mike at saxonica.com +44 (0) 118 946 5893 On 16 Aug 2014, at 20:17, Louis Wasserman wrote: > There are indications this bug has actually occurred in released JDK code > before (!!): > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/Formatter.java#2882 > > To give credit where credit is due, I reported the potential for this issue > to Eddie after seeing it on StackOverflow at > http://stackoverflow.com/q/25167015. > On Aug 16, 2014 5:39 AM, "Andrew Thompson" wrote: > >> I've encountered bugs in production code due to this surprise. >> >> A good thing to fix. >> >>> On Aug 16, 2014, at 1:38 AM, Jeremy Manson >> wrote: >>> >>> No love from core-libs-dev? It's backwards-incompatible, but in a way >> that >>> would unbreak existing broken code. Might be a worthwhile cleanup. >>> >>> Jeremy >>> >>> >>>> On Fri, Aug 8, 2014 at 1:53 PM, Eddie Aftandilian >> wrote: >>>> >>>> Hi all, >>>> >>>> We recently realized that calling new StringBuilder(char) does not do >> what >>>> you would think it does. Since there is no char constructor defined, >> the >>>> char is widened to an int and the StringBuffer is presized to the >>>> character's encoded value. Thus code like this prints an empty string >>>> rather than the expected "a": >>>> System.out.println(new StringBuilder('a')); >>>> >>>> Would it be possible to add a char constructor to StringBuilder to >> prevent >>>> this problem? I understand this would change the behavior of any code >> that >>>> is currently doing this, but it's hard to imagine anyone doing this >>>> intentionally. Of the ~20 instances we found in Google's codebase, all >>>> were bugs. What is your policy on making changes like this where (a) it >>>> will cause a change in behavior, but (b) the currently behavior is >> clearly >>>> wrong? >>>> >>>> If you're willing to take the change, I'd be happy to send a patch. >>>> >>>> Thanks, >>>> Eddie >>>> >> From Ulf.Zibis at CoSoCo.de Sat Aug 16 23:24:24 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Sun, 17 Aug 2014 01:24:24 +0200 Subject: new StringBuilder(char) In-Reply-To: References: Message-ID: <53EFE828.6000406@CoSoCo.de> Additionally nice to have: (initial capacity with initial char(s)) StringBuilder(int,char) StringBuilder(int,CharSequence) -Ulf Am 08.08.2014 um 22:53 schrieb Eddie Aftandilian: > Hi all, > > We recently realized that calling new StringBuilder(char) does not do what > you would think it does. Since there is no char constructor defined, the > char is widened to an int and the StringBuffer is presized to the > character's encoded value. Thus code like this prints an empty string > rather than the expected "a": > System.out.println(new StringBuilder('a')); > > Would it be possible to add a char constructor to StringBuilder to prevent > this problem? I understand this would change the behavior of any code that > is currently doing this, but it's hard to imagine anyone doing this > intentionally. Of the ~20 instances we found in Google's codebase, all > were bugs. What is your policy on making changes like this where (a) it > will cause a change in behavior, but (b) the currently behavior is clearly > wrong? > > If you're willing to take the change, I'd be happy to send a patch. > > Thanks, > Eddie > From amy.lu at oracle.com Mon Aug 18 07:08:22 2014 From: amy.lu at oracle.com (Amy Lu) Date: Mon, 18 Aug 2014 15:08:22 +0800 Subject: RFR 8055262: Update jdk/test/java/util/Base64 tests to use java.util.Base64 instead of sun.misc.BASE64Encoder/Decoder Message-ID: <53F1A666.4060003@oracle.com> There are two tests under jdk/test/java/util/Base64 that have dependency on internal API sun.misc.BASE64Encoder sun.misc.BASE64Decoder java/util/Base64/TestBase64Golden.java java/util/Base64/TestBase64.java This fix is to remove the internal API dependency from the tests. bug: https://bugs.openjdk.java.net/browse/JDK-8055262 webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8055262/webrev.00/ As mentioned tests are testing java.util.Base64, in this case, the unnecessary sun.misc.BASE64* verifying can be removed. Thanks, Amy From amy.lu at oracle.com Mon Aug 18 07:49:04 2014 From: amy.lu at oracle.com (Amy Lu) Date: Mon, 18 Aug 2014 15:49:04 +0800 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts Message-ID: <53F1AFF0.5000206@oracle.com> There are jdk tests that have dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts. This fix is to remove above internal API dependency from the tests. bug: https://bugs.openjdk.java.net/browse/JDK-8042003 webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.00/ The fix: 1. Updated test withconstants that defined in java.lang.Double/Float if the definition exist 2. Introduced jdk.testlibrary.DoubleUtils/FloatUtils to contain additional constants Thanks, Amy From joel.franck at oracle.com Mon Aug 18 08:23:07 2014 From: joel.franck at oracle.com (Joel Borggren-Franck) Date: Mon, 18 Aug 2014 10:23:07 +0200 Subject: RFR: JDK-8054987: (reflect) Add sharing of annotations between instances of Executable In-Reply-To: <53ECE9B9.4070000@gmail.com> References: <20140813122306.GE22209@oracle.com> <53EC0B3E.3020904@oracle.com> <20140814064708.GA4360@oracle.com> <53ECE9B9.4070000@gmail.com> Message-ID: <20140818082307.GA6217@oracle.com> Hi Peter, Joe, On 2014-08-14, Peter Levart wrote: > On 08/14/2014 08:47 AM, Joel Borggren-Franck wrote: > >On 2014-08-13, Joe Darcy wrote: > >>Hi Joel, > >> > >>Does your changeset alter the support (or non-support) of redefining > >>an annotation? > >> > >Hi Joe, > > > >It does not interact with the current non-support and I am convinced it > >wont hinder us in improving the situation. > > > >cheers > >/Joel > Hi Joel, > > Good to see this patch. It improves the efficiency of annotations > caching on methods/constructors. What about fields? They too are > AccessibleObject(s), contain annotations and are copied from root > instances when handed over to the user... > > The difference of behaviour in the presence of class redefinition > could be observed though, but I think this is not a problem. For > example: Thanks for taking a look at this. You are right about Fields, I added caching for Fields too: http://cr.openjdk.java.net/~jfranck/8054987/webrev.01/ I don't want to rewrite the synchronization in this patch, I'll file a followup RFE for the synchronization and a REF/bug for the publication. cheers /Joel From dalibor.topic at oracle.com Mon Aug 18 09:43:31 2014 From: dalibor.topic at oracle.com (dalibor topic) Date: Mon, 18 Aug 2014 11:43:31 +0200 Subject: [7u-dev] Request for Approval and Review: 8017212: File.createTempFile requires unnecessary "read" permission In-Reply-To: <53EE2A0E.9040900@oracle.com> References: <53EE2A0E.9040900@oracle.com> Message-ID: <53F1CAC3.5080702@oracle.com> Approved pending a positive review. On 15.08.2014 17:41, Ivan Gerasimov wrote: > Hello! > > I'd like to ask an approval to backport 8017212 into 7u-dev. > > The patch does not apply cleanly, however the required modifications are > quite small. > Nevertheless, I will need a peer review for this. > > The webrev for jdk7: http://cr.openjdk.java.net/~igerasim/8017212/0/webrev/ > > The difference, compared to jdk8 is: > src/share/classes/java/io/File.java -- curly bracket at the end of the > line > test/java/io/File/createTempFile/SpecialTempFile.java -- there were > conflicts due to backport of 8025128, so the test was just copied > verbatim from the latest jdk8u. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8017212 > Jdk8 changeset: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/10d2a4b1e576 > Jdk8 review: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018354.html > > The change was tested with jprt on all supported platforms. > All the io tests, including added and updated, passed. > > Sincerely yours, > Ivan -- Dalibor Topic | Principal Product Manager Phone: +494089091214 | Mobile: +491737185961 ORACLE Deutschland B.V. & Co. KG | K?hneh?fe 5 | 22761 Hamburg ORACLE Deutschland B.V. & Co. KG Hauptverwaltung: Riesstr. 25, D-80992 M?nchen Registergericht: Amtsgericht M?nchen, HRA 95603 Gesch?ftsf?hrer: J?rgen Kunz Komplement?rin: ORACLE Deutschland Verwaltung B.V. Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697 Gesch?ftsf?hrer: Alexander van der Ven, Astrid Kepper, Val Maher Oracle is committed to developing practices and products that help protect the environment From jaroslav.tulach at oracle.com Mon Aug 18 10:46:15 2014 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Mon, 18 Aug 2014 12:46:15 +0200 Subject: Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong? In-Reply-To: <53EDFF78.9040307@cs.oswego.edu> References: <2296697.ZmJV3U9KFH@logouticek> <2422213.Q7mX0svZJt@logouticek> <53EDFF78.9040307@cs.oswego.edu> Message-ID: <6261819.9tmirj4j0p@logouticek> Dne P? 15. srpna 2014 08:39:20, Doug Lea napsal(a): > Sorry for not answering this before you filed JDK-8055183. No need to apologize, Doug. I don't mind filling issues. We use their mutual dependencies to track related but otherwise independent problems in NetBeans bugzilla. I thought OpenJDK would follow the same habits, but I might have been wrong. > On 08/13/2014 07:12 AM, Jaroslav Tulach wrote: > > As far as I understand Andrew's inquiry, the problem is not (that much) > > related to finalizers, rather to question whether following method can > > ever > > > > finish or not: > > private void gcThis() { > > > > Reference ref = new WeakReference<>(this); > > while (ref.get() != null) { > > > > System.gc(); > > > > } > > System.err.println("ref is gone: " + ref); > > > > } > > > > On Oracle's JDK8 the method has never finished for me. However when I > > tried > > IBM's JDK (identification can be found below) the method finished every > > time! A bit of consistency would be beneficial in this area, imho. > > I believe that either behavior is legal under current JLS specs. See > in particular sec 12.6.2 > (http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.6.2) > Among the few guaranteed ways to ensure that "this" is kept reachable > (and not GCable) is to write "this" somewhere after its fields are > used. In other cases, a reference may or may not be kept reachable in > any given JVM, depending on safepoint schemes, whether the collector > is concurrent, etc. > > The surprisingness of the rules, and the lack of any other means of > control have been known issues for years. Because reachability > interacts with other memory ordering rules (for example, just to > explain what "after" means above), we are discussing changes as part > of the JMM revisions. (See archives at > http://mail.openjdk.java.net/pipermail/jmm-dev/) These extend some > previous discussions and proposals that we never pushed through for > JDK7. I see, but let me add one observation: reachability of objects is one thing; but reachability of this while its instance method is executing is something completely different. A general solution to reachability of objects would certainly provide a solution to reachability of this, but there is no reason to require solution to general reachability to come up with a way to keep this reachable when its instances methods (or some of them) are being executed. At the end JVM is an object oriented VM and requiring special treatment of this is much more acceptable than doing so in a generic purpose VM like LVVM for example. @GCThisIfYouWant public void instanceMethod() { } or @PreventGCOfThis public void instanceMethod() { } would imho do the trick. Of course it does not help with the more intricate problems of memory management, but one can always claim that proper memory cleanup in concurrent programs is hard. On contrary trying to say that "preventing GC of this while its instance method is running is hard" might be seen ridiculous in object oriented VM (while I understand that it is in compliance with current spec). > Minimally, there should be a means of forcing reachability without > forcing writes. One (old, unshipped) version of this can be found at > http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/atomic/Fen > ces.html > > As first discovered by Hans Boehm, it just so happens that one way to > implement the equivalent of reachabilityFence(x) even now is > "synchronized(x) {}". (See Hans's 2005 JavaOne slides at > http://hboehm.info/misc_slides/java_finalizers.pdf) Thanks. I'll take a note of ? Finalizers risk deallocating resources still in use by executing methods of unreachable object. ? Can be addressed with synchronization. > But I suspect that > a less weird and more efficient intrinsic will be introduced for JDK9. Good, I think it woud make sense - especially for the "this" case. > Beyond this, we are discussing prospects for extending reachability > without programmers needing to use lots of reachabilityFences, > possibly by introducing an @Finalized annotation to automate common > cases. I don't think there is consensus on this yet, in part because > there does not seem to be a way to do this that eliminates all > possible surprises/errors. > > In the mean time, your RFE JDK-8055183 > (https://bugs.openjdk.java.net/browse/JDK-8055183) seems to overlap > existing JMM revision efforts. I don't know whether you'd like to > keep it open as a reminder, or just close it. If there was a better way to track the progress I would just add it to the issue and close it. Up to you to decide. I am fine with any action. All I wanted was to clearly separate these reachability related issues from JDK-8051843 which is about replacing Object.finalize() with ReferenceQueue+cleanup thread. I believe such separation has happened and people interested in reachability of objects in memory can follow JDK-8055183 and there in listed pointers. Thanks for bearing with me. -jt From stanimir at riflexo.com Mon Aug 18 14:04:36 2014 From: stanimir at riflexo.com (Stanimir Simeonoff) Date: Mon, 18 Aug 2014 17:04:36 +0300 Subject: sun.net.www.protocol.https.HttpsURLConnectionImpl doesn't equal to self Message-ID: Hi, As the title says there is a major bug with HttpsURLConnection as it breaks the contract of equals. So the instance cannot be contained (mostly removed) in any collection reliably. (Concurrent)HashMap has a provision to test equality by reference prior calling equals, though. Finding the bug in production is quite a ride as the http variant doesn't exhibit the problem. Here is a simple test case. public static void main(String[] args) throws Throwable{ URLConnection c = new URL("https://oracle.com").openConnection(); System.out.println(c.getClass().getName()+" equals self: " +c.equals(c)); c.getInputStream().close(); System.out.println(c.getClass().getName()+" equals self: " +c.equals(c)); } The culprit is in HttpsURLConnectionImpl.equals that blindly calls delagate.equals: public boolean equals(Object obj) { return delegate.equals(obj); } It should be changed to: public boolean equals(Object obj) { return this==obj || (obj instanceof HttpsURLConnectionImpl) && delegate.equals( ((HttpsURLConnectionImpl)obj).delegate ); } The class has some other issue that involves declaring "finalize" method to simply call delegate's dispose. The finalize method is unneeded and just creates unnecessary link in the finalization queue + Finalizer object. Thanks Stanimir From michael.x.mcmahon at oracle.com Mon Aug 18 15:21:43 2014 From: michael.x.mcmahon at oracle.com (Michael McMahon) Date: Mon, 18 Aug 2014 16:21:43 +0100 Subject: sun.net.www.protocol.https.HttpsURLConnectionImpl doesn't equal to self In-Reply-To: References: Message-ID: <53F21A07.6020109@oracle.com> I'll file a bug for this Stanimir. Thanks for reporting it. Should be able to fix it in JDK 9 fairly promptly and we'll see about back porting it then. - Michael. On 18/08/14 15:04, Stanimir Simeonoff wrote: > Hi, > > As the title says there is a major bug with HttpsURLConnection as it breaks > the contract of equals. So the instance cannot be contained (mostly > removed) in any collection reliably. (Concurrent)HashMap has a provision to > test equality by reference prior calling equals, though. > Finding the bug in production is quite a ride as the http variant doesn't > exhibit the problem. > > Here is a simple test case. > > public static void main(String[] args) throws Throwable{ > URLConnection c = new URL("https://oracle.com").openConnection(); > System.out.println(c.getClass().getName()+" equals self: " > +c.equals(c)); > c.getInputStream().close(); > System.out.println(c.getClass().getName()+" equals self: " > +c.equals(c)); > } > > > The culprit is in HttpsURLConnectionImpl.equals that blindly calls > delagate.equals: > > public boolean equals(Object obj) { > return delegate.equals(obj); > } > > It should be changed to: > > public boolean equals(Object obj) { > return this==obj || (obj instanceof HttpsURLConnectionImpl) && > delegate.equals( ((HttpsURLConnectionImpl)obj).delegate ); > } > > > The class has some other issue that involves declaring "finalize" method to > simply call delegate's dispose. The finalize method is unneeded and just > creates unnecessary link in the finalization queue + Finalizer object. > > Thanks > Stanimir From mandy.chung at oracle.com Mon Aug 18 17:31:50 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 18 Aug 2014 10:31:50 -0700 Subject: RFR 8055262: Update jdk/test/java/util/Base64 tests to use java.util.Base64 instead of sun.misc.BASE64Encoder/Decoder In-Reply-To: <53F1A666.4060003@oracle.com> References: <53F1A666.4060003@oracle.com> Message-ID: <53F23886.6070103@oracle.com> On 8/18/14 12:08 AM, Amy Lu wrote: > There are two tests under jdk/test/java/util/Base64 that have > dependency on internal API sun.misc.BASE64Encoder sun.misc.BASE64Decoder > java/util/Base64/TestBase64Golden.java > java/util/Base64/TestBase64.java > > This fix is to remove the internal API dependency from the tests. > > bug: https://bugs.openjdk.java.net/browse/JDK-8055262 > webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8055262/webrev.00/ > This patch looks okay. I think it's fine to remove the test case comparing with sun.misc.BASE64 implementation from these tests. Mandy From xueming.shen at oracle.com Mon Aug 18 17:46:13 2014 From: xueming.shen at oracle.com (Xueming Shen) Date: Mon, 18 Aug 2014 10:46:13 -0700 Subject: RFR 8055262: Update jdk/test/java/util/Base64 tests to use java.util.Base64 instead of sun.misc.BASE64Encoder/Decoder In-Reply-To: <53F1A666.4060003@oracle.com> References: <53F1A666.4060003@oracle.com> Message-ID: <53F23BE5.2090608@oracle.com> On 08/18/2014 12:08 AM, Amy Lu wrote: > There are two tests under jdk/test/java/util/Base64 that have dependency on internal API sun.misc.BASE64Encoder sun.misc.BASE64Decoder > java/util/Base64/TestBase64Golden.java > java/util/Base64/TestBase64.java > > This fix is to remove the internal API dependency from the tests. > > bug: https://bugs.openjdk.java.net/browse/JDK-8055262 > webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8055262/webrev.00/ > > As mentioned tests are testing java.util.Base64, in this case, the unnecessary sun.misc.BASE64* verifying can be removed. > > Thanks, > Amy > looks fine. From joe.darcy at oracle.com Mon Aug 18 17:35:49 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 18 Aug 2014 10:35:49 -0700 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F1AFF0.5000206@oracle.com> References: <53F1AFF0.5000206@oracle.com> Message-ID: <53F23975.9040409@oracle.com> Hi Amy, A few comments here. This change basically adds a dependency from each of the test files to both DoubleUtils and FloatUtils test libraries. This is generally unnecessary. If the use of constants in a test is fully satisfied by java.lang.{Float, Double}, the test should not depend on the new test library at all. Likewise, if a test only uses Double-related constants, it should not reference the Float constants class, and vice versa. Please update your patch accordingly. Thanks, -Joe On 08/18/2014 12:49 AM, Amy Lu wrote: > There are jdk tests that have dependency on sun.misc.DoubleConsts and > sun.misc.FloatConsts. > This fix is to remove above internal API dependency from the tests. > > bug: https://bugs.openjdk.java.net/browse/JDK-8042003 > webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.00/ > > The fix: > 1. Updated test withconstants that defined in java.lang.Double/Float > if the definition exist > 2. Introduced jdk.testlibrary.DoubleUtils/FloatUtils to contain > additional constants > > Thanks, > Amy > From tristan.yan at oracle.com Mon Aug 18 17:46:35 2014 From: tristan.yan at oracle.com (Tristan Yan) Date: Mon, 18 Aug 2014 10:46:35 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <53D257BB.8010303@oracle.com> References: <53D257BB.8010303@oracle.com> Message-ID: <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> Hi Joe, Alan and others We?re working on moving our internal jaxp functional tests to open idk repo(Include refactoring effort). This is the first open review I am asking for SAX and Transform. Would you please review these tests. Any comment will be appreciated. I put the webrev as follows: http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev00/ Thank you very much. Tristan From mike.duigou at oracle.com Mon Aug 18 19:00:43 2014 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 18 Aug 2014 12:00:43 -0700 Subject: new StringBuilder(char) In-Reply-To: <53EFE828.6000406@CoSoCo.de> References: <53EFE828.6000406@CoSoCo.de> Message-ID: <4BAF7F0A-617A-4C46-A37F-A49AD10EA9AF@oracle.com> On Aug 16 2014, at 16:24 , Ulf Zibis wrote: > Additionally nice to have: > (initial capacity with initial char(s)) > StringBuilder(int,char) This one is unlikely. > StringBuilder(int,CharSequence) I don't see much advantage to this API. If it enabled a significant optimization then it might be worth considering but I am inclined to doubt it's value. Mike > > -Ulf > > > Am 08.08.2014 um 22:53 schrieb Eddie Aftandilian: >> Hi all, >> >> We recently realized that calling new StringBuilder(char) does not do what >> you would think it does. Since there is no char constructor defined, the >> char is widened to an int and the StringBuffer is presized to the >> character's encoded value. Thus code like this prints an empty string >> rather than the expected "a": >> System.out.println(new StringBuilder('a')); >> >> Would it be possible to add a char constructor to StringBuilder to prevent >> this problem? I understand this would change the behavior of any code that >> is currently doing this, but it's hard to imagine anyone doing this >> intentionally. Of the ~20 instances we found in Google's codebase, all >> were bugs. What is your policy on making changes like this where (a) it >> will cause a change in behavior, but (b) the currently behavior is clearly >> wrong? >> >> If you're willing to take the change, I'd be happy to send a patch. >> >> Thanks, >> Eddie >> > From mike.duigou at oracle.com Mon Aug 18 19:02:33 2014 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 18 Aug 2014 12:02:33 -0700 Subject: new StringBuilder(char) In-Reply-To: References: Message-ID: <4D9B92B0-02CF-4614-B257-DBAB1F7AE034@oracle.com> On Aug 15 2014, at 22:38 , Jeremy Manson wrote: > No love from core-libs-dev? Pavel has been looking into this and doing corpus and historical bug checks. It seems possible that we might consider fixing it as it does seem to be an ongoing source of errors. Mike > It's backwards-incompatible, but in a way that > would unbreak existing broken code. Might be a worthwhile cleanup. > > Jeremy > > > On Fri, Aug 8, 2014 at 1:53 PM, Eddie Aftandilian wrote: > >> Hi all, >> >> We recently realized that calling new StringBuilder(char) does not do what >> you would think it does. Since there is no char constructor defined, the >> char is widened to an int and the StringBuffer is presized to the >> character's encoded value. Thus code like this prints an empty string >> rather than the expected "a": >> System.out.println(new StringBuilder('a')); >> >> Would it be possible to add a char constructor to StringBuilder to prevent >> this problem? I understand this would change the behavior of any code that >> is currently doing this, but it's hard to imagine anyone doing this >> intentionally. Of the ~20 instances we found in Google's codebase, all >> were bugs. What is your policy on making changes like this where (a) it >> will cause a change in behavior, but (b) the currently behavior is clearly >> wrong? >> >> If you're willing to take the change, I'd be happy to send a patch. >> >> Thanks, >> Eddie >> From mandy.chung at oracle.com Mon Aug 18 19:09:56 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 18 Aug 2014 12:09:56 -0700 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F1AFF0.5000206@oracle.com> References: <53F1AFF0.5000206@oracle.com> Message-ID: <53F24F84.70303@oracle.com> On 8/18/14 12:49 AM, Amy Lu wrote: > There are jdk tests that have dependency on sun.misc.DoubleConsts and > sun.misc.FloatConsts. > This fix is to remove above internal API dependency from the tests. > > bug: https://bugs.openjdk.java.net/browse/JDK-8042003 > webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.00/ > In addition to Joe's comment, DoubleUtils and FloatUtils are needed by test/java/lang/Math/Tests.java and a few other math tests. It may be better to include them in test/java/lang/Math rather than in the testlibrary. Mandy From jeremymanson at google.com Mon Aug 18 20:10:20 2014 From: jeremymanson at google.com (Jeremy Manson) Date: Mon, 18 Aug 2014 13:10:20 -0700 Subject: new StringBuilder(char) In-Reply-To: <4D9B92B0-02CF-4614-B257-DBAB1F7AE034@oracle.com> References: <4D9B92B0-02CF-4614-B257-DBAB1F7AE034@oracle.com> Message-ID: Is there a bug? Jeremy On Mon, Aug 18, 2014 at 12:02 PM, Mike Duigou wrote: > > On Aug 15 2014, at 22:38 , Jeremy Manson wrote: > > > No love from core-libs-dev? > > Pavel has been looking into this and doing corpus and historical bug > checks. It seems possible that we might consider fixing it as it does seem > to be an ongoing source of errors. > > Mike > > > It's backwards-incompatible, but in a way that > > would unbreak existing broken code. Might be a worthwhile cleanup. > > > > Jeremy > > > > > > On Fri, Aug 8, 2014 at 1:53 PM, Eddie Aftandilian > wrote: > > > >> Hi all, > >> > >> We recently realized that calling new StringBuilder(char) does not do > what > >> you would think it does. Since there is no char constructor defined, > the > >> char is widened to an int and the StringBuffer is presized to the > >> character's encoded value. Thus code like this prints an empty string > >> rather than the expected "a": > >> System.out.println(new StringBuilder('a')); > >> > >> Would it be possible to add a char constructor to StringBuilder to > prevent > >> this problem? I understand this would change the behavior of any code > that > >> is currently doing this, but it's hard to imagine anyone doing this > >> intentionally. Of the ~20 instances we found in Google's codebase, all > >> were bugs. What is your policy on making changes like this where (a) it > >> will cause a change in behavior, but (b) the currently behavior is > clearly > >> wrong? > >> > >> If you're willing to take the change, I'd be happy to send a patch. > >> > >> Thanks, > >> Eddie > >> > > From joe.darcy at oracle.com Mon Aug 18 20:30:24 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 18 Aug 2014 13:30:24 -0700 Subject: new StringBuilder(char) In-Reply-To: <4D9B92B0-02CF-4614-B257-DBAB1F7AE034@oracle.com> References: <4D9B92B0-02CF-4614-B257-DBAB1F7AE034@oracle.com> Message-ID: <53F26260.5020109@oracle.com> As a general comment, in a new platform release like Java SE 9, it can be acceptable to add new overrides that would change the meaning of existing code: http://cr.openjdk.java.net/~darcy/OpenJdkDevGuide/OpenJdkDevelopersGuide.v0.777.html#general_evolution_policy Truth be told, we've sometimes adding new methods which changes client code behavior accidentally, such as: JDK-6226858: NoSuchMethodError in BigDecimal when compiling with 1.5 targetted for 1.4 https://bugs.openjdk.java.net/browse/JDK-6226858 Cheers, -Joe On 08/18/2014 12:02 PM, Mike Duigou wrote: > On Aug 15 2014, at 22:38 , Jeremy Manson wrote: > >> No love from core-libs-dev? > Pavel has been looking into this and doing corpus and historical bug checks. It seems possible that we might consider fixing it as it does seem to be an ongoing source of errors. > > Mike > >> It's backwards-incompatible, but in a way that >> would unbreak existing broken code. Might be a worthwhile cleanup. >> >> Jeremy >> >> >> On Fri, Aug 8, 2014 at 1:53 PM, Eddie Aftandilian wrote: >> >>> Hi all, >>> >>> We recently realized that calling new StringBuilder(char) does not do what >>> you would think it does. Since there is no char constructor defined, the >>> char is widened to an int and the StringBuffer is presized to the >>> character's encoded value. Thus code like this prints an empty string >>> rather than the expected "a": >>> System.out.println(new StringBuilder('a')); >>> >>> Would it be possible to add a char constructor to StringBuilder to prevent >>> this problem? I understand this would change the behavior of any code that >>> is currently doing this, but it's hard to imagine anyone doing this >>> intentionally. Of the ~20 instances we found in Google's codebase, all >>> were bugs. What is your policy on making changes like this where (a) it >>> will cause a change in behavior, but (b) the currently behavior is clearly >>> wrong? >>> >>> If you're willing to take the change, I'd be happy to send a patch. >>> >>> Thanks, >>> Eddie >>> From mike.duigou at oracle.com Mon Aug 18 21:12:52 2014 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 18 Aug 2014 14:12:52 -0700 Subject: RFR(S): 8055032: Improve numerical parsing in java.net and sun.net In-Reply-To: <53ECBC0F.7060604@oracle.com> References: <53EB6FF5.1050103@oracle.com> <53EC6752.6000601@oracle.com> <53EC822E.6000602@oracle.com> <53EC9DE7.3070007@oracle.com> <53ECA0BC.4070206@oracle.com> <53ECA4DE.5040300@oracle.com> <53ECB662.9030501@oracle.com> <53ECB838.3070201@oracle.com> <53ECBC0F.7060604@oracle.com> Message-ID: <0E6D5E4D-0A47-4E39-A9B5-5F664093AF66@oracle.com> On Aug 14 2014, at 06:39 , Alan Bateman wrote: > On 14/08/2014 14:23, Claes Redestad wrote: >> How about methods only taking beginIndex? Integer.parseInt("x: 10000000", 3, 10)? I guess these could to be dropped >> to avoid ambiguity and instead allow for variations where radix can be left out. >> >> I think there are two alternatives to the current implementation: >> - only keep parseInt(CharSequence s, int beginIndex, int endIndex, int radix) > That's my preference Looking at the examples I agree that providing only this one method is probably the least error prone option. Mike > and core-libs-dev would be the place to move the discussion. > > -Alan. > > >> - optional radix: parseInt(CharSequence s, int beginIndex, int endIndex), parseInt(CharSequence s, int beginIndex, int endIndex, int radix) >> >> (Should this discussion be moved to core-libs-dev?) >> >> /Claes > From huizhe.wang at oracle.com Mon Aug 18 23:32:09 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Mon, 18 Aug 2014 16:32:09 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> Message-ID: <53F28CF9.9030907@oracle.com> Hi Tristan, Nice work! As with those converted by Eric (8051561), the new tests looked much better and cleaner than the original ones. I see that you're using jaxp.library instead of a base class as in Eric's previous webrev. Is this the final decision on the whole test structure? It looks good. Have you run them with and without security manager? Thanks, Joe On 8/18/2014 10:46 AM, Tristan Yan wrote: > Hi Joe, Alan and others > We?re working on moving our internal jaxp functional tests to open idk > repo(Include refactoring effort). This is the first open review I am > asking for SAX and Transform. Would you please review these tests. Any > comment will be appreciated. > > I put the webrev as follows: > http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev00/ > > > Thank you very much. > Tristan From tristan.yan at oracle.com Mon Aug 18 23:42:56 2014 From: tristan.yan at oracle.com (Tristan Yan) Date: Mon, 18 Aug 2014 16:42:56 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <53F28CF9.9030907@oracle.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> Message-ID: <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> Thanks Joe We intend to replace the base class with test library because that doesn?t look like a real base class but an utilities class. I haven?t tried to run these tests with security manager, I will run them with security manager then get back you soon. Thank you. Tristan > On Aug 18, 2014, at 4:32 PM, huizhe wang wrote: > > From brian.goetz at oracle.com Tue Aug 19 00:43:18 2014 From: brian.goetz at oracle.com (Brian Goetz) Date: Mon, 18 Aug 2014 20:43:18 -0400 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53E8E366.3060200@CoSoCo.de> <313491A7-D4F0-46BA-8D60-7ADDA700040C@oracle.com> Message-ID: <53F29DA6.6030004@oracle.com> What you should have written was: String s = whatever.stream().collect(joining(", ")); On 8/11/2014 1:31 PM, Pavel Rappo wrote: > Sorry, I should've written this: > > Iterable whatever = ... > StringJoiner joiner = new StringJoiner(", "); > whatever.forEach(w -> joiner.add(w.toString())); > String s = joiner.toString(); > > -Pavel > > On 11 Aug 2014, at 17:17, Pavel Rappo wrote: > >> Iterable whatever = ... >> whatever.forEach(w -> builder.append(w.toString()); >> String s = builder.toString(); > From jeremymanson at google.com Tue Aug 19 06:22:04 2014 From: jeremymanson at google.com (Jeremy Manson) Date: Mon, 18 Aug 2014 23:22:04 -0700 Subject: new StringBuilder(char) In-Reply-To: <53F26260.5020109@oracle.com> References: <4D9B92B0-02CF-4614-B257-DBAB1F7AE034@oracle.com> <53F26260.5020109@oracle.com> Message-ID: So, should Eddie submit a patch? Someone on the Oracle side has to get it through the API gatekeepers. Jeremy On Mon, Aug 18, 2014 at 1:30 PM, Joe Darcy wrote: > As a general comment, in a new platform release like Java SE 9, it can be > acceptable to add new overrides that would change the meaning of existing > code: > > http://cr.openjdk.java.net/~darcy/OpenJdkDevGuide/ > OpenJdkDevelopersGuide.v0.777.html#general_evolution_policy > > Truth be told, we've sometimes adding new methods which changes client > code behavior accidentally, such as: > > JDK-6226858: NoSuchMethodError in BigDecimal when compiling with 1.5 > targetted for 1.4 > https://bugs.openjdk.java.net/browse/JDK-6226858 > > Cheers, > > -Joe > > > On 08/18/2014 12:02 PM, Mike Duigou wrote: > >> On Aug 15 2014, at 22:38 , Jeremy Manson wrote: >> >> No love from core-libs-dev? >>> >> Pavel has been looking into this and doing corpus and historical bug >> checks. It seems possible that we might consider fixing it as it does seem >> to be an ongoing source of errors. >> >> Mike >> >> It's backwards-incompatible, but in a way that >>> would unbreak existing broken code. Might be a worthwhile cleanup. >>> >>> Jeremy >>> >>> >>> On Fri, Aug 8, 2014 at 1:53 PM, Eddie Aftandilian >>> wrote: >>> >>> Hi all, >>>> >>>> We recently realized that calling new StringBuilder(char) does not do >>>> what >>>> you would think it does. Since there is no char constructor defined, >>>> the >>>> char is widened to an int and the StringBuffer is presized to the >>>> character's encoded value. Thus code like this prints an empty string >>>> rather than the expected "a": >>>> System.out.println(new StringBuilder('a')); >>>> >>>> Would it be possible to add a char constructor to StringBuilder to >>>> prevent >>>> this problem? I understand this would change the behavior of any code >>>> that >>>> is currently doing this, but it's hard to imagine anyone doing this >>>> intentionally. Of the ~20 instances we found in Google's codebase, all >>>> were bugs. What is your policy on making changes like this where (a) it >>>> will cause a change in behavior, but (b) the currently behavior is >>>> clearly >>>> wrong? >>>> >>>> If you're willing to take the change, I'd be happy to send a patch. >>>> >>>> Thanks, >>>> Eddie >>>> >>>> > From stanimir at riflexo.com Tue Aug 19 08:06:27 2014 From: stanimir at riflexo.com (Stanimir Simeonoff) Date: Tue, 19 Aug 2014 11:06:27 +0300 Subject: java.util.logging.FileHandler integer overflow prevents file rotation Message-ID: java.util.logging.FileHandler uses ints to track the written bytes that can cause negative value for java.util.logging.FileHandler.MeteredStream.written as there is no check in any of the write methods. The overflow prevents the check in FileHandler.publish(LogRecord) meter.written >= limit to ever trigger, esp. setting limit to Integer.MAX_VALUE that effectively always prevents file rotation. On a flip note, MeteredStream should be a static class. On another flip note, FileHandler should be using long as part of the API and internal implementation. ints are limited to 2GiB even when properly implemented that's a relatively low amount for certain types of logging files. So I propose adding overloaded c-tors FileHandler(String pattern, long limit, int count, boolean append) and FileHandler(String pattern, long limit, int count). LogManager should have a method "long getLongProperty(String name, long defaultValue)" to initialize limit. Thanks Stanimir From evgeniya.stepanova at oracle.com Tue Aug 19 12:58:51 2014 From: evgeniya.stepanova at oracle.com (Evgeniya Stepanova) Date: Tue, 19 Aug 2014 05:58:51 -0700 (PDT) Subject: 8055393: Some tests added to the TEST.group to exclude execution on inappropriate compact profiles Message-ID: <15232f91-5969-456d-ba33-14df731197c7@default> Hi all, Could you please review fix for 8055393 Problem:Some tests are being executed and fail under profiles Solution: -test java/lang/ProcessBuilder/InheritIO/InheritIO.sh changed to use COMPILEJAVA (set by jtreg harness) javac instead of TESTJAVA (which is absent in profiles) -java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java and some of the java/util/logging/ tests use java.lang.management.ManagementFactory class to get deadlocked threads. Such tests are added to the needs_compact3 testgroup -test java/lang/invoke/lambda/LambdaAsm.java check bytecode generation and use javac classes. Added to needs_jdk testgroup -test java/net/Authenticator/B4769350.java uses com.sun.net.httpserver.HttpHandler class as base class for all testcases. Added to the needs_compact2 testgroup -Some of the javax/management/mxbean tests uses java.beans.ConstructorProperties annotation. Such tests are added to the needs_jre test group -test sun/misc/URLClassPath/ClassnameCharTest.java included in both needs_compact2 and needs_jre testgroups. Removed from needs_compact2 testgroup since it fails on compacts2-3 Testing: locally. Tests excluded as expected In attachement diff against jdk8u-dev repo From evgeniya.stepanova at oracle.com Tue Aug 19 13:03:32 2014 From: evgeniya.stepanova at oracle.com (Evgeniya Stepanova) Date: Tue, 19 Aug 2014 17:03:32 +0400 Subject: 8055393: Some tests added to the TEST.group to exclude execution on inappropriate compact profiles In-Reply-To: <15232f91-5969-456d-ba33-14df731197c7@default> References: <15232f91-5969-456d-ba33-14df731197c7@default> Message-ID: <53F34B24.10301@oracle.com> Re-added lost diff On 19.08.2014 16:58, Evgeniya Stepanova wrote: > Hi all, > > Could you please review fix for 8055393 > > Problem:Some tests are being executed and fail under profiles > Solution: > -test java/lang/ProcessBuilder/InheritIO/InheritIO.sh changed to use COMPILEJAVA (set by jtreg harness) javac instead of TESTJAVA (which is absent in profiles) > -java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java and some of the java/util/logging/ tests use java.lang.management.ManagementFactory class to get deadlocked threads. Such tests are added to the needs_compact3 testgroup > -test java/lang/invoke/lambda/LambdaAsm.java check bytecode generation and use javac classes. Added to needs_jdk testgroup > -test java/net/Authenticator/B4769350.java uses com.sun.net.httpserver.HttpHandler class as base class for all testcases. Added to the needs_compact2 testgroup > -Some of the javax/management/mxbean tests uses java.beans.ConstructorProperties annotation. Such tests are added to the needs_jre test group > -test sun/misc/URLClassPath/ClassnameCharTest.java included in both needs_compact2 and needs_jre testgroups. Removed from needs_compact2 testgroup since it fails on compacts2-3 > Testing: locally. Tests excluded as expected > > > In attachement diff against jdk8u-dev repo -- /Evgeniya Stepanova/ -------------- next part -------------- diff -r 3b5417813053 test/TEST.groups --- a/test/TEST.groups Thu Aug 14 15:18:11 2014 +0200 +++ b/test/TEST.groups Tue Aug 19 16:06:07 2014 +0400 @@ -314,6 +314,7 @@ java/io/Serializable/serialver \ java/lang/invoke/lambda/LambdaAccessControlDoPrivilegedTest.java \ java/lang/invoke/lambda/LambdaAccessControlTest.java \ + java/lang/invoke/lambda/LambdaAsm.java \ java/lang/System/MacEncoding/TestFileEncoding.java \ java/net/URLClassLoader/closetest/GetResourceAsStream.java \ java/util/Collections/EmptyIterator.java \ @@ -370,8 +371,12 @@ java/text/Bidi/Bug7051769.java \ javax/crypto/Cipher/CipherStreamClose.java \ javax/management/monitor/AttributeArbitraryDataTypeTest.java \ - jdk/lambda/vm/InterfaceAccessFlagsTest.java \ - sun/misc/URLClassPath/ClassnameCharTest.java + javax/management/mxbean/AmbiguousConstructorTest.java \ + javax/management/mxbean/ExceptionDiagnosisTest.java \ + javax/management/mxbean/LeakTest.java \ + javax/management/mxbean/MXBeanTest.java \ + javax/management/mxbean/PropertyNamesTest.java \ + jdk/lambda/vm/InterfaceAccessFlagsTest.java # Tests dependent on the optional charsets.jar # These are isolated for easy exclusions @@ -465,6 +470,7 @@ sun/security/acl \ sun/security/jgss \ sun/security/krb5 \ + java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java \ java/lang/System/MacEncoding/TestFileEncoding.java \ java/nio/channels/AsynchronousSocketChannel/Leaky.java \ java/security/PermissionCollection/Concurrent.java \ @@ -472,6 +478,8 @@ java/security/cert/GetInstance.java \ java/util/logging/DrainFindDeadlockTest.java \ java/util/logging/LoggingMXBeanTest.java \ + java/util/logging/TestLogConfigurationDeadLock.java \ + java/util/logging/TestLoggerBundleSync.java \ sun/net/www/http/KeepAliveCache/B5045306.java \ sun/security/provider/PolicyFile/Alias.java \ sun/security/provider/PolicyFile/Comparator.java \ @@ -523,6 +531,7 @@ java/lang/PrimitiveSumMinMaxTest.java \ java/lang/String/StringJoinTest.java \ java/lang/Thread/StopThrowable.java \ + java/net/Authenticator/B4769350.java \ java/net/Authenticator/Deadlock.java \ java/net/CookieHandler/LocalHostCookie.java \ java/net/CookieHandler/CookieManagerTest.java \ diff -r 3b5417813053 test/java/lang/ProcessBuilder/InheritIO/InheritIO.sh --- a/test/java/lang/ProcessBuilder/InheritIO/InheritIO.sh Thu Aug 14 15:18:11 2014 +0200 +++ b/test/java/lang/ProcessBuilder/InheritIO/InheritIO.sh Tue Aug 19 16:06:07 2014 +0400 @@ -36,9 +36,12 @@ exit 1 fi +if [ "x${COMPILEJAVA}" = "x" ]; then + COMPILEJAVA="${TESTJAVA}" +fi JAVA="${TESTJAVA}/bin/java" -JAVAC="${TESTJAVA}/bin/javac" +JAVAC="${COMPILEJAVA}/bin/javac" cp -f ${TESTSRC}/InheritIO.java . From amy.lu at oracle.com Tue Aug 19 13:40:24 2014 From: amy.lu at oracle.com (Amy Lu) Date: Tue, 19 Aug 2014 21:40:24 +0800 Subject: RFR 8055262: Update jdk/test/java/util/Base64 tests to use java.util.Base64 instead of sun.misc.BASE64Encoder/Decoder In-Reply-To: <53F23886.6070103@oracle.com> References: <53F1A666.4060003@oracle.com> <53F23886.6070103@oracle.com> Message-ID: <53F353C8.3020300@oracle.com> Thank you Mandy and Sherman for your review. I'll need your help to push this. Thanks, Amy On 8/19/14, 1:31 AM, Mandy Chung wrote: > On 8/18/14 12:08 AM, Amy Lu wrote: >> There are two tests under jdk/test/java/util/Base64 that have >> dependency on internal API sun.misc.BASE64Encoder sun.misc.BASE64Decoder >> java/util/Base64/TestBase64Golden.java >> java/util/Base64/TestBase64.java >> >> This fix is to remove the internal API dependency from the tests. >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8055262 >> webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8055262/webrev.00/ >> > > This patch looks okay. I think it's fine to remove the test case > comparing with sun.misc.BASE64 implementation from these tests. > > Mandy From amy.lu at oracle.com Tue Aug 19 13:50:27 2014 From: amy.lu at oracle.com (Amy Lu) Date: Tue, 19 Aug 2014 21:50:27 +0800 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F24F84.70303@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> Message-ID: <53F35623.4020709@oracle.com> On 8/19/14, 3:09 AM, Mandy Chung wrote: > On 8/18/14 12:49 AM, Amy Lu wrote: >> There are jdk tests that have dependency on sun.misc.DoubleConsts and >> sun.misc.FloatConsts. >> This fix is to remove above internal API dependency from the tests. >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8042003 >> webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.00/ >> > In addition to Joe's comment, DoubleUtils and FloatUtils are > needed by test/java/lang/Math/Tests.java and a few other math > tests. It may be better to include them in test/java/lang/Math > rather than in the testlibrary. > > > Mandy > Thank you Mandy and Joe for your comments! To confirm, DoubleUtils and FloatUtils contain *only* constants that are not defined in java.lang.{Float, Double}, and tests fixed by using constants from 1) java.lang.{Float, Double} if constants defined there; 2) DoubleUtils and FloatUtils only for additional constants that are not in java.lang.{Float, Double}. DoubleUtils and FloatUtils now moved to test/java/lang/Math, the updated patch: http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.01/ Thanks, Amy From daniel.fuchs at oracle.com Tue Aug 19 13:52:08 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 19 Aug 2014 15:52:08 +0200 Subject: RFR: 8052403 java/util/logging/CheckZombieLockTest.java fails with NoSuchFileException In-Reply-To: <53EE6E67.4020600@oracle.com> References: <53EB5D60.3080606@oracle.com> <53EE6E67.4020600@oracle.com> Message-ID: <53F35688.3090002@oracle.com> On 8/15/14 10:32 PM, Mandy Chung wrote: > Looks good. Nit: adding a space between catch and ( would be good. Thanks Mandy. I took that opportunity to also fix the spaces before and after '+' in print statements. For the record the new webrev I'm going to push is here: http://cr.openjdk.java.net/~dfuchs/webrev_8052403/webrev.01/ (no need to re-review it's mostly noise due to the added white spaces now). best regards, -- daniel > > Mandy > > On 8/13/2014 5:43 AM, Daniel Fuchs wrote: >> Please find below a fix for >> >> 8052403: java/util/logging/CheckZombieLockTest.java fails >> with NoSuchFileException >> https://bugs.openjdk.java.net/browse/JDK-8052403 >> >> The issue here is that CheckZombieLockTest and CheckLockLocationTest use >> (create and delete) the same writable-dir under /tmp. >> >> When jtreg is run with a high concurrency factor this sometimes results >> in one of the tests deleting the directory that the other is >> running. I could verify this by triggering the same failure with: >> >> jtreg -verbose:all -jdk $MYJDK -conc:12 \ >> jdk/test/java/util/logging/Check* >> >> >> The fix simply arranges for CheckZombieLockTest to use a different >> directory than that used by CheckLockLocationTest (and also improves >> the diagnostic by arranging for setUp() to fail fast if the test >> lock file cannot be created). >> >> Webrev: >> http://cr.openjdk.java.net/~dfuchs/webrev_8052403/webrev.00/ >> >> best regards, >> >> -- daniel > From jason_mehrens at hotmail.com Tue Aug 19 14:00:07 2014 From: jason_mehrens at hotmail.com (Jason Mehrens) Date: Tue, 19 Aug 2014 09:00:07 -0500 Subject: java.util.logging.FileHandler integer overflow prevents file rotation In-Reply-To: References: Message-ID: Stanimir, Looks like the int overflow on the metered stream is an issue that hasn't been tracked. The other issues have been reported under https://bugs.openjdk.java.net/browse/JDK-6433253 and https://bugs.openjdk.java.net/browse/JDK-8028786 Jason ---------------------------------------- > Date: Tue, 19 Aug 2014 11:06:27 +0300 > Subject: java.util.logging.FileHandler integer overflow prevents file rotation > From: stanimir at riflexo.com > To: core-libs-dev at openjdk.java.net > > java.util.logging.FileHandler uses ints to track the written bytes > that can cause negative value for > java.util.logging.FileHandler.MeteredStream.written as there is no > check in any of the write methods. > The overflow prevents the check in FileHandler.publish(LogRecord) > meter.written>= limit to ever trigger, esp. setting limit to > Integer.MAX_VALUE that effectively always prevents file rotation. > > On a flip note, MeteredStream should be a static class. > On another flip note, FileHandler should be using long as part of the > API and internal implementation. ints are limited to 2GiB even when > properly implemented that's a relatively low amount for certain types > of logging files. So I propose adding overloaded c-tors > FileHandler(String pattern, long limit, int count, boolean append) > and FileHandler(String pattern, long limit, int count). LogManager > should have a method "long getLongProperty(String name, long > defaultValue)" to initialize limit. > > Thanks > Stanimir From pavel.rappo at oracle.com Tue Aug 19 15:00:12 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Tue, 19 Aug 2014 16:00:12 +0100 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53F29DA6.6030004@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53E8E366.3060200@CoSoCo.de> <313491A7-D4F0-46BA-8D60-7ADDA700040C@oracle.com> <53F29DA6.6030004@oracle.com> Message-ID: Brian, Yes, this works fine in cases when 'whatever' is a j.u.Collection (though some may argue that it's an overkill already). However we need even more thinking and transformations in case when 'whatever' is one of these: * j.u.Iterator * j.l.Iterable * j.u.Enumeration * CharSequence[] In my opinion it's not that pretty: * Enumeration whatever = ...; String s = Collections.list(whatever).stream().collect(joining(", ")); * Iterable whatever = ...; String s = StreamSupport.stream(whatever.spliterator(), false /* or true */) .collect(Collectors.joining(", ")); When we have one of these, it's even worse: * T[], where T is not an instance of CharSequence or T is primitive int[] whatever = ...; Arrays.stream(whatever).mapToObj(Integer::toString).collect(joining(", ")); * Iterable whatever = ...; String s = StreamSupport.stream(whatever.spliterator(), false /* or true */) .map(Object::toString) .collect(Collectors.joining(", ")); I believe the most common case of joining objects into a string is either when objects are strings itself or they are made strings by calling Object::toString. For such a common and simple task there should be a convenient and concise one-liner. I may be missing something. -Pavel On 19 Aug 2014, at 01:43, Brian Goetz wrote: > What you should have written was: > > String s = whatever.stream().collect(joining(", ")); From Sergey.Bylokhov at oracle.com Tue Aug 19 15:32:04 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 19 Aug 2014 19:32:04 +0400 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> Message-ID: <53F36DF4.6000008@oracle.com> Hi Ot?vio, The new alignment in DataLine.java/JColorChooser.java looks strange. Wrong change in BasicTableUI.java: - plainStr.deleteCharAt(plainStr.length() - 1).append("\n"); + plainStr.deleteCharAt(plainStr.length() - 1).append('\t'); On 13.08.2014 3:01, Ot?vio Gon?alves de Santana wrote: > Thank you Roger. > Done > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_6.zip > > > On Tue, Aug 12, 2014 at 10:15 AM, roger riggs > wrote: > >> fyi, >> >> There's a Perl script normalizer.pl that detects/fixes most of the simple >> tab/white space issues. >> The script is in the /make/scripts/normalizer.pl >> >> Roger >> >> >> On 8/12/2014 3:48 AM, Andrej Golovnin wrote: >> >>> Hi Ot?vio, >>> >>> I think you should fix the indentation in a lot of classes. You use the >>> tab-character for the indentation. As far as I know we should use the >>> space >>> character for the indentation in the JDK sources (Oracle devs feel free to >>> correct me if I'm wrong. And it would be really nice if the style guide >>> for >>> the source code would be a part of the JDK repository. So we don't need to >>> search for it on the internet/wiki. Just clone the repository, read the >>> style guide and follow it. :-) ). Here is the not complete list of classes >>> where you used the tab-character for the indentation: >>> >>> src/share/classes/com/sun/crypto/provider/OAEPParameters.java >>> src/share/classes/java/lang/management/MemoryUsage.java >>> src/share/classes/java/security/KeyStore.java >>> src/share/classes/java/security/PermissionCollection.java >>> src/share/classes/java/security/ProtectionDomain.java >>> src/share/classes/java/security/cert/CertPath.java >>> src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java >>> src/share/classes/java/security/cert/PKIXParameters.java >>> src/share/classes/java/security/cert/PolicyQualifierInfo.java >>> src/share/classes/java/security/cert/TrustAnchor.java >>> src/share/classes/java/security/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); } >>> >>> Best regards, >>> Andrej Golovnin >>> >> > -- Best regards, Sergey. From huizhe.wang at oracle.com Tue Aug 19 17:32:22 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Tue, 19 Aug 2014 10:32:22 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> Message-ID: <53F38A26.2080608@oracle.com> By the way, the plan has been that all of the JAXP SQE and Unit tests be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently in the jdk repo shall be moved to jaxp/test as well. I see that your webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're checking tests into the jdk repo. Thanks, Joe On 8/18/2014 4:42 PM, Tristan Yan wrote: > Thanks Joe > We intend to replace the base class with test library because that > doesn?t look like a real base class but an utilities class. > I haven?t tried to run these tests with security manager, I will run > them with security manager then get back you soon. > Thank you. > Tristan > >> On Aug 18, 2014, at 4:32 PM, huizhe wang > > wrote: >> >> > From tristan.yan at oracle.com Tue Aug 19 17:34:40 2014 From: tristan.yan at oracle.com (Tristan Yan) Date: Tue, 19 Aug 2014 10:34:40 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <53F38A26.2080608@oracle.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> Message-ID: <1D4F51A8-5153-45A4-B54E-C3A9431E07B5@oracle.com> Thanks Joe. I will move the tests to [openjdk]/jaxp repo then. Tristan > On Aug 19, 2014, at 10:32 AM, huizhe wang wrote: > > By the way, the plan has been that all of the JAXP SQE and Unit tests be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently in the jdk repo shall be moved to jaxp/test as well. I see that your webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're checking tests into the jdk repo. > > Thanks, > Joe > > On 8/18/2014 4:42 PM, Tristan Yan wrote: >> Thanks Joe >> We intend to replace the base class with test library because that doesn?t look like a real base class but an utilities class. >> I haven?t tried to run these tests with security manager, I will run them with security manager then get back you soon. >> Thank you. >> Tristan >> >>> On Aug 18, 2014, at 4:32 PM, huizhe wang wrote: >>> >>> >> > From joe.darcy at oracle.com Tue Aug 19 17:51:08 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 19 Aug 2014 10:51:08 -0700 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F35623.4020709@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> <53F35623.4020709@oracle.com> Message-ID: <53F38E8C.9080306@oracle.com> On 08/19/2014 06:50 AM, Amy Lu wrote: > On 8/19/14, 3:09 AM, Mandy Chung wrote: >> On 8/18/14 12:49 AM, Amy Lu wrote: >>> There are jdk tests that have dependency on sun.misc.DoubleConsts >>> and sun.misc.FloatConsts. >>> This fix is to remove above internal API dependency from the tests. >>> >>> bug: https://bugs.openjdk.java.net/browse/JDK-8042003 >>> webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.00/ >>> >> In addition to Joe's comment, DoubleUtils and FloatUtils are >> needed by test/java/lang/Math/Tests.java and a few other math >> tests. It may be better to include them in test/java/lang/Math >> rather than in the testlibrary. >> >> >> Mandy >> > > Thank you Mandy and Joe for your comments! > > To confirm, DoubleUtils and FloatUtils contain *only* constants that > are not defined in java.lang.{Float, Double}, and tests fixed by using > constants from 1) java.lang.{Float, Double} if constants defined > there; 2) DoubleUtils and FloatUtils only for additional constants > that are not in java.lang.{Float, Double}. > > DoubleUtils and FloatUtils now moved to test/java/lang/Math, the > updated patch: > > http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.01/ > The uses of DoubleUtils and FloatUtils now look okay, but I have some additional comments on the contents of those types. First, I think these type are better named "DoubleConsts" and "FloatConsts" since they only have constants defined in them. As such, they should be derived works of the sun.misc.{FloatConsts, DoubleConsts} types: * Inherit starting copyright dates of those types * Use "float" and "double" to talk about the types rather than "Float" and "Double" * Include the private constructor and static initializer to check for correctness conditions as in the sun.misc types Changing the simple names of the new types to match the old types will also have the benefit of greatly reducing the size of the patch. (In the new files, more recent javadoc conventions should be follow {@code foo} rather than foo, etc.) Thanks, -Joe From Sergey.Bylokhov at oracle.com Tue Aug 19 18:16:06 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 19 Aug 2014 22:16:06 +0400 Subject: jsr 305 In-Reply-To: <4E78E2D0.4050303@oracle.com> References: <4E77F6E3.7040300@oracle.com> <4E78E2D0.4050303@oracle.com> Message-ID: <53F39466.5040304@oracle.com> Hi, Joe. There are no news about this jsr in jdk9? I guess it will be useful in jdk development also. On 20.09.2011 23:00, Joe Darcy wrote: > Hello. > > First, a procedural point, the party responsible for making progress on > a JSR is the spec lead, which in the case of JSR 305 is Bill Pugh. > > When I last spoke to Bill about 18 months ago, he said he felt the > annotations needed more use on real-world code before they could be > fully standardized. I assume that the JSR has remained in that state > since then. > > JSR 308 is primarily about allowing annotations in more locations in a > source file and *not* about defining more annotations. > > -Joe > > Ben Evans wrote: >> Hi Sergey, >> >> I am not an expert in what happened to JSR 305, but from a quick look >> at it, it seems to have a big overlap with JSR 308 (Type Annotations), >> which is still an active JSR. >> >> So you may want to approach the Spec Lead / EG for JSR 308 and see >> what their current status is - the last I heard they were interested >> in trying to make the cut for JDK 8. >> >> Does anyone have more information? >> >> Thanks, >> >> Ben >> >> On Tue, Sep 20, 2011 at 3:13 AM, Sergey Bylokhov >> wrote: >> >>> Hello, all. >>> >>> Does anybody know what happens with jsr305? >>> http://jcp.org/en/jsr/detail?id=305 >>> >>> Probably it is replaced by another jsr? Can it be integrated as part of >>> coin project? >>> >>> >>> Thanks. >>> >>> -- >>> Best regards, Sergey. >>> >>> >>> >>> >> > > -- Best regards, Sergey. From mandy.chung at oracle.com Tue Aug 19 19:27:59 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 19 Aug 2014 12:27:59 -0700 Subject: RFR 8055262: Update jdk/test/java/util/Base64 tests to use java.util.Base64 instead of sun.misc.BASE64Encoder/Decoder In-Reply-To: <53F353C8.3020300@oracle.com> References: <53F1A666.4060003@oracle.com> <53F23886.6070103@oracle.com> <53F353C8.3020300@oracle.com> Message-ID: <53F3A53F.1040303@oracle.com> Pushed. Thanks for the contribution. Mandy On 8/19/14 6:40 AM, Amy Lu wrote: > Thank you Mandy and Sherman for your review. > > I'll need your help to push this. > > Thanks, > Amy > > On 8/19/14, 1:31 AM, Mandy Chung wrote: >> On 8/18/14 12:08 AM, Amy Lu wrote: >>> There are two tests under jdk/test/java/util/Base64 that have >>> dependency on internal API sun.misc.BASE64Encoder >>> sun.misc.BASE64Decoder >>> java/util/Base64/TestBase64Golden.java >>> java/util/Base64/TestBase64.java >>> >>> This fix is to remove the internal API dependency from the tests. >>> >>> bug: https://bugs.openjdk.java.net/browse/JDK-8055262 >>> webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8055262/webrev.00/ >>> >> >> This patch looks okay. I think it's fine to remove the test case >> comparing with sun.misc.BASE64 implementation from these tests. >> >> Mandy > From joe.darcy at oracle.com Tue Aug 19 20:56:54 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 19 Aug 2014 13:56:54 -0700 Subject: jsr 305 In-Reply-To: <53F39466.5040304@oracle.com> References: <4E77F6E3.7040300@oracle.com> <4E78E2D0.4050303@oracle.com> <53F39466.5040304@oracle.com> Message-ID: <53F3BA16.1080902@oracle.com> Sergey, JSR 305 is officially marked "dormant" in the JCP: https://www.jcp.org/en/jsr/detail?id=305 At this point, the addition of annotations in that vein should probably occur under the banner of a different effort. Cheers, -Joe On 08/19/2014 11:16 AM, Sergey Bylokhov wrote: > Hi, Joe. > There are no news about this jsr in jdk9? I guess it will be useful in > jdk development also. > > On 20.09.2011 23:00, Joe Darcy wrote: >> Hello. >> >> First, a procedural point, the party responsible for making progress on >> a JSR is the spec lead, which in the case of JSR 305 is Bill Pugh. >> >> When I last spoke to Bill about 18 months ago, he said he felt the >> annotations needed more use on real-world code before they could be >> fully standardized. I assume that the JSR has remained in that state >> since then. >> >> JSR 308 is primarily about allowing annotations in more locations in a >> source file and *not* about defining more annotations. >> >> -Joe >> >> Ben Evans wrote: >>> Hi Sergey, >>> >>> I am not an expert in what happened to JSR 305, but from a quick look >>> at it, it seems to have a big overlap with JSR 308 (Type Annotations), >>> which is still an active JSR. >>> >>> So you may want to approach the Spec Lead / EG for JSR 308 and see >>> what their current status is - the last I heard they were interested >>> in trying to make the cut for JDK 8. >>> >>> Does anyone have more information? >>> >>> Thanks, >>> >>> Ben >>> >>> On Tue, Sep 20, 2011 at 3:13 AM, Sergey Bylokhov >>> wrote: >>>> Hello, all. >>>> >>>> Does anybody know what happens with jsr305? >>>> http://jcp.org/en/jsr/detail?id=305 >>>> >>>> Probably it is replaced by another jsr? Can it be integrated as >>>> part of >>>> coin project? >>>> >>>> >>>> Thanks. >>>> >>>> -- >>>> Best regards, Sergey. >>>> >>>> >>>> >> >> > > From otaviojava at java.net Wed Aug 20 01:05:58 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Tue, 19 Aug 2014 22:05:58 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53F36DF4.6000008@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> Message-ID: Thank you Sergey. https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_7.zip On Tue, Aug 19, 2014 at 12:32 PM, Sergey Bylokhov < Sergey.Bylokhov at oracle.com> wrote: > Hi Ot?vio, > The new alignment in DataLine.java/JColorChooser.java looks strange. > Wrong change in BasicTableUI.java: > - plainStr.deleteCharAt(plainStr.length() - > 1).append("\n"); > + plainStr.deleteCharAt(plainStr.length() - > 1).append('\t'); > > > On 13.08.2014 3:01, Ot?vio Gon?alves de Santana wrote: > >> Thank you Roger. >> Done >> https://dl.dropboxusercontent.com/u/16109193/open_jdk/ >> string_builder_concat_6.zip >> >> >> On Tue, Aug 12, 2014 at 10:15 AM, roger riggs >> wrote: >> >> fyi, >>> >>> There's a Perl script normalizer.pl that detects/fixes most of the >>> simple >>> tab/white space issues. >>> The script is in the /make/scripts/normalizer.pl >>> >>> Roger >>> >>> >>> On 8/12/2014 3:48 AM, Andrej Golovnin wrote: >>> >>> Hi Ot?vio, >>>> >>>> I think you should fix the indentation in a lot of classes. You use the >>>> tab-character for the indentation. As far as I know we should use the >>>> space >>>> character for the indentation in the JDK sources (Oracle devs feel free >>>> to >>>> correct me if I'm wrong. And it would be really nice if the style guide >>>> for >>>> the source code would be a part of the JDK repository. So we don't need >>>> to >>>> search for it on the internet/wiki. Just clone the repository, read the >>>> style guide and follow it. :-) ). Here is the not complete list of >>>> classes >>>> where you used the tab-character for the indentation: >>>> >>>> src/share/classes/com/sun/crypto/provider/OAEPParameters.java >>>> src/share/classes/java/lang/management/MemoryUsage.java >>>> src/share/classes/java/security/KeyStore.java >>>> src/share/classes/java/security/PermissionCollection.java >>>> src/share/classes/java/security/ProtectionDomain.java >>>> src/share/classes/java/security/cert/CertPath.java >>>> src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java >>>> src/share/classes/java/security/cert/PKIXParameters.java >>>> src/share/classes/java/security/cert/PolicyQualifierInfo.java >>>> src/share/classes/java/security/cert/TrustAnchor.java >>>> src/share/classes/java/security/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); } >>>> >>>> Best regards, >>>> Andrej Golovnin >>>> >>>> >>> >> > > -- > Best regards, Sergey. > > -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/ThreadTab.java --- a/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java Tue Aug 19 21:59:23 2014 -0300 @@ -368,7 +368,7 @@ sb.append(Messages.STACK_TRACE); int index = 0; for (StackTraceElement e : ti.getStackTrace()) { - sb.append(e.toString()+"\n"); + sb.append(e.toString()).append('\n'); if (monitors != null) { for (MonitorInfo mi : monitors) { if (mi.getLockedStackDepth() == index) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java --- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java Tue Aug 19 21:59:23 2014 -0300 @@ -79,25 +79,25 @@ String textColor = String.format("%06x", foreground.getRGB() & 0xFFFFFF); StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append("
    "); for (int i = 0; i < arr.length; i++) { if (i % 2 == 0) { - sb.append(""); + sb.append(""); } else { - sb.append(""); + sb.append(""); } } if (arr.length == 0) { - sb.append(""); + sb.append(""); } sb.append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    " +
    -                            (arr[i] == null ?
    -                                arr[i] : htmlize(arr[i].toString())) +
    -                            "
    ")
    +                            .append(arr[i] == null ?
    +                                    arr[i] : htmlize(arr[i].toString()))
    +                            .append("
    "); arrayEditor.setText(sb.toString()); diff -r dde9f5cfde5f src/share/classes/sun/tools/jconsole/inspector/XTree.java --- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java Tue Aug 19 21:59:23 2014 -0300 @@ -507,13 +507,13 @@ // key order defined by the "orderedKeyPropertyList" for (String key : orderedKeyPropertyList) { if (map.containsKey(key)) { - sb.append(key + "=" + map.get(key) + ","); + sb.append(key).append('=').append(map.get(key)).append(','); map.remove(key); } } // Add the remaining key/value pairs to the buffer for (Map.Entry entry : map.entrySet()) { - sb.append(entry.getKey() + "=" + entry.getValue() + ","); + sb.append(entry.getKey()).append('=').append(entry.getValue()).append(','); } String orderedKeyPropertyListString = sb.toString(); orderedKeyPropertyListString = orderedKeyPropertyListString.substring( @@ -622,7 +622,7 @@ // StringBuilder sb = new StringBuilder(); for (MBeanParameterInfo mbpi : mboi.getSignature()) { - sb.append(mbpi.getType() + ","); + sb.append(mbpi.getType()).append(','); } String signature = sb.toString(); if (signature.length() > 0) { diff -r dde9f5cfde5f src/share/classes/sun/tools/jps/Jps.java --- a/src/share/classes/sun/tools/jps/Jps.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jps/Jps.java Tue Aug 19 21:59:23 2014 -0300 @@ -92,28 +92,28 @@ vm = monitoredHost.getMonitoredVm(id, 0); errorString = " -- main class information unavailable"; - output.append(" " + MonitoredVmUtil.mainClass(vm, + output.append(' ').append(MonitoredVmUtil.mainClass(vm, arguments.showLongPaths())); if (arguments.showMainArgs()) { errorString = " -- main args information unavailable"; String mainArgs = MonitoredVmUtil.mainArgs(vm); if (mainArgs != null && mainArgs.length() > 0) { - output.append(" " + mainArgs); + output.append(' ').append(mainArgs); } } if (arguments.showVmArgs()) { errorString = " -- jvm args information unavailable"; String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) { - output.append(" " + jvmArgs); + output.append(' ').append(jvmArgs); } } if (arguments.showVmFlags()) { errorString = " -- jvm flags information unavailable"; String jvmFlags = MonitoredVmUtil.jvmFlags(vm); if (jvmFlags != null && jvmFlags.length() > 0) { - output.append(" " + jvmFlags); + output.append(' ').append(jvmFlags); } } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/RawOutputFormatter.java --- a/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/RawOutputFormatter.java Tue Aug 19 21:59:23 2014 -0300 @@ -50,7 +50,7 @@ StringBuilder headerBuilder = new StringBuilder(); for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { Monitor m = i.next(); - headerBuilder.append(m.getName() + " "); + headerBuilder.append(m.getName()).append(' '); } header = headerBuilder.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/SyntaxException.java --- a/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/SyntaxException.java Tue Aug 19 21:59:23 2014 -0300 @@ -65,7 +65,7 @@ public SyntaxException(int lineno, Set expected, Token found) { StringBuilder msg = new StringBuilder(); - msg.append("Syntax error at line " + lineno + ": Expected one of \'"); + msg.append("Syntax error at line ").append(lineno).append(": Expected one of \'"); boolean first = true; for (Iterator i = expected.iterator(); i.hasNext(); /* empty */) { @@ -74,11 +74,11 @@ msg.append(keyWord); first = false; } else { - msg.append("|" + keyWord); + msg.append('|').append(keyWord); } } - msg.append("\', Found " + found.toMessage()); + msg.append("\', Found ").append(found.toMessage()); message = msg.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstat/Token.java --- a/src/share/classes/sun/tools/jstat/Token.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstat/Token.java Tue Aug 19 21:59:23 2014 -0300 @@ -89,18 +89,18 @@ sb.append("ttype=TT_EOF"); break; case StreamTokenizer.TT_NUMBER: - sb.append("ttype=TT_NUM,").append("nval="+nval); + sb.append("ttype=TT_NUM,").append("nval=").append(nval); break; case StreamTokenizer.TT_WORD: if (sval == null) { sb.append("ttype=TT_WORD:IDENTIFIER"); } else { - sb.append("ttype=TT_WORD:").append("sval="+sval); + sb.append("ttype=TT_WORD:").append("sval=").append(sval); } break; default: if (ttype == (int)'"') { - sb.append("ttype=TT_STRING:").append("sval="+sval); + sb.append("ttype=TT_STRING:").append("sval=").append(sval); } else { sb.append("ttype=TT_CHAR:").append((char)ttype); } diff -r dde9f5cfde5f src/share/classes/sun/tools/jstatd/RemoteHostImpl.java --- a/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java Tue Aug 19 21:59:23 2014 -0300 @@ -68,7 +68,7 @@ sb.append("local://").append(lvmid).append("@localhost"); if (mode != null) { - sb.append("?mode=" + mode); + sb.append("?mode=").append(mode); } String vmidStr = sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/security/acl/AclEntryImpl.java --- a/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/acl/AclEntryImpl.java Tue Aug 19 21:59:23 2014 -0300 @@ -137,26 +137,30 @@ /** * Return a string representation of the contents of the ACL entry. */ - public String toString() { - StringBuffer s = new StringBuffer(); - if (negative) - s.append("-"); - else - s.append("+"); - if (user instanceof Group) - s.append("Group."); - else - s.append("User."); - s.append(user + "="); - Enumeration e = permissions(); - while(e.hasMoreElements()) { - Permission p = e.nextElement(); - s.append(p); - if (e.hasMoreElements()) - s.append(","); - } - return new String(s); - } + public String toString() { + StringBuffer sb = new StringBuffer(); + if (negative) { + sb.append('-'); + } else { + sb.append('+'); + } + if (user instanceof Group) { + sb.append("Group."); + } else { + sb.append("User."); + } + sb.append(user).append('='); + + Enumeration e = permissions(); + while (e.hasMoreElements()) { + Permission p = e.nextElement(); + sb.append(p); + if (e.hasMoreElements()) { + sb.append(','); + } + } + return sb.toString(); + } /** * Clones an AclEntry. diff -r dde9f5cfde5f src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java --- a/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java Tue Aug 19 21:59:23 2014 -0300 @@ -640,8 +640,7 @@ for (int i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs/SigningCertificateInfo.java --- a/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java Tue Aug 19 21:59:23 2014 -0300 @@ -158,8 +158,8 @@ } sb.append(hexDumper.encode(certHash)); if (issuer != null && serialNumber != null) { - sb.append("\n\tIssuer: " + issuer + "\n"); - sb.append("\t" + serialNumber); + sb.append("\n\tIssuer: ").append(issuer).append('\n'); + sb.append('\t').append(serialNumber); } sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/pkcs11/P11KeyStore.java --- a/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/pkcs11/P11KeyStore.java Tue Aug 19 21:59:23 2014 -0300 @@ -196,24 +196,24 @@ } else if (type == ATTR_CLASS_CERT) { sb.append("\ttype=[trusted cert]\n"); } - sb.append("\tlabel=[" + label + "]\n"); + sb.append("\tlabel=[").append(label).append("]\n"); if (id == null) { sb.append("\tid=[null]\n"); } else { - sb.append("\tid=" + P11KeyStore.getID(id) + "\n"); + sb.append("\tid=").append(P11KeyStore.getID(id)).append('\n'); } - sb.append("\ttrusted=[" + trusted + "]\n"); - sb.append("\tmatched=[" + matched + "]\n"); + sb.append("\ttrusted=[").append(trusted).append("]\n"); + sb.append("\tmatched=[").append(matched).append("]\n"); if (cert == null) { sb.append("\tcert=[null]\n"); } else { - sb.append("\tcert=[\tsubject: " + - cert.getSubjectX500Principal() + - "\n\t\tissuer: " + - cert.getIssuerX500Principal() + - "\n\t\tserialNum: " + - cert.getSerialNumber().toString() + - "]"); + sb.append("\tcert=[\tsubject: ") + .append(cert.getSubjectX500Principal()) + .append("\n\t\tissuer: ") + .append(cert.getIssuerX500Principal()) + .append("\n\t\tserialNum: ") + .append(cert.getSerialNumber().toString()) + .append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/PolicyFile.java --- a/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/PolicyFile.java Tue Aug 19 21:59:23 2014 -0300 @@ -1485,30 +1485,30 @@ } int startIndex = 0; int v; - StringBuilder sb = new StringBuilder(); - while ((v = sp.getSelfName().indexOf(SELF, startIndex)) != -1) { + StringBuilder sb = new StringBuilder(); + while ((v = sp.getSelfName().indexOf(SELF, startIndex)) != -1) { - // add non-SELF string - sb.append(sp.getSelfName().substring(startIndex, v)); + // add non-SELF string + sb.append(sp.getSelfName().substring(startIndex, v)); - // expand SELF - Iterator pli = entryPs.iterator(); - while (pli.hasNext()) { - PolicyParser.PrincipalEntry pppe = pli.next(); - String[][] principalInfo = getPrincipalInfo(pppe,pdp); - for (int i = 0; i < principalInfo.length; i++) { - if (i != 0) { - sb.append(", "); - } - sb.append(principalInfo[i][0] + " " + - "\"" + principalInfo[i][1] + "\""); - } - if (pli.hasNext()) { - sb.append(", "); - } - } - startIndex = v + SELF.length(); - } + // expand SELF + Iterator pli = entryPs.iterator(); + while (pli.hasNext()) { + PolicyParser.PrincipalEntry pppe = pli.next(); + String[][] principalInfo = getPrincipalInfo(pppe, pdp); + for (int i = 0; i < principalInfo.length; i++) { + if (i != 0) { + sb.append(", "); + } + sb.append(principalInfo[i][0]).append(' ').append('"') + .append(principalInfo[i][1]).append('"'); + } + if (pli.hasNext()) { + sb.append(", "); + } + } + startIndex = v + SELF.length(); + } // add remaining string (might be the entire string) sb.append(sp.getSelfName().substring(startIndex)); @@ -1774,17 +1774,17 @@ Principal[] principals = pd.getPrincipals(); String pals = ""; if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + StringBuilder palSB = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); + palSB.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); if (i < principals.length-1) - palBuf.append(", "); + palSB.append(", "); else - palBuf.append(")"); + palSB.append(')'); } - pals = palBuf.toString(); + pals = palSB.toString(); } return "PD CodeSource: " + pd.getCodeSource() @@ -1884,7 +1884,7 @@ throw new Exception(form.format(source)); } - sb.append(X500PRINCIPAL + " \"" + suffix + "\""); + sb.append(X500PRINCIPAL).append(" \"").append(suffix).append('"'); startIndex = e+2; } else { MessageFormat form = new MessageFormat diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/CertId.java --- a/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/CertId.java Tue Aug 19 21:59:23 2014 -0300 @@ -223,13 +223,13 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CertId \n"); - sb.append("Algorithm: " + hashAlgId.toString() +"\n"); + sb.append("Algorithm: ").append(hashAlgId.toString()).append('\n'); sb.append("issuerNameHash \n"); HexDumpEncoder encoder = new HexDumpEncoder(); sb.append(encoder.encode(issuerNameHash)); sb.append("\nissuerKeyHash: \n"); sb.append(encoder.encode(issuerKeyHash)); - sb.append("\n" + certSerialNumber.toString()); + sb.append('\n').append(certSerialNumber.toString()); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/OCSPResponse.java --- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java Tue Aug 19 21:59:23 2014 -0300 @@ -812,14 +812,14 @@ StringBuilder sb = new StringBuilder(); sb.append("SingleResponse: \n"); sb.append(certId); - sb.append("\nCertStatus: "+ certStatus + "\n"); + sb.append("\nCertStatus: ").append(certStatus).append('\n'); if (certStatus == CertStatus.REVOKED) { - sb.append("revocationTime is " + revocationTime + "\n"); - sb.append("revocationReason is " + revocationReason + "\n"); + sb.append("revocationTime is ").append(revocationTime).append('\n'); + sb.append("revocationReason is ").append(revocationReason).append('\n'); } - sb.append("thisUpdate is " + thisUpdate + "\n"); + sb.append("thisUpdate is ").append(thisUpdate).append('\n'); if (nextUpdate != null) { - sb.append("nextUpdate is " + nextUpdate + "\n"); + sb.append("nextUpdate is ").append(nextUpdate).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java --- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java Tue Aug 19 21:59:23 2014 -0300 @@ -124,7 +124,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Build Forward Flag: " + String.valueOf(buildForward) + "\n"); + sb.append(" Build Forward Flag: ").append(String.valueOf(buildForward)).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/HandshakeMessage.java --- a/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java Tue Aug 19 21:59:23 2014 -0300 @@ -1478,7 +1478,7 @@ boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/ServerNameExtension.java --- a/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/ServerNameExtension.java Tue Aug 19 21:59:23 2014 -0300 @@ -267,11 +267,11 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", server_name: "); for (SNIServerName sniName : sniMap.values()) { - sb.append("[" + sniName + "]"); + sb.append('[').append(sniName).append(']'); } - - return "Extension " + type + ", server_name: " + sb; + return sb.toString(); } private static class UnknownServerName extends SNIServerName { diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java --- a/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Aug 19 21:59:23 2014 -0300 @@ -119,17 +119,17 @@ @Override public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", signature_algorithms: "); boolean opened = false; for (SignatureAndHashAlgorithm signAlg : algorithms) { if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); + sb.append(", ").append(signAlg.getAlgorithmName()); } else { sb.append(signAlg.getAlgorithmName()); opened = true; } } - - return "Extension " + type + ", signature_algorithms: " + sb; + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java Tue Aug 19 21:59:23 2014 -0300 @@ -112,37 +112,37 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Extension " + type + ", curve names: {"); - boolean first = true; - for (int curveId : curveIds) { - if (first) { - first = false; - } else { - sb.append(", "); - } - // first check if it is a known named curve, then try other cases. - String oid = getCurveOid(curveId); - if (oid != null) { - ECParameterSpec spec = JsseJce.getECParameterSpec(oid); - // this toString() output will look nice for the current - // implementation of the ECParameterSpec class in the Sun - // provider, but may not look good for other implementations. - if (spec != null) { - sb.append(spec.toString().split(" ")[0]); - } else { - sb.append(oid); - } - } else if (curveId == ARBITRARY_PRIME) { - sb.append("arbitrary_explicit_prime_curves"); - } else if (curveId == ARBITRARY_CHAR2) { - sb.append("arbitrary_explicit_char2_curves"); - } else { - sb.append("unknown curve " + curveId); - } - } - sb.append("}"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("Extension ").append(type).append(", curve names: {"); + boolean first = true; + for (int curveId : curveIds) { + if (first) { + first = false; + } else { + sb.append(", "); + } + // first check if it is a known named curve, then try other cases. + String oid = getCurveOid(curveId); + if (oid != null) { + ECParameterSpec spec = JsseJce.getECParameterSpec(oid); + // this toString() output will look nice for the current + // implementation of the ECParameterSpec class in the Sun + // provider, but may not look good for other implementations. + if (spec != null) { + sb.append(spec.toString().split(" ")[0]); + } else { + sb.append(oid); + } + } else if (curveId == ARBITRARY_PRIME) { + sb.append("arbitrary_explicit_prime_curves"); + } else if (curveId == ARBITRARY_CHAR2) { + sb.append("arbitrary_explicit_char2_curves"); + } else { + sb.append("unknown curve ").append(curveId); + } + } + sb.append("}"); + return sb.toString(); } // Test whether we support the curve with the given index. diff -r dde9f5cfde5f src/share/classes/sun/security/tools/jarsigner/Main.java --- a/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/jarsigner/Main.java Tue Aug 19 21:59:23 2014 -0300 @@ -676,14 +676,13 @@ ((man.getAttributes(name) != null) || (man.getAttributes("./"+name) != null) || (man.getAttributes("/"+name) != null)); - sb.append( - (isSigned ? rb.getString("s") : rb.getString("SPACE")) + - (inManifest ? rb.getString("m") : rb.getString("SPACE")) + - (inStore ? rb.getString("k") : rb.getString("SPACE")) + - (inScope ? rb.getString("i") : rb.getString("SPACE")) + - ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") + - rb.getString("SPACE")); - sb.append("|"); + sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE")) + .append(inManifest ? rb.getString("m") : rb.getString("SPACE")) + .append(inStore ? rb.getString("k") : rb.getString("SPACE")) + .append(inScope ? rb.getString("i") : rb.getString("SPACE")) + .append((inStoreOrScope & NOT_ALIAS) != 0 ? 'X' : ' ') + .append(rb.getString("SPACE")); + sb.append('|'); } // When -certs provided, display info has extra empty @@ -704,11 +703,13 @@ // Print no info for unsigned entries when -verbose:all, // to be consistent with old behavior. if (signatureRelated(name)) { - sb.append("\n" + tab + rb.getString( - ".Signature.related.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Signature.related.entries.")) + .append("\n\n"); } else { - sb.append("\n" + tab + rb.getString( - ".Unsigned.entries.") + "\n\n"); + sb.append('\n').append(tab).append( + rb.getString(".Unsigned.entries.")) + .append("\n\n"); } } @@ -1605,8 +1606,8 @@ // No more warning, we alreay have hasExpiredCert or notYetValidCert } else { chainNotValidated = true; - sb.append(tab + rb.getString(".CertPath.not.validated.") + - e.getLocalizedMessage() + "]\n"); // TODO + sb.append(tab).append(rb.getString(".CertPath.not.validated.")) + .append(e.getLocalizedMessage()).append("]\n"); // TODO } } String result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/tools/policytool/PolicyTool.java --- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Aug 19 21:59:23 2014 -0300 @@ -980,8 +980,9 @@ grantEntry.principals.listIterator(); while (list.hasNext()) { PolicyParser.PrincipalEntry pppe = list.next(); - sb.append(" Principal " + pppe.getDisplayClass() + " " + - pppe.getDisplayName(true)); + sb.append(" Principal ").append(pppe.getDisplayClass()) + .append(' ') + .append(pppe.getDisplayName(true)); if (list.hasNext()) sb.append(", "); } result = sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/AVA.java --- a/src/share/classes/sun/security/x509/AVA.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/AVA.java Tue Aug 19 21:59:23 2014 -0300 @@ -1062,7 +1062,7 @@ } else { boolean quoteNeeded = false; - StringBuilder sbuffer = new StringBuilder(); + StringBuilder sb = new StringBuilder(); boolean previousWhite = false; final String escapees = ",+=\n<>#;\\\""; @@ -1079,7 +1079,7 @@ for (int i = 0; i < length; i++) { char c = valStr.charAt(i); if (alreadyQuoted && (i == 0 || i == length - 1)) { - sbuffer.append(c); + sb.append(c); continue; } if (DerValue.isPrintableStringChar(c) || @@ -1096,7 +1096,7 @@ if (!(c == ' ' || c == '\n')) { // escape '"' and '\' if (c == '"' || c == '\\') { - sbuffer.append('\\'); + sb.append('\\'); } previousWhite = false; } else { @@ -1106,7 +1106,7 @@ previousWhite = true; } - sbuffer.append(c); + sb.append(c); } else if (debug != null && Debug.isOn("ava")) { @@ -1119,26 +1119,26 @@ byte[] valueBytes = Character.toString(c).getBytes("UTF8"); for (int j = 0; j < valueBytes.length; j++) { - sbuffer.append('\\'); + sb.append('\\'); char hexChar = Character.forDigit (0xF & (valueBytes[j] >>> 4), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); hexChar = Character.forDigit (0xF & (valueBytes[j]), 16); - sbuffer.append(Character.toUpperCase(hexChar)); + sb.append(Character.toUpperCase(hexChar)); } } else { // append non-printable/non-escaped char previousWhite = false; - sbuffer.append(c); + sb.append(c); } } // quote if trailing whitespace - if (sbuffer.length() > 0) { - char trailChar = sbuffer.charAt(sbuffer.length() - 1); + if (sb.length() > 0) { + char trailChar = sb.charAt(sb.length() - 1); if (trailChar == ' ' || trailChar == '\n') { quoteNeeded = true; } @@ -1147,9 +1147,9 @@ // Emit the string ... quote it if needed // if string is already quoted, don't re-quote if (!alreadyQuoted && quoteNeeded) { - retval.append("\"" + sbuffer.toString() + "\""); + retval.append('"').append(sb.toString()).append('"'); } else { - retval.append(sbuffer.toString()); + retval.append(sb.toString()); } } } catch (IOException e) { diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPoint.java --- a/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPoint.java Tue Aug 19 21:59:23 2014 -0300 @@ -381,22 +381,22 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPoint:\n " + fullName + "\n"); + sb.append("DistributionPoint:\n ").append(fullName).append('\n'); } if (relativeName != null) { - sb.append("DistributionPoint:\n " + relativeName + "\n"); + sb.append("DistributionPoint:\n ").append(relativeName).append('\n'); } if (reasonFlags != null) { sb.append(" ReasonFlags:\n"); for (int i = 0; i < reasonFlags.length; i++) { if (reasonFlags[i]) { - sb.append(" " + reasonToString(i) + "\n"); + sb.append(" ").append(reasonToString(i)).append('\n'); } } } if (crlIssuer != null) { - sb.append(" CRLIssuer:" + crlIssuer + "\n"); + sb.append(" CRLIssuer:").append(crlIssuer).append('\n'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/security/x509/DistributionPointName.java --- a/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/DistributionPointName.java Tue Aug 19 21:59:23 2014 -0300 @@ -231,10 +231,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); if (fullName != null) { - sb.append("DistributionPointName:\n " + fullName + "\n"); + sb.append("DistributionPointName:\n ").append(fullName).append('\n'); } else { - sb.append("DistributionPointName:\n " + relativeName + "\n"); + sb.append("DistributionPointName:\n ").append(relativeName).append('\n'); } return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/PolicyInformation.java --- a/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/PolicyInformation.java Tue Aug 19 21:59:23 2014 -0300 @@ -258,9 +258,9 @@ * Return a printable representation of the PolicyInformation. */ public String toString() { - StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString()); - s.append(policyQualifiers + " ]\n"); - return s.toString(); + StringBuilder sb = new StringBuilder(" [" + policyIdentifier.toString()); + sb.append(policyQualifiers).append(" ]\n"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLEntryImpl.java --- a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java Tue Aug 19 21:59:23 2014 -0300 @@ -292,17 +292,17 @@ StringBuilder sb = new StringBuilder(); sb.append(serialNumber.toString()); - sb.append(" On: " + revocationDate.toString()); + sb.append(" On: ").append(revocationDate.toString()); if (certIssuer != null) { - sb.append("\n Certificate issuer: " + certIssuer); + sb.append("\n Certificate issuer: ").append(certIssuer); } if (extensions != null) { Collection allEntryExts = extensions.getAllExtensions(); Extension[] exts = allEntryExts.toArray(new Extension[0]); - sb.append("\n CRL Entry Extensions: " + exts.length); + sb.append("\n CRL Entry Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n [" + (i+1) + "]: "); + sb.append("\n [").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -313,9 +313,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CRLImpl.java --- a/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CRLImpl.java Tue Aug 19 21:59:23 2014 -0300 @@ -537,31 +537,32 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("X.509 CRL v" + (version+1) + "\n"); + sb.append("X.509 CRL v").append(version + 1).append('\n'); if (sigAlgId != null) - sb.append("Signature Algorithm: " + sigAlgId.toString() + - ", OID=" + (sigAlgId.getOID()).toString() + "\n"); + sb.append("Signature Algorithm: ").append(sigAlgId.toString()) + .append(", OID=") + .append((sigAlgId.getOID()).toString()).append('\n'); if (issuer != null) - sb.append("Issuer: " + issuer.toString() + "\n"); + sb.append("Issuer: ").append(issuer.toString()).append('\n'); if (thisUpdate != null) - sb.append("\nThis Update: " + thisUpdate.toString() + "\n"); + sb.append("\nThis Update: ").append(thisUpdate.toString()).append('\n'); if (nextUpdate != null) - sb.append("Next Update: " + nextUpdate.toString() + "\n"); + sb.append("Next Update: ").append(nextUpdate.toString()).append('\n'); if (revokedList.isEmpty()) sb.append("\nNO certificates have been revoked\n"); else { - sb.append("\nRevoked Certificates: " + revokedList.size()); + sb.append("\nRevoked Certificates: ").append(revokedList.size()); int i = 1; for (X509CRLEntry entry: revokedList) { - sb.append("\n[" + i++ + "] " + entry.toString()); + sb.append("\n[").append(i++).append("] ").append(entry.toString()); } } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Object[] objs = allExts.toArray(); - sb.append("\nCRL Extensions: " + objs.length); + sb.append("\nCRL Extensions: ").append(objs.length); for (int i = 0; i < objs.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = (Extension)objs[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -572,9 +573,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); // sub-class exists @@ -585,8 +585,7 @@ } if (signature != null) { HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) - + "\n"); + sb.append("\nSignature:\n").append(encoder.encodeBuffer(signature)).append('\n'); } else sb.append("NOT signed yet\n"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertImpl.java --- a/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertImpl.java Tue Aug 19 21:59:23 2014 -0300 @@ -802,11 +802,11 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(info.toString() + "\n"); - sb.append(" Algorithm: [" + algId.toString() + "]\n"); + sb.append(info.toString()).append('\n'); + sb.append(" Algorithm: [").append(algId.toString()).append("]\n"); HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); + sb.append(" Signature:\n").append(encoder.encodeBuffer(signature)); sb.append("\n]"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/sun/security/x509/X509CertInfo.java --- a/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/security/x509/X509CertInfo.java Tue Aug 19 21:59:23 2014 -0300 @@ -298,27 +298,27 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); - sb.append(" " + version.toString() + "\n"); - sb.append(" Subject: " + subject.toString() + "\n"); - sb.append(" Signature Algorithm: " + algId.toString() + "\n"); - sb.append(" Key: " + pubKey.toString() + "\n"); - sb.append(" " + interval.toString() + "\n"); - sb.append(" Issuer: " + issuer.toString() + "\n"); - sb.append(" " + serialNum.toString() + "\n"); + sb.append(" ").append(version.toString()).append('\n'); + sb.append(" Subject: ").append(subject.toString()).append('\n'); + sb.append(" Signature Algorithm: ").append(algId.toString()).append('\n'); + sb.append(" Key: ").append(pubKey.toString()).append('\n'); + sb.append(" ").append(interval.toString()).append('\n'); + sb.append(" Issuer: ").append(issuer.toString()).append('\n'); + sb.append(" ").append(serialNum.toString()).append('\n'); // optional v2, v3 extras if (issuerUniqueId != null) { - sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n"); + sb.append(" Issuer Id:\n").append(issuerUniqueId.toString()).append('\n'); } if (subjectUniqueId != null) { - sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n"); + sb.append(" Subject Id:\n").append(subjectUniqueId.toString()).append('\n'); } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Extension[] exts = allExts.toArray(new Extension[0]); - sb.append("\nCertificate Extensions: " + exts.length); + sb.append("\nCertificate Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i + 1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { @@ -329,9 +329,8 @@ out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: " + "DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)).append('\n'); } } else sb.append(ext.toString()); //sub-class exists @@ -341,10 +340,10 @@ } Map invalid = extensions.getUnparseableExtensions(); if (invalid.isEmpty() == false) { - sb.append("\nUnparseable certificate extensions: " + invalid.size()); + sb.append("\nUnparseable certificate extensions: ").append(invalid.size()); int i = 1; for (Extension ext : invalid.values()) { - sb.append("\n[" + (i++) + "]: "); + sb.append("\n[").append(i++).append("]: "); sb.append(ext); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java --- a/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java Tue Aug 19 21:59:23 2014 -0300 @@ -463,12 +463,12 @@ // --------- - private static void appendIfLiteralAddress(String addr, StringBuffer sb) { + private static void appendIfLiteralAddress(String addr, StringBuilder sb) { if (IPAddressUtil.isIPv4LiteralAddress(addr)) { - sb.append("dns://" + addr + " "); + sb.append("dns://").append(addr).append(' '); } else { if (IPAddressUtil.isIPv6LiteralAddress(addr)) { - sb.append("dns://[" + addr + "] "); + sb.append("dns://[").append(addr).append("] "); } } } @@ -478,7 +478,7 @@ * corresponding to the supplied List of nameservers. */ private static String createProviderURL(List nsList) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (String s: nsList) { appendIfLiteralAddress(s, sb); } @@ -491,7 +491,7 @@ * contained in the provided str. */ private static String createProviderURL(String str) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); StringTokenizer st = new StringTokenizer(str, ","); while (st.hasMoreTokens()) { appendIfLiteralAddress(st.nextToken(), sb); diff -r dde9f5cfde5f src/share/classes/sun/net/www/HeaderParser.java --- a/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/HeaderParser.java Tue Aug 19 21:59:23 2014 -0300 @@ -220,21 +220,23 @@ public String toString () { Iterator k = keys(); - StringBuffer sbuf = new StringBuffer(); - sbuf.append ("{size="+asize+" nkeys="+nkeys+" "); + StringBuilder sb = new StringBuilder(); + sb.append("{size=").append(asize).append(" nkeys=").append(nkeys) + .append(' '); for (int i=0; k.hasNext(); i++) { String key = k.next(); String val = findValue (i); if (val != null && "".equals (val)) { val = null; } - sbuf.append (" {"+key+(val==null?"":","+val)+"}"); + sb.append(" {").append(key).append(val == null ? "" : "," + val) + .append('}'); if (k.hasNext()) { - sbuf.append (","); + sb.append (','); } } - sbuf.append (" }"); - return new String (sbuf); + sb.append (" }"); + return new String (sb); } public int findInt(String k, int Default) { diff -r dde9f5cfde5f src/share/classes/sun/net/www/MimeEntry.java --- a/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/net/www/MimeEntry.java Tue Aug 19 21:59:23 2014 -0300 @@ -288,7 +288,7 @@ int action = getAction(); if (action != MimeEntry.UNKNOWN) { - sb.append("action=" + actionKeywords[action]); + sb.append("action=").append(actionKeywords[action]); needSeparator = true; } @@ -297,7 +297,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("application=" + command); + sb.append("application=").append(command); needSeparator = true; } @@ -305,7 +305,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("icon=" + getImageFileName()); + sb.append("icon=").append(getImageFileName()); needSeparator = true; } @@ -314,7 +314,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("file_extensions=" + extensions); + sb.append("file_extensions=").append(extensions); needSeparator = true; } @@ -323,7 +323,7 @@ if (needSeparator) { sb.append(separator); } - sb.append("description=" + description); + sb.append("description=").append(description); } return sb.toString(); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/management/Agent.java --- a/src/share/classes/sun/management/Agent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/Agent.java Tue Aug 19 21:59:23 2014 -0300 @@ -502,7 +502,7 @@ } else { StringBuilder message = new StringBuilder(params[0]); for (int i = 1; i < params.length; i++) { - message.append(" " + params[i]); + message.append(' ').append(params[i]); } error(key, message.toString()); } diff -r dde9f5cfde5f src/share/classes/sun/management/MappedMXBeanType.java --- a/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/management/MappedMXBeanType.java Tue Aug 19 21:59:23 2014 -0300 @@ -289,7 +289,7 @@ if (et.isPrimitive()) { className = new StringBuilder(c.getName()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); @@ -385,7 +385,7 @@ if (elementType instanceof Class && ((Class) elementType).isPrimitive()) { className = new StringBuilder(gat.toString()); } else { - className.append("L" + baseElementType.getTypeName() + ";"); + className.append('L').append(baseElementType.getTypeName()).append(';'); } try { mappedTypeClass = Class.forName(className.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/launcher/LauncherHelper.java --- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Tue Aug 19 21:59:23 2014 -0300 @@ -369,10 +369,9 @@ static void appendVmErgoMessage(boolean isServerClass, String vm) { outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1", vm)); - outBuf = (isServerClass) - ? outBuf.append(",\n" + - getLocalizedMessage("java.launcher.ergo.message2") + "\n\n") - : outBuf.append(".\n\n"); + outBuf = (isServerClass) ? outBuf.append(",\n") + .append(getLocalizedMessage("java.launcher.ergo.message2")) + .append("\n\n") : outBuf.append(".\n\n"); } /** -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/sun/font/AttributeValues.java --- a/src/share/classes/sun/font/AttributeValues.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/AttributeValues.java Tue Aug 19 21:59:23 2014 -0300 @@ -542,7 +542,7 @@ } } } - b.append("[btx=" + baselineTransform + ", ctx=" + charTransform + "]"); + b.append("[btx=").append(baselineTransform).append(", ctx=").append(charTransform).append(']'); b.append('}'); return b.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/Decoration.java --- a/src/share/classes/sun/font/Decoration.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/Decoration.java Tue Aug 19 21:59:23 2014 -0300 @@ -431,12 +431,12 @@ StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); - if (fgPaint != null) sb.append("fgPaint: " + fgPaint); - if (bgPaint != null) sb.append(" bgPaint: " + bgPaint); + if (fgPaint != null) sb.append("fgPaint: ").append(fgPaint); + if (bgPaint != null) sb.append(" bgPaint: ").append(bgPaint); if (swapColors) sb.append(" swapColors: true"); if (strikethrough) sb.append(" strikethrough: true"); - if (stdUnderline != null) sb.append(" stdUnderline: " + stdUnderline); - if (imUnderline != null) sb.append(" imUnderline: " + imUnderline); + if (stdUnderline != null) sb.append(" stdUnderline: ").append(stdUnderline); + if (imUnderline != null) sb.append(" imUnderline: ").append(imUnderline); sb.append("]"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/sun/font/StandardGlyphVector.java --- a/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/sun/font/StandardGlyphVector.java Tue Aug 19 21:59:23 2014 -0300 @@ -1894,9 +1894,9 @@ } } catch(Exception e) { - buf.append(" " + e.getMessage()); + buf.append(' ').append(e.getMessage()); } - buf.append("}"); + buf.append('}'); return buf; } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/swing/GroupLayout.java --- a/src/share/classes/javax/swing/GroupLayout.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/GroupLayout.java Tue Aug 19 21:59:22 2014 -0300 @@ -1213,15 +1213,15 @@ registerComponents(horizontalGroup, HORIZONTAL); registerComponents(verticalGroup, VERTICAL); } - StringBuffer buffer = new StringBuffer(); - buffer.append("HORIZONTAL\n"); - createSpringDescription(buffer, horizontalGroup, " ", HORIZONTAL); - buffer.append("\nVERTICAL\n"); - createSpringDescription(buffer, verticalGroup, " ", VERTICAL); - return buffer.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("HORIZONTAL\n"); + createSpringDescription(sb, horizontalGroup, " ", HORIZONTAL); + sb.append("\nVERTICAL\n"); + createSpringDescription(sb, verticalGroup, " ", VERTICAL); + return sb.toString(); } - private void createSpringDescription(StringBuffer buffer, Spring spring, + private void createSpringDescription(StringBuilder sb, Spring spring, String indent, int axis) { String origin = ""; String padding = ""; @@ -1239,20 +1239,19 @@ padding = ", userCreated=" + paddingSpring.getUserCreated() + ", matches=" + paddingSpring.getMatchDescription(); } - buffer.append(indent + spring.getClass().getName() + " " + - Integer.toHexString(spring.hashCode()) + " " + - origin + - ", size=" + spring.getSize() + - ", alignment=" + spring.getAlignment() + - " prefs=[" + spring.getMinimumSize(axis) + - " " + spring.getPreferredSize(axis) + - " " + spring.getMaximumSize(axis) + - padding + "]\n"); + sb.append(indent).append(spring.getClass().getName()).append(' ') + .append(Integer.toHexString(spring.hashCode())).append(' ') + .append(origin).append(", size=").append(spring.getSize()) + .append(", alignment=").append(spring.getAlignment()) + .append(" prefs=[").append(spring.getMinimumSize(axis)) + .append(' ').append(spring.getPreferredSize(axis)).append(' ') + .append(spring.getMaximumSize(axis)).append(padding) + .append("]\n"); if (spring instanceof Group) { List springs = ((Group)spring).springs; indent += " "; for (int counter = 0; counter < springs.size(); counter++) { - createSpringDescription(buffer, springs.get(counter), indent, + createSpringDescription(sb, springs.get(counter), indent, axis); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/JColorChooser.java --- a/src/share/classes/javax/swing/JColorChooser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/JColorChooser.java Tue Aug 19 21:59:22 2014 -0300 @@ -543,17 +543,17 @@ * @return a string representation of this JColorChooser */ protected String paramString() { - StringBuilder chooserPanelsString = new StringBuilder(""); - for (int i=0; i keys = keys(); - while (keys.hasMoreElements()) { - Object key = keys.nextElement(); - sb.append(key + "=" + get(key) + ", "); - } - int length = sb.length(); - if (length > 1) { - sb.delete(length-2, length); - } - sb.append("}"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("{"); + Enumeration keys = keys(); + while (keys.hasMoreElements()) { + Object key = keys.nextElement(); + sb.append(key).append('=').append(get(key)).append(", "); + } + int length = sb.length(); + if (length > 1) { + sb.delete(length - 2, length); + } + sb.append('}'); + return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/javax/swing/RepaintManager.java --- a/src/share/classes/javax/swing/RepaintManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/RepaintManager.java Tue Aug 19 21:59:22 2014 -0300 @@ -990,10 +990,7 @@ * @return a String representation of this object */ public synchronized String toString() { - StringBuilder sb = new StringBuilder(); - if(dirtyComponents != null) - sb.append("" + dirtyComponents); - return sb.toString(); + return dirtyComponents != null ? dirtyComponents.toString() : ""; } diff -r dde9f5cfde5f src/share/classes/javax/swing/event/TreeModelEvent.java --- a/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/event/TreeModelEvent.java Tue Aug 19 21:59:22 2014 -0300 @@ -294,21 +294,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(getClass().getName() + " " + - Integer.toString(hashCode())); + sb.append(getClass().getName()).append(' ').append(Integer.toString(hashCode())); if(path != null) - sb.append(" path " + path); + sb.append(" path ").append(path); if(childIndices != null) { sb.append(" indices [ "); for(int counter = 0; counter < childIndices.length; counter++) - sb.append(Integer.toString(childIndices[counter])+ " "); - sb.append("]"); + sb.append(Integer.toString(childIndices[counter])).append(' '); + sb.append(']'); } if(children != null) { sb.append(" children [ "); for(int counter = 0; counter < children.length; counter++) - sb.append(children[counter] + " "); - sb.append("]"); + sb.append(children[counter]).append(' '); + sb.append(']'); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java Tue Aug 19 21:59:22 2014 -0300 @@ -1330,8 +1330,8 @@ for (Object obj : values) { String val = ((obj == null) ? "" : obj.toString()); - plainBuf.append(val + "\n"); - htmlBuf.append("
  • " + val + "\n"); + plainBuf.append(val).append('\n'); + htmlBuf.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicListUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Aug 19 21:59:22 2014 -0300 @@ -2948,8 +2948,8 @@ for (int i = 0; i < values.length; i++) { Object obj = values[i]; String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\n"); - htmlStr.append("
  • " + val + "\n"); + plainStr.append(val).append('\n'); + htmlStr.append("
  • ").append(val).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTableUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 19 21:59:22 2014 -0300 @@ -2230,11 +2230,11 @@ for (int col = 0; col < cols.length; col++) { Object obj = table.getValueAt(rows[row], cols[col]); String val = ((obj == null) ? "" : obj.toString()); - plainStr.append(val + "\t"); - htmlStr.append(" " + val + "\n"); + plainStr.append(val).append('\t'); + htmlStr.append(" ").append(val).append("\n"); } // we want a newline at the end of each line and not a tab - plainStr.deleteCharAt(plainStr.length() - 1).append("\n"); + plainStr.deleteCharAt(plainStr.length() - 1).append('\n'); htmlStr.append("\n"); } diff -r dde9f5cfde5f src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java --- a/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Tue Aug 19 21:59:22 2014 -0300 @@ -3618,8 +3618,8 @@ boolean leaf = model.isLeaf(node); String label = getDisplayString(path, true, leaf); - plainStr.append(label + "\n"); - htmlStr.append("
  • " + label + "\n"); + plainStr.append(label).append('\n'); + htmlStr.append("
  • ").append(label).append('\n'); } // remove the last newline diff -r dde9f5cfde5f src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java --- a/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Aug 19 21:59:22 2014 -0300 @@ -1160,15 +1160,15 @@ rows = rowMapper.getRowsForPaths(selection); else rows = null; - sb.append(getClass().getName() + " " + hashCode() + " [ "); + sb.append(getClass().getName()).append(' ').append(hashCode()).append(" [ "); for(int counter = 0; counter < selCount; counter++) { if(rows != null) - sb.append(selection[counter].toString() + "@" + - Integer.toString(rows[counter])+ " "); + sb.append(selection[counter].toString()).append('@') + .append(Integer.toString(rows[counter])).append(' '); else - sb.append(selection[counter].toString() + " "); + sb.append(selection[counter].toString()).append(' '); } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/AudioFileFormat.java --- a/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/AudioFileFormat.java Tue Aug 19 21:59:22 2014 -0300 @@ -272,26 +272,25 @@ @Override public String toString() { - StringBuffer buf = new StringBuffer(); + StringBuilder sb = new StringBuilder(); //$$fb2002-11-01: fix for 4672864: AudioFileFormat.toString() throws unexpected NullPointerException if (type != null) { - buf.append(type.toString() + " (." + type.getExtension() + ") file"); + sb.append(type.toString()).append(" (.").append(type.getExtension()).append(") file"); } else { - buf.append("unknown file format"); + sb.append("unknown file format"); } if (byteLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", byte length: " + byteLength); + sb.append(", byte length: ").append(byteLength); } - buf.append(", data format: " + format); + sb.append(", data format: ").append(format); if (frameLength != AudioSystem.NOT_SPECIFIED) { - buf.append(", frame length: " + frameLength); + sb.append(", frame length: ").append(frameLength); } - - return new String(buf); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/javax/sound/sampled/DataLine.java --- a/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/sound/sampled/DataLine.java Tue Aug 19 21:59:22 2014 -0300 @@ -472,21 +472,27 @@ StringBuilder sb = new StringBuilder(); - if ( (formats.length == 1) && (formats[0] != null) ) { - sb.append(" supporting format " + formats[0]); + if ((formats.length == 1) && (formats[0] != null)) { + sb.append(" supporting format ").append(formats[0]); } else if (getFormats().length > 1) { - sb.append(" supporting " + getFormats().length + " audio formats"); + sb.append(" supporting ").append(getFormats().length) + .append(" audio formats"); } - if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) { - sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes"); - } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) { - sb.append(", and buffers of at least " + minBufferSize + " bytes"); + if ((minBufferSize != AudioSystem.NOT_SPECIFIED) + && (maxBufferSize != AudioSystem.NOT_SPECIFIED)) { + sb.append(", and buffers of ").append(minBufferSize) + .append(" to ").append(maxBufferSize).append(" bytes"); + } else if ((minBufferSize != AudioSystem.NOT_SPECIFIED) + && (minBufferSize > 0)) { + sb.append(", and buffers of at least ").append(minBufferSize) + .append(" bytes"); } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) { - sb.append(", and buffers of up to " + minBufferSize + " bytes"); + sb.append(", and buffers of up to ").append(minBufferSize) + .append(" bytes"); } - return new String(super.toString() + sb); + return super.toString() + sb.toString(); } } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/security/auth/kerberos/KerberosTicket.java --- a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java Tue Aug 19 21:59:22 2014 -0300 @@ -651,8 +651,7 @@ StringBuilder caddrString = new StringBuilder(); if (clientAddresses != null) { for (int i = 0; i < clientAddresses.length; i++) { - caddrString.append("clientAddresses[" + i + "] = " + - clientAddresses[i].toString()); + caddrString.append("clientAddresses[").append(i).append("] = ").append(clientAddresses[i].toString()); } } return ("Ticket (hex) = " + "\n" + -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/naming/BinaryRefAddr.java --- a/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/BinaryRefAddr.java Tue Aug 19 21:59:22 2014 -0300 @@ -165,11 +165,11 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Address Type: " + addrType + "\n"); - + StringBuilder str = new StringBuilder(); + str.append("Address Type: ").append(addrType).append('\n'); str.append("AddressContents: "); for (int i = 0; i= 32) str.append(" ...\n"); diff -r dde9f5cfde5f src/share/classes/javax/naming/NameImpl.java --- a/src/share/classes/javax/naming/NameImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/NameImpl.java Tue Aug 19 21:59:22 2014 -0300 @@ -170,7 +170,7 @@ endQuote = one ? syntaxEndQuote1 : syntaxEndQuote2; i += syntaxTypevalSeparator.length(); - answer.append(syntaxTypevalSeparator+beginQuote); // add back + answer.append(syntaxTypevalSeparator).append(beginQuote); // add back // consume string until matching quote for (i += beginQuote.length(); diff -r dde9f5cfde5f src/share/classes/javax/naming/RefAddr.java --- a/src/share/classes/javax/naming/RefAddr.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/naming/RefAddr.java Tue Aug 19 21:59:22 2014 -0300 @@ -139,9 +139,9 @@ * @return The non-null string representation of this address. */ public String toString(){ - StringBuilder str = new StringBuilder("Type: " + addrType + "\n"); - - str.append("Content: " + getContent() + "\n"); + StringBuilder str = new StringBuilder(); + str.append("Type: ").append(addrType).append('\n'); + str.append("Content: ").append(getContent()).append('\n'); return (str.toString()); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/crypto/CryptoPermission.java --- a/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/crypto/CryptoPermission.java Tue Aug 19 21:59:22 2014 -0300 @@ -369,22 +369,24 @@ * @return information about this CryptoPermission. */ public String toString() { - StringBuilder buf = new StringBuilder(100); - buf.append("(CryptoPermission " + alg + " " + maxKeySize); + StringBuilder sb = new StringBuilder(100); + sb.append("(CryptoPermission ").append(alg).append(' ') + .append(maxKeySize); if (algParamSpec != null) { if (algParamSpec instanceof RC2ParameterSpec) { - buf.append(" , effective " + - ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits()); + sb.append(" , effective ") + .append(((RC2ParameterSpec) algParamSpec) + .getEffectiveKeyBits()); } else if (algParamSpec instanceof RC5ParameterSpec) { - buf.append(" , rounds " + - ((RC5ParameterSpec)algParamSpec).getRounds()); + sb.append(" , rounds ").append( + ((RC5ParameterSpec) algParamSpec).getRounds()); } } if (exemptionMechanism != null) { // OPTIONAL - buf.append(" " + exemptionMechanism); + sb.append(' ').append(exemptionMechanism); } - buf.append(")"); - return buf.toString(); + sb.append(')'); + return sb.toString(); } private boolean impliesExemptionMechanism(String exemptionMechanism) { -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/javax/management/MBeanPermission.java --- a/src/share/classes/javax/management/MBeanPermission.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/MBeanPermission.java Tue Aug 19 21:59:22 2014 -0300 @@ -455,11 +455,11 @@ name.append(className); if (member == null) member = "-"; - name.append("#" + member); + name.append('#').append(member); if (objectName == null) name.append("[-]"); else - name.append("[").append(objectName.getCanonicalName()).append("]"); + name.append('[').append(objectName.getCanonicalName()).append(']'); /* In the interests of legibility for Permission.toString(), we transform the empty string into "*". */ diff -r dde9f5cfde5f src/share/classes/javax/management/modelmbean/RequiredModelMBean.java --- a/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java Tue Aug 19 21:59:22 2014 -0300 @@ -716,15 +716,14 @@ } retStr.append("\nMBeanInfo for ModelMBean is:"); - retStr.append("\nCLASSNAME: \t"+ info.getClassName()); - retStr.append("\nDESCRIPTION: \t"+ info.getDescription()); + retStr.append("\nCLASSNAME: \t").append(info.getClassName()); + retStr.append("\nDESCRIPTION: \t").append(info.getDescription()); try { - retStr.append("\nMBEAN DESCRIPTOR: \t"+ - info.getMBeanDescriptor()); + retStr.append("\nMBEAN DESCRIPTOR: \t").append(info.getMBeanDescriptor()); } catch (Exception e) { - retStr.append("\nMBEAN DESCRIPTOR: \t" + " is invalid"); + retStr.append("\nMBEAN DESCRIPTOR: \t is invalid"); } retStr.append("\nATTRIBUTES"); @@ -734,13 +733,12 @@ for (int i=0; i objNameIter = objectNameList.iterator(); - objNameIter.hasNext();) { + StringBuilder sb = new StringBuilder(); + sb.append("role name: ").append(name).append("; role value: "); + for (Iterator objNameIter = objectNameList.iterator(); objNameIter + .hasNext();) { ObjectName currObjName = objNameIter.next(); - result.append(currObjName.toString()); + sb.append(currObjName.toString()); if (objNameIter.hasNext()) { - result.append(", "); + sb.append(", "); } } - return result.toString(); + return sb.toString(); } // diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleInfo.java --- a/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleInfo.java Tue Aug 19 21:59:22 2014 -0300 @@ -456,13 +456,13 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role info name: " + name); - result.append("; isReadable: " + isReadable); - result.append("; isWritable: " + isWritable); - result.append("; description: " + description); - result.append("; minimum degree: " + minDegree); - result.append("; maximum degree: " + maxDegree); - result.append("; MBean class: " + referencedMBeanClassName); + result.append("role info name: ").append(name); + result.append("; isReadable: ").append(isReadable); + result.append("; isWritable: ").append(isWritable); + result.append("; description: ").append(description); + result.append("; minimum degree: ").append(minDegree); + result.append("; maximum degree: ").append(maxDegree); + result.append("; MBean class: ").append(referencedMBeanClassName); return result.toString(); } diff -r dde9f5cfde5f src/share/classes/javax/management/relation/RoleUnresolved.java --- a/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/javax/management/relation/RoleUnresolved.java Tue Aug 19 21:59:22 2014 -0300 @@ -282,7 +282,7 @@ */ public String toString() { StringBuilder result = new StringBuilder(); - result.append("role name: " + roleName); + result.append("role name: ").append(roleName); if (roleValue != null) { result.append("; value: "); for (Iterator objNameIter = roleValue.iterator(); @@ -294,7 +294,7 @@ } } } - result.append("; problem type: " + problemType); + result.append("; problem type: ").append(problemType); return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/util/Scanner.java --- a/src/share/classes/java/util/Scanner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/Scanner.java Tue Aug 19 21:59:22 2014 -0300 @@ -1304,20 +1304,20 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.Scanner"); - sb.append("[delimiters=" + delimPattern + "]"); - sb.append("[position=" + position + "]"); - sb.append("[match valid=" + matchValid + "]"); - sb.append("[need input=" + needInput + "]"); - sb.append("[source closed=" + sourceClosed + "]"); - sb.append("[skipped=" + skipped + "]"); - sb.append("[group separator=" + groupSeparator + "]"); - sb.append("[decimal separator=" + decimalSeparator + "]"); - sb.append("[positive prefix=" + positivePrefix + "]"); - sb.append("[negative prefix=" + negativePrefix + "]"); - sb.append("[positive suffix=" + positiveSuffix + "]"); - sb.append("[negative suffix=" + negativeSuffix + "]"); - sb.append("[NaN string=" + nanString + "]"); - sb.append("[infinity string=" + infinityString + "]"); + sb.append("[delimiters=").append(delimPattern).append(']'); + sb.append("[position=").append(position).append(']'); + sb.append("[match valid=").append(matchValid).append(']'); + sb.append("[need input=").append(needInput).append(']'); + sb.append("[source closed=").append(sourceClosed).append(']'); + sb.append("[skipped=").append(skipped).append(']'); + sb.append("[group separator=").append(groupSeparator).append(']'); + sb.append("[decimal separator=").append(decimalSeparator).append(']'); + sb.append("[positive prefix=").append(positivePrefix).append(']'); + sb.append("[negative prefix=").append(negativePrefix).append(']'); + sb.append("[positive suffix=").append(positiveSuffix).append(']'); + sb.append("[negative suffix=").append(negativeSuffix).append(']'); + sb.append("[NaN string=").append(nanString).append(']'); + sb.append("[infinity string=").append(infinityString).append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Matcher.java --- a/src/share/classes/java/util/regex/Matcher.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Matcher.java Tue Aug 19 21:59:22 2014 -0300 @@ -1295,14 +1295,14 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("java.util.regex.Matcher"); - sb.append("[pattern=" + pattern()); + sb.append("[pattern=").append(pattern()); sb.append(" region="); - sb.append(regionStart() + "," + regionEnd()); + sb.append(regionStart()).append(',').append(regionEnd()); sb.append(" lastmatch="); if ((first >= 0) && (group() != null)) { sb.append(group()); } - sb.append("]"); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/util/regex/Pattern.java --- a/src/share/classes/java/util/regex/Pattern.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/util/regex/Pattern.java Tue Aug 19 21:59:22 2014 -0300 @@ -1488,10 +1488,10 @@ for(int x=0; x0) - result.append("|"+next); + result.append('|').append(next); next = composeOneStep(next); if (next != null) - result.append("|"+produceEquivalentAlternation(next)); + result.append('|').append(produceEquivalentAlternation(next)); } return result.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/text/ChoiceFormat.java --- a/src/share/classes/java/text/ChoiceFormat.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/text/ChoiceFormat.java Tue Aug 19 21:59:22 2014 -0300 @@ -272,7 +272,7 @@ double tryLess = Math.abs(Math.IEEEremainder(less, 1.0d)); if (tryLessOrEqual < tryLess) { - result.append(""+choiceLimits[i]); + result.append(choiceLimits[i]); result.append('#'); } else { if (choiceLimits[i] == Double.POSITIVE_INFINITY) { @@ -280,7 +280,7 @@ } else if (choiceLimits[i] == Double.NEGATIVE_INFINITY) { result.append("-\u221E"); } else { - result.append(""+less); + result.append(less); } result.append('<'); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/security/CodeSigner.java --- a/src/share/classes/java/security/CodeSigner.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSigner.java Tue Aug 19 21:59:21 2014 -0300 @@ -156,9 +156,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("Signer: " + signerCertPath.getCertificates().get(0)); + sb.append("Signer: ").append(signerCertPath.getCertificates().get(0)); if (timestamp != null) { - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); } sb.append(")"); return sb.toString(); diff -r dde9f5cfde5f src/share/classes/java/security/CodeSource.java --- a/src/share/classes/java/security/CodeSource.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/CodeSource.java Tue Aug 19 21:59:21 2014 -0300 @@ -468,12 +468,12 @@ if (this.certs != null && this.certs.length > 0) { for (int i = 0; i < this.certs.length; i++) { - sb.append( " " + this.certs[i]); + sb.append(' ').append(this.certs[i]); } } else if (this.signers != null && this.signers.length > 0) { for (int i = 0; i < this.signers.length; i++) { - sb.append( " " + this.signers[i]); + sb.append(' ').append(this.signers[i]); } } else { sb.append(" "); diff -r dde9f5cfde5f src/share/classes/java/security/KeyStore.java --- a/src/share/classes/java/security/KeyStore.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/KeyStore.java Tue Aug 19 21:59:21 2014 -0300 @@ -610,8 +610,8 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Private key entry and certificate chain with " - + chain.length + " elements:\r\n"); + sb.append("Private key entry and certificate chain with ") + .append(chain.length).append(" elements:\r\n"); for (Certificate cert : chain) { sb.append(cert); sb.append("\r\n"); diff -r dde9f5cfde5f src/share/classes/java/security/PermissionCollection.java --- a/src/share/classes/java/security/PermissionCollection.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/PermissionCollection.java Tue Aug 19 21:59:21 2014 -0300 @@ -179,13 +179,13 @@ public String toString() { Enumeration enum_ = elements(); StringBuilder sb = new StringBuilder(); - sb.append(super.toString()+" (\n"); + sb.append(super.toString()).append(" (\n"); while (enum_.hasMoreElements()) { try { - sb.append(" "); + sb.append(' '); sb.append(enum_.nextElement().toString()); - sb.append("\n"); - } catch (NoSuchElementException e){ + sb.append('\n'); + } catch (NoSuchElementException e) { // ignore } } diff -r dde9f5cfde5f src/share/classes/java/security/ProtectionDomain.java --- a/src/share/classes/java/security/ProtectionDomain.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/ProtectionDomain.java Tue Aug 19 21:59:21 2014 -0300 @@ -285,34 +285,32 @@ /** * Convert a ProtectionDomain to a String. */ - @Override public String toString() { + @Override + public String toString() { String pals = ""; if (principals != null && principals.length > 0) { - StringBuilder palBuf = new StringBuilder("(principals "); + StringBuilder palBuilder = new StringBuilder("(principals "); for (int i = 0; i < principals.length; i++) { - palBuf.append(principals[i].getClass().getName() + - " \"" + principals[i].getName() + - "\""); - if (i < principals.length-1) - palBuf.append(",\n"); - else - palBuf.append(")\n"); + palBuilder.append(principals[i].getClass().getName()) + .append(" \"").append(principals[i].getName()) + .append('"'); + if (i < principals.length - 1) { + palBuilder.append(",\n"); + } else { + palBuilder.append(")\n"); + } } - pals = palBuf.toString(); + pals = palBuilder.toString(); } // Check if policy is set; we don't want to load // the policy prematurely here - PermissionCollection pc = Policy.isSet() && seeAllp() ? - mergePermissions(): - getPermissions(); + PermissionCollection pc = Policy.isSet() && seeAllp() ? mergePermissions() + : getPermissions(); - return "ProtectionDomain "+ - " "+codesource+"\n"+ - " "+classloader+"\n"+ - " "+pals+"\n"+ - " "+pc+"\n"; + return "ProtectionDomain " + " " + codesource + "\n" + " " + + classloader + "\n" + " " + pals + "\n" + " " + pc + "\n"; } /** diff -r dde9f5cfde5f src/share/classes/java/security/Timestamp.java --- a/src/share/classes/java/security/Timestamp.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/Timestamp.java Tue Aug 19 21:59:21 2014 -0300 @@ -143,10 +143,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append("timestamp: " + timestamp); + sb.append("timestamp: ").append(timestamp); List certs = signerCertPath.getCertificates(); if (!certs.isEmpty()) { - sb.append("TSA: " + certs.get(0)); + sb.append("TSA: ").append(certs.get(0)); } else { sb.append("TSA: "); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CertPath.java --- a/src/share/classes/java/security/cert/CertPath.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CertPath.java Tue Aug 19 21:59:21 2014 -0300 @@ -221,20 +221,16 @@ */ public String toString() { StringBuilder sb = new StringBuilder(); - Iterator stringIterator = - getCertificates().iterator(); - sb.append("\n" + type + " Cert Path: length = " - + getCertificates().size() + ".\n"); - sb.append("[\n"); + sb.append('\n').append(type).append(" Cert Path: length = ") + .append(getCertificates().size()).append(".\n").append("[\n"); int i = 1; - while (stringIterator.hasNext()) { + for (Certificate stringCert : getCertificates()) { sb.append("==========================================" - + "===============Certificate " + i + " start.\n"); - Certificate stringCert = stringIterator.next(); + + "===============Certificate ").append(i).append(" start.\n"); sb.append(stringCert.toString()); sb.append("\n========================================" - + "=================Certificate " + i + " end.\n\n\n"); + + "=================Certificate ").append(i).append(" end.\n\n\n"); i++; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/CollectionCertStoreParameters.java --- a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/CollectionCertStoreParameters.java Tue Aug 19 21:59:21 2014 -0300 @@ -134,8 +134,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CollectionCertStoreParameters: [\n"); - sb.append(" collection: " + coll + "\n"); - sb.append("]"); + sb.append(" collection: ").append(coll).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/LDAPCertStoreParameters.java --- a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/LDAPCertStoreParameters.java Tue Aug 19 21:59:21 2014 -0300 @@ -141,9 +141,9 @@ StringBuilder sb = new StringBuilder(); sb.append("LDAPCertStoreParameters: [\n"); - sb.append(" serverName: " + serverName + "\n"); - sb.append(" port: " + port + "\n"); - sb.append("]"); + sb.append(" serverName: ").append(serverName).append('\n'); + sb.append(" port: ").append(port).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXBuilderParameters.java --- a/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXBuilderParameters.java Tue Aug 19 21:59:21 2014 -0300 @@ -192,7 +192,7 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); sb.append(super.toString()); - sb.append(" Maximum Path Length: " + maxPathLength + "\n"); + sb.append(" Maximum Path Length: ").append(maxPathLength).append('\n'); sb.append("]\n"); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java Tue Aug 19 21:59:21 2014 -0300 @@ -109,11 +109,13 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathBuilderResult: [\n"); - sb.append(" Certification Path: " + certPath + "\n"); - sb.append(" Trust Anchor: " + getTrustAnchor().toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(getPolicyTree()) + "\n"); - sb.append(" Subject Public Key: " + getPublicKey() + "\n"); - sb.append("]"); + sb.append(" Certification Path: ").append(certPath).append('\n'); + sb.append(" Trust Anchor: ").append(getTrustAnchor().toString()) + .append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(getPolicyTree())) + .append('\n'); + sb.append(" Subject Public Key: ").append(getPublicKey()).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java --- a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java Tue Aug 19 21:59:21 2014 -0300 @@ -150,10 +150,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PKIXCertPathValidatorResult: [\n"); - sb.append(" Trust Anchor: " + trustAnchor.toString() + "\n"); - sb.append(" Policy Tree: " + String.valueOf(policyTree) + "\n"); - sb.append(" Subject Public Key: " + subjectPublicKey + "\n"); - sb.append("]"); + sb.append(" Trust Anchor: ").append(trustAnchor.toString()).append('\n'); + sb.append(" Policy Tree: ").append(String.valueOf(policyTree)).append('\n'); + sb.append(" Subject Public Key: ").append(subjectPublicKey).append('\n'); + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PKIXParameters.java --- a/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PKIXParameters.java Tue Aug 19 21:59:21 2014 -0300 @@ -698,8 +698,8 @@ /* start with trusted anchor info */ if (unmodTrustAnchors != null) { - sb.append(" Trust Anchors: " + unmodTrustAnchors.toString() - + "\n"); + sb.append(" Trust Anchors: ").append(unmodTrustAnchors.toString()) + .append('\n'); } /* now, append initial state information */ @@ -707,30 +707,41 @@ if (unmodInitialPolicies.isEmpty()) { sb.append(" Initial Policy OIDs: any\n"); } else { - sb.append(" Initial Policy OIDs: [" - + unmodInitialPolicies.toString() + "]\n"); + sb.append(" Initial Policy OIDs: [") + .append(unmodInitialPolicies.toString()).append("]\n"); } } /* now, append constraints on all certificates in the path */ - sb.append(" Validity Date: " + String.valueOf(date) + "\n"); - sb.append(" Signature Provider: " + String.valueOf(sigProvider) + "\n"); - sb.append(" Default Revocation Enabled: " + revocationEnabled + "\n"); - sb.append(" Explicit Policy Required: " + explicitPolicyRequired + "\n"); - sb.append(" Policy Mapping Inhibited: " + policyMappingInhibited + "\n"); - sb.append(" Any Policy Inhibited: " + anyPolicyInhibited + "\n"); - sb.append(" Policy Qualifiers Rejected: " + policyQualifiersRejected + "\n"); + sb.append(" Validity Date: ").append(String.valueOf(date)) + .append('\n'); + sb.append(" Signature Provider: ").append(String.valueOf(sigProvider)) + .append('\n'); + sb.append(" Default Revocation Enabled: ").append(revocationEnabled) + .append('\n'); + sb.append(" Explicit Policy Required: ") + .append(explicitPolicyRequired).append('\n'); + sb.append(" Policy Mapping Inhibited: ") + .append(policyMappingInhibited).append('\n'); + sb.append(" Any Policy Inhibited: ").append(anyPolicyInhibited) + .append('\n'); + sb.append(" Policy Qualifiers Rejected: ") + .append(policyQualifiersRejected).append('\n'); /* now, append target cert requirements */ - sb.append(" Target Cert Constraints: " + String.valueOf(certSelector) + "\n"); + sb.append(" Target Cert Constraints: ") + .append(String.valueOf(certSelector)).append('\n'); /* finally, append miscellaneous parameters */ - if (certPathCheckers != null) - sb.append(" Certification Path Checkers: [" - + certPathCheckers.toString() + "]\n"); - if (certStores != null) - sb.append(" CertStores: [" + certStores.toString() + "]\n"); - sb.append("]"); + if (certPathCheckers != null) { + sb.append(" Certification Path Checkers: [") + .append(certPathCheckers.toString()).append("]\n"); + } + if (certStores != null) { + sb.append(" CertStores: [").append(certStores.toString()) + .append("]\n"); + } + sb.append(']'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/PolicyQualifierInfo.java --- a/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/PolicyQualifierInfo.java Tue Aug 19 21:59:21 2014 -0300 @@ -158,15 +158,17 @@ * {@code PolicyQualifierInfo} */ public String toString() { - if (pqiString != null) + if (pqiString != null) { return pqiString; + } HexDumpEncoder enc = new HexDumpEncoder(); StringBuilder sb = new StringBuilder(); sb.append("PolicyQualifierInfo: [\n"); - sb.append(" qualifierID: " + mId + "\n"); - sb.append(" qualifier: " + - (mData == null ? "null" : enc.encodeBuffer(mData)) + "\n"); - sb.append("]"); + sb.append(" qualifierID: ").append(mId).append('\n'); + sb.append(" qualifier: ") + .append(mData == null ? "null" : enc.encodeBuffer(mData)) + .append('\n'); + sb.append(']'); pqiString = sb.toString(); return pqiString; } diff -r dde9f5cfde5f src/share/classes/java/security/cert/TrustAnchor.java --- a/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/TrustAnchor.java Tue Aug 19 21:59:21 2014 -0300 @@ -320,14 +320,18 @@ StringBuilder sb = new StringBuilder(); sb.append("[\n"); if (pubKey != null) { - sb.append(" Trusted CA Public Key: " + pubKey.toString() + "\n"); - sb.append(" Trusted CA Issuer Name: " - + String.valueOf(caName) + "\n"); + sb.append(" Trusted CA Public Key: ").append(pubKey.toString()) + .append('\n'); + sb.append(" Trusted CA Issuer Name: ") + .append(String.valueOf(caName)).append('\n'); } else { - sb.append(" Trusted CA cert: " + trustedCert.toString() + "\n"); + sb.append(" Trusted CA cert: ").append(trustedCert.toString()) + .append('\n'); } - if (nc != null) - sb.append(" Name Constraints: " + nc.toString() + "\n"); + if (nc != null) { + sb.append(" Name Constraints: ").append(nc.toString()) + .append('\n'); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CRLSelector.java --- a/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CRLSelector.java Tue Aug 19 21:59:21 2014 -0300 @@ -572,17 +572,17 @@ sb.append(" IssuerNames:\n"); Iterator i = issuerNames.iterator(); while (i.hasNext()) - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } if (minCRL != null) - sb.append(" minCRLNumber: " + minCRL + "\n"); + sb.append(" minCRLNumber: ").append(minCRL).append('\n'); if (maxCRL != null) - sb.append(" maxCRLNumber: " + maxCRL + "\n"); + sb.append(" maxCRLNumber: ").append(maxCRL).append('\n'); if (dateAndTime != null) - sb.append(" dateAndTime: " + dateAndTime + "\n"); + sb.append(" dateAndTime: ").append(dateAndTime).append('\n'); if (certChecking != null) - sb.append(" Certificate being checked: " + certChecking + "\n"); - sb.append("]"); + sb.append(" Certificate being checked: ").append(certChecking).append('\n'); + sb.append(']'); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/java/security/cert/X509CertSelector.java --- a/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/security/cert/X509CertSelector.java Tue Aug 19 21:59:21 2014 -0300 @@ -1814,72 +1814,75 @@ StringBuilder sb = new StringBuilder(); sb.append("X509CertSelector: [\n"); if (x509Cert != null) { - sb.append(" Certificate: " + x509Cert.toString() + "\n"); + sb.append(" Certificate: ").append(x509Cert.toString()) + .append('\n'); } if (serialNumber != null) { - sb.append(" Serial Number: " + serialNumber.toString() + "\n"); + sb.append(" Serial Number: ").append(serialNumber.toString()) + .append('\n'); } if (issuer != null) { - sb.append(" Issuer: " + getIssuerAsString() + "\n"); + sb.append(" Issuer: ").append(getIssuerAsString()).append('\n'); } if (subject != null) { - sb.append(" Subject: " + getSubjectAsString() + "\n"); + sb.append(" Subject: ").append(getSubjectAsString()).append('\n'); } - sb.append(" matchAllSubjectAltNames flag: " - + String.valueOf(matchAllSubjectAltNames) + "\n"); + sb.append(" matchAllSubjectAltNames flag: ") + .append(String.valueOf(matchAllSubjectAltNames)).append('\n'); if (subjectAlternativeNames != null) { sb.append(" SubjectAlternativeNames:\n"); Iterator> i = subjectAlternativeNames.iterator(); while (i.hasNext()) { List list = i.next(); - sb.append(" type " + list.get(0) + - ", name " + list.get(1) + "\n"); + sb.append(" type ").append(list.get(0)).append(", name ") + .append(list.get(1)).append('\n'); } } if (subjectKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Subject Key Identifier: " + - enc.encodeBuffer(subjectKeyID) + "\n"); + sb.append(" Subject Key Identifier: ") + .append(enc.encodeBuffer(subjectKeyID)).append('\n'); } if (authorityKeyID != null) { HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(" Authority Key Identifier: " + - enc.encodeBuffer(authorityKeyID) + "\n"); + sb.append(" Authority Key Identifier: ") + .append(enc.encodeBuffer(authorityKeyID)).append('\n'); } if (certificateValid != null) { - sb.append(" Certificate Valid: " + - certificateValid.toString() + "\n"); + sb.append(" Certificate Valid: ") + .append(certificateValid.toString()).append('\n'); } if (privateKeyValid != null) { - sb.append(" Private Key Valid: " + - privateKeyValid.toString() + "\n"); + sb.append(" Private Key Valid: ") + .append(privateKeyValid.toString()).append('\n'); } if (subjectPublicKeyAlgID != null) { - sb.append(" Subject Public Key AlgID: " + - subjectPublicKeyAlgID.toString() + "\n"); + sb.append(" Subject Public Key AlgID: ") + .append(subjectPublicKeyAlgID.toString()).append('\n'); } if (subjectPublicKey != null) { - sb.append(" Subject Public Key: " + - subjectPublicKey.toString() + "\n"); + sb.append(" Subject Public Key: ") + .append(subjectPublicKey.toString()).append('\n'); } if (keyUsage != null) { - sb.append(" Key Usage: " + keyUsageToString(keyUsage) + "\n"); + sb.append(" Key Usage: ").append(keyUsageToString(keyUsage)) + .append('\n'); } if (keyPurposeSet != null) { - sb.append(" Extended Key Usage: " + - keyPurposeSet.toString() + "\n"); + sb.append(" Extended Key Usage: ") + .append(keyPurposeSet.toString()).append('\n'); } if (policy != null) { - sb.append(" Policy: " + policy.toString() + "\n"); + sb.append(" Policy: ").append(policy.toString()).append('\n'); } if (pathToGeneralNames != null) { sb.append(" Path to names:\n"); Iterator i = pathToGeneralNames.iterator(); while (i.hasNext()) { - sb.append(" " + i.next() + "\n"); + sb.append(" ").append(i.next()).append('\n'); } } - sb.append("]"); + sb.append(']'); return sb.toString(); } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/rmi/dgc/VMID.java --- a/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/rmi/dgc/VMID.java Tue Aug 19 21:59:21 2014 -0300 @@ -124,8 +124,7 @@ if (addr != null) for (int i = 0; i < addr.length; ++ i) { int x = addr[i] & 0xFF; - sb.append((x < 0x10 ? "0" : "") + - Integer.toString(x, 16)); + sb.append(x < 0x10 ? "0" : "").append(Integer.toString(x, 16)); } sb.append(':'); sb.append(uid.toString()); -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/java/lang/management/MemoryUsage.java --- a/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/MemoryUsage.java Tue Aug 19 21:59:21 2014 -0300 @@ -237,13 +237,16 @@ * Returns a descriptive representation of this memory usage. */ public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append("init = " + init + "(" + (init >> 10) + "K) "); - buf.append("used = " + used + "(" + (used >> 10) + "K) "); - buf.append("committed = " + committed + "(" + - (committed >> 10) + "K) " ); - buf.append("max = " + max + "(" + (max >> 10) + "K)"); - return buf.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("init = ").append(init).append('(').append(init >> 10) + .append("K) "); + sb.append("used = ").append(used).append('(').append(used >> 10) + .append("K) "); + sb.append("committed = ").append(committed).append('(') + .append(committed >> 10).append("K) "); + sb.append("max = ").append(max).append('(').append(max >> 10) + .append("K)"); + return sb.toString(); } /** diff -r dde9f5cfde5f src/share/classes/java/lang/management/ThreadInfo.java --- a/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/java/lang/management/ThreadInfo.java Tue Aug 19 21:59:21 2014 -0300 @@ -579,15 +579,17 @@ * @return a string representation of this thread info. */ public String toString() { - StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" + - " Id=" + getThreadId() + " " + - getThreadState()); + StringBuilder sb = new StringBuilder(); + sb.append('"').append(getThreadName()).append('"') + .append(" Id=").append(getThreadId()).append(' ') + .append(getThreadState()); + if (getLockName() != null) { - sb.append(" on " + getLockName()); + sb.append(" on ").append(getLockName()); } if (getLockOwnerName() != null) { - sb.append(" owned by \"" + getLockOwnerName() + - "\" Id=" + getLockOwnerId()); + sb.append(" owned by \"").append(getLockOwnerName()) + .append("\" Id=").append(getLockOwnerId()); } if (isSuspended()) { sb.append(" (suspended)"); @@ -599,21 +601,21 @@ int i = 0; for (; i < stackTrace.length && i < MAX_FRAMES; i++) { StackTraceElement ste = stackTrace[i]; - sb.append("\tat " + ste.toString()); + sb.append("\tat ").append(ste.toString()); sb.append('\n'); if (i == 0 && getLockInfo() != null) { Thread.State ts = getThreadState(); switch (ts) { case BLOCKED: - sb.append("\t- blocked on " + getLockInfo()); + sb.append("\t- blocked on ").append(getLockInfo()); sb.append('\n'); break; case WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; case TIMED_WAITING: - sb.append("\t- waiting on " + getLockInfo()); + sb.append("\t- waiting on ").append(getLockInfo()); sb.append('\n'); break; default: @@ -622,7 +624,7 @@ for (MonitorInfo mi : lockedMonitors) { if (mi.getLockedStackDepth() == i) { - sb.append("\t- locked " + mi); + sb.append("\t- locked ").append(mi); sb.append('\n'); } } @@ -634,10 +636,10 @@ LockInfo[] locks = getLockedSynchronizers(); if (locks.length > 0) { - sb.append("\n\tNumber of locked synchronizers = " + locks.length); + sb.append("\n\tNumber of locked synchronizers = ").append(locks.length); sb.append('\n'); for (LockInfo li : locks) { - sb.append("\t- " + li); + sb.append("\t- ").append(li); sb.append('\n'); } } -------------- next part -------------- diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHParameters.java --- a/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHParameters.java Tue Aug 19 21:59:21 2014 -0300 @@ -137,8 +137,11 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:") + .append(LINE_SEP).append(" ") + .append(this.l); + } return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/DHPublicKey.java --- a/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/DHPublicKey.java Tue Aug 19 21:59:21 2014 -0300 @@ -268,8 +268,10 @@ + Debug.toHexString(this.p) + LINE_SEP + "g:" + LINE_SEP + Debug.toHexString(this.g)); - if (this.l != 0) - sb.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); + if (this.l != 0) { + sb.append(LINE_SEP).append("l:").append(LINE_SEP) + .append(" ").append(this.l); + } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/GCMParameters.java --- a/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/GCMParameters.java Tue Aug 19 21:59:21 2014 -0300 @@ -140,7 +140,8 @@ = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "[" + encoder.encodeBuffer(iv) + "]"); - sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP); + sb.append(LINE_SEP).append("tLen(bits):").append(LINE_SEP) + .append(tLen * 8).append(LINE_SEP); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/OAEPParameters.java --- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java Tue Aug 19 21:59:21 2014 -0300 @@ -239,10 +239,12 @@ protected String engineToString() { StringBuilder sb = new StringBuilder(); - sb.append("MD: " + mdName + "\n"); - sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n"); - sb.append("PSource: PSpecified " + - (p.length==0? "":Debug.toHexString(new BigInteger(p))) + "\n"); + sb.append("MD: ").append(mdName).append('\n'); + sb.append("MGF: MGF1").append(mgfSpec.getDigestAlgorithm()) + .append('\n'); + sb.append("PSource: PSpecified ") + .append(p.length == 0 ? "" : Debug + .toHexString(new BigInteger(p))).append('\n'); return sb.toString(); } } diff -r dde9f5cfde5f src/share/classes/com/sun/crypto/provider/RC2Parameters.java --- a/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/crypto/provider/RC2Parameters.java Tue Aug 19 21:59:21 2014 -0300 @@ -221,8 +221,9 @@ + encoder.encodeBuffer(iv) + "]"); if (version != 0) { - sb.append(LINE_SEP + "version:" + LINE_SEP - + version + LINE_SEP); + sb.append(LINE_SEP).append("version:") + .append(LINE_SEP).append(version) + .append(LINE_SEP); } return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Aug 19 21:59:21 2014 -0300 @@ -65,7 +65,7 @@ "extractSubNet", "BINARY ARRAY :"); StringBuilder sb = new StringBuilder(); for(int i =0; i < addrLength; i++) { - sb.append((b[i] & 0xFF) + ":"); + sb.append(b[i] & 0xFF).append(':'); } SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", sb.toString()); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Aug 19 21:59:21 2014 -0300 @@ -204,7 +204,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Aug 19 21:59:21 2014 -0300 @@ -379,7 +379,7 @@ } jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); - jjtn000.name.append( "." + t.image); + jjtn000.name.append('.').append(t.image); } } finally { if (jjtc000) { @@ -408,7 +408,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -454,7 +454,7 @@ } jj_consume_token(MARK); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } } finally { if (jjtc000) { @@ -483,7 +483,7 @@ } jj_consume_token(DOT); t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); + jjtn000.address.append('.').append(t.image); } jj_consume_token(MASK); t = jj_consume_token(INTEGER_LITERAL); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Tue Aug 19 21:59:21 2014 -0300 @@ -420,7 +420,7 @@ t= { jjtn000.name.append(t.image); } ( "." t= - {jjtn000.name.append( "." + t.image); } + {jjtn000.name.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -447,7 +447,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -501,7 +501,7 @@ {jjtn000.address.append(t.image); } ( "!" t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { @@ -527,7 +527,7 @@ {jjtn000.address.append(t.image); } ( "." t= - {jjtn000.address.append( "." + t.image); } + {jjtn000.address.append( '.').append(t.image); } )* "/" t= /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Tue Aug 19 21:59:21 2014 -0300 @@ -213,7 +213,7 @@ t= { jjtThis.name.append(t.image); } ( "." t= - {jjtThis.name.append( "." + t.image); } + {jjtThis.name.append( '.').append(t.image); } )* } @@ -228,7 +228,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* } @@ -253,7 +253,7 @@ {jjtThis.address.append(t.image); } ( "!" t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* } @@ -267,7 +267,7 @@ {jjtThis.address.append(t.image); } ( "." t= - {jjtThis.address.append( "." + t.image); } + {jjtThis.address.append( '.').append(t.image); } )* "/" t= {jjtThis.mask = t.image; } } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java --- a/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java Tue Aug 19 21:59:21 2014 -0300 @@ -99,7 +99,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java --- a/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java Tue Aug 19 21:59:21 2014 -0300 @@ -479,10 +479,10 @@ */ public String printMessage() { StringBuilder sb = new StringBuilder(); - sb.append("msgId : " + msgId + "\n"); - sb.append("msgMaxSize : " + msgMaxSize + "\n"); - sb.append("msgFlags : " + msgFlags + "\n"); - sb.append("msgSecurityModel : " + msgSecurityModel + "\n"); + sb.append("msgId : ").append(msgId).append('\n'); + sb.append("msgMaxSize : ").append(msgMaxSize).append('\n'); + sb.append("msgFlags : ").append(msgFlags).append('\n'); + sb.append("msgSecurityModel : ").append(msgSecurityModel).append('\n'); if (contextEngineId == null) { sb.append("contextEngineId : null"); diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java --- a/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java Tue Aug 19 21:59:21 2014 -0300 @@ -256,7 +256,7 @@ private static String stringifyComponent(NameComponent comp) { StringBuilder one = new StringBuilder(escape(comp.id)); if (comp.kind != null && !comp.kind.equals("")) { - one.append(kindSeparator + escape(comp.kind)); + one.append(kindSeparator).append(escape(comp.kind)); } if (one.length() == 0) { return ""+kindSeparator; // if neither id nor kind specified diff -r dde9f5cfde5f src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java --- a/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java Tue Aug 19 21:59:21 2014 -0300 @@ -90,7 +90,7 @@ if (selected == -1) { StringBuilder allChoices = new StringBuilder(); for (int j = 0; j < choices.length; j++) { - allChoices.append(choices[j] + ","); + allChoices.append(choices[j]).append(','); } throw new IOException("Cannot match " + "'java.naming.security.sasl.realm' property value, '" + diff -r dde9f5cfde5f src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java --- a/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Tue Aug 19 21:59:21 2014 -0300 @@ -167,9 +167,9 @@ for (int i = 0; i < allchannelnames.length; i++) { if ((channelmask & m) != 0L) { if (i < channelnames.length) { - sb.append(channelnames[i] + " "); + sb.append(channelnames[i]).append(' '); } else { - sb.append(allchannelnames[i] + " "); + sb.append(allchannelnames[i]).append(' '); } } m *= 2L; diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java Tue Aug 19 21:59:21 2014 -0300 @@ -235,14 +235,15 @@ String nodeName = att.getNodeName(); if ((nodeName.equals("xmlns") || nodeName.startsWith("xmlns:")) && !storedNamespaces.containsKey(att.getNodeName())) { - sb.append(" " + nodeName + "=\"" + att.getNodeValue() + "\""); + sb.append(' ').append(nodeName).append("=\"") + .append(att.getNodeValue()).append('"'); storedNamespaces.put(nodeName, att.getNodeValue()); } } } wk = wk.getParentNode(); } - sb.append(">" + source + ""); + sb.append('>').append(source).append(""); return sb.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java Tue Aug 19 21:59:21 2014 -0300 @@ -85,7 +85,7 @@ if (prefix.equals("xmlns")) { sb.append("#default "); } else { - sb.append(prefix + " "); + sb.append(prefix).append(' '); } } diff -r dde9f5cfde5f src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java --- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java Tue Aug 19 21:59:21 2014 -0300 @@ -88,7 +88,7 @@ l += countQuotes(DN, j, k); if ((k > 0) && (DN.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseRDN(DN.substring(i, k).trim(), toXml) + ","); + sb.append(parseRDN(DN.substring(i, k).trim(), toXml)).append(','); i = k + 1; l = 0; @@ -121,7 +121,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(parseATAV(trim(str.substring(i, k)), toXml) + "+"); + sb.append(parseATAV(trim(str.substring(i, k)), toXml)).append('+'); i = k + 1; l = 0; @@ -369,7 +369,7 @@ int k; for (int j = 0; (k = string.indexOf("\\20", j)) >= 0; j = k + 3) { - sb.append(trim(string.substring(i, k)) + "\\ "); + sb.append(trim(string.substring(i, k))).append("\\ "); i = k + 3; } @@ -418,7 +418,7 @@ l += countQuotes(str, j, k); if ((k > 0) && (str.charAt(k - 1) != '\\') && (l % 2) == 0) { - sb.append(trim(str.substring(i, k)) + replace); + sb.append(trim(str.substring(i, k))).append(replace); i = k + 1; l = 0; diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/CramMD5Base.java --- a/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/CramMD5Base.java Tue Aug 19 21:59:21 2014 -0300 @@ -196,8 +196,7 @@ for (i = 0; i < digest.length; i++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0" + - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java --- a/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java Tue Aug 19 21:59:21 2014 -0300 @@ -391,8 +391,7 @@ for (int i = 0; i < digest.length; i ++) { if ((digest[i] & 0x000000ff) < 0x10) { - digestString.append("0"+ - Integer.toHexString(digest[i] & 0x000000ff)); + digestString.append('0').append(Integer.toHexString(digest[i] & 0x000000ff)); } else { digestString.append( Integer.toHexString(digest[i] & 0x000000ff)); diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/ParseException.java --- a/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Tue Aug 19 21:59:21 2014 -0300 @@ -198,7 +198,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java --- a/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Tue Aug 19 21:59:21 2014 -0300 @@ -107,7 +107,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u").append(s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java --- a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java Tue Aug 19 21:59:21 2014 -0300 @@ -338,10 +338,10 @@ if (classpath.isEmpty()) { String envcp = System.getProperty("env.class.path"); if ((envcp != null) && (envcp.length() > 0)) { - munged.append(" -classpath " + envcp); + munged.append(" -classpath ").append(envcp); } } else { - munged.append(" -classpath " + classpath.asString()); + munged.append(" -classpath ").append(classpath.asString()); } return munged.toString(); } else { @@ -349,14 +349,4 @@ } } - private String appendPath(String path1, String path2) { - if (path1 == null || path1.length() == 0) { - return path2 == null ? "." : path2; - } else if (path2 == null || path2.length() == 0) { - return path1; - } else { - return path1 + File.pathSeparator + path2; - } - } - } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Tue Aug 19 21:59:21 2014 -0300 @@ -346,12 +346,12 @@ public String valueString(boolean bigLimit) { // Char arrays deserve special treatment - StringBuffer result; + StringBuilder result; byte[] value = getValue(); int max = value.length; byte elementSignature = getElementType(); if (elementSignature == 'C') { - result = new StringBuffer(); + result = new StringBuilder(); for (int i = 0; i < value.length; ) { char val = charAt(i, value); result.append(val); @@ -362,7 +362,7 @@ if (bigLimit) { limit = 1000; } - result = new StringBuffer("{"); + result = new StringBuilder("{"); int num = 0; for (int i = 0; i < value.length; ) { if (num > 0) { @@ -386,37 +386,37 @@ } case 'B': { int val = 0xFF & byteAt(i, value); - result.append("0x" + Integer.toString(val, 16)); + result.append("0x").append(Integer.toString(val, 16)); i++; break; } case 'S': { short val = shortAt(i, value); i += 2; - result.append("" + val); + result.append(val); break; } case 'I': { int val = intAt(i, value); i += 4; - result.append("" + val); + result.append(val); break; } case 'J': { // long long val = longAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } case 'F': { float val = floatAt(i, value); - result.append("" + val); + result.append(val); i += 4; break; } case 'D': { // double double val = doubleAt(i, value); - result.append("" + val); + result.append(val); i += 8; break; } @@ -425,7 +425,7 @@ } } } - result.append("}"); + result.append('}'); } return result.toString(); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/hat/internal/util/Misc.java --- a/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Tue Aug 19 21:59:21 2014 -0300 @@ -97,11 +97,11 @@ } else if (ch == '&') { sb.append("&"); } else if (ch < ' ') { - sb.append("&#" + Integer.toString(ch) + ";"); + sb.append("&#").append(Integer.toString(ch)).append(';'); } else { int c = (ch & 0xFFFF); if (c > 127) { - sb.append("&#" + Integer.toString(c) + ";"); + sb.append("&#").append(Integer.toString(c)).append(';'); } else { sb.append(ch); } diff -r dde9f5cfde5f src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java --- a/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 05 19:29:00 2014 -0700 +++ b/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java Tue Aug 19 21:59:21 2014 -0300 @@ -881,12 +881,12 @@ } else if (tag == JDWP.TypeTag.ARRAY) { sb.append("ArrayType"); } else { - sb.append("UNKNOWN TAG: " + tag); + sb.append("UNKNOWN TAG: ").append(tag); } if (signature != null) { - sb.append(", signature='" + signature + "'"); + sb.append(", signature='").append(signature).append('\''); } - sb.append(", id=" + id); + sb.append(", id=").append(id); vm.printTrace(sb.toString()); } if (id == 0) { From weijun.wang at oracle.com Wed Aug 20 01:55:39 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Wed, 20 Aug 2014 09:55:39 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> Message-ID: <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> Hi Ot?vio I see TABs in the first page of sun_security.diff, too long line in javax_security.diff. Also, it's unfortunate that you will need to rename the file names to the new style with modules. See http://cr.openjdk.java.net/~chegar/docs/portingScript.html for how to do this. I can create webrev page(s) for you on cr.openjdk.java.net. Please tell me if you want a big one or one for each diff. I see no bug id. If none, I can create one for you. Thanks Max On Aug 20, 2014, at 9:05, Ot?vio Gon?alves de Santana wrote: > Thank you Sergey. > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_7.zip > > > On Tue, Aug 19, 2014 at 12:32 PM, Sergey Bylokhov < > Sergey.Bylokhov at oracle.com> wrote: > >> Hi Ot?vio, >> The new alignment in DataLine.java/JColorChooser.java looks strange. >> Wrong change in BasicTableUI.java: >> - plainStr.deleteCharAt(plainStr.length() - >> 1).append("\n"); >> + plainStr.deleteCharAt(plainStr.length() - >> 1).append('\t'); >> >> >> On 13.08.2014 3:01, Ot?vio Gon?alves de Santana wrote: >> >>> Thank you Roger. >>> Done >>> https://dl.dropboxusercontent.com/u/16109193/open_jdk/ >>> string_builder_concat_6.zip >>> >>> >>> On Tue, Aug 12, 2014 at 10:15 AM, roger riggs >>> wrote: >>> >>> fyi, >>>> >>>> There's a Perl script normalizer.pl that detects/fixes most of the >>>> simple >>>> tab/white space issues. >>>> The script is in the /make/scripts/normalizer.pl >>>> >>>> Roger >>>> >>>> >>>> On 8/12/2014 3:48 AM, Andrej Golovnin wrote: >>>> >>>> Hi Ot?vio, >>>>> >>>>> I think you should fix the indentation in a lot of classes. You use the >>>>> tab-character for the indentation. As far as I know we should use the >>>>> space >>>>> character for the indentation in the JDK sources (Oracle devs feel free >>>>> to >>>>> correct me if I'm wrong. And it would be really nice if the style guide >>>>> for >>>>> the source code would be a part of the JDK repository. So we don't need >>>>> to >>>>> search for it on the internet/wiki. Just clone the repository, read the >>>>> style guide and follow it. :-) ). Here is the not complete list of >>>>> classes >>>>> where you used the tab-character for the indentation: >>>>> >>>>> src/share/classes/com/sun/crypto/provider/OAEPParameters.java >>>>> src/share/classes/java/lang/management/MemoryUsage.java >>>>> src/share/classes/java/security/KeyStore.java >>>>> src/share/classes/java/security/PermissionCollection.java >>>>> src/share/classes/java/security/ProtectionDomain.java >>>>> src/share/classes/java/security/cert/CertPath.java >>>>> src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java >>>>> src/share/classes/java/security/cert/PKIXParameters.java >>>>> src/share/classes/java/security/cert/PolicyQualifierInfo.java >>>>> src/share/classes/java/security/cert/TrustAnchor.java >>>>> src/share/classes/java/security/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); } >>>>> >>>>> Best regards, >>>>> Andrej Golovnin >>>>> >>>>> >>>> >>> >> >> -- >> Best regards, Sergey. >> >> > > > -- > Ot?vio Gon?alves de Santana > > blog: http://otaviosantana.blogspot.com.br/ > twitter: http://twitter.com/otaviojava > site: *http://about.me/otaviojava * > 55 (11) 98255-3513 > From joel.franck at oracle.com Wed Aug 20 08:49:55 2014 From: joel.franck at oracle.com (=?windows-1252?Q?Joel_Borggr=E9n-Franck?=) Date: Wed, 20 Aug 2014 10:49:55 +0200 Subject: RFR 8u: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value In-Reply-To: <1B51A5CD-A909-42C4-97D1-1F8F5DFE55D2@oracle.com> References: <1B51A5CD-A909-42C4-97D1-1F8F5DFE55D2@oracle.com> Message-ID: Hi, On 17 jun 2014, at 18:52, Joel Borggr?n-Franck wrote: > Hi, > > Can I get a review for this fix and javadoc clarification for https://bugs.openjdk.java.net/browse/JDK-8044629 > > The problem is with potentially annotated receiver parameters, they only exist for inner class constructors, so this fix makes sure that a ctor is for an inner class or returns null (as for a static method) otherwise. > > CCC has been approved. > > Webrev: http://cr.openjdk.java.net/~jfranck/8044629/webrev.00/ Can i get a review for this in 8u as well. Only change is a ?@since 1.8? have been removed in 9, patch applies cleanly if you up the fuzz. http://cr.openjdk.java.net/~jfranck/8044629/jdk8u/webrev.00/ cheers /Joel From evgeniya.stepanova at oracle.com Wed Aug 20 09:03:17 2014 From: evgeniya.stepanova at oracle.com (Evgeniya Stepanova) Date: Wed, 20 Aug 2014 13:03:17 +0400 Subject: 8055393: Some tests added to the TEST.group to exclude execution on inappropriate compact profiles In-Reply-To: <53F34B24.10301@oracle.com> References: <15232f91-5969-456d-ba33-14df731197c7@default> <53F34B24.10301@oracle.com> Message-ID: <53F46455.1010406@oracle.com> Update review request with links: bug: https://bugs.openjdk.java.net/browse/JDK-8055393 webrev:http://cr.openjdk.java.net/~avstepan/eistepan/8055393/webrev.00/ Thanks, Jane On 19.08.2014 17:03, Evgeniya Stepanova wrote: > Re-added lost diff > On 19.08.2014 16:58, Evgeniya Stepanova wrote: >> Hi all, >> >> Could you please review fix for 8055393 >> >> Problem:Some tests are being executed and fail under profiles >> Solution: >> -test java/lang/ProcessBuilder/InheritIO/InheritIO.sh changed to use >> COMPILEJAVA (set by jtreg harness) javac instead of TESTJAVA (which >> is absent in profiles) >> -java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java >> and some of the java/util/logging/ tests use >> java.lang.management.ManagementFactory class to get deadlocked >> threads. Such tests are added to the needs_compact3 testgroup >> -test java/lang/invoke/lambda/LambdaAsm.java check bytecode >> generation and use javac classes. Added to needs_jdk testgroup >> -test java/net/Authenticator/B4769350.java uses >> com.sun.net.httpserver.HttpHandler class as base class for all >> testcases. Added to the needs_compact2 testgroup >> -Some of the javax/management/mxbean tests uses >> java.beans.ConstructorProperties annotation. Such tests are added to >> the needs_jre test group >> -test sun/misc/URLClassPath/ClassnameCharTest.java included in both >> needs_compact2 and needs_jre testgroups. Removed from needs_compact2 >> testgroup since it fails on compacts2-3 >> Testing: locally. Tests excluded as expected >> >> >> In attachement diff against jdk8u-dev repo > -- /Evgeniya Stepanova/ From amy.lu at oracle.com Wed Aug 20 13:26:55 2014 From: amy.lu at oracle.com (Amy Lu) Date: Wed, 20 Aug 2014 21:26:55 +0800 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F38E8C.9080306@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> <53F35623.4020709@oracle.com> <53F38E8C.9080306@oracle.com> Message-ID: <53F4A21F.60908@oracle.com> On 8/20/14, 1:51 AM, Joe Darcy wrote: > On 08/19/2014 06:50 AM, Amy Lu wrote: >> On 8/19/14, 3:09 AM, Mandy Chung wrote: >>> On 8/18/14 12:49 AM, Amy Lu wrote: >>>> There are jdk tests that have dependency on sun.misc.DoubleConsts >>>> and sun.misc.FloatConsts. >>>> This fix is to remove above internal API dependency from the tests. >>>> >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8042003 >>>> webrev: http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.00/ >>>> >>> In addition to Joe's comment, DoubleUtils and FloatUtils are >>> needed by test/java/lang/Math/Tests.java and a few other math >>> tests. It may be better to include them in test/java/lang/Math >>> rather than in the testlibrary. >>> >>> >>> Mandy >>> >> >> Thank you Mandy and Joe for your comments! >> >> To confirm, DoubleUtils and FloatUtils contain *only* constants that >> are not defined in java.lang.{Float, Double}, and tests fixed by >> using constants from 1) java.lang.{Float, Double} if constants >> defined there; 2) DoubleUtils and FloatUtils only for additional >> constants that are not in java.lang.{Float, Double}. >> >> DoubleUtils and FloatUtils now moved to test/java/lang/Math, the >> updated patch: >> >> http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.01/ >> > > The uses of DoubleUtils and FloatUtils now look okay, but I have some > additional comments on the contents of those types. First, I think > these type are better named "DoubleConsts" and "FloatConsts" since > they only have constants defined in them. As such, they should be > derived works of the sun.misc.{FloatConsts, DoubleConsts} types: > > * Inherit starting copyright dates of those types > * Use "float" and "double" to talk about the types rather than "Float" > and "Double" > * Include the private constructor and static initializer to check for > correctness conditions as in the sun.misc types > > Changing the simple names of the new types to match the old types will > also have the benefit of greatly reducing the size of the patch. > > (In the new files, more recent javadoc conventions should be follow > {@code foo} rather than foo, etc.) > > Thanks, > > -Joe > Yes! Thank you so much Joe! Patch updated: http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.02/ Thanks, Amy From aleksej.efimov at oracle.com Wed Aug 20 14:59:09 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Wed, 20 Aug 2014 18:59:09 +0400 Subject: RFR: 8049343: (tz) Support tzdata2014f Message-ID: <53F4B7BD.8020705@oracle.com> Hi, Please, review the tzdata2014f integration (with tzdata2014e related changes included too) [1] fix to JDK9: http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/ The tzdata2014f changes are extensive and relates mostly to timezone short names changes + "Asia/Srednekolymsk" time zone were added. Almost complete list of changes can be found in the JBS bug description [1], plus some changes wasn't documented in tzdata release notes - for such cases raw tzdata diff was used for the names modifications. Two issues with JSR310 implementation were discovered during integration process: First issue is related to the internal representation of the '24:00' value. The JSR310 implementation treats this value as a next day 00:00 time. The workaround already exists in JSR310 code for similar entries and this failure is resolved in similar way [2] as part of this update. For the second issue JDK-8051641 [3] was filled and 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one that fails with this tzdata. Other time zone related tests [4] passes without failures. Thank you, Aleksej [1] https://bugs.openjdk.java.net/browse/JDK-8049343 [2] http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java.patch [3] https://bugs.openjdk.java.net/browse/JDK-8051641 [4] TZ related test sets: test/sun/util/calendar test/java/util/Calendar test/sun/util/resources/TimeZone test/sun/util/calendar test/java/util/TimeZone test/java/time\ test/java/util/Formatter test/closed/java/util/Calendar test/closed/java/util/TimeZone From brian.burkhalter at oracle.com Wed Aug 20 15:08:49 2014 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 20 Aug 2014 08:08:49 -0700 Subject: JDK 9 RFR of 8054720: Modifications of I/O methods for instrumentation purposes Message-ID: <78EC3D5B-FB0F-48C8-9F06-2AFE3CFF906E@oracle.com> JDK 9 reviewers: I would like to reprise this thread http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-August/028181.html with an updated patch Issue: https://bugs.openjdk.java.net/browse/JDK-8054720 Patch: http://cr.openjdk.java.net/~bpb/8054720/webrev.01/ This changes builds on all platforms and passes the jdk_io and jdk_net tests on all platforms. Note that the patch posted in the original discussion thread has been moved to http://cr.openjdk.java.net/~bpb/8054720/webrev.00/ Thanks, Brian From fweimer at redhat.com Wed Aug 20 15:10:56 2014 From: fweimer at redhat.com (Florian Weimer) Date: Wed, 20 Aug 2014 17:10:56 +0200 Subject: ByteBuffer.wrap(array).getInt(offset) Message-ID: <53F4BA80.8060306@redhat.com> Is there already a way to compute the expression in the subject without the ByteBuffer allocation? I saw quite a few equivalent formulations in the OpenJDK sources, and perhaps it's time to add a standardized solution. Should this go into DataInputStream, or java.lang.Integer and friends? -- Florian Weimer / Red Hat Product Security From mandy.chung at oracle.com Wed Aug 20 15:31:32 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 20 Aug 2014 08:31:32 -0700 Subject: 8055393: Some tests added to the TEST.group to exclude execution on inappropriate compact profiles In-Reply-To: <53F46455.1010406@oracle.com> References: <15232f91-5969-456d-ba33-14df731197c7@default> <53F34B24.10301@oracle.com> <53F46455.1010406@oracle.com> Message-ID: <53F4BF54.6070001@oracle.com> On 8/20/2014 2:03 AM, Evgeniya Stepanova wrote: > Update review request with links: > > bug: https://bugs.openjdk.java.net/browse/JDK-8055393 > webrev:http://cr.openjdk.java.net/~avstepan/eistepan/8055393/webrev.00/ > > Looks okay to me. Mandy From roger.riggs at oracle.com Wed Aug 20 15:57:47 2014 From: roger.riggs at oracle.com (roger riggs) Date: Wed, 20 Aug 2014 11:57:47 -0400 Subject: JDK 9 RFR of 8054720: Modifications of I/O methods for instrumentation purposes In-Reply-To: <78EC3D5B-FB0F-48C8-9F06-2AFE3CFF906E@oracle.com> References: <78EC3D5B-FB0F-48C8-9F06-2AFE3CFF906E@oracle.com> Message-ID: <53F4C57B.9010707@oracle.com> Hi Brian, Looks fine, thanks for the cleanup. Roger On 8/20/2014 11:08 AM, Brian Burkhalter wrote: > JDK 9 reviewers: > > I would like to reprise this thread > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-August/028181.html > > with an updated patch > > Issue: https://bugs.openjdk.java.net/browse/JDK-8054720 > Patch: http://cr.openjdk.java.net/~bpb/8054720/webrev.01/ > This changes builds on all platforms and passes the jdk_io and jdk_net tests on all platforms. > Note that the patch posted in the original discussion thread has been moved to > > http://cr.openjdk.java.net/~bpb/8054720/webrev.00/ > > Thanks, > > Brian From aph at redhat.com Wed Aug 20 16:43:13 2014 From: aph at redhat.com (Andrew Haley) Date: Wed, 20 Aug 2014 17:43:13 +0100 Subject: ByteBuffer.wrap(array).getInt(offset) In-Reply-To: <53F4BA80.8060306@redhat.com> References: <53F4BA80.8060306@redhat.com> Message-ID: <53F4D021.9050300@redhat.com> On 08/20/2014 04:10 PM, Florian Weimer wrote: > Is there already a way to compute the expression in the subject without > the ByteBuffer allocation? I saw quite a few equivalent formulations in > the OpenJDK sources, and perhaps it's time to add a standardized > solution. Isn't this really calling for intrinsification of ByteBuffers? With that, C2 would know that the ByteBuffer doesn't escape, and could collapse the lot into a load. Andrew. From mandy.chung at oracle.com Thu Aug 21 00:54:30 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 20 Aug 2014 17:54:30 -0700 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F4A21F.60908@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> <53F35623.4020709@oracle.com> <53F38E8C.9080306@oracle.com> <53F4A21F.60908@oracle.com> Message-ID: <53F54346.9020306@oracle.com> On 8/20/2014 6:26 AM, Amy Lu wrote: > Patch updated: > http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.02/ test/java/lang/Double/ParseHexFloatingPoint.java test/java/lang/Double/ToHexString.java - they don't depend on DoubleConsts, do they? Otherwise, looks good. Mandy From amy.lu at oracle.com Thu Aug 21 01:39:14 2014 From: amy.lu at oracle.com (Amy Lu) Date: Thu, 21 Aug 2014 09:39:14 +0800 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F54346.9020306@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> <53F35623.4020709@oracle.com> <53F38E8C.9080306@oracle.com> <53F4A21F.60908@oracle.com> <53F54346.9020306@oracle.com> Message-ID: <53F54DC2.6060006@oracle.com> On 8/21/14, 8:54 AM, Mandy Chung wrote: > > On 8/20/2014 6:26 AM, Amy Lu wrote: >> Patch updated: >> http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.02/ > > test/java/lang/Double/ParseHexFloatingPoint.java No dependency on the new DoubleConsts. Previous dependency on sun.misc.DoubleConsts have been replaced with java.lang.Double > test/java/lang/Double/ToHexString.java This one has dependency on the new DoubleConsts. 28: * @library ../Math 29: * @build DoubleConsts 85: DoubleConsts.EXP_BIAS; Thanks, Amy > - they don't depend on DoubleConsts, do they? > > Otherwise, looks good. > > Mandy > > From mandy.chung at oracle.com Thu Aug 21 01:56:42 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 20 Aug 2014 18:56:42 -0700 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F54DC2.6060006@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> <53F35623.4020709@oracle.com> <53F38E8C.9080306@oracle.com> <53F4A21F.60908@oracle.com> <53F54346.9020306@oracle.com> <53F54DC2.6060006@oracle.com> Message-ID: <53F551DA.3070400@oracle.com> On 8/20/2014 6:39 PM, Amy Lu wrote: > On 8/21/14, 8:54 AM, Mandy Chung wrote: >> >> On 8/20/2014 6:26 AM, Amy Lu wrote: >>> Patch updated: >>> http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.02/ >> >> test/java/lang/Double/ParseHexFloatingPoint.java > No dependency on the new DoubleConsts. > Previous dependency on sun.misc.DoubleConsts have been replaced with > java.lang.Double > >> test/java/lang/Double/ToHexString.java > This one has dependency on the new DoubleConsts. > > 28: * @library ../Math > 29: * @build DoubleConsts > 85: DoubleConsts.EXP_BIAS; > Ah. I missed that. Looks good. Mandy > Thanks, > Amy >> - they don't depend on DoubleConsts, do they? >> >> Otherwise, looks good. >> >> Mandy >> >> > From masayoshi.okutsu at oracle.com Thu Aug 21 02:32:36 2014 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Thu, 21 Aug 2014 11:32:36 +0900 Subject: RFR: 8049343: (tz) Support tzdata2014f In-Reply-To: <53F4B7BD.8020705@oracle.com> References: <53F4B7BD.8020705@oracle.com> Message-ID: <53F55A44.6010501@oracle.com> I think the long names of the Australia time zones should be revisited to be consistent with the abbreviation changes. The new abbreviations follow the S[tandard] and D[aylight saving] convention rather than the S[tandard] and S[ummer time] one. The long names, such as "Eastern Summer Time (Queensland)", no longer make sense. On the other hand, you will need to access impact of the name changes, including abbreviations. Also, if you change the long names, their translations will need to be changed as well. Thanks, Masayoshi On 8/20/2014 11:59 PM, Aleksej Efimov wrote: > Hi, > > Please, review the tzdata2014f integration (with tzdata2014e related > changes included too) [1] fix to JDK9: > http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/ > > The tzdata2014f changes are extensive and relates mostly to timezone > short names changes + "Asia/Srednekolymsk" time zone were added. > Almost complete list of changes can be found in the JBS bug > description [1], plus some changes wasn't documented in tzdata release > notes - for such cases raw tzdata diff was used for the names > modifications. > > Two issues with JSR310 implementation were discovered during > integration process: > First issue is related to the internal representation of the '24:00' > value. The JSR310 implementation treats this value as a next day 00:00 > time. The workaround already exists in JSR310 code for similar entries > and this failure is resolved in similar way [2] as part of this update. > For the second issue JDK-8051641 [3] was filled and > 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one that > fails with this tzdata. > Other time zone related tests [4] passes without failures. > > Thank you, > Aleksej > > [1] https://bugs.openjdk.java.net/browse/JDK-8049343 > [2] > http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java.patch > [3] https://bugs.openjdk.java.net/browse/JDK-8051641 > [4] TZ related test sets: test/sun/util/calendar > test/java/util/Calendar test/sun/util/resources/TimeZone > test/sun/util/calendar test/java/util/TimeZone test/java/time\ > test/java/util/Formatter test/closed/java/util/Calendar > test/closed/java/util/TimeZone From otaviojava at java.net Thu Aug 21 02:32:14 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Wed, 20 Aug 2014 23:32:14 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> Message-ID: Thank you Wang. Actually I haven't neither webrev and bug id. I believe is better split in client and server code. https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_8.zip On Tue, Aug 19, 2014 at 10:55 PM, Wang Weijun wrote: > Hi Ot?vio > > I see TABs in the first page of sun_security.diff, too long line in > javax_security.diff. > > Also, it's unfortunate that you will need to rename the file names to the > new style with modules. See > http://cr.openjdk.java.net/~chegar/docs/portingScript.html for how to do > this. > > I can create webrev page(s) for you on cr.openjdk.java.net. Please tell > me if you want a big one or one for each diff. > > I see no bug id. If none, I can create one for you. > > Thanks > Max > > On Aug 20, 2014, at 9:05, Ot?vio Gon?alves de Santana > wrote: > > > Thank you Sergey. > > > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_7.zip > > > > > > On Tue, Aug 19, 2014 at 12:32 PM, Sergey Bylokhov < > > Sergey.Bylokhov at oracle.com> wrote: > > > >> Hi Ot?vio, > >> The new alignment in DataLine.java/JColorChooser.java looks strange. > >> Wrong change in BasicTableUI.java: > >> - plainStr.deleteCharAt(plainStr.length() - > >> 1).append("\n"); > >> + plainStr.deleteCharAt(plainStr.length() - > >> 1).append('\t'); > >> > >> > >> On 13.08.2014 3:01, Ot?vio Gon?alves de Santana wrote: > >> > >>> Thank you Roger. > >>> Done > >>> https://dl.dropboxusercontent.com/u/16109193/open_jdk/ > >>> string_builder_concat_6.zip > >>> > >>> > >>> On Tue, Aug 12, 2014 at 10:15 AM, roger riggs > >>> wrote: > >>> > >>> fyi, > >>>> > >>>> There's a Perl script normalizer.pl that detects/fixes most of the > >>>> simple > >>>> tab/white space issues. > >>>> The script is in the /make/scripts/normalizer.pl > >>>> > >>>> Roger > >>>> > >>>> > >>>> On 8/12/2014 3:48 AM, Andrej Golovnin wrote: > >>>> > >>>> Hi Ot?vio, > >>>>> > >>>>> I think you should fix the indentation in a lot of classes. You use > the > >>>>> tab-character for the indentation. As far as I know we should use the > >>>>> space > >>>>> character for the indentation in the JDK sources (Oracle devs feel > free > >>>>> to > >>>>> correct me if I'm wrong. And it would be really nice if the style > guide > >>>>> for > >>>>> the source code would be a part of the JDK repository. So we don't > need > >>>>> to > >>>>> search for it on the internet/wiki. Just clone the repository, read > the > >>>>> style guide and follow it. :-) ). Here is the not complete list of > >>>>> classes > >>>>> where you used the tab-character for the indentation: > >>>>> > >>>>> src/share/classes/com/sun/crypto/provider/OAEPParameters.java > >>>>> src/share/classes/java/lang/management/MemoryUsage.java > >>>>> src/share/classes/java/security/KeyStore.java > >>>>> src/share/classes/java/security/PermissionCollection.java > >>>>> src/share/classes/java/security/ProtectionDomain.java > >>>>> src/share/classes/java/security/cert/CertPath.java > >>>>> src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java > >>>>> src/share/classes/java/security/cert/PKIXParameters.java > >>>>> src/share/classes/java/security/cert/PolicyQualifierInfo.java > >>>>> src/share/classes/java/security/cert/TrustAnchor.java > >>>>> src/share/classes/java/security/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); } > >>>>> > >>>>> Best regards, > >>>>> Andrej Golovnin > >>>>> > >>>>> > >>>> > >>> > >> > >> -- > >> Best regards, Sergey. > >> > >> > > > > > > -- > > Ot?vio Gon?alves de Santana > > > > blog: http://otaviosantana.blogspot.com.br/ > > twitter: http://twitter.com/otaviojava > > site: *http://about.me/otaviojava * > > 55 (11) 98255-3513 > > > > > -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 -------------- next part -------------- A non-text attachment was scrubbed... Name: string_concat_updated.patch Type: text/x-patch Size: 152471 bytes Desc: not available URL: From aleksej.efimov at oracle.com Thu Aug 21 08:05:23 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Thu, 21 Aug 2014 12:05:23 +0400 Subject: RFR: 8049343: (tz) Support tzdata2014f In-Reply-To: <53F55A44.6010501@oracle.com> References: <53F4B7BD.8020705@oracle.com> <53F55A44.6010501@oracle.com> Message-ID: <53F5A843.3000302@oracle.com> Masayoshi, I agree that we should change the long names to match the new short names introduced by tzdata. But I suggest to log a different CR for such activity to handle long name changes and their translations (this activity is slightly out of tzdata update scope). Does it make sense? -Aleksej On 08/21/2014 06:32 AM, Masayoshi Okutsu wrote: > I think the long names of the Australia time zones should be revisited > to be consistent with the abbreviation changes. The new abbreviations > follow the S[tandard] and D[aylight saving] convention rather than the > S[tandard] and S[ummer time] one. The long names, such as "Eastern > Summer Time (Queensland)", no longer make sense. > > On the other hand, you will need to access impact of the name changes, > including abbreviations. Also, if you change the long names, their > translations will need to be changed as well. > > Thanks, > Masayoshi > > On 8/20/2014 11:59 PM, Aleksej Efimov wrote: >> Hi, >> >> Please, review the tzdata2014f integration (with tzdata2014e related >> changes included too) [1] fix to JDK9: >> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/ >> >> The tzdata2014f changes are extensive and relates mostly to timezone >> short names changes + "Asia/Srednekolymsk" time zone were added. >> Almost complete list of changes can be found in the JBS bug >> description [1], plus some changes wasn't documented in tzdata >> release notes - for such cases raw tzdata diff was used for the names >> modifications. >> >> Two issues with JSR310 implementation were discovered during >> integration process: >> First issue is related to the internal representation of the '24:00' >> value. The JSR310 implementation treats this value as a next day >> 00:00 time. The workaround already exists in JSR310 code for similar >> entries and this failure is resolved in similar way [2] as part of >> this update. >> For the second issue JDK-8051641 [3] was filled and >> 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one that >> fails with this tzdata. >> Other time zone related tests [4] passes without failures. >> >> Thank you, >> Aleksej >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8049343 >> [2] >> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java.patch >> [3] https://bugs.openjdk.java.net/browse/JDK-8051641 >> [4] TZ related test sets: test/sun/util/calendar >> test/java/util/Calendar test/sun/util/resources/TimeZone >> test/sun/util/calendar test/java/util/TimeZone test/java/time\ >> test/java/util/Formatter test/closed/java/util/Calendar >> test/closed/java/util/TimeZone > From david.holmes at oracle.com Thu Aug 21 10:22:28 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 21 Aug 2014 20:22:28 +1000 Subject: 8055393: Some tests added to the TEST.group to exclude execution on inappropriate compact profiles In-Reply-To: <53F46455.1010406@oracle.com> References: <15232f91-5969-456d-ba33-14df731197c7@default> <53F34B24.10301@oracle.com> <53F46455.1010406@oracle.com> Message-ID: <53F5C864.7070306@oracle.com> Hi Jane, On 20/08/2014 7:03 PM, Evgeniya Stepanova wrote: > Update review request with links: > > bug: https://bugs.openjdk.java.net/browse/JDK-8055393 > webrev:http://cr.openjdk.java.net/~avstepan/eistepan/8055393/webrev.00/ > To be able to evaluate this it would be useful to know what the dependencies are that force these tests into specific groups. I don't see why you have removed sun/misc/URLClassPath/ClassnameCharTest.java from needs_compact2 - but as far as I can see it should be in needs_jre because it accesses sun.applet.AppletClassLoader! Thanks, David > Thanks, > Jane > On 19.08.2014 17:03, Evgeniya Stepanova wrote: >> Re-added lost diff >> On 19.08.2014 16:58, Evgeniya Stepanova wrote: >>> Hi all, >>> >>> Could you please review fix for 8055393 >>> >>> Problem:Some tests are being executed and fail under profiles >>> Solution: >>> -test java/lang/ProcessBuilder/InheritIO/InheritIO.sh changed to use >>> COMPILEJAVA (set by jtreg harness) javac instead of TESTJAVA (which >>> is absent in profiles) >>> -java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java >>> and some of the java/util/logging/ tests use >>> java.lang.management.ManagementFactory class to get deadlocked >>> threads. Such tests are added to the needs_compact3 testgroup >>> -test java/lang/invoke/lambda/LambdaAsm.java check bytecode >>> generation and use javac classes. Added to needs_jdk testgroup >>> -test java/net/Authenticator/B4769350.java uses >>> com.sun.net.httpserver.HttpHandler class as base class for all >>> testcases. Added to the needs_compact2 testgroup >>> -Some of the javax/management/mxbean tests uses >>> java.beans.ConstructorProperties annotation. Such tests are added to >>> the needs_jre test group >>> -test sun/misc/URLClassPath/ClassnameCharTest.java included in both >>> needs_compact2 and needs_jre testgroups. Removed from needs_compact2 >>> testgroup since it fails on compacts2-3 >>> Testing: locally. Tests excluded as expected >>> >>> >>> In attachement diff against jdk8u-dev repo >> > From evgeniya.stepanova at oracle.com Thu Aug 21 10:35:45 2014 From: evgeniya.stepanova at oracle.com (Evgeniya Stepanova) Date: Thu, 21 Aug 2014 14:35:45 +0400 Subject: 8055393: Some tests added to the TEST.group to exclude execution on inappropriate compact profiles In-Reply-To: <53F5C864.7070306@oracle.com> References: <15232f91-5969-456d-ba33-14df731197c7@default> <53F34B24.10301@oracle.com> <53F46455.1010406@oracle.com> <53F5C864.7070306@oracle.com> Message-ID: <53F5CB81.5030701@oracle.com> Hi David! sun/misc/URLClassPath/ClassnameCharTest.java was in both needs_compact2 and needs_jre testgroups. I just removed it from needs_compact2 testgroup because I've noticed that for the cleanup reason. As for tests dependencies, it were described in the very first message (please see below). I'll be very grateful if you review them for checking. Thanks, Jane On 21.08.2014 14:22, David Holmes wrote: > Hi Jane, > > On 20/08/2014 7:03 PM, Evgeniya Stepanova wrote: >> Update review request with links: >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8055393 >> webrev:http://cr.openjdk.java.net/~avstepan/eistepan/8055393/webrev.00/ >> > > To be able to evaluate this it would be useful to know what the > dependencies are that force these tests into specific groups. > > I don't see why you have removed > sun/misc/URLClassPath/ClassnameCharTest.java from needs_compact2 - but > as far as I can see it should be in needs_jre because it accesses > sun.applet.AppletClassLoader! > > Thanks, > David > >> Thanks, >> Jane >> On 19.08.2014 17:03, Evgeniya Stepanova wrote: >>> Re-added lost diff >>> On 19.08.2014 16:58, Evgeniya Stepanova wrote: >>>> Hi all, >>>> >>>> Could you please review fix for 8055393 >>>> >>>> Problem:Some tests are being executed and fail under profiles >>>> Solution: >>>> -test java/lang/ProcessBuilder/InheritIO/InheritIO.sh changed to use >>>> COMPILEJAVA (set by jtreg harness) javac instead of TESTJAVA (which >>>> is absent in profiles) >>>> -java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java >>>> and some of the java/util/logging/ tests use >>>> java.lang.management.ManagementFactory class to get deadlocked >>>> threads. Such tests are added to the needs_compact3 testgroup >>>> -test java/lang/invoke/lambda/LambdaAsm.java check bytecode >>>> generation and use javac classes. Added to needs_jdk testgroup >>>> -test java/net/Authenticator/B4769350.java uses >>>> com.sun.net.httpserver.HttpHandler class as base class for all >>>> testcases. Added to the needs_compact2 testgroup >>>> -Some of the javax/management/mxbean tests uses >>>> java.beans.ConstructorProperties annotation. Such tests are added to >>>> the needs_jre test group >>>> -test sun/misc/URLClassPath/ClassnameCharTest.java included in both >>>> needs_compact2 and needs_jre testgroups. Removed from needs_compact2 >>>> testgroup since it fails on compacts2-3 >>>> Testing: locally. Tests excluded as expected >>>> >>>> >>>> In attachement diff against jdk8u-dev repo >>> >> -- /Evgeniya Stepanova/ From david.holmes at oracle.com Thu Aug 21 11:27:25 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 21 Aug 2014 21:27:25 +1000 Subject: 8055393: Some tests added to the TEST.group to exclude execution on inappropriate compact profiles In-Reply-To: <53F5CB81.5030701@oracle.com> References: <15232f91-5969-456d-ba33-14df731197c7@default> <53F34B24.10301@oracle.com> <53F46455.1010406@oracle.com> <53F5C864.7070306@oracle.com> <53F5CB81.5030701@oracle.com> Message-ID: <53F5D79D.4040601@oracle.com> On 21/08/2014 8:35 PM, Evgeniya Stepanova wrote: > Hi David! > > sun/misc/URLClassPath/ClassnameCharTest.java was in both needs_compact2 > and needs_jre testgroups. I just removed it from needs_compact2 > testgroup because I've noticed that for the cleanup reason. > As for tests dependencies, it were described in the very first message Sorry - my bad! Don't know how I didn't see all that info there. > (please see below). I'll be very grateful if you review them for checking. Reviewed. Thanks, David > > Thanks, > Jane > > On 21.08.2014 14:22, David Holmes wrote: >> Hi Jane, >> >> On 20/08/2014 7:03 PM, Evgeniya Stepanova wrote: >>> Update review request with links: >>> >>> bug: https://bugs.openjdk.java.net/browse/JDK-8055393 >>> webrev:http://cr.openjdk.java.net/~avstepan/eistepan/8055393/webrev.00/ >>> >> >> To be able to evaluate this it would be useful to know what the >> dependencies are that force these tests into specific groups. >> >> I don't see why you have removed >> sun/misc/URLClassPath/ClassnameCharTest.java from needs_compact2 - but >> as far as I can see it should be in needs_jre because it accesses >> sun.applet.AppletClassLoader! >> >> Thanks, >> David >> >>> Thanks, >>> Jane >>> On 19.08.2014 17:03, Evgeniya Stepanova wrote: >>>> Re-added lost diff >>>> On 19.08.2014 16:58, Evgeniya Stepanova wrote: >>>>> Hi all, >>>>> >>>>> Could you please review fix for 8055393 >>>>> >>>>> Problem:Some tests are being executed and fail under profiles >>>>> Solution: >>>>> -test java/lang/ProcessBuilder/InheritIO/InheritIO.sh changed to use >>>>> COMPILEJAVA (set by jtreg harness) javac instead of TESTJAVA (which >>>>> is absent in profiles) >>>>> -java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java >>>>> and some of the java/util/logging/ tests use >>>>> java.lang.management.ManagementFactory class to get deadlocked >>>>> threads. Such tests are added to the needs_compact3 testgroup >>>>> -test java/lang/invoke/lambda/LambdaAsm.java check bytecode >>>>> generation and use javac classes. Added to needs_jdk testgroup >>>>> -test java/net/Authenticator/B4769350.java uses >>>>> com.sun.net.httpserver.HttpHandler class as base class for all >>>>> testcases. Added to the needs_compact2 testgroup >>>>> -Some of the javax/management/mxbean tests uses >>>>> java.beans.ConstructorProperties annotation. Such tests are added to >>>>> the needs_jre test group >>>>> -test sun/misc/URLClassPath/ClassnameCharTest.java included in both >>>>> needs_compact2 and needs_jre testgroups. Removed from needs_compact2 >>>>> testgroup since it fails on compacts2-3 >>>>> Testing: locally. Tests excluded as expected >>>>> >>>>> >>>>> In attachement diff against jdk8u-dev repo >>>> >>> > > -- > /Evgeniya Stepanova/ From masayoshi.okutsu at oracle.com Thu Aug 21 11:51:08 2014 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Thu, 21 Aug 2014 20:51:08 +0900 Subject: RFR: 8049343: (tz) Support tzdata2014f In-Reply-To: <53F5A843.3000302@oracle.com> References: <53F4B7BD.8020705@oracle.com> <53F55A44.6010501@oracle.com> <53F5A843.3000302@oracle.com> Message-ID: <53F5DD2C.1010706@oracle.com> We used to make name changes in the root (base) bundle as part of time zone data maintenance and deter only translations. But if you want to handle name changes later, that would be fine. It's your call. Thanks, Masayoshi On 8/21/2014 5:05 PM, Aleksej Efimov wrote: > Masayoshi, > I agree that we should change the long names to match the new short > names introduced by tzdata. > But I suggest to log a different CR for such activity to handle long > name changes and their translations (this activity is slightly out of > tzdata update scope). Does it make sense? > > -Aleksej > > On 08/21/2014 06:32 AM, Masayoshi Okutsu wrote: >> I think the long names of the Australia time zones should be >> revisited to be consistent with the abbreviation changes. The new >> abbreviations follow the S[tandard] and D[aylight saving] convention >> rather than the S[tandard] and S[ummer time] one. The long names, >> such as "Eastern Summer Time (Queensland)", no longer make sense. >> >> On the other hand, you will need to access impact of the name >> changes, including abbreviations. Also, if you change the long names, >> their translations will need to be changed as well. >> >> Thanks, >> Masayoshi >> >> On 8/20/2014 11:59 PM, Aleksej Efimov wrote: >>> Hi, >>> >>> Please, review the tzdata2014f integration (with tzdata2014e related >>> changes included too) [1] fix to JDK9: >>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/ >>> >>> The tzdata2014f changes are extensive and relates mostly to timezone >>> short names changes + "Asia/Srednekolymsk" time zone were added. >>> Almost complete list of changes can be found in the JBS bug >>> description [1], plus some changes wasn't documented in tzdata >>> release notes - for such cases raw tzdata diff was used for the >>> names modifications. >>> >>> Two issues with JSR310 implementation were discovered during >>> integration process: >>> First issue is related to the internal representation of the '24:00' >>> value. The JSR310 implementation treats this value as a next day >>> 00:00 time. The workaround already exists in JSR310 code for similar >>> entries and this failure is resolved in similar way [2] as part of >>> this update. >>> For the second issue JDK-8051641 [3] was filled and >>> 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one >>> that fails with this tzdata. >>> Other time zone related tests [4] passes without failures. >>> >>> Thank you, >>> Aleksej >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8049343 >>> [2] >>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java.patch >>> [3] https://bugs.openjdk.java.net/browse/JDK-8051641 >>> [4] TZ related test sets: test/sun/util/calendar >>> test/java/util/Calendar test/sun/util/resources/TimeZone >>> test/sun/util/calendar test/java/util/TimeZone test/java/time\ >>> test/java/util/Formatter test/closed/java/util/Calendar >>> test/closed/java/util/TimeZone >> > From weijun.wang at oracle.com Thu Aug 21 12:53:54 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Thu, 21 Aug 2014 20:53:54 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> Message-ID: I filed a bug at https://bugs.openjdk.java.net/browse/JDK-8038277 Webrev in 3 parts at http://cr.openjdk.java.net/~weijun/8038277/client/webrev.00 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 wrote: > Thank you Wang. > Actually I haven't neither webrev and bug id. > I believe is better split in client and server code. > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_8.zip > > > On Tue, Aug 19, 2014 at 10:55 PM, Wang Weijun wrote: > Hi Ot?vio > > I see TABs in the first page of sun_security.diff, too long line in javax_security.diff. > > Also, it's unfortunate that you will need to rename the file names to the new style with modules. See http://cr.openjdk.java.net/~chegar/docs/portingScript.html for how to do this. > > I can create webrev page(s) for you on cr.openjdk.java.net. Please tell me if you want a big one or one for each diff. > > I see no bug id. If none, I can create one for you. > > Thanks > Max > > On Aug 20, 2014, at 9:05, Ot?vio Gon?alves de Santana wrote: > > > Thank you Sergey. > > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_7.zip > > > > > > On Tue, Aug 19, 2014 at 12:32 PM, Sergey Bylokhov < > > Sergey.Bylokhov at oracle.com> wrote: > > > >> Hi Ot?vio, > >> The new alignment in DataLine.java/JColorChooser.java looks strange. > >> Wrong change in BasicTableUI.java: > >> - plainStr.deleteCharAt(plainStr.length() - > >> 1).append("\n"); > >> + plainStr.deleteCharAt(plainStr.length() - > >> 1).append('\t'); > >> > >> > >> On 13.08.2014 3:01, Ot?vio Gon?alves de Santana wrote: > >> > >>> Thank you Roger. > >>> Done > >>> https://dl.dropboxusercontent.com/u/16109193/open_jdk/ > >>> string_builder_concat_6.zip > >>> > >>> > >>> On Tue, Aug 12, 2014 at 10:15 AM, roger riggs > >>> wrote: > >>> > >>> fyi, > >>>> > >>>> There's a Perl script normalizer.pl that detects/fixes most of the > >>>> simple > >>>> tab/white space issues. > >>>> The script is in the /make/scripts/normalizer.pl > >>>> > >>>> Roger > >>>> > >>>> > >>>> On 8/12/2014 3:48 AM, Andrej Golovnin wrote: > >>>> > >>>> Hi Ot?vio, > >>>>> > >>>>> I think you should fix the indentation in a lot of classes. You use the > >>>>> tab-character for the indentation. As far as I know we should use the > >>>>> space > >>>>> character for the indentation in the JDK sources (Oracle devs feel free > >>>>> to > >>>>> correct me if I'm wrong. And it would be really nice if the style guide > >>>>> for > >>>>> the source code would be a part of the JDK repository. So we don't need > >>>>> to > >>>>> search for it on the internet/wiki. Just clone the repository, read the > >>>>> style guide and follow it. :-) ). Here is the not complete list of > >>>>> classes > >>>>> where you used the tab-character for the indentation: > >>>>> > >>>>> src/share/classes/com/sun/crypto/provider/OAEPParameters.java > >>>>> src/share/classes/java/lang/management/MemoryUsage.java > >>>>> src/share/classes/java/security/KeyStore.java > >>>>> src/share/classes/java/security/PermissionCollection.java > >>>>> src/share/classes/java/security/ProtectionDomain.java > >>>>> src/share/classes/java/security/cert/CertPath.java > >>>>> src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java > >>>>> src/share/classes/java/security/cert/PKIXParameters.java > >>>>> src/share/classes/java/security/cert/PolicyQualifierInfo.java > >>>>> src/share/classes/java/security/cert/TrustAnchor.java > >>>>> src/share/classes/java/security/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); } > >>>>> > >>>>> Best regards, > >>>>> Andrej Golovnin > >>>>> > >>>>> > >>>> > >>> > >> > >> -- > >> Best regards, Sergey. > >> > >> > > > > > > -- > > Ot?vio Gon?alves de Santana > > > > blog: http://otaviosantana.blogspot.com.br/ > > twitter: http://twitter.com/otaviojava > > site: *http://about.me/otaviojava * > > 55 (11) 98255-3513 > > > > > > > -- > Ot?vio Gon?alves de Santana > > blog: http://otaviosantana.blogspot.com.br/ > twitter: http://twitter.com/otaviojava > site: http://about.me/otaviojava > 55 (11) 98255-3513 > From andrej.golovnin at gmail.com Thu Aug 21 13:18:19 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Thu, 21 Aug 2014 15:18:19 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> Message-ID: > > https://bugs.openjdk.java.net/browse/JDK-8038277 This is not the right bug report. The subject of this bug report is "Improve the bootstrap performance of carets keystore". > > http://cr.openjdk.java.net/~weijun/8038277/client/webrev.00 TABs are still used for 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 Aug 21, 2014, at 10:32, Ot?vio Gon?alves de Santana < > otaviojava at java.net> wrote: > > > Thank you Wang. > > Actually I haven't neither webrev and bug id. > > I believe is better split in client and server code. > > > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_8.zip > > > > > > On Tue, Aug 19, 2014 at 10:55 PM, Wang Weijun > wrote: > > Hi Ot?vio > > > > I see TABs in the first page of sun_security.diff, too long line in > javax_security.diff. > > > > Also, it's unfortunate that you will need to rename the file names to > the new style with modules. See > http://cr.openjdk.java.net/~chegar/docs/portingScript.html for how to do > this. > > > > I can create webrev page(s) for you on cr.openjdk.java.net. Please tell > me if you want a big one or one for each diff. > > > > I see no bug id. If none, I can create one for you. > > > > Thanks > > Max > > > > On Aug 20, 2014, at 9:05, Ot?vio Gon?alves de Santana < > otaviojava at java.net> wrote: > > > > > Thank you Sergey. > > > > https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_builder_concat_7.zip > > > > > > > > > On Tue, Aug 19, 2014 at 12:32 PM, Sergey Bylokhov < > > > Sergey.Bylokhov at oracle.com> wrote: > > > > > >> Hi Ot?vio, > > >> The new alignment in DataLine.java/JColorChooser.java looks strange. > > >> Wrong change in BasicTableUI.java: > > >> - plainStr.deleteCharAt(plainStr.length() - > > >> 1).append("\n"); > > >> + plainStr.deleteCharAt(plainStr.length() - > > >> 1).append('\t'); > > >> > > >> > > >> On 13.08.2014 3:01, Ot?vio Gon?alves de Santana wrote: > > >> > > >>> Thank you Roger. > > >>> Done > > >>> https://dl.dropboxusercontent.com/u/16109193/open_jdk/ > > >>> string_builder_concat_6.zip > > >>> > > >>> > > >>> On Tue, Aug 12, 2014 at 10:15 AM, roger riggs < > roger.riggs at oracle.com> > > >>> wrote: > > >>> > > >>> fyi, > > >>>> > > >>>> There's a Perl script normalizer.pl that detects/fixes most of the > > >>>> simple > > >>>> tab/white space issues. > > >>>> The script is in the /make/scripts/normalizer.pl > > >>>> > > >>>> Roger > > >>>> > > >>>> > > >>>> On 8/12/2014 3:48 AM, Andrej Golovnin wrote: > > >>>> > > >>>> Hi Ot?vio, > > >>>>> > > >>>>> I think you should fix the indentation in a lot of classes. You > use the > > >>>>> tab-character for the indentation. As far as I know we should use > the > > >>>>> space > > >>>>> character for the indentation in the JDK sources (Oracle devs feel > free > > >>>>> to > > >>>>> correct me if I'm wrong. And it would be really nice if the style > guide > > >>>>> for > > >>>>> the source code would be a part of the JDK repository. So we don't > need > > >>>>> to > > >>>>> search for it on the internet/wiki. Just clone the repository, > read the > > >>>>> style guide and follow it. :-) ). Here is the not complete list of > > >>>>> classes > > >>>>> where you used the tab-character for the indentation: > > >>>>> > > >>>>> src/share/classes/com/sun/crypto/provider/OAEPParameters.java > > >>>>> src/share/classes/java/lang/management/MemoryUsage.java > > >>>>> src/share/classes/java/security/KeyStore.java > > >>>>> src/share/classes/java/security/PermissionCollection.java > > >>>>> src/share/classes/java/security/ProtectionDomain.java > > >>>>> src/share/classes/java/security/cert/CertPath.java > > >>>>> src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java > > >>>>> src/share/classes/java/security/cert/PKIXParameters.java > > >>>>> src/share/classes/java/security/cert/PolicyQualifierInfo.java > > >>>>> src/share/classes/java/security/cert/TrustAnchor.java > > >>>>> src/share/classes/java/security/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); } > > >>>>> > > >>>>> Best regards, > > >>>>> Andrej Golovnin > > >>>>> > > >>>>> > > >>>> > > >>> > > >> > > >> -- > > >> Best regards, Sergey. > > >> > > >> > > > > > > > > > -- > > > Ot?vio Gon?alves de Santana > > > > > > blog: http://otaviosantana.blogspot.com.br/ > > > twitter: http://twitter.com/otaviojava > > > site: *http://about.me/otaviojava * > > > 55 (11) 98255-3513 > > > > > > > > > > > > > > -- > > Ot?vio Gon?alves de Santana > > > > blog: http://otaviosantana.blogspot.com.br/ > > twitter: http://twitter.com/otaviojava > > site: http://about.me/otaviojava > > 55 (11) 98255-3513 > > > > From martin.desruisseaux at geomatys.fr Thu Aug 21 13:26:09 2014 From: martin.desruisseaux at geomatys.fr (Martin Desruisseaux) Date: Thu, 21 Aug 2014 15:26:09 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> Message-ID: <53F5F371.7070401@geomatys.fr> I had a random look at the Webrev for TreeModelEvent.java and saw the following new code: sb.append(Integer.toString(childIndices[counter])) Wouldn't the following be slightly more efficient? sb.append(childIndices[counter]) since Integer.toString(int) creates a temporary char[] array later copied in the StringBuilder, while StringBuilder.append(int) writes directly in the buffer internal array. Martin Le 21/08/14 14:53, Wang Weijun a ?crit : > I filed a bug at > > https://bugs.openjdk.java.net/browse/JDK-8038277 > > Webrev in 3 parts at > > http://cr.openjdk.java.net/~weijun/8038277/client/webrev.00 > http://cr.openjdk.java.net/~weijun/8038277/core/webrev.00/ > http://cr.openjdk.java.net/~weijun/8038277/extra/webrev.00/ > > --Max From andrej.golovnin at gmail.com Thu Aug 21 13:37:54 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Thu, 21 Aug 2014 15:37:54 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53F5F371.7070401@geomatys.fr> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <53F5F371.7070401@geomatys.fr> Message-ID: 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.desruisseaux at geomatys.fr> wrote: > I had a random look at the Webrev for TreeModelEvent.java and saw the > following new code: > > sb.append(Integer.toString(childIndices[counter])) > > Wouldn't the following be slightly more efficient? > > sb.append(childIndices[counter]) > > since Integer.toString(int) creates a temporary char[] array later > copied in the StringBuilder, while StringBuilder.append(int) writes > directly in the buffer internal array. > > > Martin > > > > Le 21/08/14 14:53, Wang Weijun a ?crit : > > I filed a bug at > > > > https://bugs.openjdk.java.net/browse/JDK-8038277 > > > > Webrev in 3 parts at > > > > http://cr.openjdk.java.net/~weijun/8038277/client/webrev.00 > > http://cr.openjdk.java.net/~weijun/8038277/core/webrev.00/ > > http://cr.openjdk.java.net/~weijun/8038277/extra/webrev.00/ > > > > --Max > > From weijun.wang at oracle.com Thu Aug 21 14:13:59 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Thu, 21 Aug 2014 22:13:59 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> Message-ID: <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> On Aug 21, 2014, at 21:18, Andrej Golovnin wrote: > https://bugs.openjdk.java.net/browse/JDK-8038277 > > This is not the right bug report. The subject of this bug report is "Improve the bootstrap performance of carets keystore". Oh, my mistake, it should be https://bugs.openjdk.java.net/browse/JDK-8055723. Will update it in the next round of webrev. > > > http://cr.openjdk.java.net/~weijun/8038277/client/webrev.00 > > TABs are still used for indentation. I looked only at src/java.desktop/share/classes/javax/swing/RepaintManager.java. My mistake again. In order to create 3 changesets for a single bug id, I turned off jcheck. These files includes TABs: client: Warning: src/java.desktop/share/classes/javax/swing/GroupLayout.java:1242: Tab character Warning: src/java.desktop/share/classes/javax/swing/MultiUIDefaults.java:193: Tab character Warning: src/java.desktop/share/classes/javax/swing/RepaintManager.java:993: Tab character core: Warning: src/java.base/share/classes/java/security/ProtectionDomain.java:288: Tab character Warning: src/java.base/share/classes/sun/launcher/LauncherHelper.java:372: Tab character Warning: src/java.base/share/classes/sun/net/www/HeaderParser.java:224: Tab character Warning: src/java.base/share/classes/sun/security/provider/PolicyFile.java:1488: Tab character Warning: src/java.base/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java:115: Tab character extra: Warning: src/java.management/share/classes/java/lang/management/ThreadInfo.java:582: Tab character Warning: src/jdk.dev/share/classes/sun/security/tools/jarsigner/Main.java:707: Tab character Warning: src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java:99: Tab character Warning: src/jdk.naming.dns/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java:494: Tab character Thanks Max From amy.lu at oracle.com Thu Aug 21 14:38:04 2014 From: amy.lu at oracle.com (Amy Lu) Date: Thu, 21 Aug 2014 22:38:04 +0800 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F551DA.3070400@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> <53F35623.4020709@oracle.com> <53F38E8C.9080306@oracle.com> <53F4A21F.60908@oracle.com> <53F54346.9020306@oracle.com> <53F54DC2.6060006@oracle.com> <53F551DA.3070400@oracle.com> Message-ID: <53F6044C.7010707@oracle.com> On 8/21/14, 9:56 AM, Mandy Chung wrote: > > On 8/20/2014 6:39 PM, Amy Lu wrote: >> On 8/21/14, 8:54 AM, Mandy Chung wrote: >>> >>> On 8/20/2014 6:26 AM, Amy Lu wrote: >>>> Patch updated: >>>> http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.02/ >>> >>> test/java/lang/Double/ParseHexFloatingPoint.java >> No dependency on the new DoubleConsts. >> Previous dependency on sun.misc.DoubleConsts have been replaced with >> java.lang.Double >> >>> test/java/lang/Double/ToHexString.java >> This one has dependency on the new DoubleConsts. >> >> 28: * @library ../Math >> 29: * @build DoubleConsts >> 85: DoubleConsts.EXP_BIAS; >> > > Ah. I missed that. > > Looks good. > Mandy Thank you for reviewing! May I get your help for push the change? Thanks, Amy > >> Thanks, >> Amy >>> - they don't depend on DoubleConsts, do they? >>> >>> Otherwise, looks good. >>> >>> Mandy >>> >>> >> > From weijun.wang at oracle.com Thu Aug 21 15:04:28 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Thu, 21 Aug 2014 23:04:28 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> Message-ID: <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> I also see a lot of .toString() and String.valueOf() calls. $ cat string_concat_updated.patch | perl -ne 'print if /^\+ .*append.*(String\.valueOf|\.toString\(\))/' | wc 62 210 4626 Wrapped lines not indented correctly in src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java src/java.base/share/classes/com/sun/crypto/provider/DHParameters.java src/java.base/share/classes/com/sun/crypto/provider/DHPublicKey.java src/java.base/share/classes/com/sun/crypto/provider/GCMParameters.java --Max From lance.andersen at oracle.com Thu Aug 21 18:48:28 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Thu, 21 Aug 2014 14:48:28 -0400 Subject: RFR: 8055776, Add tests to exercise SQLPermissions for DriverManager & SyncFactory Message-ID: <5D837606-7440-4F0E-9731-79C1EC976333@oracle.com> Hi all, This is a request for review for This adds tests which exercise SQLPermissions for DriverManager and SyncFactory. The webrev can be found at http://cr.openjdk.java.net/~lancea/8055776/webrev.00/ Best, Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From lance.andersen at oracle.com Thu Aug 21 19:06:49 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Thu, 21 Aug 2014 15:06:49 -0400 Subject: RFR(S): 8055055: Improve numeric parsing in java.sql In-Reply-To: <53EBBFA9.6020307@oracle.com> References: <53EB970D.80801@oracle.com> <4B9A9590-7EA4-45B3-B9DB-8C0EECFC4664@oracle.com> <53EBBFA9.6020307@oracle.com> Message-ID: <41C11643-EB9A-4EC4-BB79-2C847DC73C28@oracle.com> I think this is OK. However, I want to write some additional tests to reduce the chance of regression and add this as part of the putback I am going to be out of the office for a few days so doubt I will get to this for another week or so Best, Lance On Aug 13, 2014, at 3:42 PM, Claes Redestad wrote: > Thanks, Lance! > > I only ran the jtreg tests under jdk/test/java/sql locally for this (29 passed). > > /Claes > > On 2014-08-13 20:14, Lance Andersen wrote: >> I will take a look this week. Did you run the unit tests to make sure they still pass? >> >> >> On Aug 13, 2014, at 12:49 PM, Claes Redestad > wrote: >> >>> Hi, >>> >>> can I have a review of this small patch which improves performance of java.sql.Time::valueOf (~1.3x) and java.sql.Timestamp::valueOf (~1.9x). >>> >>> Uses Integer.parseInt with offset to make intermediary substrings unnecessary and improves the nanosecond fraction calculation to not use String concatenation. >>> >>> bug: https://bugs.openjdk.java.net/browse/JDK-8055055 >>> webrev: http://cr.openjdk.java.net/~redestad/8055055/webrev.0/ >>> >>> Thanks! >>> >>> /Claes >> >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> >> >> > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From weijun.wang at oracle.com Fri Aug 22 08:09:53 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Fri, 22 Aug 2014 16:09:53 +0800 Subject: Trusted service? In-Reply-To: <20140813083119.502977@eggemoggin.niobe.net> References: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com>, <53EB743E.8050809@oracle.com> <20140813083119.502977@eggemoggin.niobe.net> Message-ID: <9F4CFCFE-258E-416E-95CB-74F974D7300F@oracle.com> On Aug 13, 2014, at 23:31, mark.reinhold at oracle.com wrote: > 2014/8/13 7:20 -0700, alan.bateman at oracle.com: >> The usual thing is to just have a default implementation that is used >> when ServiceLoader doesn't locate a useful provider. You'll find many >> examples of this in the JDK. In those cases then the default is not >> listed in a services configuration file. From what you describe then >> this may be what you want too. >> >> ServiceLoader does not have a way to configure a preferred provider so >> this is one reason why you'll see places where a system property can be >> used to configured the preferred implementation. > > Another alternative is to use the ServiceLoader::loadInstalled method, > which will ignore providers on the application class path. Great, this works for me. But why does it need to be called in a doPrivileged() block? Isn't it only about JDK-internal classes/resources? Thanks Max > > - Mark From aleksej.efimov at oracle.com Fri Aug 22 12:17:28 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Fri, 22 Aug 2014 16:17:28 +0400 Subject: RFR: 8049343: (tz) Support tzdata2014f In-Reply-To: <53F5DD2C.1010706@oracle.com> References: <53F4B7BD.8020705@oracle.com> <53F55A44.6010501@oracle.com> <53F5A843.3000302@oracle.com> <53F5DD2C.1010706@oracle.com> Message-ID: <53F734D8.1000801@oracle.com> Masayoshi, You're right that the "root names" should be changed as part of this update. The names were changed according to Australian official document here: http://australia.gov.au/about-australia/our-country/time The fixed version of the webrev can be found here: http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.02 Thanks, Aleksej On 08/21/2014 03:51 PM, Masayoshi Okutsu wrote: > We used to make name changes in the root (base) bundle as part of time > zone data maintenance and deter only translations. But if you want to > handle name changes later, that would be fine. It's your call. > > Thanks, > Masayoshi > > On 8/21/2014 5:05 PM, Aleksej Efimov wrote: >> Masayoshi, >> I agree that we should change the long names to match the new short >> names introduced by tzdata. >> But I suggest to log a different CR for such activity to handle long >> name changes and their translations (this activity is slightly out of >> tzdata update scope). Does it make sense? >> >> -Aleksej >> >> On 08/21/2014 06:32 AM, Masayoshi Okutsu wrote: >>> I think the long names of the Australia time zones should be >>> revisited to be consistent with the abbreviation changes. The new >>> abbreviations follow the S[tandard] and D[aylight saving] convention >>> rather than the S[tandard] and S[ummer time] one. The long names, >>> such as "Eastern Summer Time (Queensland)", no longer make sense. >>> >>> On the other hand, you will need to access impact of the name >>> changes, including abbreviations. Also, if you change the long >>> names, their translations will need to be changed as well. >>> >>> Thanks, >>> Masayoshi >>> >>> On 8/20/2014 11:59 PM, Aleksej Efimov wrote: >>>> Hi, >>>> >>>> Please, review the tzdata2014f integration (with tzdata2014e >>>> related changes included too) [1] fix to JDK9: >>>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/ >>>> >>>> The tzdata2014f changes are extensive and relates mostly to >>>> timezone short names changes + "Asia/Srednekolymsk" time zone were >>>> added. >>>> Almost complete list of changes can be found in the JBS bug >>>> description [1], plus some changes wasn't documented in tzdata >>>> release notes - for such cases raw tzdata diff was used for the >>>> names modifications. >>>> >>>> Two issues with JSR310 implementation were discovered during >>>> integration process: >>>> First issue is related to the internal representation of the >>>> '24:00' value. The JSR310 implementation treats this value as a >>>> next day 00:00 time. The workaround already exists in JSR310 code >>>> for similar entries and this failure is resolved in similar way [2] >>>> as part of this update. >>>> For the second issue JDK-8051641 [3] was filled and >>>> 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one >>>> that fails with this tzdata. >>>> Other time zone related tests [4] passes without failures. >>>> >>>> Thank you, >>>> Aleksej >>>> >>>> [1] https://bugs.openjdk.java.net/browse/JDK-8049343 >>>> [2] >>>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java.patch >>>> [3] https://bugs.openjdk.java.net/browse/JDK-8051641 >>>> [4] TZ related test sets: test/sun/util/calendar >>>> test/java/util/Calendar test/sun/util/resources/TimeZone >>>> test/sun/util/calendar test/java/util/TimeZone test/java/time\ >>>> test/java/util/Formatter test/closed/java/util/Calendar >>>> test/closed/java/util/TimeZone >>> >> > From joe.darcy at oracle.com Fri Aug 22 21:54:58 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 22 Aug 2014 14:54:58 -0700 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F6044C.7010707@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> <53F35623.4020709@oracle.com> <53F38E8C.9080306@oracle.com> <53F4A21F.60908@oracle.com> <53F54346.9020306@oracle.com> <53F54DC2.6060006@oracle.com> <53F551DA.3070400@oracle.com> <53F6044C.7010707@oracle.com> Message-ID: <53F7BC32.7030509@oracle.com> Hello, Catching up on email; the .02 version looks good. Thanks, -Joe On 08/21/2014 07:38 AM, Amy Lu wrote: > On 8/21/14, 9:56 AM, Mandy Chung wrote: >> >> On 8/20/2014 6:39 PM, Amy Lu wrote: >>> On 8/21/14, 8:54 AM, Mandy Chung wrote: >>>> >>>> On 8/20/2014 6:26 AM, Amy Lu wrote: >>>>> Patch updated: >>>>> http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.02/ >>>> >>>> test/java/lang/Double/ParseHexFloatingPoint.java >>> No dependency on the new DoubleConsts. >>> Previous dependency on sun.misc.DoubleConsts have been replaced with >>> java.lang.Double >>> >>>> test/java/lang/Double/ToHexString.java >>> This one has dependency on the new DoubleConsts. >>> >>> 28: * @library ../Math >>> 29: * @build DoubleConsts >>> 85: DoubleConsts.EXP_BIAS; >>> >> >> Ah. I missed that. >> >> Looks good. >> Mandy > Thank you for reviewing! > > May I get your help for push the change? > > Thanks, > Amy >> >>> Thanks, >>> Amy >>>> - they don't depend on DoubleConsts, do they? >>>> >>>> Otherwise, looks good. >>>> >>>> Mandy >>>> >>>> >>> >> > From mandy.chung at oracle.com Fri Aug 22 22:29:36 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 22 Aug 2014 15:29:36 -0700 Subject: RFR 8042003: java/lang/Math tests have external dependency on sun.misc.DoubleConsts and sun.misc.FloatConsts In-Reply-To: <53F7BC32.7030509@oracle.com> References: <53F1AFF0.5000206@oracle.com> <53F24F84.70303@oracle.com> <53F35623.4020709@oracle.com> <53F38E8C.9080306@oracle.com> <53F4A21F.60908@oracle.com> <53F54346.9020306@oracle.com> <53F54DC2.6060006@oracle.com> <53F551DA.3070400@oracle.com> <53F6044C.7010707@oracle.com> <53F7BC32.7030509@oracle.com> Message-ID: <53F7C450.3040803@oracle.com> Amy, I have pushed your patch. Mandy On 8/22/14 2:54 PM, Joe Darcy wrote: > Hello, > > Catching up on email; the .02 version looks good. > > Thanks, > > -Joe > > On 08/21/2014 07:38 AM, Amy Lu wrote: >> On 8/21/14, 9:56 AM, Mandy Chung wrote: >>> >>> On 8/20/2014 6:39 PM, Amy Lu wrote: >>>> On 8/21/14, 8:54 AM, Mandy Chung wrote: >>>>> >>>>> On 8/20/2014 6:26 AM, Amy Lu wrote: >>>>>> Patch updated: >>>>>> http://cr.openjdk.java.net/~ewang/amylu/JDK-8042003/webrev.02/ >>>>> >>>>> test/java/lang/Double/ParseHexFloatingPoint.java >>>> No dependency on the new DoubleConsts. >>>> Previous dependency on sun.misc.DoubleConsts have been replaced >>>> with java.lang.Double >>>> >>>>> test/java/lang/Double/ToHexString.java >>>> This one has dependency on the new DoubleConsts. >>>> >>>> 28: * @library ../Math >>>> 29: * @build DoubleConsts >>>> 85: DoubleConsts.EXP_BIAS; >>>> >>> >>> Ah. I missed that. >>> >>> Looks good. >>> Mandy >> Thank you for reviewing! >> >> May I get your help for push the change? >> >> Thanks, >> Amy >>> >>>> Thanks, >>>> Amy >>>>> - they don't depend on DoubleConsts, do they? >>>>> >>>>> Otherwise, looks good. >>>>> >>>>> Mandy >>>>> >>>>> >>>> >>> >> > From weijun.wang at oracle.com Mon Aug 25 02:03:19 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Mon, 25 Aug 2014 10:03:19 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> Message-ID: <67921D59-5230-49F1-B526-5A39B75FF27F@oracle.com> New webrevs updated http://cr.openjdk.java.net/~weijun/8055723/core/webrev.00/ Includes modules java.base and security-related modules and the jarsigner tool http://cr.openjdk.java.net/~weijun/8055723/client/webrev.00 Includes the java.desktop module http://cr.openjdk.java.net/~weijun/8055723/extra/webrev.00 Includes java.corba, java.management, java.naming, java.rmi, jdk.dev, jdk.jcmd, jdk.jconsole, jdk.jdi, jdk.jvmstat, /jdk.naming.dns, jdk.runtime, jdk.snmp, and a jpda demo file Thanks Max From Alan.Bateman at oracle.com Mon Aug 25 07:02:36 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 25 Aug 2014 08:02:36 +0100 Subject: JDK 9 RFR of 8054720: Modifications of I/O methods for instrumentation purposes In-Reply-To: <78EC3D5B-FB0F-48C8-9F06-2AFE3CFF906E@oracle.com> References: <78EC3D5B-FB0F-48C8-9F06-2AFE3CFF906E@oracle.com> Message-ID: <53FADF8C.3060703@oracle.com> On 20/08/2014 16:08, Brian Burkhalter wrote: > JDK 9 reviewers: > > I would like to reprise this thread > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-August/028181.html > > with an updated patch > > Issue: https://bugs.openjdk.java.net/browse/JDK-8054720 > Patch: http://cr.openjdk.java.net/~bpb/8054720/webrev.01/ > This changes builds on all platforms and passes the jdk_io and jdk_net tests on all platforms. > Note that the patch posted in the original discussion thread has been moved to > > http://cr.openjdk.java.net/~bpb/8054720/webrev.00/ > Thanks for dropping SSLSocketImpl, it looks much better now. The new comments "wrap native call to allow instrumentation" seem to be added in really odd place, can't you just use @implNote? -Alan. From Alan.Bateman at oracle.com Mon Aug 25 07:07:50 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 25 Aug 2014 08:07:50 +0100 Subject: Trusted service? In-Reply-To: <9F4CFCFE-258E-416E-95CB-74F974D7300F@oracle.com> References: <634B9F42-25A5-43DD-8DE7-068DB74F338A@oracle.com>, <53EB743E.8050809@oracle.com> <20140813083119.502977@eggemoggin.niobe.net> <9F4CFCFE-258E-416E-95CB-74F974D7300F@oracle.com> Message-ID: <53FAE0C6.7050802@oracle.com> On 22/08/2014 09:09, Wang Weijun wrote: > : > > Great, this works for me. > > But why does it need to be called in a doPrivileged() block? Isn't it only about JDK-internal classes/resources? > > It's a public API so it can be used by anyone. The question about privileges and limiting them is a good question. Part of the issue is that still have scanning of the extension and boot class paths, the other is that some service providers require a permission to instantiate or else do something in their initialization that requires permissions. -Alan From Alan.Bateman at oracle.com Mon Aug 25 08:25:34 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 25 Aug 2014 09:25:34 +0100 Subject: RFR(S): 8055032: Improve numerical parsing in java.net and sun.net In-Reply-To: <0E6D5E4D-0A47-4E39-A9B5-5F664093AF66@oracle.com> References: <53EB6FF5.1050103@oracle.com> <53EC6752.6000601@oracle.com> <53EC822E.6000602@oracle.com> <53EC9DE7.3070007@oracle.com> <53ECA0BC.4070206@oracle.com> <53ECA4DE.5040300@oracle.com> <53ECB662.9030501@oracle.com> <53ECB838.3070201@oracle.com> <53ECBC0F.7060604@oracle.com> <0E6D5E4D-0A47-4E39-A9B5-5F664093AF66@oracle.com> Message-ID: <53FAF2FE.7010903@oracle.com> On 18/08/2014 22:12, Mike Duigou wrote: > On Aug 14 2014, at 06:39 , Alan Bateman wrote: > >> On 14/08/2014 14:23, Claes Redestad wrote: >>> How about methods only taking beginIndex? Integer.parseInt("x: 10000000", 3, 10)? I guess these could to be dropped >>> to avoid ambiguity and instead allow for variations where radix can be left out. >>> >>> I think there are two alternatives to the current implementation: >>> - only keep parseInt(CharSequence s, int beginIndex, int endIndex, int radix) >> That's my preference > Looking at the examples I agree that providing only this one method is probably the least error prone option. > I think we mostly got agreement on net-dev to re-examine the newly introduced methods. I've created JDK-8055032 to track it and I'm sure Claes will pick it up once he gets back. -Alan. From Alan.Bateman at oracle.com Mon Aug 25 15:19:24 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 25 Aug 2014 16:19:24 +0100 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <67921D59-5230-49F1-B526-5A39B75FF27F@oracle.com> References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <67921D59-5230-49F1-B526-5A39B75FF27F@orac! le.com> Message-ID: <53FB53FC.5040605@oracle.com> On 25/08/2014 03:03, Wang Weijun wrote: > New webrevs updated > > http://cr.openjdk.java.net/~weijun/8055723/core/webrev.00/ > > Includes modules java.base and security-related modules and the jarsigner tool > > http://cr.openjdk.java.net/~weijun/8055723/client/webrev.00 > > Includes the java.desktop module > > http://cr.openjdk.java.net/~weijun/8055723/extra/webrev.00 Thanks for donning the sponsor hat, it's always a pain to have deal with changes that require splitting between jdk9/dev and jdk9/client. Hopefully in time that this business can be re-visited so that changes to client libraries can be pushed to jdk9/dev. For the webrev then I assume there isn't any need to split core and what you call "extra" as they will all go into jdk9/dev. I saw a few comments on tabs and maybe this is what I see but some of the indentation looks a bit odd and inconsistent in a number of places. It seems to be mostly places where method invocation chaining is used and the statement goes into a second or third line. In a few places then the .append is aligned with the start of sb.append (see DHParameters and GSMParameters for example), in other places then the second/more lines are pushed in by 8. You can probably drop src/demo/share/jpda/com/sun/tools/example/debug/gui/ContextManager.java from the list as there is a patch in review on serviceability-dev that will get this of this obsolete demo. -Alan. From martinrb at google.com Mon Aug 25 17:37:59 2014 From: martinrb at google.com (Martin Buchholz) Date: Mon, 25 Aug 2014 10:37:59 -0700 Subject: RFR: 8055949: ByteArrayOutputStream capacity should be maximal array size permitted by VM Message-ID: Hi friends of ByteArrayOutputStream, I'm trying to clean up an apparent oversight when I tried to fix huge array resizing back in 6933217: Huge arrays handled poorly in core libraries https://bugs.openjdk.java.net/browse/JDK-8055949 http://cr.openjdk.java.net/~martin/webrevs/openjdk9/ByteArrayOutputStream-MAX_ARRAY_SIZE/ The 2x capacity gap was noticed by real users! From Alan.Bateman at oracle.com Mon Aug 25 20:28:28 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 25 Aug 2014 21:28:28 +0100 Subject: RFR: 8055949: ByteArrayOutputStream capacity should be maximal array size permitted by VM In-Reply-To: References: Message-ID: <53FB9C6C.20706@oracle.com> On 25/08/2014 18:37, Martin Buchholz wrote: > Hi friends of ByteArrayOutputStream, > > I'm trying to clean up an apparent oversight when I tried to fix huge > array resizing back in > 6933217: Huge arrays handled poorly in core libraries > > https://bugs.openjdk.java.net/browse/JDK-8055949 > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/ByteArrayOutputStream-MAX_ARRAY_SIZE/ > > > The 2x capacity gap was noticed by real users! The change to BAOS looks okay, I don't recall why it wasn't updated with the previous changes. I'm not sure about adding a test with @ignore though, maybe the @test should just be dropped to avoid the temptation to "fix" the test before there is support for selecting tests based on the resources available. -Alan From martinrb at google.com Mon Aug 25 20:45:18 2014 From: martinrb at google.com (Martin Buchholz) Date: Mon, 25 Aug 2014 13:45:18 -0700 Subject: RFR: 8055949: ByteArrayOutputStream capacity should be maximal array size permitted by VM In-Reply-To: <53FB9C6C.20706@oracle.com> References: <53FB9C6C.20706@oracle.com> Message-ID: Thanks, Alan. On Mon, Aug 25, 2014 at 1:28 PM, Alan Bateman wrote: > On 25/08/2014 18:37, Martin Buchholz wrote: > > Hi friends of ByteArrayOutputStream, > > I'm trying to clean up an apparent oversight when I tried to fix huge > array resizing back in > 6933217: Huge arrays handled poorly in core libraries > > https://bugs.openjdk.java.net/browse/JDK-8055949 > > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/ByteArrayOutputStream-MAX_ARRAY_SIZE/ > > The 2x capacity gap was noticed by real users! > > The change to BAOS looks okay, I don't recall why it wasn't updated with > the previous changes. > > I'm not sure about adding a test with @ignore though, maybe the @test > should just be dropped to avoid the temptation to "fix" the test before > there is support for selecting tests based on the resources available. > > jtreg tests are run by default with -ignore:quiet and there is precedent for other tests with such @ignore statements, and I actually used jtreg -ignore:run to really test this. What I would really like someday is to be able to run expensive tests (like this one) only if a user expressly requested them. Anyways, I'm intending to submit as is unless you feel strongly. From mike.duigou at oracle.com Mon Aug 25 20:54:32 2014 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 25 Aug 2014 13:54:32 -0700 Subject: RFR: 8055949: ByteArrayOutputStream capacity should be maximal array size permitted by VM In-Reply-To: <53FB9C6C.20706@oracle.com> References: <53FB9C6C.20706@oracle.com> Message-ID: <383BD2D5-83EB-4FC6-B188-7DCF910CC3D4@oracle.com> This looks fine to me as well. I am fine with the @ignore as I don't suspect anyone would be able to sneak in a change which removed the @ignore without anyone noticing and the comment for why it is marked @ignore seems adequate. Mike On Aug 25 2014, at 13:28 , Alan Bateman wrote: > On 25/08/2014 18:37, Martin Buchholz wrote: >> Hi friends of ByteArrayOutputStream, >> >> I'm trying to clean up an apparent oversight when I tried to fix huge array resizing back in >> 6933217: Huge arrays handled poorly in core libraries >> >> https://bugs.openjdk.java.net/browse/JDK-8055949 >> http://cr.openjdk.java.net/~martin/webrevs/openjdk9/ByteArrayOutputStream-MAX_ARRAY_SIZE/ >> >> The 2x capacity gap was noticed by real users! > The change to BAOS looks okay, I don't recall why it wasn't updated with the previous changes. > > I'm not sure about adding a test with @ignore though, maybe the @test should just be dropped to avoid the temptation to "fix" the test before there is support for selecting tests based on the resources available. > > -Alan From david.holmes at oracle.com Mon Aug 25 23:32:11 2014 From: david.holmes at oracle.com (David Holmes) Date: Tue, 26 Aug 2014 09:32:11 +1000 Subject: About JDK-8042694 In-Reply-To: References: Message-ID: <53FBC77B.6060805@oracle.com> On 2/08/2014 11:40 PM, Harshad RJ wrote: > Hi, > > I hit this bug in my own application today: > https://bugs.openjdk.java.net/browse/JDK-8042694 > > My app uses the h2 database which installs a shutdown hook. Works fine, but > while running with JNLP, the shutdown hook thrown an exception, probably > because the JAR gets closed too early. > > I can't find a way to register on the JIRA site, hence posting here. > > I would like to know why was the bug closed as "won't fix"? Not speaking for the webstart folk. ShutdownHooks are generally very problematic so issues like this are not surprising. There's no guarantee that a shutdown hook thread can access any "system" services like submitting to the AWT-Event thread, using logging, or even (as seems in this case) loading a new class. Trying to make system services work better with hooks is sometimes possible but also generally very difficult and error-prone. Generally hooks should be written to do as little as possible, relying on as few external services as possible, and always anticipating failure. It may be that a shutdown hook is not the right mechanism for cleaning up the library in this case - perhaps it needs to be done explicitly when the app detects that it is required to terminate. Just my 2c. David > ?thanks,? > From weijun.wang at oracle.com Tue Aug 26 03:28:09 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Tue, 26 Aug 2014 11:28:09 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53FB53FC.5040605@oracle.com> References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <67921D59-5230-49F1-B526-5A39B75FF27F@orac! le.com> <53FB53FC.5040605@oracle.com> Message-ID: <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> New webrevs available at http://cr.openjdk.java.net/~weijun/8055723/client/webrev.01/ http://cr.openjdk.java.net/~weijun/8055723/core/webrev.01/ There are only 2 now. Everything non-client is in core. Everyone, please do code review quickly because the patch touches too many files and any delay could mean re-merge. *Ot?vio*: If there is only small change in feedback, tell me to update my own repo and you don't need to generate the big patch again. I see you still include that demo file. Thanks Max From xuelei.fan at oracle.com Tue Aug 26 05:20:15 2014 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Tue, 26 Aug 2014 13:20:15 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <67921D59-5230-49F1-B526-5A39B75FF27F@orac! le.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> Message-ID: <53FC190F.7030204@oracle.com> I was wondering, is it nice to address it in Java compiler to use string builder for the string "+" operator? Xuelei On 8/26/2014 11:28 AM, Wang Weijun wrote: > New webrevs available at > > http://cr.openjdk.java.net/~weijun/8055723/client/webrev.01/ > http://cr.openjdk.java.net/~weijun/8055723/core/webrev.01/ > > There are only 2 now. Everything non-client is in core. > > Everyone, please do code review quickly because the patch touches too many files and any delay could mean re-merge. > > *Ot?vio*: If there is only small change in feedback, tell me to update my own repo and you don't need to generate the big patch again. > > I see you still include that demo file. > > Thanks > Max > > From Alan.Bateman at oracle.com Tue Aug 26 07:07:49 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 26 Aug 2014 08:07:49 +0100 Subject: RFR: 8055949: ByteArrayOutputStream capacity should be maximal array size permitted by VM In-Reply-To: References: <53FB9C6C.20706@oracle.com> Message-ID: <53FC3245.2060703@oracle.com> On 25/08/2014 21:45, Martin Buchholz wrote: > : > > jtreg tests are run by default with -ignore:quiet and there is > precedent for other tests with such @ignore statements, and I actually > used jtreg -ignore:run to really test this. > > What I would really like someday is to be able to run expensive tests > (like this one) only if a user expressly requested them. > > Anyways, I'm intending to submit as is unless you feel strongly. The issue here is that we still lack a means to select tests based on resources and other criteria. I hope this come in time so it will be possible to write tests like this properly. In the mean-time then my only concern is that pushing a test with @ignore is just adding to the technical debt. Such tests are unlikely to be run or maintained. If you do push it with @test then a minor comment is to maybe push in the second line of @summary so that it is more distinguishable from the @ lines. -Alan. From pavel.rappo at oracle.com Tue Aug 26 08:41:25 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Tue, 26 Aug 2014 09:41:25 +0100 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53FC190F.7030204@oracle.com> References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <67921D59-5230-49F1-B526-5A39B75FF27F@orac! le.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> <53FC190F.7030204@oracle.com> Message-ID: <14C6AB07-3499-4535-A4CE-8F1838EA0971@oracle.com> It's exactly the way it's been working since 1.6 I believe. public class Optimization { public String concat(String... strings) { return "#: " + strings[0] + strings[2] + strings[3] + "..."; } } public class Optimization { public Optimization(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."":()V 4: return public java.lang.String concat(java.lang.String...); Code: 0: new #2 // class java/lang/StringBuilder 3: dup 4: invokespecial #3 // Method java/lang/StringBuilder."":()V 7: ldc #4 // String #: 9: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 12: aload_1 13: iconst_0 14: aaload 15: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 18: aload_1 19: iconst_2 20: aaload 21: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 24: aload_1 25: iconst_3 26: aaload 27: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 30: ldc #6 // String ... 32: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 35: invokevirtual #7 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; 38: areturn } -Pavel On 26 Aug 2014, at 06:20, Xuelei Fan wrote: > I was wondering, is it nice to address it in Java compiler to use string > builder for the string "+" operator? > > Xuelei > > > On 8/26/2014 11:28 AM, Wang Weijun wrote: >> New webrevs available at >> >> http://cr.openjdk.java.net/~weijun/8055723/client/webrev.01/ >> http://cr.openjdk.java.net/~weijun/8055723/core/webrev.01/ >> >> There are only 2 now. Everything non-client is in core. >> >> Everyone, please do code review quickly because the patch touches too many files and any delay could mean re-merge. >> >> *Ot?vio*: If there is only small change in feedback, tell me to update my own repo and you don't need to generate the big patch again. >> >> I see you still include that demo file. >> >> Thanks >> Max >> >> > From markt at apache.org Tue Aug 26 08:45:30 2014 From: markt at apache.org (Mark Thomas) Date: Tue, 26 Aug 2014 09:45:30 +0100 Subject: Exposing LZ77 sliding window size in the java.util.zip.[Inflator|Defaltor] API Message-ID: <53FC492A.40100@apache.org> Hi, I'm currently working on the implementation of the WebSocket permessage-deflate extension for Apache Tomcat. I am using the JRE provided classes java.util.zip.[Inflator|Defaltor] to do the compression and decompression. I have a working implementation but there is one feature I can't implement because the necessary API isn't available. The WebSocket permessage-deflate specification [1] allows both the client and server to specify a number between 8 to 15 inclusive indicating the base-2 logarithm of the LZ77 sliding window size. The purpose of this feature is to enable both the client and the server to limit the size of the buffer they need to maintain to reduce their memory footprint per connection. Would it be possible for the java.util.zip.Inflator and java.util.zip.Defaltor API to be extended to expose the LZ77 window size? My suggestion would be an additional constructor for each class that took and additional int parameter for window size but I'd be happy with any API that provided control of the window size. Cheers, Mark [1] http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-18 From xuelei.fan at oracle.com Tue Aug 26 09:11:29 2014 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Tue, 26 Aug 2014 17:11:29 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <14C6AB07-3499-4535-A4CE-8F1838EA0971@oracle.com> References: <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <67921D59-5230-49F1-B526-5A39B75FF27F@orac! le.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> <53FC190F.7030204@oracle.com> <14C6AB07-3499-4535-A4CE-8F1838EA0971@oracle.com> Message-ID: <53FC4F41.2000104@oracle.com> Pavel, thanks for the checking and confirm. Look back to the benchmark code: private StringBuilder createBuilder(String... values) { StringBuilder text = new StringBuilder(); text.append(values[0]).append(values[1]) .append(values[2]).append(values[3]) .append(values[4]).append(values[5]); return text; } private StringBuilder createBuilderWithConcat(String... values) { StringBuilder text = new StringBuilder(); text.append(values[0] + values[1]) .append(values[2] + values[3]) .append(values[4]+ values[5]); return text; } Comparing to createBuilder, the code similar to (values[0] + values[1]) in createBuilderWithConcat may take additional memory and CPU cycles to create new StringBuffer objects. As may be able to explain the benchmark result. Therefore, I think it might not be necessary to make this change (replacing string "+" operator with StringBuilder append()). Xuelei On 8/26/2014 4:41 PM, Pavel Rappo wrote: > It's exactly the way it's been working since 1.6 I believe. > > > > public class Optimization { > > public String concat(String... strings) { > return "#: " + strings[0] + strings[2] + strings[3] + "..."; > } > } > > > > public class Optimization { > public Optimization(); > Code: > 0: aload_0 > 1: invokespecial #1 // Method java/lang/Object."":()V > 4: return > > public java.lang.String concat(java.lang.String...); > Code: > 0: new #2 // class java/lang/StringBuilder > 3: dup > 4: invokespecial #3 // Method java/lang/StringBuilder."":()V > 7: ldc #4 // String #: > 9: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; > 12: aload_1 > 13: iconst_0 > 14: aaload > 15: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; > 18: aload_1 > 19: iconst_2 > 20: aaload > 21: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; > 24: aload_1 > 25: iconst_3 > 26: aaload > 27: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; > 30: ldc #6 // String ... > 32: invokevirtual #5 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; > 35: invokevirtual #7 // Method java/lang/StringBuilder.toString:()Ljava/lang/String; > 38: areturn > } > > -Pavel > > On 26 Aug 2014, at 06:20, Xuelei Fan wrote: > >> I was wondering, is it nice to address it in Java compiler to use string >> builder for the string "+" operator? >> >> Xuelei >> >> >> On 8/26/2014 11:28 AM, Wang Weijun wrote: >>> New webrevs available at >>> >>> http://cr.openjdk.java.net/~weijun/8055723/client/webrev.01/ >>> http://cr.openjdk.java.net/~weijun/8055723/core/webrev.01/ >>> >>> There are only 2 now. Everything non-client is in core. >>> >>> Everyone, please do code review quickly because the patch touches too many files and any delay could mean re-merge. >>> >>> *Ot?vio*: If there is only small change in feedback, tell me to update my own repo and you don't need to generate the big patch again. >>> >>> I see you still include that demo file. >>> >>> Thanks >>> Max >>> >>> >> > From stanimir at riflexo.com Tue Aug 26 11:07:07 2014 From: stanimir at riflexo.com (Stanimir Simeonoff) Date: Tue, 26 Aug 2014 14:07:07 +0300 Subject: Exposing LZ77 sliding window size in the java.util.zip.[Inflator|Defaltor] API In-Reply-To: <53FC492A.40100@apache.org> References: <53FC492A.40100@apache.org> Message-ID: Hi, If there would be any changes to Deflater/Inflater I'd strongly suggest enabling them to operate with direct buffers. Working with byte[] forces a copy in the native code which is suboptimal. Probably there should be a concern on memLevel for Deflate as well, iirc it uses the 8 by default (max being 9). memLevel is different than the sliding window but still allocates 2^(7+memLevel+1) bytes. Several years ago I found out a java implementation of Deflate out-performed the provided native code. So I abandoned the built-in library. Plus it's possible to implement Z_SYNC_FLUSH naturally instead of changing the compression level back and forth to achieve similar effect. Also reusing a java pooled Deflater doesn't need free the allocated memory unlike calling end() of the zlib one. The only downside probably is the increased heap usage which could be an issue for huge heaps (although it's mostly primitive arrays). Stanimir On Tue, Aug 26, 2014 at 11:45 AM, Mark Thomas wrote: > Hi, > > I'm currently working on the implementation of the WebSocket > permessage-deflate extension for Apache Tomcat. I am using the JRE > provided classes java.util.zip.[Inflator|Defaltor] to do the compression > and decompression. > > I have a working implementation but there is one feature I can't > implement because the necessary API isn't available. > > The WebSocket permessage-deflate specification [1] allows both the > client and server to specify a number between 8 to 15 inclusive > indicating the base-2 logarithm of the LZ77 sliding window size. The > purpose of this feature is to enable both the client and the server to > limit the size of the buffer they need to maintain to reduce their > memory footprint per connection. > > Would it be possible for the java.util.zip.Inflator and > java.util.zip.Defaltor API to be extended to expose the LZ77 window > size? My suggestion would be an additional constructor for each class > that took and additional int parameter for window size but I'd be happy > with any API that provided control of the window size. > > Cheers, > > Mark > > > > [1] http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-18 > From andrej.golovnin at gmail.com Tue Aug 26 11:12:03 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Tue, 26 Aug 2014 13:12:03 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> Message-ID: Hi all, src/java.base/share/classes/com/sun/crypto/provider/DHPublicKey.java: 269 .append(LINE_SEP + "g:" + LINE_SEP) should be changed to: 269 .append(LINE_SEP).append( "g:").append(LINE_SEP) src/java.base/share/classes/sun/security/x509/PolicyInformation.java: 260 public String toString() { 261 StringBuilder sb = new StringBuilder(" [" + policyIdentifier.toString()); 262 sb.append(policyQualifiers).append(" ]\n"); 263 return sb.toString(); 264 } should be changed either to: 260 public String toString() { 261 StringBuilder sb = new StringBuilder(" ["); 262 sb.append(policyIdentifier); 263 sb.append(policyQualifiers).append(" ]\n"); 264 return sb.toString(); 265 } or to: 260 public String toString() { 261 return " [" + policyIdentifier + policyQualifiers + " ]\n"; 262 } src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java: 316 sb.append("Extension unknown: " + "DER encoded OCTET string =\n") 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 From ron at paralleluniverse.co Tue Aug 26 11:25:19 2014 From: ron at paralleluniverse.co (Ron Pressler) Date: Tue, 26 Aug 2014 14:25:19 +0300 Subject: Process API Updates (JEP 102) Message-ID: I might be a little late to this party, but recently I've had a (rather frustrating) need for the ability to execve a process rather than fork-exec it. I understand that the ability to exec (replace the current process's image) is also available on Windows. This operation (on ProcessBuilder?), which never returns, would have the same semantics as System.exit(pb.start().waitFor()), only it would replace the current JVM process (i.e. maintain the same pid/handle) with the command. This is required when a JVM process is used to set up and launch another, JVM or other, process, but we'd want the user running the program to be oblivious to the setup process (because, say, they want to monitor the running program with some OS tool). Ron From weijun.wang at oracle.com Tue Aug 26 13:33:07 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Tue, 26 Aug 2014 21:33:07 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <67921D59-5230-49F1-B526-5A39B75FF27F@orac! ! le.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> Message-ID: I see no problem from the core part of the webrev. However, I am not sure how you find all the occurrences of "+" in StringBuilder, but I just run the following command in jdk/src find . -type f -name *.java -print | xargs grep -n StringBuilder | perl -ne 'print if /new StringBuilder\([^\)]*\+/' find . -type f -name *.java -print | xargs grep -n append | perl -ne 'print if /append\([^\)]*\+/' and there are still many results. Some are false alarms like buf.append(" + "); result.append(patt.charAt(i + 1)); but I still see sb.append("Extension unknown: " + "DER encoded OCTET string =\n") StringBuilder sb = new StringBuilder("\"" + ti.getThreadName() + "\"" + tagBuffer.append(""); ... Thanks Max On Aug 26, 2014, at 11:28, Wang Weijun wrote: > New webrevs available at > > http://cr.openjdk.java.net/~weijun/8055723/client/webrev.01/ > http://cr.openjdk.java.net/~weijun/8055723/core/webrev.01/ > > There are only 2 now. Everything non-client is in core. > > Everyone, please do code review quickly because the patch touches too many files and any delay could mean re-merge. > > *Ot?vio*: If there is only small change in feedback, tell me to update my own repo and you don't need to generate the big patch again. > > I see you still include that demo file. > > Thanks > Max > > From xueming.shen at oracle.com Tue Aug 26 17:12:01 2014 From: xueming.shen at oracle.com (Xueming Shen) Date: Tue, 26 Aug 2014 10:12:01 -0700 Subject: Exposing LZ77 sliding window size in the java.util.zip.[Inflator|Defaltor] API In-Reply-To: <53FC492A.40100@apache.org> References: <53FC492A.40100@apache.org> Message-ID: <53FCBFE1.9090304@oracle.com> Hi Mark, It sounds like a reasonable requirement. I have filed the rfe at https://bugs.openjdk.java.net/browse/JDK-8056093. Let's consider to add a pair of constructors in In/Deflator in jdk9. -Sherman On 08/26/2014 01:45 AM, Mark Thomas wrote: > Hi, > > I'm currently working on the implementation of the WebSocket > permessage-deflate extension for Apache Tomcat. I am using the JRE > provided classes java.util.zip.[Inflator|Defaltor] to do the compression > and decompression. > > I have a working implementation but there is one feature I can't > implement because the necessary API isn't available. > > The WebSocket permessage-deflate specification [1] allows both the > client and server to specify a number between 8 to 15 inclusive > indicating the base-2 logarithm of the LZ77 sliding window size. The > purpose of this feature is to enable both the client and the server to > limit the size of the buffer they need to maintain to reduce their > memory footprint per connection. > > Would it be possible for the java.util.zip.Inflator and > java.util.zip.Defaltor API to be extended to expose the LZ77 window > size? My suggestion would be an additional constructor for each class > that took and additional int parameter for window size but I'd be happy > with any API that provided control of the window size. > > Cheers, > > Mark > > > > [1] http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-18 From huizhe.wang at oracle.com Tue Aug 26 17:41:23 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Tue, 26 Aug 2014 10:41:23 -0700 Subject: RFR 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory Message-ID: <53FCC6C3.2090803@oracle.com> Hi, Please review update to XMLSchemaFactory along with changes to relevant classes. All new tests passed, as well as existing jaxp tests and JPRT. Note that this updates XMLSchemaFactory, related classes such as XMLShemaValidator are only updated to the related revisions. Full update of XMLSchemaValidator and XMLSchemaLoader will be done separately. http://cr.openjdk.java.net/~joehw/jdk9/8037819/webrev/ Thanks, Joe From martinrb at google.com Tue Aug 26 20:38:35 2014 From: martinrb at google.com (Martin Buchholz) Date: Tue, 26 Aug 2014 13:38:35 -0700 Subject: RFR: 8055949: ByteArrayOutputStream capacity should be maximal array size permitted by VM In-Reply-To: <53FC3245.2060703@oracle.com> References: <53FB9C6C.20706@oracle.com> <53FC3245.2060703@oracle.com> Message-ID: I'll submit soonish. @summary second line indented. I added some gratuitous assertions to the test: // check data integrity while we're here byte[] bytes = baos.toByteArray(); if (bytes.length != n) throw new AssertionError("wrong length"); if (bytes[0] != 'x' || bytes[bytes.length - 1] != 'x') throw new AssertionError("wrong contents"); On Tue, Aug 26, 2014 at 12:07 AM, Alan Bateman wrote: > > In the mean-time then my only concern is that pushing a test with @ignore > is just adding to the technical debt. Such tests are unlikely to be run or > maintained. If you do push it with @test then a minor comment is to maybe > push in the second line of @summary so that it is more distinguishable from > the @ lines. I don't think it particularly adds to the technical debt because there's an existing pile of @ignored tests that share the same reason, that will all be handled together ... in the fullness of time. From mandy.chung at oracle.com Tue Aug 26 22:40:36 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 26 Aug 2014 15:40:36 -0700 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds Message-ID: <53FD0CE4.5010404@oracle.com> JDK-8055856: checkdeps build target doesn't work for cross-compilation builds JDK-8056113: [build] tools.jar missing modules.xml Webrev at: http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/ This patch fixes a few things about modules.xml 1. jdeps is invoked at build time to verify the module boundaries. For cross-compilation, it has to run on the host system. jdeps is added in the langtools interim build so that it can run with the BOOT_JDK. jdeps is also modified to support a system property to specify the path to modules.xml generated later. 2. The generated modules.xml is solely for jdeps to use until the module system is in place. The build tool takes the modules.xml in the top repo and generates a new file to include the module membership for jdeps to use. It is better to name it differently to jdeps-modules.xml to avoid confusion as Magnus suggests. 3. main-jars is missing the dependency of modules-xml target and thus jdeps in the JDK images fails. To help catch this issue, jdeps now throws an exception if jdeps-modules.xml is missing. thanks Mandy From weijun.wang at oracle.com Wed Aug 27 02:07:56 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Wed, 27 Aug 2014 10:07:56 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> Message-ID: Webrev updated again, this time include more changes. http://cr.openjdk.java.net/~weijun/8055723/client/webrev.02/ http://cr.openjdk.java.net/~weijun/8055723/core/webrev.02/ The change to a demo file is removed because that file itself is already removed. *Ot?vio*: I believe Andrej's following suggestion is worth looking at. Thanks Max On Aug 26, 2014, at 19:12, Andrej Golovnin wrote: > > src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java: > 316 sb.append("Extension unknown: " + "DER encoded OCTET string =\n") > > 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 From weijun.wang at oracle.com Wed Aug 27 03:29:51 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Wed, 27 Aug 2014 11:29:51 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> Message-ID: I found an error: diff --git a/src/jdk.dev/share/classes/com/sun/tools/hat/internal/util/Misc.java b/src/jdk.dev/share/classes/com/sun/tools/hat/internal/util/Misc.java --- a/src/jdk.dev/share/classes/com/sun/tools/hat/internal/util/Misc.java +++ b/src/jdk.dev/share/classes/com/sun/tools/hat/internal/util/Misc.java @@ -97,11 +97,11 @@ } else if (ch == '&') { sb.append("&"); } else if (ch < ' ') { - sb.append("&#" + Integer.toString(ch) + ";"); + sb.append("&#").append((int)ch).append(';'); } else { int c = (ch & 0xFFFF); if (c > 127) { - sb.append("&#" + Integer.toString(c) + ";"); + sb.append("&#").append((int)c).append(';'); } else { sb.append(ch); } In the 2nd change, it should be "append(c)" instead of "append((int)c)". Here c is already an integer and this redundant cast will be treated as an error when -Werror specified. --Max On Aug 27, 2014, at 10:07, Wang Weijun wrote: > Webrev updated again, this time include more changes. > > http://cr.openjdk.java.net/~weijun/8055723/client/webrev.02/ > http://cr.openjdk.java.net/~weijun/8055723/core/webrev.02/ > > The change to a demo file is removed because that file itself is already removed. > > *Ot?vio*: I believe Andrej's following suggestion is worth looking at. > > Thanks > Max > > On Aug 26, 2014, at 19:12, Andrej Golovnin wrote: > >> >> src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java: >> 316 sb.append("Extension unknown: " + "DER encoded OCTET string =\n") >> >> 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 > From erik.joelsson at oracle.com Wed Aug 27 08:26:13 2014 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Wed, 27 Aug 2014 10:26:13 +0200 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FD0CE4.5010404@oracle.com> References: <53FD0CE4.5010404@oracle.com> Message-ID: <53FD9625.3050201@oracle.com> Hello Mandy, Looking at this, I just realized that $(JDK_OUTPUTDIR)/modules/jdk.dev/com/sun/tools/jdeps/resources/jdeps-modules.xml is a generated resource for a module and that you correctly added it to the gendata target. Then to make it fit with the new makefile model, the running of TOOL_GENMODULESXML should be moved to jdk/make/gendata/Gendata-jdk.dev.gmk, which would make it be run automatically with correct dependencies. ModulesXml.gmk should also probably be renamed to something better describing the checkdeps target, which is all it would be doing then. Perhaps it would also fit better in the root make dir. I can understand if fixing the cross compilation issue is urgent and am fine with you pushing this to fix that, but would like to see it further improved eventually. /Erik On 2014-08-27 00:40, Mandy Chung wrote: > JDK-8055856: checkdeps build target doesn't work for cross-compilation > builds > JDK-8056113: [build] tools.jar missing modules.xml > > Webrev at: > http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/ > > This patch fixes a few things about modules.xml > > 1. jdeps is invoked at build time to verify the module boundaries. > For cross-compilation, it has to run on the host system. > jdeps is added in the langtools interim build so that it > can run with the BOOT_JDK. jdeps is also modified to > support a system property to specify the path to modules.xml > generated later. > > 2. The generated modules.xml is solely for jdeps to use until > the module system is in place. The build tool takes the > modules.xml in the top repo and generates a new file > to include the module membership for jdeps to use. It > is better to name it differently to jdeps-modules.xml > to avoid confusion as Magnus suggests. > > 3. main-jars is missing the dependency of modules-xml target > and thus jdeps in the JDK images fails. To help catch > this issue, jdeps now throws an exception if jdeps-modules.xml > is missing. > > thanks > Mandy > From masayoshi.okutsu at oracle.com Wed Aug 27 08:34:33 2014 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Wed, 27 Aug 2014 17:34:33 +0900 Subject: RFR: 8049343: (tz) Support tzdata2014f In-Reply-To: <53F734D8.1000801@oracle.com> References: <53F4B7BD.8020705@oracle.com> <53F55A44.6010501@oracle.com> <53F5A843.3000302@oracle.com> <53F5DD2C.1010706@oracle.com> <53F734D8.1000801@oracle.com> Message-ID: <53FD9819.7080000@oracle.com> Here are additional comments. src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java: I'm concerned about the workarounds. It's not new in this update, but this problem would make tzupdater data void until the workaround is added to the next update release. Could you please work with Sherman to eliminate the workaround (outside of this 2014f update)? src/java.base/share/classes/sun/util/resources/TimeZoneNames.java: String LORD_HOWE[] = new String[] {"Lord Howe Standard Time", "LHST", - "Lord Howe Summer Time", "LHST", + "Lord Howe Summer Time", "LHDT", The S-D convention is applied to Lord Howe as well. 567 {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST", 568 "Macquarie Island Summer Time", "MIST", 569 "Macquarie Island Time", "MIST"}}, This one should also follow the S-D convention, although this time zone doesn't observe daylight saving time. + String XJT[] = new String[] {"China Standard Time", "XJT", + "China Daylight Time", "XJDT", + "China Time", "XJT"}; Should the long names be based on Xinjiang? Africa/Freetown is now a link to Africa/Abidjan. Those should be the same time zone. - {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST", - "Metlakatla Daylight Time", "MeDT", - "Metlakatla Time", "MeT"}}, + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "PST", + "Metlakatla Daylight Time", "PDT", + "Metlakatla Time", "PT"}}, - {"Europe/Volgograd", new String[] {"Volgograd Time", "VOLT", - "Volgograd Summer Time", "VOLST", - "Volgograd Time", "VOLT"}}, + {"Europe/Volgograd", new String[] {"Volgograd Time", "MSK", + "Volgograd Summer Time", "MSK", + "Volgograd Time", "MSK"}}, The long names should be changed accordingly. Thanks, Masayoshi On 8/22/2014 9:17 PM, Aleksej Efimov wrote: > Masayoshi, > You're right that the "root names" should be changed as part of this > update. The names were changed according to Australian official > document here: http://australia.gov.au/about-australia/our-country/time > The fixed version of the webrev can be found here: > http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.02 > > Thanks, > Aleksej > > > On 08/21/2014 03:51 PM, Masayoshi Okutsu wrote: >> We used to make name changes in the root (base) bundle as part of >> time zone data maintenance and deter only translations. But if you >> want to handle name changes later, that would be fine. It's your call. >> >> Thanks, >> Masayoshi >> >> On 8/21/2014 5:05 PM, Aleksej Efimov wrote: >>> Masayoshi, >>> I agree that we should change the long names to match the new short >>> names introduced by tzdata. >>> But I suggest to log a different CR for such activity to handle long >>> name changes and their translations (this activity is slightly out >>> of tzdata update scope). Does it make sense? >>> >>> -Aleksej >>> >>> On 08/21/2014 06:32 AM, Masayoshi Okutsu wrote: >>>> I think the long names of the Australia time zones should be >>>> revisited to be consistent with the abbreviation changes. The new >>>> abbreviations follow the S[tandard] and D[aylight saving] >>>> convention rather than the S[tandard] and S[ummer time] one. The >>>> long names, such as "Eastern Summer Time (Queensland)", no longer >>>> make sense. >>>> >>>> On the other hand, you will need to access impact of the name >>>> changes, including abbreviations. Also, if you change the long >>>> names, their translations will need to be changed as well. >>>> >>>> Thanks, >>>> Masayoshi >>>> >>>> On 8/20/2014 11:59 PM, Aleksej Efimov wrote: >>>>> Hi, >>>>> >>>>> Please, review the tzdata2014f integration (with tzdata2014e >>>>> related changes included too) [1] fix to JDK9: >>>>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/ >>>>> >>>>> The tzdata2014f changes are extensive and relates mostly to >>>>> timezone short names changes + "Asia/Srednekolymsk" time zone were >>>>> added. >>>>> Almost complete list of changes can be found in the JBS bug >>>>> description [1], plus some changes wasn't documented in tzdata >>>>> release notes - for such cases raw tzdata diff was used for the >>>>> names modifications. >>>>> >>>>> Two issues with JSR310 implementation were discovered during >>>>> integration process: >>>>> First issue is related to the internal representation of the >>>>> '24:00' value. The JSR310 implementation treats this value as a >>>>> next day 00:00 time. The workaround already exists in JSR310 code >>>>> for similar entries and this failure is resolved in similar way >>>>> [2] as part of this update. >>>>> For the second issue JDK-8051641 [3] was filled and >>>>> 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one >>>>> that fails with this tzdata. >>>>> Other time zone related tests [4] passes without failures. >>>>> >>>>> Thank you, >>>>> Aleksej >>>>> >>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8049343 >>>>> [2] >>>>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java.patch >>>>> [3] https://bugs.openjdk.java.net/browse/JDK-8051641 >>>>> [4] TZ related test sets: test/sun/util/calendar >>>>> test/java/util/Calendar test/sun/util/resources/TimeZone >>>>> test/sun/util/calendar test/java/util/TimeZone test/java/time\ >>>>> test/java/util/Formatter test/closed/java/util/Calendar >>>>> test/closed/java/util/TimeZone >>>> >>> >> > From Ulf.Zibis at CoSoCo.de Wed Aug 27 09:41:21 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Wed, 27 Aug 2014 11:41:21 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53E8CCD6.2090503@CoSoCo.de> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <53E8CCD6.2090503@CoSoCo.de> Message-ID: <53FDA7C1.6060303@CoSoCo.de> Hi all, a critical question! 1.) Why we have String concatenation in Java? ... I would answer: for _readability_ purpose. 2.) In the early javac times, we were asked to refactor to StringBuffer for performance critical code. 3.) Since 1.6 ? javac is capable to replace multiple concatenation with one Stringbuilder, so we are again asked to refactor the code for better readability. 4.) Now we see, that javac optimization fails again if StringBuilder, concatenation, toString(), append(String), append(Collection) etc. and StringJoiner use is mixed. ************************************************************************************* 5.) Couldn't we force the better optimization of javac instead again refactoring the code and decrease readability again? ************************************************************************************* + manual .append("x") should be translated to .append('x') + Javac could calculate a reasonable buffer size init value. -Ulf Am 11.08.2014 um 16:01 schrieb Ulf Zibis: > > Am 11.08.2014 um 15:12 schrieb Andrej Golovnin: >> In the most classes I mentioned in my previous mail only the >> #toString()-methods would be affected by the proposal. And in the most >> cases, maybe in all cases, the #toString()-methods in this classes exists >> only to provide nice output. > > So why not "nice input" from the java sources ...i.e.: use concatenation only if possible. The > performance problem occurs, if both strategies are mixed. > >> Btw. I see here a 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').append(o2).append('\n').toString(); >> >> instead of: >> >> String s = new >> StringBuilder().append("abc").append(o1).append("c").append(o2).append("\n").toString(); > > + manual .append("x") should be translated to .append('x') > + Javac could avoid to instantiate multiple SBs from mixed concatenation/SB source code. > + Javac could calculate a reasonable buffer size init value. > > -Ulf > > From paul.sandoz at oracle.com Wed Aug 27 09:51:06 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 27 Aug 2014 11:51:06 +0200 Subject: The future of Serialization In-Reply-To: <53E6586F.7080906@oracle.com> References: <1407563776.1841.30.camel@Nokia-N900> <53E6586F.7080906@oracle.com> Message-ID: On Aug 9, 2014, at 7:20 PM, Brian Goetz wrote: >> I've noticed there's not much interest in improving Serialization on >> these lists. This makes me wonder if java Serialization has lost >> relevance in recent years with the rise of protocol buffers apache >> thrift and other means of data transfer over byte streams. > > I sense your frustration, but I think you may be reaching the wrong conclusion. The lack of response is probably not evidence that there's no interest in fixing serialization; its that fixing serialization, with all the constraints that "fix" entails, is just really really hard, and its much easier to complain about it (and even say "let's just get rid of it") than to fix it. > >> Should Serializable eventually be deprecated? Should Serialization be >> disabled by default? Should a new mechanism be developed? If a new >> mechanism is developed, what about circular object relationships? > > As I delved into my own explorations of serialization, I started to realize why such a horrible approach was the one that was ultimately chosen; while serialization is horrible and awful and leaky and insecure and complex and brittle, it does address problems like cyclic data structures and independent evolution of subclass and superclass better than the "clean" models. > > My conclusion is, at best, a new mechanism would have to live side-by-side with the old one, since it could only handle 95% of the cases. It might handle those 95% much better -- more cleanly, securely, and allowing easier schema evolution -- but the hard cases are still there. Still, reducing the use of the horrible old mechanism may still be a worthy goal, even if it can't be killed outright. > Also many serialization-based libraries use sun.misc.Unsafe or sun.reflect.ReflectionFactory for various reasons (with backup plans if such classes are not available or accessible). As part to the future of serialization i think we need to evaluate libraries such as XStream and Objenesis to see what unsafe/internal mechanisms can be replaced by functionally equivalent safe public mechanisms. I have more questions than answers at the moment with regards to that :-( Paul. From magnus.ihse.bursie at oracle.com Wed Aug 27 10:19:47 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Wed, 27 Aug 2014 12:19:47 +0200 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FD9625.3050201@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> Message-ID: <53FDB0C3.5010900@oracle.com> On 2014-08-27 10:26, Erik Joelsson wrote: > Hello Mandy, > > Looking at this, I just realized that > $(JDK_OUTPUTDIR)/modules/jdk.dev/com/sun/tools/jdeps/resources/jdeps-modules.xml > is a generated resource for a module and that you correctly added it > to the gendata target. Then to make it fit with the new makefile > model, the running of TOOL_GENMODULESXML should be moved to > jdk/make/gendata/Gendata-jdk.dev.gmk, which would make it be run > automatically with correct dependencies. ModulesXml.gmk should also > probably be renamed to something better describing the checkdeps > target, which is all it would be doing then. Perhaps it would also fit > better in the root make dir. > > I can understand if fixing the cross compilation issue is urgent and > am fine with you pushing this to fix that, but would like to see it > further improved eventually. I agree. The changes look good, but as Erik suggests, they can be taken even further, possibly in a separate fix. Perhaps the name "CheckModules.gmk" would be better suite than ModulesXml.gmk, when the gendata part has been separated out? /Magnus From Ulf.Zibis at CoSoCo.de Wed Aug 27 10:41:47 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Wed, 27 Aug 2014 12:41:47 +0200 Subject: RFR: 8055949: ByteArrayOutputStream capacity should be maximal array size permitted by VM In-Reply-To: References: Message-ID: <53FDB5EB.8000105@CoSoCo.de> Am 25.08.2014 um 19:37 schrieb Martin Buchholz: > https://bugs.openjdk.java.net/browse/JDK-8055949 > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/ByteArrayOutputStream-MAX_ARRAY_SIZE/ > > The 2x capacity gap was noticed by real users! Hi Martin, the MAX_ARRAY_SIZE code now is copied to many places in JDK. Couldn't you better centralize the code to one place, e.g. j.u.Arrays or some hidden class of sun.java...? Isn't there a property to retrieve MAX_ARRAY_SIZE from the running VM? Imagine, some VM throws OOME above Integer.MAX_VALUE-4 and minCapacity is Integer.MAX_VALUE-4. With this code a OOME will happen: 124 return (minCapacity > MAX_ARRAY_SIZE) ? 125 Integer.MAX_VALUE : 126 MAX_ARRAY_SIZE; With this code we would avoid the OOME: 124 return (minCapacity > MAX_ARRAY_SIZE) ? 125 minCapacity : 126 MAX_ARRAY_SIZE; -Ulf From pavel.rappo at oracle.com Wed Aug 27 12:02:37 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Wed, 27 Aug 2014 13:02:37 +0100 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53FDA7C1.6060303@CoSoCo.de> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <53E8CCD6.2090503@CoSoCo.de> <53FDA7C1.6060303@CoSoCo.de> Message-ID: <902B0B7A-32BE-498A-B9DD-8937960430A2@oracle.com> Could you please explain what you mean by "javac optimization fails" here? -Pavel On 27 Aug 2014, at 10:41, Ulf Zibis wrote: > 4.) Now we see, that javac optimization fails again if StringBuilder, concatenation, toString(), append(String), append(Collection) etc. and StringJoiner use is mixed. From paul.sandoz at oracle.com Wed Aug 27 12:23:36 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 27 Aug 2014 14:23:36 +0200 Subject: RFR: [8054714] Use StringJoiner where it makes the code cleaner In-Reply-To: <53E5C09A.6080106@oracle.com> References: <53E5407A.10407@oracle.com> <53E56EEA.6030202@oracle.com> <53E5C09A.6080106@oracle.com> Message-ID: On Aug 9, 2014, at 8:32 AM, Ivan Gerasimov wrote: > Yes, this will surely work faster. I've incorporated your suggestion: > http://cr.openjdk.java.net/~igerasim/8054714/1/webrev/ > Looks ok. V. minor point, rogue space: sun/net/www/protocol/http/HttpURLConnection.java 2014-08-09 10:34:38.656983033 +0400 + if (! cookie.isHttpOnly()) Paul. From aleksej.efimov at oracle.com Wed Aug 27 13:45:55 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Wed, 27 Aug 2014 17:45:55 +0400 Subject: [8u-dev] RFR: 8036981: JAXB not preserving formatting for xsd:any Mixed content In-Reply-To: <53FC95D3.5040508@oracle.com> References: <53F21BF5.7000803@oracle.com> <53F7A18F.4090505@oracle.com> <53FC8476.5010207@oracle.com> <53FC95D3.5040508@oracle.com> Message-ID: <53FDE113.1030503@oracle.com> Hi, I'm adding a core-libs-dev mail list - I might be lucky to find a JDK8 reviewer for my fix there. Thank you, Aleksej On 08/26/2014 06:12 PM, Aleksej Efimov wrote: > Hi Dalibor, > > It's a partial backport (logged with a different bugID) of JDK9 fix, I > got an approval from Miran (Thank you Miran!) and right now I'm > waiting for a JDK8 reviewer approval. > > -Aleksej > > On 08/26/2014 04:58 PM, dalibor topic wrote: >> Hi Aleksej - are you looking for approval to push into jdk8u-dev? >> >> cheers, >> dalibor topic >> >> On 22.08.2014 22:01, Miroslav Kos wrote: >>> Hi Aleksej, >>> looks good to me. >>> >>> Thanks >>> Miran >>> >>> >>> On 18/08/14 17:29, Aleksej Efimov wrote: >>>> Hi, >>>> >>>> Can I ask for a review of 8036981 bug [1] fix: >>>> JAXWS: >>>> http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jaxws/ >>>> JDK: http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jdk/ >>>> >>>> The proposed fix is a partial backport of "Update JAX-WS RI >>>> integration to latest version" bug [2] to JDK8. >>>> The proposed patch fixes the broken formatting of the input xml during >>>> JAXB marshalling/unmarshalling. Regression test is included. >>>> Testing: >>>> - regtests: xml related tests from 'core' testset - no failures >>>> - JCK: api/xinclude api/xsl api/javax_xml api/org_xml xml_schema >>>> api/xinclude - no failures >>>> >>>> Thank you, >>>> Aleksej >>>> >>>> [1] https://bugs.openjdk.java.net/browse/JDK-8036981 >>>> [2] https://bugs.openjdk.java.net/browse/JDK-8044656 >>>> [3] 8044656 JDK9 review thread: >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-June/027458.html >>>> >>>> >>>> >>> >> > From aleksej.efimov at oracle.com Wed Aug 27 13:53:17 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Wed, 27 Aug 2014 17:53:17 +0400 Subject: RFR: 8049343: (tz) Support tzdata2014f In-Reply-To: <53FD9819.7080000@oracle.com> References: <53F4B7BD.8020705@oracle.com> <53F55A44.6010501@oracle.com> <53F5A843.3000302@oracle.com> <53F5DD2C.1010706@oracle.com> <53F734D8.1000801@oracle.com> <53FD9819.7080000@oracle.com> Message-ID: <53FDE2CD.8040709@oracle.com> Masayoshi, Thank you for a detailed review - I tried to address all your comments. Please, see the updated review: http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.03 About the workarounds - I will start discussion with Sherman when the tzdata2014f (and I suppose the 2014g - it will be available soon according to tzdata mail-list [1]) integration will be complete. -Aleksej [1] tzdata2014g is coming: http://mm.icann.org/pipermail/tz/2014-August/021528.html On 08/27/2014 12:34 PM, Masayoshi Okutsu wrote: > Here are additional comments. > > src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java: > > I'm concerned about the workarounds. It's not new in this update, but > this problem would make tzupdater data void until the workaround is > added to the next update release. Could you please work with Sherman > to eliminate the workaround (outside of this 2014f update)? > > src/java.base/share/classes/sun/util/resources/TimeZoneNames.java: > > String LORD_HOWE[] = new String[] {"Lord Howe Standard Time", > "LHST", > - "Lord Howe Summer Time", > "LHST", > + "Lord Howe Summer Time", > "LHDT", > > The S-D convention is applied to Lord Howe as well. > > 567 {"Antarctica/Macquarie", new String[] {"Macquarie > Island Time", "MIST", > 568 "Macquarie > Island Summer Time", "MIST", > 569 "Macquarie > Island Time", "MIST"}}, > > This one should also follow the S-D convention, although this time > zone doesn't observe daylight saving time. > > > + String XJT[] = new String[] {"China Standard Time", "XJT", > + "China Daylight Time", "XJDT", > + "China Time", "XJT"}; > > Should the long names be based on Xinjiang? > > Africa/Freetown is now a link to Africa/Abidjan. Those should be the > same time zone. > > - {"America/Metlakatla", new String[] {"Metlakatla Standard > Time", "MeST", > - "Metlakatla Daylight > Time", "MeDT", > - "Metlakatla Time", > "MeT"}}, > + {"America/Metlakatla", new String[] {"Metlakatla Standard > Time", "PST", > + "Metlakatla Daylight > Time", "PDT", > + "Metlakatla Time", > "PT"}}, > > - {"Europe/Volgograd", new String[] {"Volgograd Time", "VOLT", > - "Volgograd Summer > Time", "VOLST", > - "Volgograd Time", > "VOLT"}}, > + {"Europe/Volgograd", new String[] {"Volgograd Time", "MSK", > + "Volgograd Summer > Time", "MSK", > + "Volgograd Time", > "MSK"}}, > > > The long names should be changed accordingly. > > Thanks, > Masayoshi > > On 8/22/2014 9:17 PM, Aleksej Efimov wrote: >> Masayoshi, >> You're right that the "root names" should be changed as part of this >> update. The names were changed according to Australian official >> document here: http://australia.gov.au/about-australia/our-country/time >> The fixed version of the webrev can be found here: >> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.02 >> >> Thanks, >> Aleksej >> >> >> On 08/21/2014 03:51 PM, Masayoshi Okutsu wrote: >>> We used to make name changes in the root (base) bundle as part of >>> time zone data maintenance and deter only translations. But if you >>> want to handle name changes later, that would be fine. It's your call. >>> >>> Thanks, >>> Masayoshi >>> >>> On 8/21/2014 5:05 PM, Aleksej Efimov wrote: >>>> Masayoshi, >>>> I agree that we should change the long names to match the new short >>>> names introduced by tzdata. >>>> But I suggest to log a different CR for such activity to handle >>>> long name changes and their translations (this activity is slightly >>>> out of tzdata update scope). Does it make sense? >>>> >>>> -Aleksej >>>> >>>> On 08/21/2014 06:32 AM, Masayoshi Okutsu wrote: >>>>> I think the long names of the Australia time zones should be >>>>> revisited to be consistent with the abbreviation changes. The new >>>>> abbreviations follow the S[tandard] and D[aylight saving] >>>>> convention rather than the S[tandard] and S[ummer time] one. The >>>>> long names, such as "Eastern Summer Time (Queensland)", no longer >>>>> make sense. >>>>> >>>>> On the other hand, you will need to access impact of the name >>>>> changes, including abbreviations. Also, if you change the long >>>>> names, their translations will need to be changed as well. >>>>> >>>>> Thanks, >>>>> Masayoshi >>>>> >>>>> On 8/20/2014 11:59 PM, Aleksej Efimov wrote: >>>>>> Hi, >>>>>> >>>>>> Please, review the tzdata2014f integration (with tzdata2014e >>>>>> related changes included too) [1] fix to JDK9: >>>>>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/ >>>>>> >>>>>> The tzdata2014f changes are extensive and relates mostly to >>>>>> timezone short names changes + "Asia/Srednekolymsk" time zone >>>>>> were added. >>>>>> Almost complete list of changes can be found in the JBS bug >>>>>> description [1], plus some changes wasn't documented in tzdata >>>>>> release notes - for such cases raw tzdata diff was used for the >>>>>> names modifications. >>>>>> >>>>>> Two issues with JSR310 implementation were discovered during >>>>>> integration process: >>>>>> First issue is related to the internal representation of the >>>>>> '24:00' value. The JSR310 implementation treats this value as a >>>>>> next day 00:00 time. The workaround already exists in JSR310 code >>>>>> for similar entries and this failure is resolved in similar way >>>>>> [2] as part of this update. >>>>>> For the second issue JDK-8051641 [3] was filled and >>>>>> 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one >>>>>> that fails with this tzdata. >>>>>> Other time zone related tests [4] passes without failures. >>>>>> >>>>>> Thank you, >>>>>> Aleksej >>>>>> >>>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8049343 >>>>>> [2] >>>>>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java.patch >>>>>> [3] https://bugs.openjdk.java.net/browse/JDK-8051641 >>>>>> [4] TZ related test sets: test/sun/util/calendar >>>>>> test/java/util/Calendar test/sun/util/resources/TimeZone >>>>>> test/sun/util/calendar test/java/util/TimeZone test/java/time\ >>>>>> test/java/util/Formatter test/closed/java/util/Calendar >>>>>> test/closed/java/util/TimeZone >>>>> >>>> >>> >> > From lange.fabian at gmail.com Wed Aug 27 14:02:00 2014 From: lange.fabian at gmail.com (Fabian Lange) Date: Wed, 27 Aug 2014 17:02:00 +0300 Subject: Impact of code difference in Collection#contains() worth improving? Message-ID: Hi all, I have been involved recently in some theoretical or nonsensical discussions about microbenchmarking, jit compiling assemblies and so fort. One example was LinkedList vs ArrayList. What I noticed is that those two have a different implementation for contains(): ArrayList: public boolean contains(Object o) { return indexOf(o) >= 0; } LinkedList: public boolean contains(Object o) { return indexOf(o) != -1; } Logically this is of course identical due to the contract of contains which returns either -1 or the >=0 index of the element. This code has been like this almost forever, and I was wondering if this actually makes a difference in CPU cycles. And in fact this code compiles into different assembler instructions. The array list does a test against 0 and conditional move, while the linked list does a jump equals on -1. Again that is not surprising, because the actual java source is different. But I wonder if both options are equally good in cold performance and when jitted based on parameter values. Wouldn't one implementation be better than the other? And why is not the "better" implementation taken in both classes (and maybe other Collections which use indexOf) ? Is the answer that this has always been like this and the benefit is not worth the risk of touching ancient code? And if not for performance, would code clarify and similarity be an argument? (this message was posted to jdk8-dev initially, thanks to Dalibor Topic for the pointer to this list) Fabian From weijun.wang at oracle.com Wed Aug 27 14:13:43 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Wed, 27 Aug 2014 22:13:43 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <141CEE3F-4343-4767-A43C-5E7CF1A9F7A7@oracle.com> <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> Message-ID: On Aug 27, 2014, at 10:07, Wang Weijun wrote: > Webrev updated again, this time include more changes. > > http://cr.openjdk.java.net/~weijun/8055723/client/webrev.02/ > http://cr.openjdk.java.net/~weijun/8055723/core/webrev.02/ The core part is updated again at http://cr.openjdk.java.net/~weijun/8055723/core/webrev.03/ including a fix s/(int)c/c/ in com/sun/tools/hat/internal/util/Misc.java and literal string merge in X509CRLEntryImpl.java, X509CRLImpl.java, and X509CertInfo.java. No change for the client part. Thanks Max From vitalyd at gmail.com Wed Aug 27 14:12:42 2014 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Wed, 27 Aug 2014 10:12:42 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: There's no clear winner between cmov and jmp in the general case. When you looked at the generated assembly, what code did you run to warm it up? Were most instances found in the list or not or some mix? Using 0 as a test does have benefits in some places (e.g. when flags register can be used from prior operations that set the zero bit), but this one seems unlikely to be one of those. Also, LL traversal is likely to suffer cache misses, which would trump anything else here (AL as well to a lesser degree). Sent from my phone On Aug 27, 2014 10:02 AM, "Fabian Lange" wrote: > Hi all, > I have been involved recently in some theoretical or nonsensical > discussions about microbenchmarking, jit compiling assemblies and so > fort. > One example was LinkedList vs ArrayList. > > What I noticed is that those two have a different implementation for > contains(): > > ArrayList: > > public boolean contains(Object o) { > return indexOf(o) >= 0; > } > > LinkedList: > > public boolean contains(Object o) { > return indexOf(o) != -1; > } > > Logically this is of course identical due to the contract of contains > which returns either -1 or the >=0 index of the element. > > This code has been like this almost forever, and I was wondering if > this actually makes a difference in CPU cycles. > > And in fact this code compiles into different assembler instructions. > The array list does a test against 0 and conditional move, while the > linked list does a jump equals on -1. > > Again that is not surprising, because the actual java source is > different. But I wonder if both options are equally good in cold > performance and when jitted based on parameter values. > > Wouldn't one implementation be better than the other? And why is not > the "better" implementation taken in both classes (and maybe other > Collections which use indexOf) ? > > Is the answer that this has always been like this and the benefit is > not worth the risk of touching ancient code? > > And if not for performance, would code clarify and similarity be an > argument? > > (this message was posted to jdk8-dev initially, thanks to Dalibor > Topic for the pointer to this list) > > Fabian > From lange.fabian at gmail.com Wed Aug 27 14:32:41 2014 From: lange.fabian at gmail.com (Fabian Lange) Date: Wed, 27 Aug 2014 17:32:41 +0300 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: Hi Vitaly, The code comes from a single invocation of a contains(1) on an empty list. I forced -Xcomp to get a compilation result. But as stated in the initial mail, this was just curiosity. If the >=0 and !=-1 checks are 100% equal in performance and optimization, then it does not matter. If one of them is faster it should be used in both places. I tried also to provoke hot spot compiled code, and it looks that after inlining the code is much more similar. And yes the cache miss discussion has spurred my investigation, but I think the argument that other factors dominate the runtime should not be an excuse to use different (java code) implementations for the same thing in different places. Fabian On Wed, Aug 27, 2014 at 5:12 PM, Vitaly Davidovich wrote: > There's no clear winner between cmov and jmp in the general case. When you > looked at the generated assembly, what code did you run to warm it up? Were > most instances found in the list or not or some mix? > > Using 0 as a test does have benefits in some places (e.g. when flags > register can be used from prior operations that set the zero bit), but this > one seems unlikely to be one of those. > > Also, LL traversal is likely to suffer cache misses, which would trump > anything else here (AL as well to a lesser degree). > > Sent from my phone > > On Aug 27, 2014 10:02 AM, "Fabian Lange" wrote: >> >> Hi all, >> I have been involved recently in some theoretical or nonsensical >> discussions about microbenchmarking, jit compiling assemblies and so >> fort. >> One example was LinkedList vs ArrayList. >> >> What I noticed is that those two have a different implementation for >> contains(): >> >> ArrayList: >> >> public boolean contains(Object o) { >> return indexOf(o) >= 0; >> } >> >> LinkedList: >> >> public boolean contains(Object o) { >> return indexOf(o) != -1; >> } >> >> Logically this is of course identical due to the contract of contains >> which returns either -1 or the >=0 index of the element. >> >> This code has been like this almost forever, and I was wondering if >> this actually makes a difference in CPU cycles. >> >> And in fact this code compiles into different assembler instructions. >> The array list does a test against 0 and conditional move, while the >> linked list does a jump equals on -1. >> >> Again that is not surprising, because the actual java source is >> different. But I wonder if both options are equally good in cold >> performance and when jitted based on parameter values. >> >> Wouldn't one implementation be better than the other? And why is not >> the "better" implementation taken in both classes (and maybe other >> Collections which use indexOf) ? >> >> Is the answer that this has always been like this and the benefit is >> not worth the risk of touching ancient code? >> >> And if not for performance, would code clarify and similarity be an >> argument? >> >> (this message was posted to jdk8-dev initially, thanks to Dalibor >> Topic for the pointer to this list) >> >> Fabian From vitalyd at gmail.com Wed Aug 27 14:39:32 2014 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Wed, 27 Aug 2014 10:39:32 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: As far as I know, hotspot jit will favor cmov only when the branch appears to be unpredictable (or conversely, not strongly predictable); otherwise, jmp is used. To get feedback on predictability, the code needs to run in the interpreter, which you've not done by using -Xcomp. Generally, if you're going to analyze generated assembly for performance, you should not force compilation out of the gate. Personally, it doesn't bother me that these use slightly diff condition since semantics are same, but I take your point about consistency. Sent from my phone On Aug 27, 2014 10:32 AM, "Fabian Lange" wrote: > Hi Vitaly, > The code comes from a single invocation of a contains(1) on an empty > list. I forced -Xcomp to get a compilation result. > But as stated in the initial mail, this was just curiosity. > If the >=0 and !=-1 checks are 100% equal in performance and > optimization, then it does not matter. > If one of them is faster it should be used in both places. > > I tried also to provoke hot spot compiled code, and it looks that > after inlining the code is much more similar. > > And yes the cache miss discussion has spurred my investigation, but I > think the argument that other factors dominate the runtime should not > be an excuse to use different (java code) implementations for the same > thing in different places. > > Fabian > > On Wed, Aug 27, 2014 at 5:12 PM, Vitaly Davidovich > wrote: > > There's no clear winner between cmov and jmp in the general case. When > you > > looked at the generated assembly, what code did you run to warm it up? > Were > > most instances found in the list or not or some mix? > > > > Using 0 as a test does have benefits in some places (e.g. when flags > > register can be used from prior operations that set the zero bit), but > this > > one seems unlikely to be one of those. > > > > Also, LL traversal is likely to suffer cache misses, which would trump > > anything else here (AL as well to a lesser degree). > > > > Sent from my phone > > > > On Aug 27, 2014 10:02 AM, "Fabian Lange" wrote: > >> > >> Hi all, > >> I have been involved recently in some theoretical or nonsensical > >> discussions about microbenchmarking, jit compiling assemblies and so > >> fort. > >> One example was LinkedList vs ArrayList. > >> > >> What I noticed is that those two have a different implementation for > >> contains(): > >> > >> ArrayList: > >> > >> public boolean contains(Object o) { > >> return indexOf(o) >= 0; > >> } > >> > >> LinkedList: > >> > >> public boolean contains(Object o) { > >> return indexOf(o) != -1; > >> } > >> > >> Logically this is of course identical due to the contract of contains > >> which returns either -1 or the >=0 index of the element. > >> > >> This code has been like this almost forever, and I was wondering if > >> this actually makes a difference in CPU cycles. > >> > >> And in fact this code compiles into different assembler instructions. > >> The array list does a test against 0 and conditional move, while the > >> linked list does a jump equals on -1. > >> > >> Again that is not surprising, because the actual java source is > >> different. But I wonder if both options are equally good in cold > >> performance and when jitted based on parameter values. > >> > >> Wouldn't one implementation be better than the other? And why is not > >> the "better" implementation taken in both classes (and maybe other > >> Collections which use indexOf) ? > >> > >> Is the answer that this has always been like this and the benefit is > >> not worth the risk of touching ancient code? > >> > >> And if not for performance, would code clarify and similarity be an > >> argument? > >> > >> (this message was posted to jdk8-dev initially, thanks to Dalibor > >> Topic for the pointer to this list) > >> > >> Fabian > From mandy.chung at oracle.com Wed Aug 27 14:39:22 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 27 Aug 2014 07:39:22 -0700 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FDB0C3.5010900@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> Message-ID: <53FDED9A.5020702@oracle.com> On 8/27/2014 3:19 AM, Magnus Ihse Bursie wrote: > On 2014-08-27 10:26, Erik Joelsson wrote: >> Hello Mandy, >> >> Looking at this, I just realized that >> $(JDK_OUTPUTDIR)/modules/jdk.dev/com/sun/tools/jdeps/resources/jdeps-modules.xml >> is a generated resource for a module and that you correctly added it >> to the gendata target. Then to make it fit with the new makefile >> model, the running of TOOL_GENMODULESXML should be moved to >> jdk/make/gendata/Gendata-jdk.dev.gmk, which would make it be run >> automatically with correct dependencies. ModulesXml.gmk should also >> probably be renamed to something better describing the checkdeps >> target, which is all it would be doing then. Perhaps it would also >> fit better in the root make dir. >> >> I can understand if fixing the cross compilation issue is urgent and >> am fine with you pushing this to fix that, but would like to see it >> further improved eventually. > > I agree. The changes look good, but as Erik suggests, they can be > taken even further, possibly in a separate fix. Perhaps the name > "CheckModules.gmk" would be better suite than ModulesXml.gmk, when the > gendata part has been separated out? jdeps-modules.xml contains the membership information of all modules. I considered adding Gendata-jdk.dev.gmk but it would have to the last target to run for building exploded image (after jdk.dev classes are compiled). Do you think that'd be doable? Currently modules-xml has a dependency on "java" target. Mandy From erik.joelsson at oracle.com Wed Aug 27 14:59:30 2014 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Wed, 27 Aug 2014 16:59:30 +0200 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FDED9A.5020702@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> <53FDED9A.5020702@oracle.com> Message-ID: <53FDF252.804@oracle.com> On 2014-08-27 16:39, Mandy Chung wrote: > > On 8/27/2014 3:19 AM, Magnus Ihse Bursie wrote: >> On 2014-08-27 10:26, Erik Joelsson wrote: >>> Hello Mandy, >>> >>> Looking at this, I just realized that >>> $(JDK_OUTPUTDIR)/modules/jdk.dev/com/sun/tools/jdeps/resources/jdeps-modules.xml >>> is a generated resource for a module and that you correctly added it >>> to the gendata target. Then to make it fit with the new makefile >>> model, the running of TOOL_GENMODULESXML should be moved to >>> jdk/make/gendata/Gendata-jdk.dev.gmk, which would make it be run >>> automatically with correct dependencies. ModulesXml.gmk should also >>> probably be renamed to something better describing the checkdeps >>> target, which is all it would be doing then. Perhaps it would also >>> fit better in the root make dir. >>> >>> I can understand if fixing the cross compilation issue is urgent and >>> am fine with you pushing this to fix that, but would like to see it >>> further improved eventually. >> >> I agree. The changes look good, but as Erik suggests, they can be >> taken even further, possibly in a separate fix. Perhaps the name >> "CheckModules.gmk" would be better suite than ModulesXml.gmk, when >> the gendata part has been separated out? > > jdeps-modules.xml contains the membership information of all modules. > I considered adding Gendata-jdk.dev.gmk but it would have to the last > target to run for building exploded image (after jdk.dev classes are > compiled). Do you think that'd be doable? > > Currently modules-xml has a dependency on "java" target. > It's still doable and would work. You would need the extra explicit dependency "jdk.dev-gendata: java", but I can't see any problem with that. /Erik From martinrb at google.com Wed Aug 27 15:51:01 2014 From: martinrb at google.com (Martin Buchholz) Date: Wed, 27 Aug 2014 08:51:01 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: The ArrayList version saves one byte of bytecode, and is therefore very slightly better. We should bless that version and use it consistently. javap -c -private java.util.ArrayList | grep -A10 'boolean.*contains' public boolean contains(java.lang.Object); Code: 0: aload_0 1: aload_1 2: invokevirtual #31 // Method indexOf:(Ljava/lang/Object;)I 5: iflt 12 8: iconst_1 9: goto 13 12: iconst_0 13: ireturn On Wed, Aug 27, 2014 at 7:02 AM, Fabian Lange wrote: > Hi all, > I have been involved recently in some theoretical or nonsensical > discussions about microbenchmarking, jit compiling assemblies and so > fort. > One example was LinkedList vs ArrayList. > > What I noticed is that those two have a different implementation for > contains(): > > ArrayList: > > public boolean contains(Object o) { > return indexOf(o) >= 0; > } > > LinkedList: > > public boolean contains(Object o) { > return indexOf(o) != -1; > } > > Logically this is of course identical due to the contract of contains > which returns either -1 or the >=0 index of the element. > > This code has been like this almost forever, and I was wondering if > this actually makes a difference in CPU cycles. > > And in fact this code compiles into different assembler instructions. > The array list does a test against 0 and conditional move, while the > linked list does a jump equals on -1. > > Again that is not surprising, because the actual java source is > different. But I wonder if both options are equally good in cold > performance and when jitted based on parameter values. > > Wouldn't one implementation be better than the other? And why is not > the "better" implementation taken in both classes (and maybe other > Collections which use indexOf) ? > > Is the answer that this has always been like this and the benefit is > not worth the risk of touching ancient code? > > And if not for performance, would code clarify and similarity be an > argument? > > (this message was posted to jdk8-dev initially, thanks to Dalibor > Topic for the pointer to this list) > > Fabian > From lance.andersen at oracle.com Wed Aug 27 15:56:33 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 27 Aug 2014 11:56:33 -0400 Subject: [8u-dev] RFR: 8036981: JAXB not preserving formatting for xsd:any Mixed content In-Reply-To: <53FDE113.1030503@oracle.com> References: <53F21BF5.7000803@oracle.com> <53F7A18F.4090505@oracle.com> <53FC8476.5010207@oracle.com> <53FC95D3.5040508@oracle.com> <53FDE113.1030503@oracle.com> Message-ID: <3B37A070-FABD-4322-932D-B10B9ECA13C0@oracle.com> I will review it by the end of the week On Aug 27, 2014, at 9:45 AM, Aleksej Efimov wrote: > Hi, > I'm adding a core-libs-dev mail list - I might be lucky to find a JDK8 reviewer for my fix there. > > Thank you, > Aleksej > > On 08/26/2014 06:12 PM, Aleksej Efimov wrote: >> Hi Dalibor, >> >> It's a partial backport (logged with a different bugID) of JDK9 fix, I got an approval from Miran (Thank you Miran!) and right now I'm waiting for a JDK8 reviewer approval. >> >> -Aleksej >> >> On 08/26/2014 04:58 PM, dalibor topic wrote: >>> Hi Aleksej - are you looking for approval to push into jdk8u-dev? >>> >>> cheers, >>> dalibor topic >>> >>> On 22.08.2014 22:01, Miroslav Kos wrote: >>>> Hi Aleksej, >>>> looks good to me. >>>> >>>> Thanks >>>> Miran >>>> >>>> >>>> On 18/08/14 17:29, Aleksej Efimov wrote: >>>>> Hi, >>>>> >>>>> Can I ask for a review of 8036981 bug [1] fix: >>>>> JAXWS: http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jaxws/ >>>>> JDK: http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jdk/ >>>>> >>>>> The proposed fix is a partial backport of "Update JAX-WS RI >>>>> integration to latest version" bug [2] to JDK8. >>>>> The proposed patch fixes the broken formatting of the input xml during >>>>> JAXB marshalling/unmarshalling. Regression test is included. >>>>> Testing: >>>>> - regtests: xml related tests from 'core' testset - no failures >>>>> - JCK: api/xinclude api/xsl api/javax_xml api/org_xml xml_schema >>>>> api/xinclude - no failures >>>>> >>>>> Thank you, >>>>> Aleksej >>>>> >>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8036981 >>>>> [2] https://bugs.openjdk.java.net/browse/JDK-8044656 >>>>> [3] 8044656 JDK9 review thread: >>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-June/027458.html >>>>> >>>>> >>>> >>> >> > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From mandy.chung at oracle.com Wed Aug 27 16:00:21 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 27 Aug 2014 09:00:21 -0700 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FDF252.804@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> <53FDED9A.5020702@oracle.com> <53FDF252.804@oracle.com> Message-ID: <53FE0095.7080700@oracle.com> Erik, Magnus, This is much easier than I have thought. I really like this new build. I have separated out Gendata-jdk.dev.gmk and removed the modules-xml target completely. Webrev at: http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.01/ Mandy From aleksej.efimov at oracle.com Wed Aug 27 17:41:02 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Wed, 27 Aug 2014 21:41:02 +0400 Subject: [8u-dev] RFR: 8036981: JAXB not preserving formatting for xsd:any Mixed content In-Reply-To: <3B37A070-FABD-4322-932D-B10B9ECA13C0@oracle.com> References: <53F21BF5.7000803@oracle.com> <53F7A18F.4090505@oracle.com> <53FC8476.5010207@oracle.com> <53FC95D3.5040508@oracle.com> <53FDE113.1030503@oracle.com> <3B37A070-FABD-4322-932D-B10B9ECA13C0@oracle.com> Message-ID: <53FE182E.2030101@oracle.com> Thank you Lance! -Aleksej On 27.08.2014 19:56, Lance Andersen wrote: > I will review it by the end of the week > > > On Aug 27, 2014, at 9:45 AM, Aleksej Efimov > wrote: > >> Hi, >> I'm adding a core-libs-dev mail list - I might be lucky to find a >> JDK8 reviewer for my fix there. >> >> Thank you, >> Aleksej >> >> On 08/26/2014 06:12 PM, Aleksej Efimov wrote: >>> Hi Dalibor, >>> >>> It's a partial backport (logged with a different bugID) of JDK9 fix, >>> I got an approval from Miran (Thank you Miran!) and right now I'm >>> waiting for a JDK8 reviewer approval. >>> >>> -Aleksej >>> >>> On 08/26/2014 04:58 PM, dalibor topic wrote: >>>> Hi Aleksej - are you looking for approval to push into jdk8u-dev? >>>> >>>> cheers, >>>> dalibor topic >>>> >>>> On 22.08.2014 22:01, Miroslav Kos wrote: >>>>> Hi Aleksej, >>>>> looks good to me. >>>>> >>>>> Thanks >>>>> Miran >>>>> >>>>> >>>>> On 18/08/14 17:29, Aleksej Efimov wrote: >>>>>> Hi, >>>>>> >>>>>> Can I ask for a review of 8036981 bug [1] fix: >>>>>> JAXWS: >>>>>> http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jaxws/ >>>>>> >>>>>> JDK: >>>>>> http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jdk/ >>>>>> >>>>>> >>>>>> The proposed fix is a partial backport of "Update JAX-WS RI >>>>>> integration to latest version" bug [2] to JDK8. >>>>>> The proposed patch fixes the broken formatting of the input xml >>>>>> during >>>>>> JAXB marshalling/unmarshalling. Regression test is included. >>>>>> Testing: >>>>>> - regtests: xml related tests from 'core' testset - no failures >>>>>> - JCK: api/xinclude api/xsl api/javax_xml api/org_xml xml_schema >>>>>> api/xinclude - no failures >>>>>> >>>>>> Thank you, >>>>>> Aleksej >>>>>> >>>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8036981 >>>>>> [2] https://bugs.openjdk.java.net/browse/JDK-8044656 >>>>>> [3] 8044656 JDK9 review thread: >>>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-June/027458.html >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From mike.duigou at oracle.com Wed Aug 27 17:41:25 2014 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 27 Aug 2014 10:41:25 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: <04DF30AF-CB27-4BAC-BC7D-6B7BC31301AD@oracle.com> Hi Fabian; The correct mailing list for this discussion would be core-libs-dev at openjdk.java.net The difference between these two implementations is probably of not much consequence though it seems that one or the other could be promoted to AbstractList. This implementation would be marginally better than that offered by AbstractCollection.contains() by generally avoiding creation of an Iterator. There is always some risk associated with making a change even when we believe that the regression testing adequately exercises the functionality. In this case the factors which have resulted in different implementations are; lack of attention, effort relative to benefit and the extremely small but non-zero risk. A nano-benchmark would tell the tale of which of the two implementations is more efficient though I suspect that the difference is negligible if even measurable. Mike On Aug 27 2014, at 06:48 , Fabian Lange wrote: > Hi all, > I have been involved recently in some theoretical or nonsensical > discussions about microbenchmarking, jit compiling assemblies and so fort. > One example was LinkedList vs ArrayList. > > What I noticed is that those two have a different implementation for > contains(): > > ArrayList: > > *public* *boolean* contains(Object o) { > *return* indexOf(o) >= 0; > } > > LinkedList: > > *public* *boolean* contains(Object o) { > *return* indexOf(o) != -1; > } > > Logically this is of course identical due to the contract of contains which > returns either -1 or the >=0 index of the element. > > This code has been like this almost forever, and I was wondering if this > actually makes a difference in CPU cycles. > > And in fact this code compiles into different assembler instructions. The > array list does a test against 0 and conditional move, while the linked > list does a jump equals on -1. > > Again that is not surprising, because the actual java source is different. > But I wonder if both options are equally good in cold performance and when > jitted based on parameter values. > > Wouldn't one implementation be better than the other? And why is not the > "better" implementation taken in both classes (and maybe other Collections > which use indexOf) ? > > Is the answer that this has always been like this and the benefit is not > worth the risk of touching ancient code? > > And if not for performance, would code clarify and similarity be an > argument? > > Or can the answer be found on a different mailing list? Then let me know :) > > > Fabian From ivan.gerasimov at oracle.com Wed Aug 27 18:10:45 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 27 Aug 2014 22:10:45 +0400 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> Message-ID: <53FE1F25.6000409@oracle.com> Hi Max! > The core part is updated again at > > http://cr.openjdk.java.net/~weijun/8055723/core/webrev.03/ Can you please revert changes to src/java.base/share/classes/sun/net/www/MimeEntry.java, as they're conflicting with the fix for JDK-8054714? Apologizing for adding you more work. Sincerely yours, Ivan From john.r.rose at oracle.com Wed Aug 27 19:42:18 2014 From: john.r.rose at oracle.com (John Rose) Date: Wed, 27 Aug 2014 12:42:18 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: On Aug 27, 2014, at 6:48 AM, Fabian Lange wrote: > Hi all, > I have been involved recently in some theoretical or nonsensical > discussions about microbenchmarking, jit compiling assemblies and so fort. > One example was LinkedList vs ArrayList. > > What I noticed is that those two have a different implementation for > contains(): > > ArrayList: > > *public* *boolean* contains(Object o) { > *return* indexOf(o) >= 0; > } > > LinkedList: > > *public* *boolean* contains(Object o) { > *return* indexOf(o) != -1; > } > > Logically this is of course identical due to the contract of contains which > returns either -1 or the >=0 index of the element. > > This code has been like this almost forever, and I was wondering if this > actually makes a difference in CPU cycles. If it makes a difference, (a) that difference is unimportant, and (b) it is not controllable at the source code level. Ad (a), the only time the choice of an instruction or two would make even a slight difference is if the list is empty. Otherwise, the cost of traversing the list and testing each element will swamp any small difference in the comparison. Ad (b), the JIT will unrecognizably optimize both codes into surprising instruction sequences. If they differ, the differences will be suprising, and depend on stuff you weren't looking at, such as branch frequencies or the complexity of nearby code structures. > And in fact this code compiles into different assembler instructions. The > array list does a test against 0 and conditional move, while the linked > list does a jump equals on -1. On Thursdays, they compile to the same thing. On every full moon, they swap instruction sequences. ...That's not strictly true, but you get the idea. Changing the Java source code operators in response to observed instruction sequences is a losing game, unless there is a large profit directly available. So what's the winning game? That might be to file a bug against the optimizer (server compiler) if you see truly bad instructions. But the "badness" has to be more than speculative. Unless it must has a measurable and significant cost, for plausibly applications (not nanobenchmarks), the bug will not (and should not) get time from compiler engineers. Often, as with a bit of dust on your camera lens, the best course is not to touch it at all, for fear of making things worse. ? John > Again that is not surprising, because the actual java source is different. > But I wonder if both options are equally good in cold performance and when > jitted based on parameter values. > > Wouldn't one implementation be better than the other? And why is not the > "better" implementation taken in both classes (and maybe other Collections > which use indexOf) ? > > Is the answer that this has always been like this and the benefit is not > worth the risk of touching ancient code? > > And if not for performance, would code clarify and similarity be an > argument? > > Or can the answer be found on a different mailing list? Then let me know :) > > > Fabian From tristan.yan at oracle.com Wed Aug 27 23:03:21 2014 From: tristan.yan at oracle.com (Tristan Yan) Date: Wed, 27 Aug 2014 16:03:21 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <53F38A26.2080608@oracle.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> Message-ID: Hi Joe and others I updated the tests with putting them in jaxp repo. I also run these tests with security manager and they all passed http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev01/ Also I?d like to propose our way for handling jaxp tests run with security manager. The way we?d use is creating two targets for running jaxp tests. One is for normal run; which will run all the tests without security manager. One is secure run; the target only run the tests that have to be run with security manager. This could be easy to be handled with adding two targets in makefile. And for most of people they only care about the function. They only need run normal run target. We would run two targets for any of our formal tests like nightly, ci build and jprt tests. For the tests which can not be run in secure mode(like tests for xsltc direct extension), we'd add testng group called ?secure-hostile?. We won?t run these tests in secure mode by bypassing them in secure run target. By this way we could easily transform our tests as usual without additional effort. Thank you Tristan > On Aug 19, 2014, at 10:32 AM, huizhe wang wrote: > > By the way, the plan has been that all of the JAXP SQE and Unit tests be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently in the jdk repo shall be moved to jaxp/test as well. I see that your webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're checking tests into the jdk repo. > > Thanks, > Joe > > On 8/18/2014 4:42 PM, Tristan Yan wrote: >> Thanks Joe >> We intend to replace the base class with test library because that doesn?t look like a real base class but an utilities class. >> I haven?t tried to run these tests with security manager, I will run them with security manager then get back you soon. >> Thank you. >> Tristan >> >>> On Aug 18, 2014, at 4:32 PM, huizhe wang > wrote: >>> >>> >> > From weijun.wang at oracle.com Wed Aug 27 23:15:57 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Thu, 28 Aug 2014 07:15:57 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53FE1F25.6000409@oracle.com> References: <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> <53FE1F25.6000409@oracle.com> Message-ID: <061E7188-4F9F-490F-8261-D62D0C4E6C05@oracle.com> OK, I'll remember that. So you will include the StringBuilder changes into your fix? --Max On Aug 28, 2014, at 2:10, Ivan Gerasimov wrote: > Hi Max! > >> The core part is updated again at >> >> http://cr.openjdk.java.net/~weijun/8055723/core/webrev.03/ > > Can you please revert changes to src/java.base/share/classes/sun/net/www/MimeEntry.java, as they're conflicting with the fix for JDK-8054714? > > Apologizing for adding you more work. > > Sincerely yours, > Ivan > From huizhe.wang at oracle.com Wed Aug 27 23:38:33 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Wed, 27 Aug 2014 16:38:33 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> Message-ID: <53FE6BF9.3070305@oracle.com> On 8/27/2014 4:03 PM, Tristan Yan wrote: > Hi Joe and others > > I updated the tests with putting them in jaxp repo. I also run these > tests with security manager and they all passed > http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev01/ > > Awesome. > Also I?d like to propose our way for handling jaxp tests run with > security manager. The way we?d use is creating two targets for > running jaxp tests. One is for normal run; which will run all the > tests without security manager. One is secure run; the target only run > the tests that have to be run with security manager. This could be > easy to be handled with adding two targets in makefile. And for most > of people they only care about the function. They only need run normal > run target. We would run two targets for any of our formal tests like > nightly, ci build and jprt tests. Yes, please coordinate with Frank and Eric so that all of the jaxp tests share the same configuration. > For the tests which can not be run in secure mode(like tests for xsltc > direct extension), we'd add testng group called ?secure-hostile?. We > won?t run these tests in secure mode by bypassing them in secure run > target. By this way we could easily transform our tests as usual > without additional effort. I had been previously updated them so that all of the tests were capable of running with and without security manager. Sustaining SQE had invested several month to incorporate the changes into that hosted in Aurora. Please consider taking the patches from them if you haven't already done so. Thanks, Joe > > Thank you > Tristan > >> On Aug 19, 2014, at 10:32 AM, huizhe wang > > wrote: >> >> By the way, the plan has been that all of the JAXP SQE and Unit tests >> be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently >> in the jdk repo shall be moved to jaxp/test as well. I see that your >> webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're >> checking tests into the jdk repo. >> >> Thanks, >> Joe >> >> On 8/18/2014 4:42 PM, Tristan Yan wrote: >>> Thanks Joe >>> We intend to replace the base class with test library because that >>> doesn?t look like a real base class but an utilities class. >>> I haven?t tried to run these tests with security manager, I will run >>> them with security manager then get back you soon. >>> Thank you. >>> Tristan >>> >>>> On Aug 18, 2014, at 4:32 PM, huizhe wang >>> > wrote: >>>> >>>> >>> >> > From ivan.gerasimov at oracle.com Wed Aug 27 23:49:17 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 28 Aug 2014 03:49:17 +0400 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <061E7188-4F9F-490F-8261-D62D0C4E6C05@oracle.com> References: <53EA137C.5020701@oracle.com> <53F36DF4.6000008@oracle.com> <8ACDFE32-99C1-44A4-941D-47D3681EBA6A@oracle.com> <739FC8D7-A438-485D-99D0-BA88EF20CA36@oracle.com> <4FEECA8F-2B3A-42DE-9778-0119E644596D@oracle.com> <53FB53FC.5040605@oracle.com> <90DD3089-0347-4010-ADDC-686EF65FE48A@oracle.com> <53FE1F25.6000409@oracle.com> <061E7188-4F9F-490F-8261-D62D0C4E6C05@oracle.com> Message-ID: <53FE6E7D.9030007@oracle.com> On 28.08.2014 3:15, Wang Weijun wrote: > OK, I'll remember that. Thanks. > So you will include the StringBuilder changes into your fix? No. I reimplemented MimeEntry.toProperty() with StringJoiner: http://hg.openjdk.java.net/jdk9/dev/jdk/diff/8be081fb8db1/src/java.base/share/classes/sun/net/www/MimeEntry.java Sincerely yours, Ivan From frank.yuan at oracle.com Thu Aug 28 03:42:31 2014 From: frank.yuan at oracle.com (Frank Yuan) Date: Thu, 28 Aug 2014 11:42:31 +0800 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <53FE6BF9.3070305@oracle.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> <53FE6BF9.3070305@oracle.com> Message-ID: <010e01cfc272$1a1667d0$4e433770$@oracle.com> Hi Joe The test Tristan mentioned that is unable to run with security manager is http://sqe-hgi.us.oracle.com/hg/index.cgi/testbase/javase/functional/9/xml/file/3f7ae9b99933/src/JAXP/unittests/unit-test/bug6513892 , it is used to test xslt redirect extension. When it runs with security manager, fails due to; java.lang.RuntimeException: Use of the extension element 'redirect' is not allowed when the secure processing feature is set to true. Anyway, Jibing would communicate with sustaining team about their patch, the discussion is in another mail chain. Best Regards Frank -----Original Message----- From: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] On Behalf Of huizhe wang Sent: Thursday, August 28, 2014 7:39 AM To: Tristan Yan Cc: Core-Libs-Dev Subject: Re: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests On 8/27/2014 4:03 PM, Tristan Yan wrote: > Hi Joe and others > > I updated the tests with putting them in jaxp repo. I also run these > tests with security manager and they all passed > http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev01/ > < http://cr.openjdk.java.net/%7Etyan/JDK-8051540/webrev01/> > Awesome. > Also I?d like to propose our way for handling jaxp tests run with > security manager. The way we?d use is creating two targets for > running jaxp tests. One is for normal run; which will run all the > tests without security manager. One is secure run; the target only run > the tests that have to be run with security manager. This could be > easy to be handled with adding two targets in makefile. And for most > of people they only care about the function. They only need run normal > run target. We would run two targets for any of our formal tests like > nightly, ci build and jprt tests. Yes, please coordinate with Frank and Eric so that all of the jaxp tests share the same configuration. > For the tests which can not be run in secure mode(like tests for xsltc > direct extension), we'd add testng group called ?secure-hostile?. We > won?t run these tests in secure mode by bypassing them in secure run > target. By this way we could easily transform our tests as usual > without additional effort. I had been previously updated them so that all of the tests were capable of running with and without security manager. Sustaining SQE had invested several month to incorporate the changes into that hosted in Aurora. Please consider taking the patches from them if you haven't already done so. Thanks, Joe > > Thank you > Tristan > >> On Aug 19, 2014, at 10:32 AM, huizhe wang > < mailto:huizhe.wang at oracle.com>> wrote: >> >> By the way, the plan has been that all of the JAXP SQE and Unit tests >> be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently >> in the jdk repo shall be moved to jaxp/test as well. I see that your >> webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're >> checking tests into the jdk repo. >> >> Thanks, >> Joe >> >> On 8/18/2014 4:42 PM, Tristan Yan wrote: >>> Thanks Joe >>> We intend to replace the base class with test library because that >>> doesn?t look like a real base class but an utilities class. >>> I haven?t tried to run these tests with security manager, I will run >>> them with security manager then get back you soon. >>> Thank you. >>> Tristan >>> >>>> On Aug 18, 2014, at 4:32 PM, huizhe wang >>> < mailto:huizhe.wang at oracle.com>> wrote: >>>> >>>> >>> >> > From masayoshi.okutsu at oracle.com Thu Aug 28 03:43:35 2014 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Thu, 28 Aug 2014 12:43:35 +0900 Subject: RFR: 8049343: (tz) Support tzdata2014f In-Reply-To: <53FDE2CD.8040709@oracle.com> References: <53F4B7BD.8020705@oracle.com> <53F55A44.6010501@oracle.com> <53F5A843.3000302@oracle.com> <53F5DD2C.1010706@oracle.com> <53F734D8.1000801@oracle.com> <53FD9819.7080000@oracle.com> <53FDE2CD.8040709@oracle.com> Message-ID: <53FEA567.9020601@oracle.com> src/java.base/share/classes/sun/util/resources/TimeZoneNames.java: 239 String SLST[] = new String[] {"Greenwich Mean Time", "GMT", 240 "Sierra Leone Summer Time", "SLST", 241 "Sierra Leone Time", "SLT"}; 251 String WART[] = new String[] {"Western Argentine Time", "WART", 252 "Western Argentine Summer Time", "WARST", 253 "Western Argentine Time", "WART"}; It seems these are no longer used. - {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST", - "Macquarie Island Summer Time", "MIST", + {"Antarctica/Macquarie", new String[] {"Macquarie Island Standard Time", "MIST", + "Macquarie Island Daylight Time", "MIST", The daylight saving time abbreviation should be MIDT. Thanks, Masayoshi On 8/27/2014 10:53 PM, Aleksej Efimov wrote: > Masayoshi, > Thank you for a detailed review - I tried to address all your > comments. Please, see the updated review: > http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.03 > About the workarounds - I will start discussion with Sherman when the > tzdata2014f (and I suppose the 2014g - it will be available soon > according to tzdata mail-list [1]) integration will be complete. > > -Aleksej > > [1] tzdata2014g is coming: > http://mm.icann.org/pipermail/tz/2014-August/021528.html > > On 08/27/2014 12:34 PM, Masayoshi Okutsu wrote: >> Here are additional comments. >> >> src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java: >> >> I'm concerned about the workarounds. It's not new in this update, but >> this problem would make tzupdater data void until the workaround is >> added to the next update release. Could you please work with Sherman >> to eliminate the workaround (outside of this 2014f update)? >> >> src/java.base/share/classes/sun/util/resources/TimeZoneNames.java: >> >> String LORD_HOWE[] = new String[] {"Lord Howe Standard >> Time", "LHST", >> - "Lord Howe Summer Time", >> "LHST", >> + "Lord Howe Summer Time", >> "LHDT", >> >> The S-D convention is applied to Lord Howe as well. >> >> 567 {"Antarctica/Macquarie", new String[] {"Macquarie >> Island Time", "MIST", >> 568 "Macquarie Island Summer Time", "MIST", >> 569 "Macquarie Island Time", "MIST"}}, >> >> This one should also follow the S-D convention, although this time >> zone doesn't observe daylight saving time. >> >> >> + String XJT[] = new String[] {"China Standard Time", "XJT", >> + "China Daylight Time", "XJDT", >> + "China Time", "XJT"}; >> >> Should the long names be based on Xinjiang? >> >> Africa/Freetown is now a link to Africa/Abidjan. Those should be the >> same time zone. >> >> - {"America/Metlakatla", new String[] {"Metlakatla >> Standard Time", "MeST", >> - "Metlakatla >> Daylight Time", "MeDT", >> - "Metlakatla Time", >> "MeT"}}, >> + {"America/Metlakatla", new String[] {"Metlakatla >> Standard Time", "PST", >> + "Metlakatla >> Daylight Time", "PDT", >> + "Metlakatla Time", >> "PT"}}, >> >> - {"Europe/Volgograd", new String[] {"Volgograd Time", >> "VOLT", >> - "Volgograd Summer >> Time", "VOLST", >> - "Volgograd Time", >> "VOLT"}}, >> + {"Europe/Volgograd", new String[] {"Volgograd Time", "MSK", >> + "Volgograd Summer >> Time", "MSK", >> + "Volgograd Time", >> "MSK"}}, >> >> >> The long names should be changed accordingly. >> >> Thanks, >> Masayoshi >> >> On 8/22/2014 9:17 PM, Aleksej Efimov wrote: >>> Masayoshi, >>> You're right that the "root names" should be changed as part of this >>> update. The names were changed according to Australian official >>> document here: http://australia.gov.au/about-australia/our-country/time >>> The fixed version of the webrev can be found here: >>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.02 >>> >>> Thanks, >>> Aleksej >>> >>> >>> On 08/21/2014 03:51 PM, Masayoshi Okutsu wrote: >>>> We used to make name changes in the root (base) bundle as part of >>>> time zone data maintenance and deter only translations. But if you >>>> want to handle name changes later, that would be fine. It's your call. >>>> >>>> Thanks, >>>> Masayoshi >>>> >>>> On 8/21/2014 5:05 PM, Aleksej Efimov wrote: >>>>> Masayoshi, >>>>> I agree that we should change the long names to match the new >>>>> short names introduced by tzdata. >>>>> But I suggest to log a different CR for such activity to handle >>>>> long name changes and their translations (this activity is >>>>> slightly out of tzdata update scope). Does it make sense? >>>>> >>>>> -Aleksej >>>>> >>>>> On 08/21/2014 06:32 AM, Masayoshi Okutsu wrote: >>>>>> I think the long names of the Australia time zones should be >>>>>> revisited to be consistent with the abbreviation changes. The new >>>>>> abbreviations follow the S[tandard] and D[aylight saving] >>>>>> convention rather than the S[tandard] and S[ummer time] one. The >>>>>> long names, such as "Eastern Summer Time (Queensland)", no longer >>>>>> make sense. >>>>>> >>>>>> On the other hand, you will need to access impact of the name >>>>>> changes, including abbreviations. Also, if you change the long >>>>>> names, their translations will need to be changed as well. >>>>>> >>>>>> Thanks, >>>>>> Masayoshi >>>>>> >>>>>> On 8/20/2014 11:59 PM, Aleksej Efimov wrote: >>>>>>> Hi, >>>>>>> >>>>>>> Please, review the tzdata2014f integration (with tzdata2014e >>>>>>> related changes included too) [1] fix to JDK9: >>>>>>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/ >>>>>>> >>>>>>> The tzdata2014f changes are extensive and relates mostly to >>>>>>> timezone short names changes + "Asia/Srednekolymsk" time zone >>>>>>> were added. >>>>>>> Almost complete list of changes can be found in the JBS bug >>>>>>> description [1], plus some changes wasn't documented in tzdata >>>>>>> release notes - for such cases raw tzdata diff was used for the >>>>>>> names modifications. >>>>>>> >>>>>>> Two issues with JSR310 implementation were discovered during >>>>>>> integration process: >>>>>>> First issue is related to the internal representation of the >>>>>>> '24:00' value. The JSR310 implementation treats this value as a >>>>>>> next day 00:00 time. The workaround already exists in JSR310 >>>>>>> code for similar entries and this failure is resolved in similar >>>>>>> way [2] as part of this update. >>>>>>> For the second issue JDK-8051641 [3] was filled and >>>>>>> 'sun/util/calendar/zi/TestZoneInfo310.java' test is the only one >>>>>>> that fails with this tzdata. >>>>>>> Other time zone related tests [4] passes without failures. >>>>>>> >>>>>>> Thank you, >>>>>>> Aleksej >>>>>>> >>>>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8049343 >>>>>>> [2] >>>>>>> http://cr.openjdk.java.net/~aefimov/8049343/9/webrev.01/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java.patch >>>>>>> [3] https://bugs.openjdk.java.net/browse/JDK-8051641 >>>>>>> [4] TZ related test sets: test/sun/util/calendar >>>>>>> test/java/util/Calendar test/sun/util/resources/TimeZone >>>>>>> test/sun/util/calendar test/java/util/TimeZone test/java/time\ >>>>>>> test/java/util/Formatter test/closed/java/util/Calendar >>>>>>> test/closed/java/util/TimeZone >>>>>> >>>>> >>>> >>> >> > From huizhe.wang at oracle.com Thu Aug 28 03:48:03 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Wed, 27 Aug 2014 20:48:03 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <010e01cfc272$1a1667d0$4e433770$@oracle.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> <53FE6BF9.3070305@oracle.com> <010e01cfc272$1a1667d0$4e433770$@oracle.com> Message-ID: <53FEA673.909@oracle.com> The patches I mentioned would disable security manager or grant specific permissions needed to run those code, so that no test needs to be excluded from a target (whether with or without security manager). Thanks, Joe On 8/27/2014 8:42 PM, Frank Yuan wrote: > > Hi Joe > > The test Tristan mentioned that is unable to run with security manager > is > http://sqe-hgi.us.oracle.com/hg/index.cgi/testbase/javase/functional/9/xml/file/3f7ae9b99933/src/JAXP/unittests/unit-test/bug6513892 > , it is used to test xslt redirect extension. When it runs with > security manager, fails due to; > > /java.lang.RuntimeException: Use of the extension element 'redirect' > is not allowed when the secure processing feature is set to true./ > > Anyway, Jibing would communicate with sustaining team about their > patch, the discussion is in another mail chain. > > Best Regards > > Frank > > -----Original Message----- > From: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] On > Behalf Of huizhe wang > Sent: Thursday, August 28, 2014 7:39 AM > To: Tristan Yan > Cc: Core-Libs-Dev > Subject: Re: Review request for JDK-8051540: Convert JAXP functin > tests: org.xml.sax to jtreg (testNG) tests > > On 8/27/2014 4:03 PM, Tristan Yan wrote: > > > Hi Joe and others > > > > > > I updated the tests with putting them in jaxp repo. I also run these > > > tests with security manager and they all passed > > > http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev01/ > > > > > > > > > Awesome. > > > Also I?d like to propose our way for handling jaxp tests run with > > > security manager. The way we?d use is creating two targets for > > > running jaxp tests. One is for normal run; which will run all the > > > tests without security manager. One is secure run; the target only run > > > the tests that have to be run with security manager. This could be > > > easy to be handled with adding two targets in makefile. And for most > > > of people they only care about the function. They only need run normal > > > run target. We would run two targets for any of our formal tests like > > > nightly, ci build and jprt tests. > > Yes, please coordinate with Frank and Eric so that all of the jaxp > tests share the same configuration. > > > For the tests which can not be run in secure mode(like tests for xsltc > > > direct extension), we'd add testng group called ?secure-hostile?. We > > > won?t run these tests in secure mode by bypassing them in secure run > > > target. By this way we could easily transform our tests as usual > > > without additional effort. > > I had been previously updated them so that all of the tests were > capable of running with and without security manager. Sustaining SQE > had invested several month to incorporate the changes into that hosted > in Aurora. Please consider taking the patches from them if you haven't > already done so. > > Thanks, > > Joe > > > > > > Thank you > > > Tristan > > > > > >> On Aug 19, 2014, at 10:32 AM, huizhe wang > >> > wrote: > > >> > > >> By the way, the plan has been that all of the JAXP SQE and Unit tests > > >> be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently > > >> in the jdk repo shall be moved to jaxp/test as well. I see that your > > >> webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're > > >> checking tests into the jdk repo. > > >> > > >> Thanks, > > >> Joe > > >> > > >> On 8/18/2014 4:42 PM, Tristan Yan wrote: > > >>> Thanks Joe > > >>> We intend to replace the base class with test library because that > > >>> doesn?t look like a real base class but an utilities class. > > >>> I haven?t tried to run these tests with security manager, I will run > > >>> them with security manager then get back you soon. > > >>> Thank you. > > >>> Tristan > > >>> > > >>>> On Aug 18, 2014, at 4:32 PM, huizhe wang > >>>> > wrote: > > >>>> > > >>>> > > >>> > > >> > > > > From erik.joelsson at oracle.com Thu Aug 28 06:38:58 2014 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Thu, 28 Aug 2014 08:38:58 +0200 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FE0095.7080700@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> <53FDED9A.5020702@oracle.com> <53FDF252.804@oracle.com> <53FE0095.7080700@oracle.com> Message-ID: <53FECE82.3030602@oracle.com> Hello Mandy, That certainly looks better. A couple of more thoughts, and sorry for not pointing this out earlier, but the new structure is still new to me too. * The rmic targets also generate classes, so for modules.xml to be correct, I suspect you need to depend on that too. Simply add "rmic" after java on the dependency line. I assume the verification doesn't care about resources? If it does, then you would also need to depend on the rest of gendata, something like $(filter-out jdk.dev-gendata, $(GENDATA_TARGETS)). * In Gendata-jdk.dev.gmk, there is an ifndef OPENJDK. We are trying to move away from that construct when possible. It's a bit cumbersome but to avoid it. To do it in the current model, create a closed version of Gendata-jdk.dev.gmk. Add "$(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.dev.gmk))" after "include GendataCommon.gmk". Change the first assignment of METADATA_FILES to += and move the closed addition to the closed version of the file. There is no need for ifndef OPENJDK in the closed file. It only gets included when we build closed. /Erik On 2014-08-27 18:00, Mandy Chung wrote: > Erik, Magnus, > > This is much easier than I have thought. I really like this new build. > I have separated out Gendata-jdk.dev.gmk and removed the modules-xml > target completely. > > Webrev at: > http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.01/ > > Mandy > From mike at saxonica.com Thu Aug 28 07:31:07 2014 From: mike at saxonica.com (Michael Kay) Date: Thu, 28 Aug 2014 08:31:07 +0100 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <010e01cfc272$1a1667d0$4e433770$@oracle.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> <53FE6BF9.3070305@oracle.com> <010e01cfc272$1a1667d0$4e433770$@oracle.com> Message-ID: <0C1D5A9F-94A6-43CC-89DA-787A66F8C3D0@saxonica.com> I haven't yet had a chance to look at the JAXP tests, but this kind of message suggests to me that they don't separate what is in JAXP (the interface) from what is in Xalan and Xerces (the implementations).Would that be a correct assumption? The "redirect" extension is not a JAXP feature, it is a Xalan feature. I've had the impression for some years that the management of JAXP as an interface is far too closely tied up with the management of the JAXP implementations within the JDK. Michael Kay Saxonica mike at saxonica.com +44 (0) 118 946 5893 On 28 Aug 2014, at 04:42, Frank Yuan wrote: > Hi Joe > > > > The test Tristan mentioned that is unable to run with security manager is http://sqe-hgi.us.oracle.com/hg/index.cgi/testbase/javase/functional/9/xml/file/3f7ae9b99933/src/JAXP/unittests/unit-test/bug6513892 , it is used to test xslt redirect extension. When it runs with security manager, fails due to; > > java.lang.RuntimeException: Use of the extension element 'redirect' is not allowed when the secure processing feature is set to true. > > > > Anyway, Jibing would communicate with sustaining team about their patch, the discussion is in another mail chain. > > > > Best Regards > > Frank > > > > > > -----Original Message----- > From: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] On Behalf Of huizhe wang > Sent: Thursday, August 28, 2014 7:39 AM > To: Tristan Yan > Cc: Core-Libs-Dev > Subject: Re: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests > > > > > > On 8/27/2014 4:03 PM, Tristan Yan wrote: > >> Hi Joe and others > >> > >> I updated the tests with putting them in jaxp repo. I also run these > >> tests with security manager and they all passed > >> http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev01/ > >> < http://cr.openjdk.java.net/%7Etyan/JDK-8051540/webrev01/> > >> > > > > Awesome. > > > >> Also I?d like to propose our way for handling jaxp tests run with > >> security manager. The way we?d use is creating two targets for > >> running jaxp tests. One is for normal run; which will run all the > >> tests without security manager. One is secure run; the target only run > >> the tests that have to be run with security manager. This could be > >> easy to be handled with adding two targets in makefile. And for most > >> of people they only care about the function. They only need run normal > >> run target. We would run two targets for any of our formal tests like > >> nightly, ci build and jprt tests. > > > > Yes, please coordinate with Frank and Eric so that all of the jaxp tests share the same configuration. > > > >> For the tests which can not be run in secure mode(like tests for xsltc > >> direct extension), we'd add testng group called ?secure-hostile?. We > >> won?t run these tests in secure mode by bypassing them in secure run > >> target. By this way we could easily transform our tests as usual > >> without additional effort. > > > > I had been previously updated them so that all of the tests were capable of running with and without security manager. Sustaining SQE had invested several month to incorporate the changes into that hosted in Aurora. Please consider taking the patches from them if you haven't already done so. > > > > Thanks, > > Joe > > > >> > >> Thank you > >> Tristan > >> > >>> On Aug 19, 2014, at 10:32 AM, huizhe wang >>> < mailto:huizhe.wang at oracle.com>> wrote: > >>> > >>> By the way, the plan has been that all of the JAXP SQE and Unit tests > >>> be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently > >>> in the jdk repo shall be moved to jaxp/test as well. I see that your > >>> webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're > >>> checking tests into the jdk repo. > >>> > >>> Thanks, > >>> Joe > >>> > >>> On 8/18/2014 4:42 PM, Tristan Yan wrote: > >>>> Thanks Joe > >>>> We intend to replace the base class with test library because that > >>>> doesn?t look like a real base class but an utilities class. > >>>> I haven?t tried to run these tests with security manager, I will run > >>>> them with security manager then get back you soon. > >>>> Thank you. > >>>> Tristan > >>>> > >>>>> On Aug 18, 2014, at 4:32 PM, huizhe wang >>>>> < mailto:huizhe.wang at oracle.com>> wrote: > >>>>> > >>>>> > >>>> > >>> > >> > > > From magnus.ihse.bursie at oracle.com Thu Aug 28 08:32:19 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Thu, 28 Aug 2014 10:32:19 +0200 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FE0095.7080700@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> <53FDED9A.5020702@oracle.com> <53FDF252.804@oracle.com> <53FE0095.7080700@oracle.com> Message-ID: <53FEE913.8000608@oracle.com> On 2014-08-27 18:00, Mandy Chung wrote: > Erik, Magnus, > > This is much easier than I have thought. I really like this new build. Glad to hear! :) > I have separated out Gendata-jdk.dev.gmk and removed the modules-xml > target completely. > > Webrev at: > http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.01/ Looks good, but I still think the CheckModules.gmk file should be in $TOP/make/ instead of jdk/make. As a rule of thumb, stuff working on "all modules" should sit in the top level, but stuff working on a specific module should sit close to that module. Apart from that, it looks great. /Magnus From frank.yuan at oracle.com Thu Aug 28 08:45:49 2014 From: frank.yuan at oracle.com (Frank Yuan) Date: Thu, 28 Aug 2014 16:45:49 +0800 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <0C1D5A9F-94A6-43CC-89DA-787A66F8C3D0@saxonica.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> <53FE6BF9.3070305@oracle.com> <010e01cfc272$1a1667d0$4e433770$@oracle.com> <0C1D5A9F-94A6-43CC-89DA-787A66F8C3D0@saxonica.com> Message-ID: <01bd01cfc29c$79444e00$6bccea00$@oracle.com> Hi, Michael Secure processing feature(XMLConstants.FEATURE_SECURE_PROCESSING) is also valid for transform API(Xalan). And the transform API is a portion of JAXP. To Joe Please correct me if I am wrong. Best Regards Frank -----Original Message----- From: Michael Kay [mailto:mike at saxonica.com] Sent: Thursday, August 28, 2014 3:31 PM To: Frank Yuan Cc: huizhe wang; Tristan Yan; Core-Libs-Dev Subject: Re: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests I haven't yet had a chance to look at the JAXP tests, but this kind of message suggests to me that they don't separate what is in JAXP (the interface) from what is in Xalan and Xerces (the implementations).Would that be a correct assumption? The "redirect" extension is not a JAXP feature, it is a Xalan feature. I've had the impression for some years that the management of JAXP as an interface is far too closely tied up with the management of the JAXP implementations within the JDK. Michael Kay Saxonica mike at saxonica.com +44 (0) 118 946 5893 On 28 Aug 2014, at 04:42, Frank Yuan > wrote: > Hi Joe > > > > The test Tristan mentioned that is unable to run with security manager is bug6513892 , it is used to test xslt redirect extension. When it runs with security manager, fails due to; > > java.lang.RuntimeException: Use of the extension element 'redirect' is not allowed when the secure processing feature is set to true. > > > > Anyway, Jibing would communicate with sustaining team about their patch, the discussion is in another mail chain. > > > > Best Regards > > Frank > > > > > > -----Original Message----- > From: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] On Behalf Of huizhe wang > Sent: Thursday, August 28, 2014 7:39 AM > To: Tristan Yan > Cc: Core-Libs-Dev > Subject: Re: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests > > > > > > On 8/27/2014 4:03 PM, Tristan Yan wrote: > >> Hi Joe and others > >> > >> I updated the tests with putting them in jaxp repo. I also run these > >> tests with security manager and they all passed > >> http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev01/ > >> < http://cr.openjdk.java.net/%7Etyan/JDK-8051540/webrev01/> > >> > > > > Awesome. > > > >> Also I'd like to propose our way for handling jaxp tests run with > >> security manager. The way we'd use is creating two targets for > >> running jaxp tests. One is for normal run; which will run all the > >> tests without security manager. One is secure run; the target only run > >> the tests that have to be run with security manager. This could be > >> easy to be handled with adding two targets in makefile. And for most > >> of people they only care about the function. They only need run normal > >> run target. We would run two targets for any of our formal tests like > >> nightly, ci build and jprt tests. > > > > Yes, please coordinate with Frank and Eric so that all of the jaxp tests share the same configuration. > > > >> For the tests which can not be run in secure mode(like tests for xsltc > >> direct extension), we'd add testng group called "secure-hostile". We > >> won't run these tests in secure mode by bypassing them in secure run > >> target. By this way we could easily transform our tests as usual > >> without additional effort. > > > > I had been previously updated them so that all of the tests were capable of running with and without security manager. Sustaining SQE had invested several month to incorporate the changes into that hosted in Aurora. Please consider taking the patches from them if you haven't already done so. > > > > Thanks, > > Joe > > > >> > >> Thank you > >> Tristan > >> > >>> On Aug 19, 2014, at 10:32 AM, huizhe wang >>> < mailto:huizhe.wang at oracle.com>> wrote: > >>> > >>> By the way, the plan has been that all of the JAXP SQE and Unit tests > >>> be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently > >>> in the jdk repo shall be moved to jaxp/test as well. I see that your > >>> webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're > >>> checking tests into the jdk repo. > >>> > >>> Thanks, > >>> Joe > >>> > >>> On 8/18/2014 4:42 PM, Tristan Yan wrote: > >>>> Thanks Joe > >>>> We intend to replace the base class with test library because that > >>>> doesn't look like a real base class but an utilities class. > >>>> I haven't tried to run these tests with security manager, I will run > >>>> them with security manager then get back you soon. > >>>> Thank you. > >>>> Tristan > >>>> > >>>>> On Aug 18, 2014, at 4:32 PM, huizhe wang >>>>> < mailto:huizhe.wang at oracle.com>> wrote: > >>>>> > >>>>> > >>>> > >>> > >> > > > From paul.sandoz at oracle.com Thu Aug 28 08:51:11 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 28 Aug 2014 10:51:11 +0200 Subject: RFR 8u: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value In-Reply-To: References: <1B51A5CD-A909-42C4-97D1-1F8F5DFE55D2@oracle.com> Message-ID: On Aug 20, 2014, at 10:49 AM, Joel Borggr?n-Franck wrote: > Hi, > > On 17 jun 2014, at 18:52, Joel Borggr?n-Franck wrote: > >> Hi, >> >> Can I get a review for this fix and javadoc clarification for https://bugs.openjdk.java.net/browse/JDK-8044629 >> >> The problem is with potentially annotated receiver parameters, they only exist for inner class constructors, so this fix makes sure that a ctor is for an inner class or returns null (as for a static method) otherwise. >> >> CCC has been approved. >> >> Webrev: http://cr.openjdk.java.net/~jfranck/8044629/webrev.00/ > > > Can i get a review for this in 8u as well. Only change is a ?@since 1.8? have been removed in 9, patch applies cleanly if you up the fuzz. > > http://cr.openjdk.java.net/~jfranck/8044629/jdk8u/webrev.00/ > +1 Paul. From ivan.gerasimov at oracle.com Thu Aug 28 11:09:21 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 28 Aug 2014 15:09:21 +0400 Subject: [7u-dev] Request for Approval and Review: 8017212: File.createTempFile requires unnecessary "read" permission In-Reply-To: <53EE2A0E.9040900@oracle.com> References: <53EE2A0E.9040900@oracle.com> Message-ID: <53FF0DE1.8060606@oracle.com> Hello! Could someone please review this mostly strait-forward backport? The only conflict in the fix was a curly bracket. The regtest had a few conflicts, so it seemed better to replace it with the latest version from jdk8u. Thanks in advance, Ivan On 15.08.2014 19:41, Ivan Gerasimov wrote: > Hello! > > I'd like to ask an approval to backport 8017212 into 7u-dev. > > The patch does not apply cleanly, however the required modifications > are quite small. > Nevertheless, I will need a peer review for this. > > The webrev for jdk7: > http://cr.openjdk.java.net/~igerasim/8017212/0/webrev/ > > The difference, compared to jdk8 is: > src/share/classes/java/io/File.java -- curly bracket at the end of > the line > test/java/io/File/createTempFile/SpecialTempFile.java -- there were > conflicts due to backport of 8025128, so the test was just copied > verbatim from the latest jdk8u. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8017212 > Jdk8 changeset: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/10d2a4b1e576 > Jdk8 review: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018354.html > > The change was tested with jprt on all supported platforms. > All the io tests, including added and updated, passed. > > Sincerely yours, > Ivan > > From Alan.Bateman at oracle.com Thu Aug 28 11:44:24 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 28 Aug 2014 12:44:24 +0100 Subject: [7u-dev] Request for Approval and Review: 8017212: File.createTempFile requires unnecessary "read" permission In-Reply-To: <53FF0DE1.8060606@oracle.com> References: <53EE2A0E.9040900@oracle.com> <53FF0DE1.8060606@oracle.com> Message-ID: <53FF1618.9070809@oracle.com> On 28/08/2014 12:09, Ivan Gerasimov wrote: > Hello! > > Could someone please review this mostly strait-forward backport? > > The only conflict in the fix was a curly bracket. > The regtest had a few conflicts, so it seemed better to replace it > with the latest version from jdk8u. > This seems to align it with what we have in 8u so looks okay. -Alan From paul.sandoz at oracle.com Thu Aug 28 14:38:46 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 28 Aug 2014 16:38:46 +0200 Subject: DMH to fields, casts and type profiling Re: [9] RFR (M): 8037209: Improvements and cleanups to bytecode assembly for lambda forms In-Reply-To: <7FAEB94F-EB98-49A9-A4B0-9B4A6B730CA9@oracle.com> References: <5322EBF2.7030209@oracle.com> <5322F3D7.9010103@oracle.com> <94F61B19-8904-42FA-9E16-CC0A6B30FD79@oracle.com> <53230184.9090007@oracle.com> <2FCC64E3-3753-4CE0-9CC6-849FF737BFB5@oracle.com> <53232FF3.9020803@oracle.com> <53305E52.2060001@oracle.com> <53BBC340.7040509@oracle.com> <7FAEB94F-EB98-49A9-A4B0-9B4A6B730CA9@oracle.com> Message-ID: <23A89ADB-F43D-4AAA-B0FB-8B7D4748355F@oracle.com> On Jul 8, 2014, at 9:09 PM, John Rose wrote: > Regarding the extra cast in accessor logic that Paul picked up on: That may be a left-over from obsolete versions of the code, or it may cover for some corner cases, or it could possibly be a re-assurance to the JIT. > I had some enlightening discussions with Roland on this. It seems quite tricky to solve in general the removal of the null check due to the aggressive nature in which the null branch is reduce to a trap, but IIUC may be possible to turn Class.cast into an intrinsic to handle the specific case (although that seems costly). I was labouring under the misapprehension that an explicit Class.cast was a profiling point but now i realize it's only certain byte codes (like checkcast/invokehandle). Nothing specific to the DHM access logic showed up with regards to type profiling when analysing the MethodData output from some simple examples [*]. Therefore i presume it's more likely to be the first or third reason you state. So i propose to proceed with the experiment with a patch to replace the casts with asserts in the accessor logic and run that through the usual tests. Paul. [*] Also i have so far failed to concoct a simple example for VarHandles where i can trigger profile pollution and failed inlining From ivan.gerasimov at oracle.com Thu Aug 28 14:41:36 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 28 Aug 2014 18:41:36 +0400 Subject: [7u-dev] Request for Approval and Review: 8017212: File.createTempFile requires unnecessary "read" permission In-Reply-To: <53FF1618.9070809@oracle.com> References: <53EE2A0E.9040900@oracle.com> <53FF0DE1.8060606@oracle.com> <53FF1618.9070809@oracle.com> Message-ID: <53FF3FA0.3020406@oracle.com> Thanks! On 28.08.2014 15:44, Alan Bateman wrote: > On 28/08/2014 12:09, Ivan Gerasimov wrote: >> Hello! >> >> Could someone please review this mostly strait-forward backport? >> >> The only conflict in the fix was a curly bracket. >> The regtest had a few conflicts, so it seemed better to replace it >> with the latest version from jdk8u. >> > This seems to align it with what we have in 8u so looks okay. > > -Alan > > > From pavel.rappo at oracle.com Thu Aug 28 16:13:33 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Thu, 28 Aug 2014 17:13:33 +0100 Subject: A List from Iterator Message-ID: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> Hi everyone, Is there any particular reason why there's no convenience method for iterators similar to j.u.Collections.list for enumerations? Or at least the one that adapts Iterator to Enumeration and vice versa. Thanks. -Pavel From blackdrag at gmx.org Thu Aug 28 16:30:41 2014 From: blackdrag at gmx.org (Jochen Theodorou) Date: Thu, 28 Aug 2014 18:30:41 +0200 Subject: A List from Iterator In-Reply-To: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> References: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> Message-ID: <53FF5931.1020303@gmx.org> Am 28.08.2014 18:13, schrieb Pavel Rappo: > Hi everyone, > > Is there any particular reason why there's no convenience method for iterators similar to j.u.Collections.list for enumerations? Or at least the one that adapts Iterator to Enumeration and vice versa. Thanks. my opinion: Enumeration is pre java 1.2. Back then java we to get away from that to collections already. Now it is probably streams. Besides supporting old code, there is rarely a good reason to support Enumeration in anything. bye Jochen -- Jochen "blackdrag" Theodorou - Groovy Project Tech Lead blog: http://blackdragsview.blogspot.com/ german groovy discussion newsgroup: de.comp.lang.misc For Groovy programming sources visit http://groovy-lang.org From jason_mehrens at hotmail.com Thu Aug 28 16:51:59 2014 From: jason_mehrens at hotmail.com (Jason Mehrens) Date: Thu, 28 Aug 2014 11:51:59 -0500 Subject: A List from Iterator In-Reply-To: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> References: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> Message-ID: Pavel, The stated reason is to discourage use of a 'poor man's collection'. See Java Collections API Design FAQ (http://docs.oracle.com/javase/7/docs/technotes/guides/collections/designfaq.html) under the 'Collection Interface' section. Jason ---------------------------------------- > From: pavel.rappo at oracle.com > Subject: A List from Iterator > Date: Thu, 28 Aug 2014 17:13:33 +0100 > To: core-libs-dev at openjdk.java.net > > Hi everyone, > > Is there any particular reason why there's no convenience method for iterators similar to j.u.Collections.list for enumerations? Or at least the one that adapts Iterator to Enumeration and vice versa. Thanks. > > -Pavel > From mike.duigou at oracle.com Thu Aug 28 16:52:34 2014 From: mike.duigou at oracle.com (Mike Duigou) Date: Thu, 28 Aug 2014 09:52:34 -0700 Subject: A List from Iterator In-Reply-To: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> References: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> Message-ID: <02202C56-63EF-45FE-B9AA-06B1E1EA7BA1@oracle.com> We considered having Enumeration extend Iterator and provide next() and hasNext() defaults which called the Enumeration methods but found, unfortuantely that there were several Enumeration implementations that already had next(). If we were to provide a Collections util it would to wrap Enumeration as an Iterator but that's it. Mike On Aug 28 2014, at 09:13 , Pavel Rappo wrote: > Hi everyone, > > Is there any particular reason why there's no convenience method for iterators similar to j.u.Collections.list for enumerations? Or at least the one that adapts Iterator to Enumeration and vice versa. Thanks. > > -Pavel > From roger.riggs at oracle.com Thu Aug 28 16:58:06 2014 From: roger.riggs at oracle.com (roger riggs) Date: Thu, 28 Aug 2014 12:58:06 -0400 Subject: Process API Updates (JEP 102) In-Reply-To: References: Message-ID: <53FF5F9E.60701@oracle.com> Hi Ron, I have not looked at that idea closely but I would be concerned about the robustness of the 2nd, execve'd Java runtime. Since it would not be a brand new process, there might be leftover state from the previous execution that would break the usual assumptions of a newly started Java Runtime. Anything from signal handler state to open file descriptors to the specific memory mapping and there may be others. Roger On 8/26/2014 7:25 AM, Ron Pressler wrote: > I might be a little late to this party, but recently I've had a (rather > frustrating) need for the ability to execve a process rather than fork-exec > it. I understand that the ability to exec (replace the current process's > image) is also available on Windows. This operation (on ProcessBuilder?), > which never returns, would have the same semantics as > System.exit(pb.start().waitFor()), only it would replace the current JVM > process (i.e. maintain the same pid/handle) with the command. > > This is required when a JVM process is used to set up and launch another, > JVM or other, process, but we'd want the user running the program to be > oblivious to the setup process (because, say, they want to monitor the > running program with some OS tool). > > Ron From mandy.chung at oracle.com Thu Aug 28 17:16:39 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 28 Aug 2014 10:16:39 -0700 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FEE913.8000608@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> <53FDED9A.5020702@oracle.com> <53FDF252.804@oracle.com> <53FE0095.7080700@oracle.com> <53FEE913.8000608@oracle.com> Message-ID: <53FF63F7.2010605@oracle.com> On 8/28/14 1:32 AM, Magnus Ihse Bursie wrote: > On 2014-08-27 18:00, Mandy Chung wrote: >> Erik, Magnus, >> >> This is much easier than I have thought. I really like this new build. > Glad to hear! :) >> I have separated out Gendata-jdk.dev.gmk and removed the modules-xml >> target completely. >> >> Webrev at: >> http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.01/ > > Looks good, but I still think the CheckModules.gmk file should be in > $TOP/make/ instead of jdk/make. As a rule of thumb, stuff working on > "all modules" should sit in the top level, but stuff working on a > specific module should sit close to that module. Apart from that, it > looks great. Agree. It should be moved to the top repo. jdk/make/ModulesXml.gmk was added while the modular build was undergoing various change/reorganized. I will move it. Mandy From mandy.chung at oracle.com Thu Aug 28 17:21:54 2014 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 28 Aug 2014 10:21:54 -0700 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FECE82.3030602@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> <53FDED9A.5020702@oracle.com> <53FDF252.804@oracle.com> <53FE0095.7080700@oracle.com> <53FECE82.3030602@oracle.com> Message-ID: <53FF6532.7080402@oracle.com> On 8/27/14 11:38 PM, Erik Joelsson wrote: > Hello Mandy, > > That certainly looks better. A couple of more thoughts, and sorry for > not pointing this out earlier, but the new structure is still new to > me too. > > * The rmic targets also generate classes, so for modules.xml to be > correct, I suspect you need to depend on that too. Simply add "rmic" > after java on the dependency line. I assume the verification doesn't > care about resources? If it does, then you would also need to depend > on the rest of gendata, something like $(filter-out jdk.dev-gendata, > $(GENDATA_TARGETS)). Good catch. rmic needs to be added in the dependency. jdeps verifies class files only and doesn't care about resources. > > * In Gendata-jdk.dev.gmk, there is an ifndef OPENJDK. We are trying to > move away from that construct when possible. It's a bit cumbersome but > to avoid it. To do it in the current model, create a closed version of > Gendata-jdk.dev.gmk. Add "$(eval $(call IncludeCustomExtension, jdk, > gendata/Gendata-jdk.dev.gmk))" after "include GendataCommon.gmk". > Change the first assignment of METADATA_FILES to += and move the > closed addition to the closed version of the file. There is no need > for ifndef OPENJDK in the closed file. It only gets included when we > build closed. That's another good change in the build. Updated webrev: http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.02/ I also moved jdk/make/CheckModules.gmk to top/make/CheckModules.gmk per Magnus's suggestion. Mandy > > /Erik > > On 2014-08-27 18:00, Mandy Chung wrote: >> Erik, Magnus, >> >> This is much easier than I have thought. I really like this new build. >> I have separated out Gendata-jdk.dev.gmk and removed the modules-xml >> target completely. >> >> Webrev at: >> http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.01/ >> >> Mandy >> > From magnus.ihse.bursie at oracle.com Thu Aug 28 17:26:58 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Thu, 28 Aug 2014 19:26:58 +0200 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FF6532.7080402@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> <53FDED9A.5020702@oracle.com> <53FDF252.804@oracle.com> <53FE0095.7080700@oracle.com> <53FECE82.3030602@oracle.com> <53FF6532.7080402@oracle.com> Message-ID: <26CA57A3-1650-4F71-8E5D-903EC49FA733@oracle.com> Looks great! Thank you for polishing this fix! /Magnus 28 aug 2014 kl. 19:21 skrev Mandy Chung : > On 8/27/14 11:38 PM, Erik Joelsson wrote: >> Hello Mandy, >> >> That certainly looks better. A couple of more thoughts, and sorry for not pointing this out earlier, but the new structure is still new to me too. >> >> * The rmic targets also generate classes, so for modules.xml to be correct, I suspect you need to depend on that too. Simply add "rmic" after java on the dependency line. I assume the verification doesn't care about resources? If it does, then you would also need to depend on the rest of gendata, something like $(filter-out jdk.dev-gendata, $(GENDATA_TARGETS)). > > Good catch. rmic needs to be added in the dependency. jdeps verifies class files only and doesn't care about resources. > >> >> * In Gendata-jdk.dev.gmk, there is an ifndef OPENJDK. We are trying to move away from that construct when possible. It's a bit cumbersome but to avoid it. To do it in the current model, create a closed version of Gendata-jdk.dev.gmk. Add "$(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.dev.gmk))" after "include GendataCommon.gmk". Change the first assignment of METADATA_FILES to += and move the closed addition to the closed version of the file. There is no need for ifndef OPENJDK in the closed file. It only gets included when we build closed. > > That's another good change in the build. > > Updated webrev: > http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.02/ > > I also moved jdk/make/CheckModules.gmk to top/make/CheckModules.gmk per Magnus's suggestion. > > Mandy > >> >> /Erik >> >> On 2014-08-27 18:00, Mandy Chung wrote: >>> Erik, Magnus, >>> >>> This is much easier than I have thought. I really like this new build. >>> I have separated out Gendata-jdk.dev.gmk and removed the modules-xml >>> target completely. >>> >>> Webrev at: >>> http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.01/ >>> >>> Mandy > From Ulf.Zibis at CoSoCo.de Thu Aug 28 17:27:28 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Thu, 28 Aug 2014 19:27:28 +0200 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: <53FF6680.9000907@CoSoCo.de> Am 27.08.2014 um 17:51 schrieb Martin Buchholz: > The ArrayList version saves one byte of bytecode, and is therefore very > slightly better. We should bless that version and use it consistently. +1 Additional argument: The LinkedList code requires to load 32/64-Bit -1 into CPU. This may take some time on some CPU and at least wastes memory footprint. Additionally register pressure increases. Vitaly, please correct me, if I'm wrong, just for learning more. Another advantage is that there is no problem if some implementation of indexOf() erroneously returns another negative value than -1. I remember some compare() implementations, which sometimes return different values than only -1, 0, +1. -Ulf >> ArrayList: >> >> public boolean contains(Object o) { >> return indexOf(o) >= 0; >> } >> >> LinkedList: >> >> public boolean contains(Object o) { >> return indexOf(o) != -1; >> } >> From lowasser at google.com Thu Aug 28 17:30:10 2014 From: lowasser at google.com (Louis Wasserman) Date: Thu, 28 Aug 2014 10:30:10 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: <53FF6680.9000907@CoSoCo.de> References: <53FF6680.9000907@CoSoCo.de> Message-ID: Comparator is spec'd to be allowed to return any number, positive, negative, or zero, but indexOf is specifically spec'd to return -1. If an indexOf method returns a negative value other than -1, that is a bug; it is not a bug if a Comparator returns a number other than -1, 0, +1. On Thu, Aug 28, 2014 at 10:27 AM, Ulf Zibis wrote: > > Am 27.08.2014 um 17:51 schrieb Martin Buchholz: > > The ArrayList version saves one byte of bytecode, and is therefore very >> slightly better. We should bless that version and use it consistently. >> > > +1 > Additional argument: > The LinkedList code requires to load 32/64-Bit -1 into CPU. This may take > some time on some CPU and at least wastes memory footprint. > Additionally register pressure increases. > Vitaly, please correct me, if I'm wrong, just for learning more. > > Another advantage is that there is no problem if some implementation of > indexOf() erroneously returns another negative value than -1. I remember > some compare() implementations, which sometimes return different values > than only -1, 0, +1. > > -Ulf > > > ArrayList: >>> >>> public boolean contains(Object o) { >>> return indexOf(o) >= 0; >>> } >>> >>> LinkedList: >>> >>> public boolean contains(Object o) { >>> return indexOf(o) != -1; >>> } >>> >>> > -- Louis Wasserman From lance.andersen at oracle.com Thu Aug 28 17:35:41 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Thu, 28 Aug 2014 13:35:41 -0400 Subject: [8u-dev] RFR: 8036981: JAXB not preserving formatting for xsd:any Mixed content In-Reply-To: <53FDE113.1030503@oracle.com> References: <53F21BF5.7000803@oracle.com> <53F7A18F.4090505@oracle.com> <53FC8476.5010207@oracle.com> <53FC95D3.5040508@oracle.com> <53FDE113.1030503@oracle.com> Message-ID: <44C15DD2-68C5-417E-A633-4EB588DC40BB@oracle.com> This change looks fine and I believe Miran also reviewed this. Best Lance On Aug 27, 2014, at 9:45 AM, Aleksej Efimov wrote: > Hi, > I'm adding a core-libs-dev mail list - I might be lucky to find a JDK8 reviewer for my fix there. > > Thank you, > Aleksej > > On 08/26/2014 06:12 PM, Aleksej Efimov wrote: >> Hi Dalibor, >> >> It's a partial backport (logged with a different bugID) of JDK9 fix, I got an approval from Miran (Thank you Miran!) and right now I'm waiting for a JDK8 reviewer approval. >> >> -Aleksej >> >> On 08/26/2014 04:58 PM, dalibor topic wrote: >>> Hi Aleksej - are you looking for approval to push into jdk8u-dev? >>> >>> cheers, >>> dalibor topic >>> >>> On 22.08.2014 22:01, Miroslav Kos wrote: >>>> Hi Aleksej, >>>> looks good to me. >>>> >>>> Thanks >>>> Miran >>>> >>>> >>>> On 18/08/14 17:29, Aleksej Efimov wrote: >>>>> Hi, >>>>> >>>>> Can I ask for a review of 8036981 bug [1] fix: >>>>> JAXWS: http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jaxws/ >>>>> JDK: http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jdk/ >>>>> >>>>> The proposed fix is a partial backport of "Update JAX-WS RI >>>>> integration to latest version" bug [2] to JDK8. >>>>> The proposed patch fixes the broken formatting of the input xml during >>>>> JAXB marshalling/unmarshalling. Regression test is included. >>>>> Testing: >>>>> - regtests: xml related tests from 'core' testset - no failures >>>>> - JCK: api/xinclude api/xsl api/javax_xml api/org_xml xml_schema >>>>> api/xinclude - no failures >>>>> >>>>> Thank you, >>>>> Aleksej >>>>> >>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8036981 >>>>> [2] https://bugs.openjdk.java.net/browse/JDK-8044656 >>>>> [3] 8044656 JDK9 review thread: >>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-June/027458.html >>>>> >>>>> >>>> >>> >> > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From vitalyd at gmail.com Thu Aug 28 17:46:22 2014 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Thu, 28 Aug 2014 13:46:22 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: <53FF6680.9000907@CoSoCo.de> References: <53FF6680.9000907@CoSoCo.de> Message-ID: There's no register pressure - the immediate (I.e. -1) is encoded directly into the instruction, just like 0 would be. The time when 0 is particularly useful is when you test for it in the zero bit of the flags register (e.g. dec followed by jz, such as when counting a loop down to 0). Otherwise, I don't see any advantage from machine code perspective. The aforementioned cmov instruction is not without its own downsides, so it's unclear which is better when branch probability isn't known a priori. The 1 byte code is unlikely to make any difference, unless jit is turned off and you're running this through a tight loop in the interpreter (but if one does that, perf conversation is moot :)). Sent from my phone On Aug 28, 2014 1:28 PM, "Ulf Zibis" wrote: > > Am 27.08.2014 um 17:51 schrieb Martin Buchholz: > >> The ArrayList version saves one byte of bytecode, and is therefore very >> slightly better. We should bless that version and use it consistently. >> > > +1 > Additional argument: > The LinkedList code requires to load 32/64-Bit -1 into CPU. This may take > some time on some CPU and at least wastes memory footprint. > Additionally register pressure increases. > Vitaly, please correct me, if I'm wrong, just for learning more. > > Another advantage is that there is no problem if some implementation of > indexOf() erroneously returns another negative value than -1. I remember > some compare() implementations, which sometimes return different values > than only -1, 0, +1. > > -Ulf > > ArrayList: >>> >>> public boolean contains(Object o) { >>> return indexOf(o) >= 0; >>> } >>> >>> LinkedList: >>> >>> public boolean contains(Object o) { >>> return indexOf(o) != -1; >>> } >>> >>> > From vitalyd at gmail.com Thu Aug 28 17:49:34 2014 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Thu, 28 Aug 2014 13:49:34 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> Message-ID: Also, micro optimization conversations at this scale would have a leg to stand on if we were talking about a tight loop with very simple instructions around it with no memory chasing; this is LinkedList traversal with equality checking we're talking about. Sent from my phone On Aug 28, 2014 1:46 PM, "Vitaly Davidovich" wrote: > There's no register pressure - the immediate (I.e. -1) is encoded directly > into the instruction, just like 0 would be. The time when 0 is > particularly useful is when you test for it in the zero bit of the flags > register (e.g. dec followed by jz, such as when counting a loop down to > 0). Otherwise, I don't see any advantage from machine code perspective. > The aforementioned cmov instruction is not without its own downsides, so > it's unclear which is better when branch probability isn't known a priori. > > The 1 byte code is unlikely to make any difference, unless jit is turned > off and you're running this through a tight loop in the interpreter (but if > one does that, perf conversation is moot :)). > > Sent from my phone > On Aug 28, 2014 1:28 PM, "Ulf Zibis" wrote: > >> >> Am 27.08.2014 um 17:51 schrieb Martin Buchholz: >> >>> The ArrayList version saves one byte of bytecode, and is therefore very >>> slightly better. We should bless that version and use it consistently. >>> >> >> +1 >> Additional argument: >> The LinkedList code requires to load 32/64-Bit -1 into CPU. This may take >> some time on some CPU and at least wastes memory footprint. >> Additionally register pressure increases. >> Vitaly, please correct me, if I'm wrong, just for learning more. >> >> Another advantage is that there is no problem if some implementation of >> indexOf() erroneously returns another negative value than -1. I remember >> some compare() implementations, which sometimes return different values >> than only -1, 0, +1. >> >> -Ulf >> >> ArrayList: >>>> >>>> public boolean contains(Object o) { >>>> return indexOf(o) >= 0; >>>> } >>>> >>>> LinkedList: >>>> >>>> public boolean contains(Object o) { >>>> return indexOf(o) != -1; >>>> } >>>> >>>> >> From vitalyd at gmail.com Thu Aug 28 17:51:40 2014 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Thu, 28 Aug 2014 13:51:40 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> Message-ID: Right, and people take advantage of Comparable spec to avoid branches (when over/underflow isn't a concern). Sent from my phone On Aug 28, 2014 1:30 PM, "Louis Wasserman" wrote: > Comparator is spec'd to be allowed to return any number, positive, > negative, or zero, but indexOf is specifically spec'd to return -1. > > If an indexOf method returns a negative value other than -1, that is a bug; > it is not a bug if a Comparator returns a number other than -1, 0, +1. > > > On Thu, Aug 28, 2014 at 10:27 AM, Ulf Zibis wrote: > > > > > Am 27.08.2014 um 17:51 schrieb Martin Buchholz: > > > > The ArrayList version saves one byte of bytecode, and is therefore very > >> slightly better. We should bless that version and use it consistently. > >> > > > > +1 > > Additional argument: > > The LinkedList code requires to load 32/64-Bit -1 into CPU. This may take > > some time on some CPU and at least wastes memory footprint. > > Additionally register pressure increases. > > Vitaly, please correct me, if I'm wrong, just for learning more. > > > > Another advantage is that there is no problem if some implementation of > > indexOf() erroneously returns another negative value than -1. I remember > > some compare() implementations, which sometimes return different values > > than only -1, 0, +1. > > > > -Ulf > > > > > > ArrayList: > >>> > >>> public boolean contains(Object o) { > >>> return indexOf(o) >= 0; > >>> } > >>> > >>> LinkedList: > >>> > >>> public boolean contains(Object o) { > >>> return indexOf(o) != -1; > >>> } > >>> > >>> > > > > > -- > Louis Wasserman > From Ulf.Zibis at CoSoCo.de Thu Aug 28 18:17:40 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Thu, 28 Aug 2014 20:17:40 +0200 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <902B0B7A-32BE-498A-B9DD-8937960430A2@oracle.com> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <53E8CCD6.2090503@CoSoCo.de> <53FDA7C1.6060303@CoSoCo.de> <902B0B7A-32BE-498A-B9DD-8937960430A2@oracle.com> Message-ID: <53FF7244.2030804@CoSoCo.de> I mean: It does not output byte code that only uses a single char array to compose the entire String in question. With "optimization fails", I also mean, there is used an additional "StringComposer" e.g. another StringBuilder or a StringJoiner in addition to the 1st StringBuilder. -Ulf Am 27.08.2014 um 14:02 schrieb Pavel Rappo: > Could you please explain what you mean by "javac optimization fails" here? > > -Pavel > > On 27 Aug 2014, at 10:41, Ulf Zibis wrote: > >> 4.) Now we see, that javac optimization fails again if StringBuilder, concatenation, toString(), append(String), append(Collection) etc. and StringJoiner use is mixed. > From huizhe.wang at oracle.com Thu Aug 28 20:22:59 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Thu, 28 Aug 2014 13:22:59 -0700 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <0C1D5A9F-94A6-43CC-89DA-787A66F8C3D0@saxonica.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> <53FE6BF9.3070305@oracle.com> <010e01cfc272$1a1667d0$4e433770$@oracle.com> <0C1D5A9F-94A6-43CC-89DA-787A66F8C3D0@saxonica.com> Message-ID: <53FF8FA3.50301@oracle.com> Hi Michael, These are functional and unit tests. They reflect what are supported by the JDK. So yes, you are right, a good portion of them are relevant to the implementation. If you are looking for pure JAXP API tests, you'd find them in the JCK. Thanks, Joe On 8/28/2014 12:31 AM, Michael Kay wrote: > I haven't yet had a chance to look at the JAXP tests, but this kind of message suggests to me that they don't separate what is in JAXP (the interface) from what is in Xalan and Xerces (the implementations).Would that be a correct assumption? The "redirect" extension is not a JAXP feature, it is a Xalan feature. > > I've had the impression for some years that the management of JAXP as an interface is far too closely tied up with the management of the JAXP implementations within the JDK. > > Michael Kay > Saxonica > mike at saxonica.com > +44 (0) 118 946 5893 > > > > > On 28 Aug 2014, at 04:42, Frank Yuan wrote: > >> Hi Joe >> >> >> >> The test Tristan mentioned that is unable to run with security manager is http://sqe-hgi.us.oracle.com/hg/index.cgi/testbase/javase/functional/9/xml/file/3f7ae9b99933/src/JAXP/unittests/unit-test/bug6513892 , it is used to test xslt redirect extension. When it runs with security manager, fails due to; >> >> java.lang.RuntimeException: Use of the extension element 'redirect' is not allowed when the secure processing feature is set to true. >> >> >> >> Anyway, Jibing would communicate with sustaining team about their patch, the discussion is in another mail chain. >> >> >> >> Best Regards >> >> Frank >> >> >> >> >> >> -----Original Message----- >> From: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] On Behalf Of huizhe wang >> Sent: Thursday, August 28, 2014 7:39 AM >> To: Tristan Yan >> Cc: Core-Libs-Dev >> Subject: Re: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests >> >> >> >> >> >> On 8/27/2014 4:03 PM, Tristan Yan wrote: >> >>> Hi Joe and others >>> I updated the tests with putting them in jaxp repo. I also run these >>> tests with security manager and they all passed >>> http://cr.openjdk.java.net/~tyan/JDK-8051540/webrev01/ >>> < http://cr.openjdk.java.net/%7Etyan/JDK-8051540/webrev01/> >> >> >> Awesome. >> >> >> >>> Also I?d like to propose our way for handling jaxp tests run with >>> security manager. The way we?d use is creating two targets for >>> running jaxp tests. One is for normal run; which will run all the >>> tests without security manager. One is secure run; the target only run >>> the tests that have to be run with security manager. This could be >>> easy to be handled with adding two targets in makefile. And for most >>> of people they only care about the function. They only need run normal >>> run target. We would run two targets for any of our formal tests like >>> nightly, ci build and jprt tests. >> >> >> Yes, please coordinate with Frank and Eric so that all of the jaxp tests share the same configuration. >> >> >> >>> For the tests which can not be run in secure mode(like tests for xsltc >>> direct extension), we'd add testng group called ?secure-hostile?. We >>> won?t run these tests in secure mode by bypassing them in secure run >>> target. By this way we could easily transform our tests as usual >>> without additional effort. >> >> >> I had been previously updated them so that all of the tests were capable of running with and without security manager. Sustaining SQE had invested several month to incorporate the changes into that hosted in Aurora. Please consider taking the patches from them if you haven't already done so. >> >> >> >> Thanks, >> >> Joe >> >> >> >>> Thank you >>> Tristan >>>> On Aug 19, 2014, at 10:32 AM, huizhe wang >>> < mailto:huizhe.wang at oracle.com>> wrote: >>>> By the way, the plan has been that all of the JAXP SQE and Unit tests >>>> be migrated into [openjdk]/jaxp repo under jaxp/test. Tests currently >>>> in the jdk repo shall be moved to jaxp/test as well. I see that your >>>> webrev was generated in jdk9/dev/jdk. I hope it doesn't mean you're >>>> checking tests into the jdk repo. >>>> Thanks, >>>> Joe >>>> On 8/18/2014 4:42 PM, Tristan Yan wrote: >>>>> Thanks Joe >>>>> We intend to replace the base class with test library because that >>>>> doesn?t look like a real base class but an utilities class. >>>>> I haven?t tried to run these tests with security manager, I will run >>>>> them with security manager then get back you soon. >>>>> Thank you. >>>>> Tristan >>>>>> On Aug 18, 2014, at 4:32 PM, huizhe wang >>>>> < mailto:huizhe.wang at oracle.com>> wrote: >> >> From pavel.rappo at oracle.com Thu Aug 28 22:22:11 2014 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Thu, 28 Aug 2014 23:22:11 +0100 Subject: A List from Iterator In-Reply-To: <02202C56-63EF-45FE-B9AA-06B1E1EA7BA1@oracle.com> References: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> <02202C56-63EF-45FE-B9AA-06B1E1EA7BA1@oracle.com> Message-ID: <090E62C8-18EA-4325-BD73-B125B847884E@oracle.com> > If we were to provide a Collections util it would to wrap Enumeration as an Iterator but that's it. Mike, that's what I'm talking about. It's just for convenience. -Pavel From ivan.gerasimov at oracle.com Thu Aug 28 22:28:18 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 29 Aug 2014 02:28:18 +0400 Subject: RFR: [8056310] Cleanup in WinNTFileSystem_md.c Message-ID: <53FFAD02.1030906@oracle.com> Hello! This is a proposal to make some minor cleanup in WinNTFileSystem_md.c: - fix a typo in error message, - use wide char constant for consistency, - avoid an array reallocation for power-of-two sizes, - avoid a very unlikely memory leak (when frompath != NULL && topath == NULL). BUGURL: https://bugs.openjdk.java.net/browse/JDK-8056310 WEBREV: http://cr.openjdk.java.net/~igerasim/8056310/0/webrev/ Sincerely yours, Ivan From john.r.rose at oracle.com Thu Aug 28 22:45:42 2014 From: john.r.rose at oracle.com (John Rose) Date: Thu, 28 Aug 2014 15:45:42 -0700 Subject: DMH to fields, casts and type profiling Re: [9] RFR (M): 8037209: Improvements and cleanups to bytecode assembly for lambda forms In-Reply-To: <23A89ADB-F43D-4AAA-B0FB-8B7D4748355F@oracle.com> References: <5322EBF2.7030209@oracle.com> <5322F3D7.9010103@oracle.com> <94F61B19-8904-42FA-9E16-CC0A6B30FD79@oracle.com> <53230184.9090007@oracle.com> <2FCC64E3-3753-4CE0-9CC6-849FF737BFB5@oracle.com> <53232FF3.9020803@oracle.com> <53305E52.2060001@oracle.com> <53BBC340.7040509@oracle.com> <7FAEB94F-EB98-49A9-A4B0-9B4A6B730CA9@oracle.com> <23A89ADB-F43D-4AAA-B0FB-8B7D4748355F@oracle.com> Message-ID: <29479440-3FB5-4D81-9BA2-E5B179F1461B@oracle.com> On Aug 28, 2014, at 7:38 AM, Paul Sandoz wrote: > On Jul 8, 2014, at 9:09 PM, John Rose wrote: > >> Regarding the extra cast in accessor logic that Paul picked up on: That may be a left-over from obsolete versions of the code, or it may cover for some corner cases, or it could possibly be a re-assurance to the JIT. >> > > I had some enlightening discussions with Roland on this. > > It seems quite tricky to solve in general the removal of the null check due to the aggressive nature in which the null branch is reduce to a trap, but IIUC may be possible to turn Class.cast into an intrinsic to handle the specific case (although that seems costly). > > I was labouring under the misapprehension that an explicit Class.cast was a profiling point but now i realize it's only certain byte codes (like checkcast/invokehandle). Nothing specific to the DHM access logic showed up with regards to type profiling when analysing the MethodData output from some simple examples [*]. Therefore i presume it's more likely to be the first or third reason you state. > > So i propose to proceed with the experiment with a patch to replace the casts with asserts in the accessor logic and run that through the usual tests. > > Paul. > > > [*] Also i have so far failed to concoct a simple example for VarHandles where i can trigger profile pollution and failed inlining Here's something to try first: Force a profile point before Class.cast, even without Roland's enhancements. You should be able to type-profile "x" by inserting "push x; checkcast java/lang/Object; pop". See last line of https://wiki.openjdk.java.net/display/HotSpot/MethodData ? John From huizhe.wang at oracle.com Fri Aug 29 02:46:26 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Thu, 28 Aug 2014 19:46:26 -0700 Subject: RFR (JAXP) 8056202: Xerces Update: Catalog Resolver Message-ID: <53FFE982.7080408@oracle.com> Hi, This is an update to Xerces' Catalog Resolver implementation. The changes were mostly performance related, for example the changes to the normalizeURI method in Catalog.java to avoid creating new Strings if the input is already in normalized form. Bug: https://bugs.openjdk.java.net/browse/JDK-8056202 Webrev: http://cr.openjdk.java.net/~joehw/jdk9/8056202/webrev/ Thanks, Joe From erik.joelsson at oracle.com Fri Aug 29 07:03:05 2014 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Fri, 29 Aug 2014 09:03:05 +0200 Subject: Review request: 8055856: checkdeps build target doesn't work for cross-compilation builds In-Reply-To: <53FF6532.7080402@oracle.com> References: <53FD0CE4.5010404@oracle.com> <53FD9625.3050201@oracle.com> <53FDB0C3.5010900@oracle.com> <53FDED9A.5020702@oracle.com> <53FDF252.804@oracle.com> <53FE0095.7080700@oracle.com> <53FECE82.3030602@oracle.com> <53FF6532.7080402@oracle.com> Message-ID: <540025A9.1030101@oracle.com> Hello Mandy, Looks good. Just noticed another thing in CheckModules.gmk. You can remove the explicit FIXPATH as the variable JAVA already contains it. In general, only spec.gmk should need to worry about FIXPATH. If there are no other changes, I don't need to see another round before you push. /Erik On 2014-08-28 19:21, Mandy Chung wrote: > On 8/27/14 11:38 PM, Erik Joelsson wrote: >> Hello Mandy, >> >> That certainly looks better. A couple of more thoughts, and sorry for >> not pointing this out earlier, but the new structure is still new to >> me too. >> >> * The rmic targets also generate classes, so for modules.xml to be >> correct, I suspect you need to depend on that too. Simply add "rmic" >> after java on the dependency line. I assume the verification doesn't >> care about resources? If it does, then you would also need to depend >> on the rest of gendata, something like $(filter-out jdk.dev-gendata, >> $(GENDATA_TARGETS)). > > Good catch. rmic needs to be added in the dependency. jdeps verifies > class files only and doesn't care about resources. > >> >> * In Gendata-jdk.dev.gmk, there is an ifndef OPENJDK. We are trying >> to move away from that construct when possible. It's a bit cumbersome >> but to avoid it. To do it in the current model, create a closed >> version of Gendata-jdk.dev.gmk. Add "$(eval $(call >> IncludeCustomExtension, jdk, gendata/Gendata-jdk.dev.gmk))" after >> "include GendataCommon.gmk". Change the first assignment of >> METADATA_FILES to += and move the closed addition to the closed >> version of the file. There is no need for ifndef OPENJDK in the >> closed file. It only gets included when we build closed. > > That's another good change in the build. > > Updated webrev: > http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.02/ > > I also moved jdk/make/CheckModules.gmk to top/make/CheckModules.gmk > per Magnus's suggestion. > > Mandy > >> >> /Erik >> >> On 2014-08-27 18:00, Mandy Chung wrote: >>> Erik, Magnus, >>> >>> This is much easier than I have thought. I really like this new build. >>> I have separated out Gendata-jdk.dev.gmk and removed the modules-xml >>> target completely. >>> >>> Webrev at: >>> http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8055856/webrev.01/ >>> >>> Mandy >>> >> > From weijun.wang at oracle.com Fri Aug 29 08:01:30 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Fri, 29 Aug 2014 16:01:30 +0800 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: <53FF7244.2030804@CoSoCo.de> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <53E8CCD6.2090503@CoSoCo.de> <53FDA7C1.6060303@CoSoCo.de> <902B0B7A-32BE-498A-B9DD-8937960430A2@oracle.com> <53FF7244.2030804@CoSoCo.de> Message-ID: So it's not that the optimization fails but there is no optimization on them yet. I do see the .append("x") case will be easy to deal with, but it looks like historically javac has not been a place to do many optimizations. It mostly converts the java source to byte codes in a 1-to-1 mapping and let VM do whatever it wants (to optimize). When you talked about compiling multiple concatenation into using a single StringBuilder, it's more like choosing the correct implementation rather than an optimization. I don't expect to see big change on this in the near future, so shall we go on with the current enhancement? Thanks Max On Aug 29, 2014, at 2:17, Ulf Zibis wrote: > I mean: > It does not output byte code that only uses a single char array to compose the entire String in question. > With "optimization fails", I also mean, there is used an additional "StringComposer" e.g. another StringBuilder or a StringJoiner in addition to the 1st StringBuilder. > > -Ulf > > Am 27.08.2014 um 14:02 schrieb Pavel Rappo: >> Could you please explain what you mean by "javac optimization fails" here? >> >> -Pavel >> >> On 27 Aug 2014, at 10:41, Ulf Zibis wrote: >> >>> 4.) Now we see, that javac optimization fails again if StringBuilder, concatenation, toString(), append(String), append(Collection) etc. and StringJoiner use is mixed. >> > From Alan.Bateman at oracle.com Fri Aug 29 08:00:57 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 29 Aug 2014 09:00:57 +0100 Subject: Review request for JDK-8051540: Convert JAXP functin tests: org.xml.sax to jtreg (testNG) tests In-Reply-To: <0C1D5A9F-94A6-43CC-89DA-787A66F8C3D0@saxonica.com> References: <53D257BB.8010303@oracle.com> <2DA2DB81-DAC7-431C-AFD7-A73CB0C748C6@oracle.com> <53F28CF9.9030907@oracle.com> <87EB6F2A-260C-4419-9A65-D46A2AFEA0A2@oracle.com> <53F38A26.2080608@oracle.com> <53FE6BF9.3070305@oracle.com> <010e01cfc272$1a1667d0$4e433770$@oracle.com> <0C1D5A9F-94A6-43CC-89DA-787A66F8C3D0@saxonica.com> Message-ID: <54003339.3010304@oracle.com> On 28/08/2014 08:31, Michael Kay wrote: > I haven't yet had a chance to look at the JAXP tests, but this kind of message suggests to me that they don't separate what is in JAXP (the interface) from what is in Xalan and Xerces (the implementations).Would that be a correct assumption? The "redirect" extension is not a JAXP feature, it is a Xalan feature. > > I've had the impression for some years that the management of JAXP as an interface is far too closely tied up with the management of the JAXP implementations within the JDK. > Just to add to Joe's comments then it is important to have a comprehensive set of tests that fully exercise the implementation and any JDK-specific implementation features. Clearly conformance tests for the JAXP API should only have tests that are developed based on the specification but that is the role of the conformance suite/JCK (which is not in OpenJDK). -Alan. From paul.sandoz at oracle.com Fri Aug 29 10:01:26 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 29 Aug 2014 12:01:26 +0200 Subject: RFR 8056249 Improve CompletableFuture resource usage Message-ID: Hi, Please review fixes by Doug to j.u.c.CompletableFuture to better control resources for long completion chains (e.g. avoiding stack overflows). This fix resulted in a lot of internal refactoring and clean up. There are also some doc clarifications for certain j.u.c.CompletationStage exception handling methods (which most likely means a CCC is required). https://bugs.openjdk.java.net/browse/JDK-8056249 http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8056249-cf-resource-usage/webrev/ -- Is the following snippet missing from the doc updates to the methods CompletationStage.handle and handleAsync? If the supplied function itself encounters an exception, then the returned stage exceptionally completes with this exception unless this stage also completed exceptionally. Paul. From paul.sandoz at oracle.com Fri Aug 29 10:43:16 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 29 Aug 2014 12:43:16 +0200 Subject: RFR 8056248: Improve ForkJoin thread throttling Message-ID: <84315DEB-13C4-4DD0-889A-EF895F4B1A13@oracle.com> Hi, Please review fixes by Doug to For/Join to improve thread throttling (e.g. for nested parallel streams). This fix resulted in a lot of internal refactoring and clean up. In addition a new system property was added "java.util.concurrent.ForkJoinPool.common.maximumSpares" (which i suspect will only very rarely be used), so a CCC will be required: http://cs.oswego.edu/pipermail/concurrency-interest/2014-July/012838.html *
  • {@code java.util.concurrent.ForkJoinPool.common.maximumSpares} * - the maximum number of allowed extra threads to maintain target * parallelism (default 256). https://bugs.openjdk.java.net/browse/JDK-8056248 http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8056248-fj-thread-throttling/webrev/ -- Once this review is complete i think we should also backport to 8u40, and likewise for the CompletableFuture updates (which i forgot to mention in a previously related email). Both these updates have been soaking in the 166 repo for a month or two. No related test failures were reported for a JPRT run with both patches. Paul. From Alan.Bateman at oracle.com Fri Aug 29 11:21:59 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 29 Aug 2014 12:21:59 +0100 Subject: RFR: [8056310] Cleanup in WinNTFileSystem_md.c In-Reply-To: <53FFAD02.1030906@oracle.com> References: <53FFAD02.1030906@oracle.com> Message-ID: <54006257.5060306@oracle.com> On 28/08/2014 23:28, Ivan Gerasimov wrote: > Hello! > > This is a proposal to make some minor cleanup in WinNTFileSystem_md.c: > - fix a typo in error message, Looks okay. > - use wide char constant for consistency, Looks okay. > - avoid an array reallocation for power-of-two sizes, It's a bit of corner case but should okay. As some point we should just get rid of this code completely and re-implement the list method to use the new file system API. > - avoid a very unlikely memory leak (when frompath != NULL && topath > == NULL). I checked the MSDN docs and free(NULL) is a no-op as it is elsewhere so I think this is okay. Clearly if either is NULL then memory is completely exhausted and the VM will likely crash/terminate anyway. -Alan. From joel.franck at oracle.com Fri Aug 29 11:28:17 2014 From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Fri, 29 Aug 2014 13:28:17 +0200 Subject: RFR: 5043030 (reflect) unnecessary object creation in reflection In-Reply-To: References: <61880398-2F5F-4569-96E6-2C8A0D53BAE6@gmail.com> <55590437-6901-4ED9-BBC5-C96355442AB5@oracle.com> <2DD9A9E7-48A5-4EBE-8BF4-3687C3D840C4@gmail.com> <237340BB-AD86-443D-BFFC-A1E601E44BDF@oracle.com> <20140613084650.GA24337@oracle.com> Message-ID: Hi Andrej, On 22 jun 2014, at 00:00, Andrej Golovnin wrote: > Hi Joel, > > sorry for late response. I was too busy with other things. > Likewise! > I have changed the test TestMethodReflectValueOf as you suggested and I have changed the summary of both tests too. You will find the changes in the attached patch. Here is the new webrev: https://db.tt/wQBLVceA > > And here is the coverage report in the HTML format: > > https://db.tt/JTZjpnMM > Out of curiosity, did you generate the coverage report running the jdk_lang test suite? 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. Thanks for the contribution! cheers /Joel From dl at cs.oswego.edu Fri Aug 29 13:35:02 2014 From: dl at cs.oswego.edu (Doug Lea) Date: Fri, 29 Aug 2014 09:35:02 -0400 Subject: RFR 8056249 Improve CompletableFuture resource usage In-Reply-To: References: Message-ID: <54008186.5050807@cs.oswego.edu> On 08/29/2014 06:01 AM, Paul Sandoz wrote: > Hi, > > Please review fixes by Doug to j.u.c.CompletableFuture to better control resources for long completion chains (e.g. avoiding stack overflows). This fix resulted in a lot of internal refactoring and clean up. There are also some doc clarifications for certain j.u.c.CompletationStage exception handling methods (which most likely means a CCC is required). > > https://bugs.openjdk.java.net/browse/JDK-8056249 > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8056249-cf-resource-usage/webrev/ > Thanks for doing this! > Is the following snippet missing from the doc updates to the methods CompletationStage.handle and handleAsync? While touching up wording, we noticed that this sentence doesn't capture all the cases that are described in the top-level CompletionStage specs. So including it seems more confusing than omitting it, and just relying on the overall specs. -Doug > > If the supplied function itself encounters an > exception, then the returned stage exceptionally completes with this > exception unless this stage also completed exceptionally. > > Paul. > From chris.hegarty at oracle.com Fri Aug 29 13:38:15 2014 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 29 Aug 2014 14:38:15 +0100 Subject: RFR 8056249 Improve CompletableFuture resource usage In-Reply-To: References: Message-ID: <54008247.5060105@oracle.com> On 29/08/14 11:01, Paul Sandoz wrote: > Hi, > > Please review fixes by Doug to j.u.c.CompletableFuture to better control resources for long completion chains (e.g. avoiding stack overflows). This fix resulted in a lot of internal refactoring and clean up. There are also some doc clarifications for certain j.u.c.CompletationStage exception handling methods (which most likely means a CCC is required). IMHO, the rewording and clarifications in the docs do not warrant a CCC. From what I can see, these cases are already covered by JCK tests. In the case of handle() then the returned CF mush complete with the function's result, given the method signature. This is just the docs explicitly stating what is already a given. > https://bugs.openjdk.java.net/browse/JDK-8056249 > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8056249-cf-resource-usage/webrev/ > > > -- > > Is the following snippet missing from the doc updates to the methods CompletationStage.handle and handleAsync? > > If the supplied function itself encounters an > exception, then the returned stage exceptionally completes with this > exception unless this stage also completed exceptionally. I don't think so. Whether, or not, this CF completes exceptionally will have no impact of the result of the returned CF. You could add all of what you suggested less, "unless this stage also completed exceptionally", but I don't think that is even necessary. I think it is already covered by "the function's result is used to complete the returned stage", function's result could be an exception. But I guess you could be explicit. -Chris. > > Paul. > From paul.sandoz at oracle.com Fri Aug 29 14:13:43 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 29 Aug 2014 16:13:43 +0200 Subject: RFR 8056249 Improve CompletableFuture resource usage In-Reply-To: <54008186.5050807@cs.oswego.edu> References: <54008186.5050807@cs.oswego.edu> Message-ID: On Aug 29, 2014, at 3:35 PM, Doug Lea
    wrote: > >> Is the following snippet missing from the doc updates to the methods CompletationStage.handle and handleAsync? > > While touching up wording, we noticed that this sentence doesn't capture > all the cases that are described in the top-level CompletionStage specs. > So including it seems more confusing than omitting it, and just relying > on the overall specs. > I got it now, on first look i missed the subtleties of the exception handling. Paul. From paul.sandoz at oracle.com Fri Aug 29 14:23:43 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 29 Aug 2014 16:23:43 +0200 Subject: RFR 8056249 Improve CompletableFuture resource usage In-Reply-To: <54008247.5060105@oracle.com> References: <54008247.5060105@oracle.com> Message-ID: On Aug 29, 2014, at 3:38 PM, Chris Hegarty wrote: > > On 29/08/14 11:01, Paul Sandoz wrote: >> Hi, >> >> Please review fixes by Doug to j.u.c.CompletableFuture to better control resources for long completion chains (e.g. avoiding stack overflows). This fix resulted in a lot of internal refactoring and clean up. There are also some doc clarifications for certain j.u.c.CompletationStage exception handling methods (which most likely means a CCC is required). > > IMHO, the rewording and clarifications in the docs do not warrant a CCC. > Agreed it's just a clarification. Paul. From forax at univ-mlv.fr Fri Aug 29 15:03:42 2014 From: forax at univ-mlv.fr (=?ISO-8859-1?Q?R=E9mi_Forax?=) Date: Fri, 29 Aug 2014 17:03:42 +0200 Subject: A List from Iterator In-Reply-To: <090E62C8-18EA-4325-BD73-B125B847884E@oracle.com> References: <4C988EC2-AE3C-4F7B-8E40-EC2F1C54DB0B@oracle.com> <02202C56-63EF-45FE-B9AA-06B1E1EA7BA1@oracle.com> <090E62C8-18EA-4325-BD73-B125B847884E@oracle.com> Message-ID: <6eeb0d27-8c0d-468e-997c-ed4c12c0e86a@email.android.com> ArrayList list = ... iterator.forEachRemaining(list::add); R?mi On 29 ao?t 2014 00:22:11 UTC+02:00, Pavel Rappo wrote: >> If we were to provide a Collections util it would to wrap Enumeration >as an Iterator but that's it. > >Mike, that's what I'm talking about. It's just for convenience. > >-Pavel -- Envoy? de mon t?l?phone Android avec K-9 Mail. Excusez la bri?vet?. From paul.sandoz at oracle.com Fri Aug 29 15:10:15 2014 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 29 Aug 2014 17:10:15 +0200 Subject: DMH to fields, casts and type profiling Re: [9] RFR (M): 8037209: Improvements and cleanups to bytecode assembly for lambda forms In-Reply-To: <29479440-3FB5-4D81-9BA2-E5B179F1461B@oracle.com> References: <5322EBF2.7030209@oracle.com> <5322F3D7.9010103@oracle.com> <94F61B19-8904-42FA-9E16-CC0A6B30FD79@oracle.com> <53230184.9090007@oracle.com> <2FCC64E3-3753-4CE0-9CC6-849FF737BFB5@oracle.com> <53232FF3.9020803@oracle.com> <53305E52.2060001@oracle.com> <53BBC340.7040509@oracle.com> <7FAEB94F-EB98-49A9-A4B0-9B4A6B730CA9@oracle.com> <23A89ADB-F43D-4AAA-B0FB-8B7D4748355F@oracle.com> <29479440-3FB5-4D81-9BA2-E5B179F1461B@oracle.com> Message-ID: <1691E74F-7950-4F61-9A1D-4738ACD4C5BE@oracle.com> On Aug 29, 2014, at 12:45 AM, John Rose wrote: > On Aug 28, 2014, at 7:38 AM, Paul Sandoz wrote: > >> On Jul 8, 2014, at 9:09 PM, John Rose wrote: >> >>> Regarding the extra cast in accessor logic that Paul picked up on: That may be a left-over from obsolete versions of the code, or it may cover for some corner cases, or it could possibly be a re-assurance to the JIT. >>> >> >> I had some enlightening discussions with Roland on this. >> >> It seems quite tricky to solve in general the removal of the null check due to the aggressive nature in which the null branch is reduce to a trap, but IIUC may be possible to turn Class.cast into an intrinsic to handle the specific case (although that seems costly). >> >> I was labouring under the misapprehension that an explicit Class.cast was a profiling point but now i realize it's only certain byte codes (like checkcast/invokehandle). Nothing specific to the DHM access logic showed up with regards to type profiling when analysing the MethodData output from some simple examples [*]. Therefore i presume it's more likely to be the first or third reason you state. >> >> So i propose to proceed with the experiment with a patch to replace the casts with asserts in the accessor logic and run that through the usual tests. >> >> Paul. >> >> >> [*] Also i have so far failed to concoct a simple example for VarHandles where i can trigger profile pollution and failed inlining > > Here's something to try first: Force a profile point before Class.cast, even without Roland's enhancements. > You should be able to type-profile "x" by inserting "push x; checkcast java/lang/Object; pop". > See last line of https://wiki.openjdk.java.net/display/HotSpot/MethodData > Thanks, that's a neat trick. I will play around with that. Some thoughts triggered (now i am a supposedly little wiser... perhaps :-)). I could imagine things would get polluted fairly quickly within the compiled & shared DHM LFs for field access (same for VHs), plus cast-wise only the value is operated on and not the receiver. In general presumably what matters most is the type profile from the call site that would flow down to the LF? But... what would there be in compiled DHM LFs for field access that they would require profiling so that generated code would be different for accessing a field of Bar rather than a field of Foo? since it all boils down to Unsafe calls, or are there some subtle details hidden within the Unsafe intrinsics? or perhaps a lack of that can result in some odd effects? Paul. From andrej.golovnin at gmail.com Fri Aug 29 15:30:07 2014 From: andrej.golovnin at gmail.com (Andrej Golovnin) Date: Fri, 29 Aug 2014 17:30:07 +0200 Subject: RFR: 5043030 (reflect) unnecessary object creation in reflection In-Reply-To: References: <61880398-2F5F-4569-96E6-2C8A0D53BAE6@gmail.com> <55590437-6901-4ED9-BBC5-C96355442AB5@oracle.com> <2DD9A9E7-48A5-4EBE-8BF4-3687C3D840C4@gmail.com> <237340BB-AD86-443D-BFFC-A1E601E44BDF@oracle.com> <20140613084650.GA24337@oracle.com> Message-ID: Hi Joel, >> I have changed the test TestMethodReflectValueOf as you suggested and I have changed the summary of both tests too. You will find the changes in the attached patch. Here is the new webrev: https://db.tt/wQBLVceA >> >> And here is the coverage report in the HTML format: >> >> https://db.tt/JTZjpnMM >> > > Out of curiosity, did you generate the coverage report running the jdk_lang test suite? Yes and I used the following config for JCov: include_list=jcov_jdk_lang.txt,field=on,abstract=on,native=on,type=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 From martinrb at google.com Fri Aug 29 15:56:08 2014 From: martinrb at google.com (Martin Buchholz) Date: Fri, 29 Aug 2014 08:56:08 -0700 Subject: RFR 8056249 Improve CompletableFuture resource usage In-Reply-To: References: Message-ID: Looks fine. Instead of using Contributed-by: for Doug's work, you should make him the hg "user", as is done in previous changesets. E.g. hg import has a --user flag. All of jsr166 CVS src/main is ready for sync'ing with openjdk9, i.e. there are no known bugs, even though some future improvements are on the TODO list. On Fri, Aug 29, 2014 at 3:01 AM, Paul Sandoz wrote: > Hi, > > Please review fixes by Doug to j.u.c.CompletableFuture to better control > resources for long completion chains (e.g. avoiding stack overflows). This > fix resulted in a lot of internal refactoring and clean up. There are also > some doc clarifications for certain j.u.c.CompletationStage exception > handling methods (which most likely means a CCC is required). > > https://bugs.openjdk.java.net/browse/JDK-8056249 > > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8056249-cf-resource-usage/webrev/ > > > -- > > Is the following snippet missing from the doc updates to the methods > CompletationStage.handle and handleAsync? > > If the supplied function itself encounters an > exception, then the returned stage exceptionally completes with this > exception unless this stage also completed exceptionally. > > Paul. > From martinrb at google.com Fri Aug 29 16:15:25 2014 From: martinrb at google.com (Martin Buchholz) Date: Fri, 29 Aug 2014 09:15:25 -0700 Subject: RFR 8056248: Improve ForkJoin thread throttling In-Reply-To: <84315DEB-13C4-4DD0-889A-EF895F4B1A13@oracle.com> References: <84315DEB-13C4-4DD0-889A-EF895F4B1A13@oracle.com> Message-ID: Approved. Thanks for doing this. On Fri, Aug 29, 2014 at 3:43 AM, Paul Sandoz wrote: > Hi, > > Please review fixes by Doug to For/Join to improve thread throttling (e.g. > for nested parallel streams). This fix resulted in a lot of internal > refactoring and clean up. > > In addition a new system property was added > "java.util.concurrent.ForkJoinPool.common.maximumSpares" (which i suspect > will only very rarely be used), so a CCC will be required: > > http://cs.oswego.edu/pipermail/concurrency-interest/2014-July/012838.html > > *
  • {@code java.util.concurrent.ForkJoinPool.common.maximumSpares} > * - the maximum number of allowed extra threads to maintain target > * parallelism (default 256). > > https://bugs.openjdk.java.net/browse/JDK-8056248 > > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8056248-fj-thread-throttling/webrev/ > > > -- > > Once this review is complete i think we should also backport to 8u40, and > likewise for the CompletableFuture updates (which i forgot to mention in a > previously related email). > > Both these updates have been soaking in the 166 repo for a month or two. > No related test failures were reported for a JPRT run with both patches. > > Paul. > From lance.andersen at oracle.com Fri Aug 29 16:47:02 2014 From: lance.andersen at oracle.com (Lance Andersen) Date: Fri, 29 Aug 2014 12:47:02 -0400 Subject: RFR 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory In-Reply-To: <53FCC6C3.2090803@oracle.com> References: <53FCC6C3.2090803@oracle.com> Message-ID: <19D9315E-6B80-4A8F-8131-E65583400F33@oracle.com> Hi Joe, This looks OK. I assume all TCK/JCK tests have been run and still pass as an additional sanity check ? Have a good weekend. Best, Lance On Aug 26, 2014, at 1:41 PM, huizhe wang wrote: > Hi, > > Please review update to XMLSchemaFactory along with changes to relevant classes. All new tests passed, as well as existing jaxp tests and JPRT. > > Note that this updates XMLSchemaFactory, related classes such as XMLShemaValidator are only updated to the related revisions. Full update of XMLSchemaValidator and XMLSchemaLoader will be done separately. > > http://cr.openjdk.java.net/~joehw/jdk9/8037819/webrev/ > > Thanks, > Joe Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From tristan.yan at oracle.com Fri Aug 29 16:50:28 2014 From: tristan.yan at oracle.com (Tristan Yan) Date: Fri, 29 Aug 2014 09:50:28 -0700 Subject: Review request for JDK-8051561: Convert JAXP function tests: javax.xml.xpath.* to jtreg (testNG) tests In-Reply-To: <53D257BB.8010303@oracle.com> References: <53D257BB.8010303@oracle.com> Message-ID: <6587E2F4-B626-43BE-9D76-6295CBCD22F4@oracle.com> Hi Joe, Alan and others I took over Eric?s last work and did some refactor for his code. Please help to review the code change again. webrev: http://cr.openjdk.java.net/~tyan/JDK-8051561/webrev.01/ bug: https://bugs.openjdk.java.net/browse/JDK-8051561 These code has been run with security manager and without security manager both and all passed. Thank you Tristan > On Jul 25, 2014, at 6:12 AM, Eric Wang wrote: > > Hi Joe, alan and every one > > I'm working on jaxp functional test colocation which is traced by the bug JDK-8043091 . > We have finished to convert a few suite and the jaxp/xpath tracked by bug JDK-8051561 is the first one chosen for public review. > > Can you please review the webrev below? your comments given would be helpful for our future work. > http://cr.openjdk.java.net/~ewang/JDK-8051561/webrev.00/ > > Thanks, > Eric > From vladimir.x.ivanov at oracle.com Fri Aug 29 17:20:15 2014 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Fri, 29 Aug 2014 21:20:15 +0400 Subject: [9] RFR (S): 8056926: Improve caching of GuardWithTest combinator Message-ID: <5400B64F.5080408@oracle.com> http://cr.openjdk.java.net/~vlivanov/8056926/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8056926 Cache GuardWithTest per erased to basic types signature. GWT shape is made friendly to sharing: * GWT MH is implemented as BMH which stores 3 method handles * LF loads them from the associated MethodHandle Testing: jdk/java/lang/invoke, jdk/java/util/streams, nashorn, octane w/ "-ea -esa" and COMPILE_THRESHOLD={0,30}. Reviewed-by: vlivanov, ? Contributed-by: john.r.rose at oracle.com Thanks! Best regards, Vladimir Ivanov From huizhe.wang at oracle.com Fri Aug 29 18:21:24 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Fri, 29 Aug 2014 11:21:24 -0700 Subject: Review request for JDK-8051561: Convert JAXP function tests: javax.xml.xpath.* to jtreg (testNG) tests In-Reply-To: <6587E2F4-B626-43BE-9D76-6295CBCD22F4@oracle.com> References: <53D257BB.8010303@oracle.com> <6587E2F4-B626-43BE-9D76-6295CBCD22F4@oracle.com> Message-ID: <5400C4A4.1080907@oracle.com> Hi Tristan, Looks good. I left notes in the bug's comment section as a record and status of the original test development. Thanks, Joe On 8/29/2014 9:50 AM, Tristan Yan wrote: > Hi Joe, Alan and others > I took over Eric?s last work and did some refactor for his code. > Please help to review the code change again. > webrev: _http://cr.openjdk.java.net/~tyan/JDK-8051561/webrev.01/ > _ > bug: https://bugs.openjdk.java.net/browse/JDK-8051561 > > These code has been run with security manager and without security > manager both and all passed. > Thank you > Tristan > >> On Jul 25, 2014, at 6:12 AM, Eric Wang > > wrote: >> >> Hi Joe, alan and every one >> >> I'm working on jaxp functional test colocation which is traced by the >> bug JDK-8043091 . >> We have finished to convert a few suite and the jaxp/xpath tracked by >> bug JDK-8051561 is >> the first one chosen for public review. >> >> Can you please review the webrev below? your comments given would be >> helpful for our future work. >> http://cr.openjdk.java.net/~ewang/JDK-8051561/webrev.00/ >> >> Thanks, >> Eric >> > From huizhe.wang at oracle.com Fri Aug 29 18:39:39 2014 From: huizhe.wang at oracle.com (huizhe wang) Date: Fri, 29 Aug 2014 11:39:39 -0700 Subject: RFR 8037819: Xerces Update: jaxp/validation/XMLSchemaFactory In-Reply-To: <19D9315E-6B80-4A8F-8131-E65583400F33@oracle.com> References: <53FCC6C3.2090803@oracle.com> <19D9315E-6B80-4A8F-8131-E65583400F33@oracle.com> Message-ID: <5400C8EB.1040700@oracle.com> Thanks Lance. A TCK test I started when I saw your comment is just completed without any relevant failure. Have a good weekend! Best, Joe On 8/29/2014 9:47 AM, Lance Andersen wrote: > Hi Joe, > > This looks OK. I assume all TCK/JCK tests have been run and still > pass as an additional sanity check ? > > Have a good weekend. > > Best, > Lance > On Aug 26, 2014, at 1:41 PM, huizhe wang > wrote: > >> Hi, >> >> Please review update to XMLSchemaFactory along with changes to >> relevant classes. All new tests passed, as well as existing jaxp >> tests and JPRT. >> >> Note that this updates XMLSchemaFactory, related classes such as >> XMLShemaValidator are only updated to the related revisions. Full >> update of XMLSchemaValidator and XMLSchemaLoader will be done separately. >> >> http://cr.openjdk.java.net/~joehw/jdk9/8037819/webrev/ >> >> >> Thanks, >> Joe > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From martinrb at google.com Fri Aug 29 19:12:39 2014 From: martinrb at google.com (Martin Buchholz) Date: Fri, 29 Aug 2014 12:12:39 -0700 Subject: RFR: JDK-8056934: ZipInputStream does not correctly handle local header data descriptors with the optional signature missing Message-ID: Hi Xueming and Alan, I'd like you to do a code review. https://bugs.openjdk.java.net/browse/JDK-8056934 http://cr.openjdk.java.net/~martin/webrevs/openjdk9/zip-DataDescriptorSignatureMissing/ This seems like an atypical off-by-one, so I'm not sure how it happened, and I have the nagging feeling I'm missing something. Greg, this java code review contains a python program! From Ulf.Zibis at CoSoCo.de Fri Aug 29 19:54:31 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Fri, 29 Aug 2014 21:54:31 +0200 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> Message-ID: <5400DA77.4080900@CoSoCo.de> Am 28.08.2014 um 19:30 schrieb Louis Wasserman: > Comparator is spec'd to be allowed to return any number, positive, negative, or zero, but indexOf > is specifically spec'd to return -1. Yes, I know. I wanted to say, that from this knowing some developer might assume the same for indexOf when successfully using ArrayList at contains() with other negative value than -1. > If an indexOf method returns a negative value other than -1, that is a bug; Yes, but how you suggest to deal with such a bug in existing code. If we would unify JDK code to LinkedList style, it would break such existing code. That's what I wanted to point on. Does the original thread opener want to open a bug e.g. "Unify code of contains()"? If not, the discussion doesn't make sense anymore. -Ulf > > > On Thu, Aug 28, 2014 at 10:27 AM, Ulf Zibis > wrote: > > > Am 27.08.2014 um 17:51 schrieb Martin Buchholz: > > The ArrayList version saves one byte of bytecode, and is therefore very > slightly better. We should bless that version and use it consistently. > > > +1 > Additional argument: > The LinkedList code requires to load 32/64-Bit -1 into CPU. This may take some time on some > CPU and at least wastes memory footprint. > Additionally register pressure increases. > Vitaly, please correct me, if I'm wrong, just for learning more. > > Another advantage is that there is no problem if some implementation of indexOf() erroneously > returns another negative value than -1. I remember some compare() implementations, which > sometimes return different values than only -1, 0, +1. > > -Ulf > > > ArrayList: > > public boolean contains(Object o) { > return indexOf(o) >= 0; > } > > LinkedList: > > public boolean contains(Object o) { > return indexOf(o) != -1; > } > > > > > > -- > Louis Wasserman From Ulf.Zibis at CoSoCo.de Fri Aug 29 20:05:04 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Fri, 29 Aug 2014 22:05:04 +0200 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> Message-ID: <5400DCF0.6090302@CoSoCo.de> Am 28.08.2014 um 19:46 schrieb Vitaly Davidovich: > > There's no register pressure - the immediate (I.e. -1) is encoded directly into the instruction, > just like 0 would be. The time when 0 is particularly useful is when you test for it in the zero > bit of the flags register (e.g. dec followed by jz, such as when counting a loop down to 0). > Otherwise, I don't see any advantage from machine code perspective. > Thanks for explaining this, but a very little nit: the immediate (I.e. -1) uses additional 32/64 bits in code which must be loaded from memory and wastes space in CPU cache or am I wrong? This could be saved with >= 0. So if unifying the code I agree to Martin's opinion. -Ulf > The aforementioned cmov instruction is not without its own downsides, so it's unclear which is > better when branch probability isn't known a priori. > > The 1 byte code is unlikely to make any difference, unless jit is turned off and you're running > this through a tight loop in the interpreter (but if one does that, perf conversation is moot :)). > > Sent from my phone > > On Aug 28, 2014 1:28 PM, "Ulf Zibis" > wrote: > > > Am 27.08.2014 um 17:51 schrieb Martin Buchholz: > > The ArrayList version saves one byte of bytecode, and is therefore very > slightly better. We should bless that version and use it consistently. > > > +1 > Additional argument: > The LinkedList code requires to load 32/64-Bit -1 into CPU. This may take some time on some > CPU and at least wastes memory footprint. > Additionally register pressure increases. > Vitaly, please correct me, if I'm wrong, just for learning more. > > Another advantage is that there is no problem if some implementation of indexOf() erroneously > returns another negative value than -1. I remember some compare() implementations, which > sometimes return different values than only -1, 0, +1. > > -Ulf > > ArrayList: > > public boolean contains(Object o) { > return indexOf(o) >= 0; > } > > LinkedList: > > public boolean contains(Object o) { > return indexOf(o) != -1; > } > > From chris.hegarty at oracle.com Fri Aug 29 20:20:29 2014 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 29 Aug 2014 21:20:29 +0100 Subject: RFR 8056249 Improve CompletableFuture resource usage In-Reply-To: References: Message-ID: <165F62F3-D9A4-4E20-9BBD-F9B04D5B7548@oracle.com> > On 29 Aug 2014, at 16:56, Martin Buchholz wrote: > > Looks fine. +1 -Chris. > Instead of using Contributed-by: for Doug's work, you should make him the > hg "user", as is done in previous changesets. E.g. hg import has a --user > flag. > > All of jsr166 CVS src/main is ready for sync'ing with openjdk9, i.e. there > are no known bugs, even though some future improvements are on the TODO > list. > > >> On Fri, Aug 29, 2014 at 3:01 AM, Paul Sandoz wrote: >> >> Hi, >> >> Please review fixes by Doug to j.u.c.CompletableFuture to better control >> resources for long completion chains (e.g. avoiding stack overflows). This >> fix resulted in a lot of internal refactoring and clean up. There are also >> some doc clarifications for certain j.u.c.CompletationStage exception >> handling methods (which most likely means a CCC is required). >> >> https://bugs.openjdk.java.net/browse/JDK-8056249 >> >> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8056249-cf-resource-usage/webrev/ >> >> >> -- >> >> Is the following snippet missing from the doc updates to the methods >> CompletationStage.handle and handleAsync? >> >> If the supplied function itself encounters an >> exception, then the returned stage exceptionally completes with this >> exception unless this stage also completed exceptionally. >> >> Paul. >> From Ulf.Zibis at CoSoCo.de Fri Aug 29 20:53:50 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Fri, 29 Aug 2014 22:53:50 +0200 Subject: Optimization 2.0 for composing strings - Was: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <53E8CCD6.2090503@CoSoCo.de> <53FDA7C1.6060303@CoSoCo.de> <902B0B7A-32BE-498A-B9DD-8937960430A2@oracle.com> <53FF7244.2030804@CoSoCo.de> Message-ID: <5400E85E.9030005@CoSoCo.de> Hi compiler people, is there some chance that javac could be enhanced to optimize better as discussed in this thread? Than refactoring of up to now better readable code to ugly StringBuilder at append() code would be superfluous. I really like the String concatenation syntax, but unfortunately it often causes slower code and bigger footprint. Optimally javac would optimize mixed use of StringBuilder, StringJoiner, concatenation, toString(), append(String), append(Collection) etc. to a single StringBuilder instance, so that the resulting code, JITed or not, will have better performance. Additionally javac could guess a reasonable initial capacity from the given source code. Am 29.08.2014 um 10:01 schrieb Wang Weijun: > So it's not that the optimization fails but there is no optimization on them yet. > > I do see the .append("x") case will be easy to deal with, but it looks like historically javac has not been a place to do many optimizations. It mostly converts the java source to byte codes in a 1-to-1 mapping and let VM do whatever it wants (to optimize). When you talked about compiling multiple concatenation into using a single StringBuilder, it's more like choosing the correct implementation rather than an optimization. > > I don't expect to see big change on this in the near future, so shall we go on with the current enhancement? > > Thanks > Max > > On Aug 29, 2014, at 2:17, Ulf Zibis wrote: > >> I mean: >> It does not output byte code that only uses a single char array to compose the entire String in question. >> With "optimization fails", I also mean, there is used an additional "StringComposer" e.g. another StringBuilder or a StringJoiner in addition to the 1st StringBuilder. >> >> -Ulf >> >> Am 27.08.2014 um 14:02 schrieb Pavel Rappo: >>> Could you please explain what you mean by "javac optimization fails" here? >>> >>> -Pavel >>> >>> On 27 Aug 2014, at 10:41, Ulf Zibis wrote: >>> >>>> 4.) Now we see, that javac optimization fails again if StringBuilder, concatenation, toString(), append(String), append(Collection) etc. and StringJoiner use is mixed. > From vitalyd at gmail.com Fri Aug 29 21:05:11 2014 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Fri, 29 Aug 2014 17:05:11 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: <5400DCF0.6090302@CoSoCo.de> References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> Message-ID: Yes, the immediate is part of the instruction encoding, so takes up space. However, I believe the CMP instruction allows comparison of an immediate with a wider register (e.g. cmp $-1, %eax), in which case the immediate takes up 1 byte and is then sign extended to the size of the register. But again, let's keep in mind that LinkedList is (likely) going to have performance problems long before the difference being discussed here. The JIT compiler emits drastically different (and much more of it in my trials, so instruction size difference in terms of a byte or two is irrelevant) code when it's given profiling info (i.e. no -Xcomp flag), for both ArrayList and LinkedList. As mentioned before, if we were talking about some tight loop with nothing but very basic/cheap instructions in there (e.g. integer arithmetic, shifting, etc) and no memory chasing, then micro optimizations like this may be interesting and lead to some perf gain. But in the context of this example, I don't think so. On Fri, Aug 29, 2014 at 4:05 PM, Ulf Zibis wrote: > > Am 28.08.2014 um 19:46 schrieb Vitaly Davidovich: > > >> There's no register pressure - the immediate (I.e. -1) is encoded >> directly into the instruction, just like 0 would be. The time when 0 is >> particularly useful is when you test for it in the zero bit of the flags >> register (e.g. dec followed by jz, such as when counting a loop down to >> 0). Otherwise, I don't see any advantage from machine code perspective. >> >> > Thanks for explaining this, but a very little nit: the immediate (I.e. -1) > uses additional 32/64 bits in code which must be loaded from memory and > wastes space in CPU cache or am I wrong? This could be saved with >= 0. > > So if unifying the code I agree to Martin's opinion. > > -Ulf > > The aforementioned cmov instruction is not without its own downsides, so >> it's unclear which is better when branch probability isn't known a priori. >> >> The 1 byte code is unlikely to make any difference, unless jit is turned >> off and you're running this through a tight loop in the interpreter (but if >> one does that, perf conversation is moot :)). >> >> Sent from my phone >> >> On Aug 28, 2014 1:28 PM, "Ulf Zibis" > Ulf.Zibis at cosoco.de>> wrote: >> >> >> Am 27.08.2014 um 17:51 schrieb Martin Buchholz: >> >> The ArrayList version saves one byte of bytecode, and is >> therefore very >> slightly better. We should bless that version and use it >> consistently. >> >> >> +1 >> Additional argument: >> The LinkedList code requires to load 32/64-Bit -1 into CPU. This may >> take some time on some >> CPU and at least wastes memory footprint. >> Additionally register pressure increases. >> Vitaly, please correct me, if I'm wrong, just for learning more. >> >> Another advantage is that there is no problem if some implementation >> of indexOf() erroneously >> returns another negative value than -1. I remember some compare() >> implementations, which >> sometimes return different values than only -1, 0, +1. >> >> -Ulf >> >> ArrayList: >> >> public boolean contains(Object o) { >> return indexOf(o) >= 0; >> } >> >> LinkedList: >> >> public boolean contains(Object o) { >> return indexOf(o) != -1; >> } >> >> >> > From martinrb at google.com Fri Aug 29 21:56:16 2014 From: martinrb at google.com (Martin Buchholz) Date: Fri, 29 Aug 2014 14:56:16 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: <5400DCF0.6090302@CoSoCo.de> References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> Message-ID: Just think - one whole byte saved for each individual change! I have a webrev! http://cr.openjdk.java.net/~martin/webrevs/openjdk9/pico-optimize-contains/ https://bugs.openjdk.java.net/browse/JDK-8056951 Can haz review please? On Fri, Aug 29, 2014 at 1:05 PM, Ulf Zibis wrote: > > Am 28.08.2014 um 19:46 schrieb Vitaly Davidovich: > > >> There's no register pressure - the immediate (I.e. -1) is encoded >> directly into the instruction, just like 0 would be. The time when 0 is >> particularly useful is when you test for it in the zero bit of the flags >> register (e.g. dec followed by jz, such as when counting a loop down to >> 0). Otherwise, I don't see any advantage from machine code perspective. >> >> > Thanks for explaining this, but a very little nit: the immediate (I.e. -1) > uses additional 32/64 bits in code which must be loaded from memory and > wastes space in CPU cache or am I wrong? This could be saved with >= 0. > > So if unifying the code I agree to Martin's opinion. > > -Ulf > > The aforementioned cmov instruction is not without its own downsides, so >> it's unclear which is better when branch probability isn't known a priori. >> >> The 1 byte code is unlikely to make any difference, unless jit is turned >> off and you're running this through a tight loop in the interpreter (but if >> one does that, perf conversation is moot :)). >> >> Sent from my phone >> >> On Aug 28, 2014 1:28 PM, "Ulf Zibis" > Ulf.Zibis at cosoco.de>> wrote: >> >> >> Am 27.08.2014 um 17:51 schrieb Martin Buchholz: >> >> The ArrayList version saves one byte of bytecode, and is >> therefore very >> slightly better. We should bless that version and use it >> consistently. >> >> >> +1 >> Additional argument: >> The LinkedList code requires to load 32/64-Bit -1 into CPU. This may >> take some time on some >> CPU and at least wastes memory footprint. >> Additionally register pressure increases. >> Vitaly, please correct me, if I'm wrong, just for learning more. >> >> Another advantage is that there is no problem if some implementation >> of indexOf() erroneously >> returns another negative value than -1. I remember some compare() >> implementations, which >> sometimes return different values than only -1, 0, +1. >> >> -Ulf >> >> ArrayList: >> >> public boolean contains(Object o) { >> return indexOf(o) >= 0; >> } >> >> LinkedList: >> >> public boolean contains(Object o) { >> return indexOf(o) != -1; >> } >> >> >> > From vitalyd at gmail.com Fri Aug 29 22:10:03 2014 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Fri, 29 Aug 2014 18:10:03 -0400 Subject: Optimization 2.0 for composing strings - Was: Replace concat String to append in StringBuilder parameters In-Reply-To: <5400E85E.9030005@CoSoCo.de> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <53E8CCD6.2090503@CoSoCo.de> <53FDA7C1.6060303@CoSoCo.de> <902B0B7A-32BE-498A-B9DD-8937960430A2@oracle.com> <53FF7244.2030804@CoSoCo.de> <5400E85E.9030005@CoSoCo.de> Message-ID: It's probably best to teach the JIT to handle more of these cases. The reason is I don't think the longer compile time will be worth it considering that, on a large codebase, there will inevitably be lots of places where these patterns appear but have no dominance at runtime (either because they're not called or called just a few times). Additionally, these patterns are unlikely to appear in hot code paths; no matter what type of concat/string building (practical) optimizations you do, that type of code will kill performance. Assuming that's true, what's the value add given the costs? Sent from my phone On Aug 29, 2014 4:54 PM, "Ulf Zibis" wrote: > Hi compiler people, > > is there some chance that javac could be enhanced to optimize better as > discussed in this thread? Than refactoring of up to now better readable > code to ugly StringBuilder at append() code would be superfluous. > I really like the String concatenation syntax, but unfortunately it often > causes slower code and bigger footprint. > Optimally javac would optimize mixed use of StringBuilder, StringJoiner, > concatenation, toString(), append(String), append(Collection) etc. to a > single StringBuilder instance, so that the resulting code, JITed or not, > will have better performance. > Additionally javac could guess a reasonable initial capacity from the > given source code. > > > Am 29.08.2014 um 10:01 schrieb Wang Weijun: > >> So it's not that the optimization fails but there is no optimization on >> them yet. >> >> I do see the .append("x") case will be easy to deal with, but it looks >> like historically javac has not been a place to do many optimizations. It >> mostly converts the java source to byte codes in a 1-to-1 mapping and let >> VM do whatever it wants (to optimize). When you talked about compiling >> multiple concatenation into using a single StringBuilder, it's more like >> choosing the correct implementation rather than an optimization. >> >> I don't expect to see big change on this in the near future, so shall we >> go on with the current enhancement? >> >> Thanks >> Max >> >> On Aug 29, 2014, at 2:17, Ulf Zibis wrote: >> >> I mean: >>> It does not output byte code that only uses a single char array to >>> compose the entire String in question. >>> With "optimization fails", I also mean, there is used an additional >>> "StringComposer" e.g. another StringBuilder or a StringJoiner in addition >>> to the 1st StringBuilder. >>> >>> -Ulf >>> >>> Am 27.08.2014 um 14:02 schrieb Pavel Rappo: >>> >>>> Could you please explain what you mean by "javac optimization fails" >>>> here? >>>> >>>> -Pavel >>>> >>>> On 27 Aug 2014, at 10:41, Ulf Zibis wrote: >>>> >>>> 4.) Now we see, that javac optimization fails again if StringBuilder, >>>>> concatenation, toString(), append(String), append(Collection) etc. and >>>>> StringJoiner use is mixed. >>>>> >>>> >> > From vitalyd at gmail.com Fri Aug 29 22:23:29 2014 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Fri, 29 Aug 2014 18:23:29 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> Message-ID: :) so if you're going to do this, is there no base class in the hierarchy where this can be placed (I don't have source in front of me)? That way there's a higher likelihood that the pattern will stay consistent (with new implementations at least). Sent from my phone On Aug 29, 2014 5:56 PM, "Martin Buchholz" wrote: Just think - one whole byte saved for each individual change! I have a webrev! http://cr.openjdk.java.net/~martin/webrevs/openjdk9/pico-optimize-contains/ https://bugs.openjdk.java.net/browse/JDK-8056951 Can haz review please? On Fri, Aug 29, 2014 at 1:05 PM, Ulf Zibis wrote: > > Am 28.08.2014 um 19:46 schrieb Vitaly Davidovich: > > >> There's no register pressure - the immediate (I.e. -1) is encoded >> directly into the instruction, just like 0 would be. The time when 0 is >> particularly useful is when you test for it in the zero bit of the flags >> register (e.g. dec followed by jz, such as when counting a loop down to >> 0). Otherwise, I don't see any advantage from machine code perspective. >> >> > Thanks for explaining this, but a very little nit: the immediate (I.e. -1) > uses additional 32/64 bits in code which must be loaded from memory and > wastes space in CPU cache or am I wrong? This could be saved with >= 0. > > So if unifying the code I agree to Martin's opinion. > > -Ulf > > The aforementioned cmov instruction is not without its own downsides, so >> it's unclear which is better when branch probability isn't known a priori. >> >> The 1 byte code is unlikely to make any difference, unless jit is turned >> off and you're running this through a tight loop in the interpreter (but if >> one does that, perf conversation is moot :)). >> >> Sent from my phone >> >> On Aug 28, 2014 1:28 PM, "Ulf Zibis" > Ulf.Zibis at cosoco.de>> wrote: >> >> >> Am 27.08.2014 um 17:51 schrieb Martin Buchholz: >> >> The ArrayList version saves one byte of bytecode, and is >> therefore very >> slightly better. We should bless that version and use it >> consistently. >> >> >> +1 >> Additional argument: >> The LinkedList code requires to load 32/64-Bit -1 into CPU. This may >> take some time on some >> CPU and at least wastes memory footprint. >> Additionally register pressure increases. >> Vitaly, please correct me, if I'm wrong, just for learning more. >> >> Another advantage is that there is no problem if some implementation >> of indexOf() erroneously >> returns another negative value than -1. I remember some compare() >> implementations, which >> sometimes return different values than only -1, 0, +1. >> >> -Ulf >> >> ArrayList: >> >> public boolean contains(Object o) { >> return indexOf(o) >= 0; >> } >> >> LinkedList: >> >> public boolean contains(Object o) { >> return indexOf(o) != -1; >> } >> >> >> > From martinrb at google.com Fri Aug 29 22:32:51 2014 From: martinrb at google.com (Martin Buchholz) Date: Fri, 29 Aug 2014 15:32:51 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> Message-ID: Refactoring the hierarchy should be separate (and much more controversial) change. This change is a clean win, just very small. Refactoring runs into space/time tradeoffs. On Fri, Aug 29, 2014 at 3:23 PM, Vitaly Davidovich wrote: > :) so if you're going to do this, is there no base class in the hierarchy > where this can be placed (I don't have source in front of me)? That way > there's a higher likelihood that the pattern will stay consistent (with new > implementations at least). > > Sent from my phone > On Aug 29, 2014 5:56 PM, "Martin Buchholz" wrote: > > Just think - one whole byte saved for each individual change! > I have a webrev! > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/pico-optimize-contains/ > https://bugs.openjdk.java.net/browse/JDK-8056951 > > Can haz review please? > > > On Fri, Aug 29, 2014 at 1:05 PM, Ulf Zibis wrote: > > > > > Am 28.08.2014 um 19:46 schrieb Vitaly Davidovich: > > > > > >> There's no register pressure - the immediate (I.e. -1) is encoded > >> directly into the instruction, just like 0 would be. The time when 0 is > >> particularly useful is when you test for it in the zero bit of the flags > >> register (e.g. dec followed by jz, such as when counting a loop down to > >> 0). Otherwise, I don't see any advantage from machine code perspective. > >> > >> > > Thanks for explaining this, but a very little nit: the immediate (I.e. > -1) > > uses additional 32/64 bits in code which must be loaded from memory and > > wastes space in CPU cache or am I wrong? This could be saved with >= 0. > > > > So if unifying the code I agree to Martin's opinion. > > > > -Ulf > > > > The aforementioned cmov instruction is not without its own downsides, so > >> it's unclear which is better when branch probability isn't known a > priori. > >> > >> The 1 byte code is unlikely to make any difference, unless jit is turned > >> off and you're running this through a tight loop in the interpreter > (but if > >> one does that, perf conversation is moot :)). > >> > >> Sent from my phone > >> > >> On Aug 28, 2014 1:28 PM, "Ulf Zibis" >> Ulf.Zibis at cosoco.de>> wrote: > >> > >> > >> Am 27.08.2014 um 17:51 schrieb Martin Buchholz: > >> > >> The ArrayList version saves one byte of bytecode, and is > >> therefore very > >> slightly better. We should bless that version and use it > >> consistently. > >> > >> > >> +1 > >> Additional argument: > >> The LinkedList code requires to load 32/64-Bit -1 into CPU. This may > >> take some time on some > >> CPU and at least wastes memory footprint. > >> Additionally register pressure increases. > >> Vitaly, please correct me, if I'm wrong, just for learning more. > >> > >> Another advantage is that there is no problem if some implementation > >> of indexOf() erroneously > >> returns another negative value than -1. I remember some compare() > >> implementations, which > >> sometimes return different values than only -1, 0, +1. > >> > >> -Ulf > >> > >> ArrayList: > >> > >> public boolean contains(Object o) { > >> return indexOf(o) >= 0; > >> } > >> > >> LinkedList: > >> > >> public boolean contains(Object o) { > >> return indexOf(o) != -1; > >> } > >> > >> > >> > > > > From ioi.lam at oracle.com Fri Aug 29 23:07:03 2014 From: ioi.lam at oracle.com (Ioi Lam) Date: Fri, 29 Aug 2014 16:07:03 -0700 Subject: RFR (7u): 8046070 - Class Data Sharing clean up and refactoring Message-ID: <54010797.5010107@oracle.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8046070 jdk9 review thread: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2014-August/012235.html jdk9 webrev: http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-vfinal/ jdk8u-40 webrev: http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-backport-8u40/ The JDK 9 changes in the open source code applied mostly cleanly with some minor manual reshuffling of the source code but otherwise no semantic differences. Thanks Ioi From john.r.rose at oracle.com Fri Aug 29 23:33:57 2014 From: john.r.rose at oracle.com (John Rose) Date: Fri, 29 Aug 2014 16:33:57 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: <5400DCF0.6090302@CoSoCo.de> References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> Message-ID: <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> On Aug 29, 2014, at 1:05 PM, Ulf Zibis wrote: > Thanks for explaining this, but a very little nit: the immediate (I.e. -1) uses additional 32/64 bits in code which must be loaded from memory and wastes space in CPU cache or am I wrong? This could be saved with >= 0. I have to say you're more wrong than right about this. Optimizers routinely change the form of constants. For example, a constant 0 will often show up as something like "xor eax,eax", not a 32-bit literal zero that loads from somewhere in memory. A comparison of the form "x > -1" will be freely changed to "x >= 0" and back again; the latter form may (or may not, depending on chip version) transform to "test eax", with no "-1" or "0" in sight. Also, even if you can (on some sunny Friday) detect 32 or more one-bits in an instruction stream, it does not follow that tweaking your source code to make them disappear will prevent them from reappearing (in the dark of the next solstice or the next update release of the JVM). And this won't be a bug, because data loads from instruction cache are extremely cheap, since in most present chips they are pipelined well ahead of any use. Changing source code on based on the difference between 0 and -1 is almost as pointless as removing whitespace and comments, or swapping "a+b" to "b+a", hoping somehow to improve efficiency. Sure, it might happen if you are lucky but because it's luck, your luck will change. I hate to say it, but (as a different example) removing "asserts" is much more likely to improve performance than shuffling constant spellings. And this is because of a more important bug in the JIT, where inline decisions wrongly take into account the presence of inactive asserts. I'm not trying to evade the present subject, but in the grand scheme of things this email thread is shuffling equivalent chunks of furniture, which the JIT is going to reshuffle behind your back anyway. If you really have a measurable performance problem (as with asserts), file a bug against the JIT rather than trying to control code shape by making semantically null changes to source code. ? John From martinrb at google.com Fri Aug 29 23:47:25 2014 From: martinrb at google.com (Martin Buchholz) Date: Fri, 29 Aug 2014 16:47:25 -0700 Subject: RFR: 8055949: ByteArrayOutputStream capacity should be maximal array size permitted by VM In-Reply-To: <53FDB5EB.8000105@CoSoCo.de> References: <53FDB5EB.8000105@CoSoCo.de> Message-ID: I decided to care just enough about the last 2x of scalability, but not about the last 8 elements. Your code would resize the 2g elements 8 times before finally reaching MAX_VALUE... Now I'm back in not-caring-anymore mode. At least about MAX_ARRAY_SIZE. On Wed, Aug 27, 2014 at 3:41 AM, Ulf Zibis wrote: > Am 25.08.2014 um 19:37 schrieb Martin Buchholz: > > https://bugs.openjdk.java.net/browse/JDK-8055949 >> http://cr.openjdk.java.net/~martin/webrevs/openjdk9/ >> ByteArrayOutputStream-MAX_ARRAY_SIZE/ >> >> The 2x capacity gap was noticed by real users! >> > > Hi Martin, > > the MAX_ARRAY_SIZE code now is copied to many places in JDK. Couldn't you > better centralize the code to one place, e.g. j.u.Arrays or some hidden > class of sun.java...? > Isn't there a property to retrieve MAX_ARRAY_SIZE from the running VM? > > Imagine, some VM throws OOME above Integer.MAX_VALUE-4 and minCapacity is > Integer.MAX_VALUE-4. > With this code a OOME will happen: > 124 return (minCapacity > MAX_ARRAY_SIZE) ? > 125 Integer.MAX_VALUE : > 126 MAX_ARRAY_SIZE; > With this code we would avoid the OOME: > 124 return (minCapacity > MAX_ARRAY_SIZE) ? > 125 minCapacity : > 126 MAX_ARRAY_SIZE; > > -Ulf > > From martinrb at google.com Sat Aug 30 00:27:45 2014 From: martinrb at google.com (Martin Buchholz) Date: Fri, 29 Aug 2014 17:27:45 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> Message-ID: Hi John, I agree that the benefit is very small, but I am coming at this from source code consistency and bytecode size (not jitted code performance), and I think bytecode size is at least one of the problems with assert. ... I filed that bug long ago, but no action yet .... https://bugs.openjdk.java.net/browse/JDK-6445664 Eliminate remaining performance penalty for using assert On Fri, Aug 29, 2014 at 4:33 PM, John Rose wrote: > On Aug 29, 2014, at 1:05 PM, Ulf Zibis wrote: > > > Thanks for explaining this, but a very little nit: the immediate (I.e. > -1) uses additional 32/64 bits in code which must be loaded from memory and > wastes space in CPU cache or am I wrong? This could be saved with >= 0. > > I have to say you're more wrong than right about this. Optimizers > routinely change the form of constants. For example, a constant 0 will > often show up as something like "xor eax,eax", not a 32-bit literal zero > that loads from somewhere in memory. A comparison of the form "x > -1" > will be freely changed to "x >= 0" and back again; the latter form may (or > may not, depending on chip version) transform to "test eax", with no "-1" > or "0" in sight. > > Also, even if you can (on some sunny Friday) detect 32 or more one-bits in > an instruction stream, it does not follow that tweaking your source code to > make them disappear will prevent them from reappearing (in the dark of the > next solstice or the next update release of the JVM). And this won't be a > bug, because data loads from instruction cache are extremely cheap, since > in most present chips they are pipelined well ahead of any use. > > Changing source code on based on the difference between 0 and -1 is almost > as pointless as removing whitespace and comments, or swapping "a+b" to > "b+a", hoping somehow to improve efficiency. Sure, it might happen if you > are lucky but because it's luck, your luck will change. > > I hate to say it, but (as a different example) removing "asserts" is much > more likely to improve performance than shuffling constant spellings. And > this is because of a more important bug in the JIT, where inline decisions > wrongly take into account the presence of inactive asserts. > > I'm not trying to evade the present subject, but in the grand scheme of > things this email thread is shuffling equivalent chunks of furniture, which > the JIT is going to reshuffle behind your back anyway. > > If you really have a measurable performance problem (as with asserts), > file a bug against the JIT rather than trying to control code shape by > making semantically null changes to source code. > > ? John From john.r.rose at oracle.com Sat Aug 30 00:49:17 2014 From: john.r.rose at oracle.com (John Rose) Date: Fri, 29 Aug 2014 17:49:17 -0700 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> Message-ID: On Aug 29, 2014, at 5:27 PM, Martin Buchholz wrote: > I agree that the benefit is very small, but I am coming at this from source code consistency and bytecode size (not jitted code performance), and I think bytecode size is at least one of the problems with assert. We agree about JDK-6445664. See my JDK-6316156, which I just linked to your bug. Unfortunately the current inlining heuristics create a performance linkage (an accidental one) to the size of a method's bytecode instructions. (BTW, there is no such linkage to the overall class file size, lest anyone go a quest to shrink class files. For example, you won't get penalized for using a CONSTANT_Long instead of a CONSTANT_Integer of the same value.) I am not against individual ad hoc reductions in bytecode size, or regularization of code, but I am resolutely against any proposition that a steady stream of such suggestions is worth the expense of anyone's professional attention. To be positive... :-) New useful APIs (streams), or real algorithmic changes to old libraries (TimSort), make me smile a lot. More than that, bugs like JDK-6445664, which connect desirable code styles to required JIT optimizations, excite my interest, because they show opportunities that we can exploit if we coordinate our efforts. (Streams are also in the latter category, since they are likely to require new JIT optimizations.) In that spirit, I'll try some rabble-rousing on the JIT team about this... ? John From guy.steele at oracle.com Sat Aug 30 02:53:34 2014 From: guy.steele at oracle.com (Guy Steele) Date: Fri, 29 Aug 2014 22:53:34 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> Message-ID: <911C95F8-70D5-4F36-A7D6-D3564CA8B324@oracle.com> On Aug 29, 2014, at 7:33 PM, John Rose wrote: > . . . > Changing source code on based on the difference between 0 and -1 is almost as pointless as removing whitespace and comments . . . Well said, John! But I cannot resist recalling that one of the earliest pieces of software in the implementation of EMACS (back when the implementation language was TECO, a text-editing language) was a routine that, when it loaded TECO macros from a file, would carefully remove comments and excess whitespace in order to improve the execution speed of the macros (and therefore the response time of the EMACS keystrokes)! We have come a long, long way in 38 years. --Guy From ivan.gerasimov at oracle.com Sat Aug 30 08:36:48 2014 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Sat, 30 Aug 2014 12:36:48 +0400 Subject: Optimization 2.0 for composing strings - Was: Replace concat String to append in StringBuilder parameters In-Reply-To: <5400E85E.9030005@CoSoCo.de> References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <53E8CCD6.2090503@CoSoCo.de> <53FDA7C1.6060303@CoSoCo.de> <902B0B7A-32BE-498A-B9DD-8937960430A2@oracle.com> <53FF7244.2030804@CoSoCo.de> <5400E85E.9030005@CoSoCo.de> Message-ID: <54018D20.7060806@oracle.com> It may be worth to compare the performance of alternative implementations with -XX:+OptimizeStringConcat option turned on. Sincerely yours, Ivan On 30.08.2014 0:53, Ulf Zibis wrote: > Hi compiler people, > > is there some chance that javac could be enhanced to optimize better > as discussed in this thread? Than refactoring of up to now better > readable code to ugly StringBuilder at append() code would be superfluous. > I really like the String concatenation syntax, but unfortunately it > often causes slower code and bigger footprint. > Optimally javac would optimize mixed use of StringBuilder, > StringJoiner, concatenation, toString(), append(String), > append(Collection) etc. to a single StringBuilder instance, so that > the resulting code, JITed or not, will have better performance. > Additionally javac could guess a reasonable initial capacity from the > given source code. > > > Am 29.08.2014 um 10:01 schrieb Wang Weijun: >> So it's not that the optimization fails but there is no optimization >> on them yet. >> >> I do see the .append("x") case will be easy to deal with, but it >> looks like historically javac has not been a place to do many >> optimizations. It mostly converts the java source to byte codes in a >> 1-to-1 mapping and let VM do whatever it wants (to optimize). When >> you talked about compiling multiple concatenation into using a single >> StringBuilder, it's more like choosing the correct implementation >> rather than an optimization. >> >> I don't expect to see big change on this in the near future, so shall >> we go on with the current enhancement? >> >> Thanks >> Max >> >> On Aug 29, 2014, at 2:17, Ulf Zibis wrote: >> >>> I mean: >>> It does not output byte code that only uses a single char array to >>> compose the entire String in question. >>> With "optimization fails", I also mean, there is used an additional >>> "StringComposer" e.g. another StringBuilder or a StringJoiner in >>> addition to the 1st StringBuilder. >>> >>> -Ulf >>> >>> Am 27.08.2014 um 14:02 schrieb Pavel Rappo: >>>> Could you please explain what you mean by "javac optimization >>>> fails" here? >>>> >>>> -Pavel >>>> >>>> On 27 Aug 2014, at 10:41, Ulf Zibis wrote: >>>> >>>>> 4.) Now we see, that javac optimization fails again if >>>>> StringBuilder, concatenation, toString(), append(String), >>>>> append(Collection) etc. and StringJoiner use is mixed. >> > > > From otaviojava at java.net Sat Aug 30 13:12:45 2014 From: otaviojava at java.net (=?UTF-8?Q?Ot=C3=A1vio_Gon=C3=A7alves_de_Santana?=) Date: Sat, 30 Aug 2014 10:12:45 -0300 Subject: Replace concat String to append in StringBuilder parameters In-Reply-To: References: <53E7FA44.9050207@oracle.com> <476830A4-7A8E-4652-A0C7-805687155F4A@oracle.com> <53E8CCD6.2090503@CoSoCo.de> <53FDA7C1.6060303@CoSoCo.de> <902B0B7A-32BE-498A-B9DD-8937960430A2@oracle.com> <53FF7244.2030804@CoSoCo.de> Message-ID: I believe yes. Using the -XX:+OptimizeStringConcat: java -jar -XX:+OptimizeStringConcat target/microbenchmarks.jar ".*StringBuilderConcatBenchMark.*" -wi 10 -i 10 -f 1 The same thing happened: Benchmark Mode Samples Mean Mean error Units m.StringBuilderConcatBenchMark.stringBuilder thrpt 10 6316489.783 211751.479 ops/s m.StringBuilderConcatBenchMark.stringBuilderWithConcat thrpt 10 3206244.215 60752.652 ops/s So, can you review these changes, please. https://bugs.openjdk.java.net/browse/JDK-8055723 http://cr.openjdk.java.net/~weijun/8055723/client/webrev.02/ http://cr.openjdk.java.net/~weijun/8055723/core/webrev.02/ http://cr.openjdk.java.net/~weijun/8055723/core/webrev.03/ On Fri, Aug 29, 2014 at 5:01 AM, Wang Weijun wrote: > So it's not that the optimization fails but there is no optimization on > them yet. > > I do see the .append("x") case will be easy to deal with, but it looks > like historically javac has not been a place to do many optimizations. It > mostly converts the java source to byte codes in a 1-to-1 mapping and let > VM do whatever it wants (to optimize). When you talked about compiling > multiple concatenation into using a single StringBuilder, it's more like > choosing the correct implementation rather than an optimization. > > I don't expect to see big change on this in the near future, so shall we > go on with the current enhancement? > > Thanks > Max > > On Aug 29, 2014, at 2:17, Ulf Zibis wrote: > > > I mean: > > It does not output byte code that only uses a single char array to > compose the entire String in question. > > With "optimization fails", I also mean, there is used an additional > "StringComposer" e.g. another StringBuilder or a StringJoiner in addition > to the 1st StringBuilder. > > > > -Ulf > > > > Am 27.08.2014 um 14:02 schrieb Pavel Rappo: > >> Could you please explain what you mean by "javac optimization fails" > here? > >> > >> -Pavel > >> > >> On 27 Aug 2014, at 10:41, Ulf Zibis wrote: > >> > >>> 4.) Now we see, that javac optimization fails again if StringBuilder, > concatenation, toString(), append(String), append(Collection) etc. and > StringJoiner use is mixed. > >> > > > > -- Ot?vio Gon?alves de Santana blog: http://otaviosantana.blogspot.com.br/ twitter: http://twitter.com/otaviojava site: *http://about.me/otaviojava * 55 (11) 98255-3513 From Ulf.Zibis at CoSoCo.de Sat Aug 30 14:17:40 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Sat, 30 Aug 2014 16:17:40 +0200 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> Message-ID: <5401DD04.6050802@CoSoCo.de> Am 30.08.2014 um 01:33 schrieb John Rose: > On Aug 29, 2014, at 1:05 PM, Ulf Zibis > wrote: > >> Thanks for explaining this, but a very little nit: the immediate (I.e. -1) uses additional 32/64 >> bits in code which must be loaded from memory and wastes space in CPU cache or am I wrong? This >> could be saved with >= 0. > > I have to say you're more wrong than right about this. Optimizers routinely change the form of > constants. For example, a constant 0 will often show up as something like "xor eax,eax", not a > 32-bit literal zero that loads from somewhere in memory. A comparison of the form "x > -1" will > be freely changed to "x >= 0" and back again; the latter form may (or may not, depending on chip > version) transform to "test eax", with no "-1" or "0" in sight. 1. Thanks for the hint about "x > -1" ===> "x >= 0". But I'm afraid this would apply on the "x != -1" case we are discussing here. 2. Are you really sure this optimization is always implemented, as following bug is still open: JDK-6984886 : Transform comparisons against odd border to even border -Ulf From Ulf.Zibis at CoSoCo.de Sat Aug 30 14:22:17 2014 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Sat, 30 Aug 2014 16:22:17 +0200 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> Message-ID: <5401DE19.6050207@CoSoCo.de> Am 29.08.2014 um 23:56 schrieb Martin Buchholz: > Just think - one whole byte saved for each individual change! > I have a webrev! > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/pico-optimize-contains/ > > https://bugs.openjdk.java.net/browse/JDK-8056951 > > Can haz review please? Looks good to me! -Ulf From lange.fabian at gmail.com Sat Aug 30 17:04:20 2014 From: lange.fabian at gmail.com (Fabian Lange) Date: Sat, 30 Aug 2014 19:04:20 +0200 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: Hello dear list, it was not my intention to steal precious developer time by annoying you guys with my finding. I really wanted to understand why there is a source difference. So I went ahead and looked at it from the only aspect I could estimate contributing to it. I am well aware of the fact that JIT does an amazing job optimizing code, so it surprises me how in some replies there is an negative undertone and randomness attributed to JIT. Right now I assume that my question upset some people, because it is of course not nice that people question code which was written over a decade ago. If not discussing the question on a technical level, I do not know why the argument of time wasting on micro level is made in multiple page long e-mails, which for sure also took precious time to write. So thanks to everybody who taught me a bit about inner workings of JIT, and special thanks to Martin who did have the courage to submit a bug and webrev! Fabian: PS: Out of curiosity I looked at the contains implementation here: https://android.googlesource.com/platform/libcore/+/master/luni/src/main/java/java/util/LinkedList.java it is manually inlined to avoid counting the position at all. I wonder if JIT would do that at any point as well. On Wed, Aug 27, 2014 at 4:02 PM, Fabian Lange wrote: > Hi all, > I have been involved recently in some theoretical or nonsensical > discussions about microbenchmarking, jit compiling assemblies and so > fort. > One example was LinkedList vs ArrayList. > > What I noticed is that those two have a different implementation for contains(): > > ArrayList: > > public boolean contains(Object o) { > return indexOf(o) >= 0; > } > > LinkedList: > > public boolean contains(Object o) { > return indexOf(o) != -1; > } > > Logically this is of course identical due to the contract of contains > which returns either -1 or the >=0 index of the element. > > This code has been like this almost forever, and I was wondering if > this actually makes a difference in CPU cycles. > > And in fact this code compiles into different assembler instructions. > The array list does a test against 0 and conditional move, while the > linked list does a jump equals on -1. > > Again that is not surprising, because the actual java source is > different. But I wonder if both options are equally good in cold > performance and when jitted based on parameter values. > > Wouldn't one implementation be better than the other? And why is not > the "better" implementation taken in both classes (and maybe other > Collections which use indexOf) ? > > Is the answer that this has always been like this and the benefit is > not worth the risk of touching ancient code? > > And if not for performance, would code clarify and similarity be an argument? > > (this message was posted to jdk8-dev initially, thanks to Dalibor > Topic for the pointer to this list) > > Fabian From dl at cs.oswego.edu Sat Aug 30 17:58:35 2014 From: dl at cs.oswego.edu (Doug Lea) Date: Sat, 30 Aug 2014 13:58:35 -0400 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: <53FF6680.9000907@CoSoCo.de> <5400DCF0.6090302@CoSoCo.de> <56359349-BC8F-4EFE-8260-D118E5312873@oracle.com> Message-ID: <540210CB.3050402@cs.oswego.edu> Stepping back from this just a little... Potential OpenJDK contributors wonder whether, all other things being equal, they should choose construction A because it is faster than construction B. And they'd like a better answer than "it's complicated". Usually, the answer IS complicated, so it's hard to know where to start. I suppose one way is to recommend study of or courses in compilers, systems software, computer architecture, and algorithm design to provide a conceptual basis for dealing with virtual machine infrastructures, and then to study OpenJDK source and try performance experiments to see how they apply or are extended. That's not a very satisfying answer either. In the present case, I'm with Martin about short-circuiting this with a simple approximate answer: Rather than flip a coin choosing between solutions A and B, pick the one with smaller bytecode. This has a decent enough correlation with actual performance factors to better than chance. And even if the effects are small, sometimes the only path to making things substantially faster is a few percent at a time. -Doug From stanimir at riflexo.com Sat Aug 30 18:32:08 2014 From: stanimir at riflexo.com (Stanimir Simeonoff) Date: Sat, 30 Aug 2014 21:32:08 +0300 Subject: Impact of code difference in Collection#contains() worth improving? In-Reply-To: References: Message-ID: Somewhat off topic. The linked implementation of android lacks integer overflow on size. That might be actually irrelevant on android due to OOM happening earlier than integer overflow. The latter that made me check the JDK impl. I know most concurrent collections handle integer overflow (CLQ, CHM for instance) but I didn't expect LinkedList would be a integer overflow victim. There is no prevention of size going negative. It's unlikely to cause security issues as LinkedList is pretty much shunned (rightfully) and seldom used. Stanimir On Sat, Aug 30, 2014 at 8:04 PM, Fabian Lange wrote: > Hello dear list, > > it was not my intention to steal precious developer time by annoying > you guys with my finding. > I really wanted to understand why there is a source difference. So I > went ahead and looked at it from the only aspect I could estimate > contributing to it. > I am well aware of the fact that JIT does an amazing job optimizing > code, so it surprises me how in some replies there is an negative > undertone and randomness attributed to JIT. > Right now I assume that my question upset some people, because it is > of course not nice that people question code which was written over a > decade ago. > If not discussing the question on a technical level, I do not know why > the argument of time wasting on micro level is made in multiple page > long e-mails, which for sure also took precious time to write. > > So thanks to everybody who taught me a bit about inner workings of JIT, > and special thanks to Martin who did have the courage to submit a bug > and webrev! > > Fabian: > > PS: Out of curiosity I looked at the contains implementation here: > > https://android.googlesource.com/platform/libcore/+/master/luni/src/main/java/java/util/LinkedList.java > it is manually inlined to avoid counting the position at all. > I wonder if JIT would do that at any point as well. > > On Wed, Aug 27, 2014 at 4:02 PM, Fabian Lange > wrote: > > Hi all, > > I have been involved recently in some theoretical or nonsensical > > discussions about microbenchmarking, jit compiling assemblies and so > > fort. > > One example was LinkedList vs ArrayList. > > > > What I noticed is that those two have a different implementation for > contains(): > > > > ArrayList: > > > > public boolean contains(Object o) { > > return indexOf(o) >= 0; > > } > > > > LinkedList: > > > > public boolean contains(Object o) { > > return indexOf(o) != -1; > > } > > > > Logically this is of course identical due to the contract of contains > > which returns either -1 or the >=0 index of the element. > > > > This code has been like this almost forever, and I was wondering if > > this actually makes a difference in CPU cycles. > > > > And in fact this code compiles into different assembler instructions. > > The array list does a test against 0 and conditional move, while the > > linked list does a jump equals on -1. > > > > Again that is not surprising, because the actual java source is > > different. But I wonder if both options are equally good in cold > > performance and when jitted based on parameter values. > > > > Wouldn't one implementation be better than the other? And why is not > > the "better" implementation taken in both classes (and maybe other > > Collections which use indexOf) ? > > > > Is the answer that this has always been like this and the benefit is > > not worth the risk of touching ancient code? > > > > And if not for performance, would code clarify and similarity be an > argument? > > > > (this message was posted to jdk8-dev initially, thanks to Dalibor > > Topic for the pointer to this list) > > > > Fabian > From aleksej.efimov at oracle.com Sun Aug 31 12:19:41 2014 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Sun, 31 Aug 2014 16:19:41 +0400 Subject: [8u-dev] RFR: 8036981: JAXB not preserving formatting for xsd:any Mixed content In-Reply-To: <44C15DD2-68C5-417E-A633-4EB588DC40BB@oracle.com> References: <53F21BF5.7000803@oracle.com> <53F7A18F.4090505@oracle.com> <53FC8476.5010207@oracle.com> <53FC95D3.5040508@oracle.com> <53FDE113.1030503@oracle.com> <44C15DD2-68C5-417E-A633-4EB588DC40BB@oracle.com> Message-ID: <540312DD.9010209@oracle.com> Lance, thank you for the review. Correct - it was also reviewed by Miran. Aleksej On 08/28/2014 09:35 PM, Lance Andersen wrote: > This change looks fine and I believe Miran also reviewed this. > > Best > Lance > On Aug 27, 2014, at 9:45 AM, Aleksej Efimov > wrote: > >> Hi, >> I'm adding a core-libs-dev mail list - I might be lucky to find a >> JDK8 reviewer for my fix there. >> >> Thank you, >> Aleksej >> >> On 08/26/2014 06:12 PM, Aleksej Efimov wrote: >>> Hi Dalibor, >>> >>> It's a partial backport (logged with a different bugID) of JDK9 fix, >>> I got an approval from Miran (Thank you Miran!) and right now I'm >>> waiting for a JDK8 reviewer approval. >>> >>> -Aleksej >>> >>> On 08/26/2014 04:58 PM, dalibor topic wrote: >>>> Hi Aleksej - are you looking for approval to push into jdk8u-dev? >>>> >>>> cheers, >>>> dalibor topic >>>> >>>> On 22.08.2014 22:01, Miroslav Kos wrote: >>>>> Hi Aleksej, >>>>> looks good to me. >>>>> >>>>> Thanks >>>>> Miran >>>>> >>>>> >>>>> On 18/08/14 17:29, Aleksej Efimov wrote: >>>>>> Hi, >>>>>> >>>>>> Can I ask for a review of 8036981 bug [1] fix: >>>>>> JAXWS: >>>>>> http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jaxws/ >>>>>> >>>>>> JDK: >>>>>> http://cr.openjdk.java.net/~aefimov/8036981/8/webrev.00/jdk/ >>>>>> >>>>>> >>>>>> The proposed fix is a partial backport of "Update JAX-WS RI >>>>>> integration to latest version" bug [2] to JDK8. >>>>>> The proposed patch fixes the broken formatting of the input xml >>>>>> during >>>>>> JAXB marshalling/unmarshalling. Regression test is included. >>>>>> Testing: >>>>>> - regtests: xml related tests from 'core' testset - no failures >>>>>> - JCK: api/xinclude api/xsl api/javax_xml api/org_xml xml_schema >>>>>> api/xinclude - no failures >>>>>> >>>>>> Thank you, >>>>>> Aleksej >>>>>> >>>>>> [1] https://bugs.openjdk.java.net/browse/JDK-8036981 >>>>>> [2] https://bugs.openjdk.java.net/browse/JDK-8044656 >>>>>> [3] 8044656 JDK9 review thread: >>>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-June/027458.html >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > > From david.holmes at oracle.com Sun Aug 31 22:34:29 2014 From: david.holmes at oracle.com (David Holmes) Date: Mon, 01 Sep 2014 08:34:29 +1000 Subject: RFR (7u): 8046070 - Class Data Sharing clean up and refactoring In-Reply-To: <54010797.5010107@oracle.com> References: <54010797.5010107@oracle.com> Message-ID: <5403A2F5.9030007@oracle.com> Hi Ioi, The backport (combined with 8056971) looks okay to me. Thanks, David On 30/08/2014 9:07 AM, Ioi Lam wrote: > Bug: https://bugs.openjdk.java.net/browse/JDK-8046070 > jdk9 review thread: > http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2014-August/012235.html > > jdk9 webrev: http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-vfinal/ > jdk8u-40 webrev: > http://cr.openjdk.java.net/~iklam/8046070-cds-cleanup-backport-8u40/ > > > The JDK 9 changes in the open source code applied mostly cleanly with > some minor manual reshuffling of the > source code but otherwise no semantic differences. > > Thanks > Ioi