Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread David Schlosnagle
Hi David, Would it be beneficial to push the toStringCache up to AbstractStringBuilder so that StringBuilder.toString() benefits from this cache as well? It seems like this would affect both StringBuilder and StringBuffer for repeated calls to toString(), although StringBuffer would obviously

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread David Schlosnagle
public String toString() { if (toStringCache == null) { toStringCache = new String(value, 0, count); } return toStringCache; } - Dave On Fri, May 10, 2013 at 2:25 AM, David Schlosnagle schlo...@gmail.comwrote: Hi David, Would it be beneficial to push

Re: Review request 7190657 Modify getDriver() to call Thread.currentThread().getContextClassLoader();

2012-08-10 Thread David Schlosnagle
Lance, There are a couple of other uses of DriverManager.getCallerClassLoader() that do no fall back to Thread.currentThread().getContextClassLoader() if the caller class loader is null (bootstrap loader). Should these be updated as well? From

Re: Review Request: CR 7100996 - (spec str) IndexOutOfBoundsException when using a StringBuffer from multiple threads

2012-06-21 Thread David Schlosnagle
On Thu, Jun 21, 2012 at 11:59 AM, Jim Gish jim.g...@oracle.com wrote: + * across threads, must ensure that StringBuffer.add/insert has a Jim, You may want to replace add with append if you are intending to reference the actual method name and not the generic operation. Additionally, you may

Re: specification for null handling in String, StringBuilder, etc.

2012-06-12 Thread David Schlosnagle
On Tue, Jun 12, 2012 at 9:04 AM, Alan Bateman alan.bate...@oracle.com wrote: On 12/06/2012 06:40, David Holmes wrote: This is very, very common in the core libraries. Rather than document every single method where a null parameter triggers NPE they are often covered (directly or indirectly)

Re: Review request for 7145913 CachedRowSetSwriter.insertNewRow() throws SQLException

2012-05-31 Thread David Schlosnagle
On Thu, May 31, 2012 at 1:50 PM, Lance Andersen - Oracle lance.ander...@oracle.com wrote: Hi, Looking for a reviewer for 7145913.  This addresses an issue with where a SQLException could be thrown when writing a row back with an auto-incremented column on some databases. Webrev is

Re: Request for Review : CR#6924259: Remove String.count/String.offset

2012-05-25 Thread David Schlosnagle
On 24/05/2012 21:45, Mike Duigou wrote: Hello all; For a long time preparations and planing have been underway to remove the offset and count fields from java.lang.String. These two fields enable multiple String instances to share the same backing character buffer. Shared character buffers

Re: Review request for CR 171917 CachedRowSetImpl.populate does not handle map properly

2012-05-25 Thread David Schlosnagle
On Fri, May 25, 2012 at 3:50 PM, Lance Andersen - Oracle lance.ander...@oracle.com wrote: The populate() method needs to check for a size of 0 for the map in case a webrowset xml file has an empty map tag,  which would result in calling setobject specifying a map and not all databases/drivers

Re: RFR: 6988220: java.lang.ObjectName use of String.intern() causes major performance issues at scale

2012-02-23 Thread David Schlosnagle
On Thu, Feb 23, 2012 at 12:01 PM, Frederic Parain frederic.par...@oracle.com wrote: No particular reason. But after thinking more about it, equals() should be a better choice, clearer code, and the length check in equals() implementation is likely to help performance of ObjectName's

Re: Review request : 7141141 Add 3 new test scenarios for testing Main-Class attribute in jar manifest file

2012-02-01 Thread David Schlosnagle
On Wed, Feb 1, 2012 at 7:46 PM, Joseph Darcy joe.da...@oracle.com wrote:  43  * only English is seleced and will pass vacuosly for other locales. Pedantic I know, but can you correct the two spelling mistakes in MainClassAttributeTest.java? s/seleced/selected/ s/vacuosly/vacuously/ 43 * only

Re: Request for Review: Warnings cleanup in java.lang.*, java.util.**

2011-12-04 Thread David Schlosnagle
On Dec 4, 2011, at 7:17 PM, Stuart Marks stuart.ma...@oracle.com wrote: I've been mulling over what to do with these two patches for the past couple days. Initially I was thinking of merging the patches and generating a new one combining the best of both. But after I looked over both of

Re: Any chance to see EnumSet implement SortedSet in JDK8?

2011-08-12 Thread David Schlosnagle
On Fri, Aug 12, 2011 at 9:06 AM, Rémi Forax fo...@univ-mlv.fr wrote: On 08/12/2011 02:46 PM, mike.ske...@talk21.com wrote: Hi Remi, Your argument is flawed The complexity of the operations is not defined by the interface or the presence or absence of the interface In theory yes, but in

Re: JDK 8 code review request for 6380161 (reflect) Exception from newInstance() not chained to cause.

2011-08-08 Thread David Schlosnagle
On Mon, Aug 8, 2011 at 4:57 PM, Sebastian Sickelmann sebastian.sickelm...@gmx.de wrote: These ones are candidates for cleanup too, but i want to discuss if someone sees a good argument to not to change to    throw new InternalError(e.getMessage(),e);    or    throw new InternalError(Lorem

Re: Review (Updated) : 4884238 : Constants for Standard Charsets

2011-04-26 Thread David Schlosnagle
On Mon, Apr 18, 2011 at 6:24 PM, Mike Duigou mike.dui...@oracle.com wrote: The latest webrev : http://cr.openjdk.java.net/~mduigou/4884238/2/webrev/ Any other remaining feeback? Mike, You'll need to update the private constructor and AssertionError for StandardCharset as the existing private

Re: Review request for 7034570 - java.lang.Runtime.exec(String[] cmd, String[] env) can not work properly if SystemRoot not inherited

2011-04-18 Thread David Schlosnagle
On Mon, Apr 18, 2011 at 1:40 PM, Ulf Zibis ulf.zi...@gmx.de wrote: Am 15.04.2011 15:43, schrieb Michael McMahon: I have incorporated much of Ulf's approach into this version. I agree with Alan about the spec. We could find other variables in the future that need to be set, but can have

Re: Review request for 7034570 - java.lang.Runtime.exec(String[] cmd, String[] env) can not work properly if SystemRoot not inherited

2011-04-17 Thread David Schlosnagle
On Sun, Apr 17, 2011 at 1:27 PM, Ulf Zibis ulf.zi...@gmx.de wrote: Am 16.04.2011 16:45, schrieb David Schlosnagle: One minor nit in ProcessEnvironment.java  336     private static void addToEnv(StringBuilder sb, String name, String val) {  337         sb.append(name+=+val+'\u');  338

Re: Review request for 7034570 - java.lang.Runtime.exec(String[] cmd, String[] env) can not work properly if SystemRoot not inherited

2011-04-16 Thread David Schlosnagle
On Sat, Apr 16, 2011 at 6:48 AM, Alan Bateman alan.bate...@oracle.com wrote: Michael McMahon wrote: I have incorporated much of Ulf's approach into this version. I agree with Alan about the spec. We could find other variables in the future that need to be set, but can have alternative

Re: Code review request for 7026898 DriverManager to now use CopyOnWriteArrayList

2011-03-11 Thread David Schlosnagle
On Fri, Mar 11, 2011 at 3:03 PM, Lance Andersen - Oracle lance.ander...@oracle.com wrote: I have posted the diffs to DriverManager for review at http://cr.openjdk.java.net/~lancea/7026898/.  This change utilizes CopyOnWriteArrayList instead of the Vectors previously used. Lance, Shouldn't

Re: 6407460: provide Collections helper methods for new interfaces in JDK 1.6

2011-01-27 Thread David Schlosnagle
Thanks for the feedback Brian and Rémi. I'm assuming this would go into JDK 8 at the earliest, so there seems to be some time to build out the test cases and other related missing methods. Are JUnit tests acceptable (I see only a couple in jdk/test/java/dyn/) or would you prefer the standalone

Re: Code review: 7012540 (java.util.Objects.nonNull() incorrectly named)

2011-01-26 Thread David Schlosnagle
On Tue, Jan 25, 2011 at 6:33 PM, Brian Goetz brian.go...@oracle.com wrote: Additional notes: After much discussion on core-libs-dev, the name requireNonNull() seemed the least objectionable. I think requireNonNull(x) is confusing. Remember there's two versions of someModifierNonNull being

Re: Objects.nonNull()

2011-01-13 Thread David Schlosnagle
On Thu, Jan 13, 2011 at 7:06 PM, Brian Goetz brian.go...@oracle.com wrote: For clarification only (we're not suggesting adding these NOW, but instead preserving the option): People constantly write methods like  public String nonNull(String s) { return s != null ? s : } and other versions

Re: Code Review 7000511: PrintStream, PrintWriter, Formatter leave files open when exception thrown

2010-12-14 Thread David Schlosnagle
Chris, In src/share/classes/java/util/Formatter.java, shouldn't lines 1977 and 2084 also use wrapFileOutputStream? 1975 public Formatter(String fileName) throws FileNotFoundException { 1976 this(Locale.getDefault(Locale.Category.FORMAT), 1977 wrapFileOutputStream(new

Re: Please review -XshowSettings a java launcher option.

2010-11-11 Thread David Schlosnagle
Kumar, Do you need all of the StringBuilder/StringBuffer to buffer the output prior to writing to the PrintStream? Using the PrintStream directly would also allow it to handle the newlines. I was envisaging something like this: private static void printVmSettings(PrintStream ostream, long

Re: Please review -XshowSettings a java launcher option.

2010-11-11 Thread David Schlosnagle
Kumar, No problem, if you have time pressures, I definitely understand. This is welcome functionality, we have our own similar implementation internally but it will be nice to have in OpenJDK. I am curious though about the concern for string concatenation on something like (INDENT + INDENT). As

Re: hg: jdk7/tl/jdk: 6843995: RowSet 1.1 updates

2010-11-06 Thread David Schlosnagle
On Fri, Nov 5, 2010 at 5:51 PM, Lance Andersen - Oracle lance.ander...@oracle.com wrote: Hi Remi (and team), I made changes to SyncFactory and one other class for a similar error.  Also cleaned up a couple of other minor issues in these classes. The webrev can be found at 

Re: Threads should not be Cloneable

2010-08-13 Thread David Schlosnagle
On Fri, Aug 13, 2010 at 10:15 AM, Chris Hegarty chris.hega...@oracle.com wrote: OK, so we'll allow subclasses to crate their own clones but disallow access to the default Object.clone implementation. I don't have a particular problem with this. -Chris. I may be missing something, but if

Re: Threads should not be Cloneable

2010-08-13 Thread David Schlosnagle
(); The final can (and should, IMO) be removed. Why? What purpose would it serve? You can not clone the Thread. The clone of the subclass could only be done via construction - so just use a constructor in the first place. As David Schlosnagle points out any subclass of that Cloneable would

Re: PING: Re: Fix build failure with JAVAC_MAX_WARNINGS=true in sun/nio/cs

2010-06-08 Thread David Schlosnagle
On Tue, Jun 8, 2010 at 5:47 PM, Andrew John Hughes ahug...@redhat.com wrote: New webrev: http://cr.openjdk.java.net/~andrew/warnings/webrev.04/ Andrew, In src/share/classes/sun/nio/cs/ext/HKSCS.java, the following change seems odd setting a static field in the HKSCS.Decoder constructor. Is

Re: UNIXProcess improvements

2010-04-21 Thread David Schlosnagle
Martin, In src/solaris/classes/java/lang/UNIXProcess.java.linux, are lines 177, 181, and 185 needed? If the assignment of these streams were in the constructor, they could be final.  176 synchronized void processExited(int exitcode) {  177 stdout = this.stdout;  178 if

Re: UNIXProcess improvements

2010-04-21 Thread David Schlosnagle
On Wed, Apr 21, 2010 at 9:14 PM, Martin Buchholz marti...@google.com wrote: Thanks for the careful review. No problem, I wanted test this patch out on OS X since the current UNIXProcess.java.bsd is virtually identical to UNIXProcess.java.linux. I slightly tweaked the ManyProcesses test to exec

Re: Re : Code review request for 6908131 Pure Java implementations of StrictMath.floor(double) StrictMath.ceil(double)

2010-01-22 Thread David Schlosnagle
On Fri, Jan 22, 2010 at 2:13 PM, Jeff Hain jeffh...@rocketmail.com wrote: For Joe (or whoever wants to read it): If benches get harder and harder as JVM's get smarter and smarter, maybe some tools could be developped to help developpers with that, instead of just having them warned about

Re: Optimize Formatter.parse (including String.printf)

2009-11-05 Thread David Schlosnagle
Martin, Did you want to remove the commented out formatter? //private Formatter formatter; - Dave Schlosnagle On Thu, Nov 5, 2009 at 6:14 PM, Martin Buchholz marti...@google.com wrote: On Wed, Nov 4, 2009 at 23:07, Xueming Shen xueming.s...@sun.com wrote: #2659:

Re: Sponsoring getting 5015163 (str) String merge/join that is the inverse of String.split() into JDK 7

2009-10-14 Thread David Schlosnagle
Hi Rémi, One quick comment on AbstractStringBuilder.join(String, Object, Object...) -- I'd propose to check that 'elements' is not null prior to appending 'first' so that if the preconditions are violated and the NullPointerException is thrown, there are no side effects. This would also be a nice