From kevinarpe at gmail.com Fri Aug 2 08:47:10 2013 From: kevinarpe at gmail.com (Kevin Connor Arpe) Date: Fri, 2 Aug 2013 16:47:10 +0800 Subject: javax.swing.plaf.basic.BasicHTML.isHTMLString(String) In-Reply-To: References: Message-ID: Hello, My original message is still awaiting approval by the list moderator. If my mail was sent to the wrong list, please let me know. Otherwise, please kindly approve the previous mail. Kind regards, Kevin On Fri, Jul 26, 2013 at 7:27 PM, Kevin Connor Arpe wrote: > Hello, > > This is my first post to this mailing list. > > I was playing around with HTML + text labels on Swing widgets today. I > noticed that the sniff test for HTML is defined by this static method: > javax.swing.plaf.basic.BasicHTML.isHTMLString(String) > > The test is quite strict. Basically, the string must start with "" > -- no whitespace allowed, but it is case insensitive. > > If there is a good reason for this strictness, please let me know. > Otherwise, I would like to submit a small patch (+ test) to improve this > static method to be more forgiving. If OK, please also advise about JDK7u > vs JDK8. (I don't know if a [simple] patch can be applied to both releases > easily.) > > In Perl regex parlance, something like: m/\s*/i > Of course, my solution probably wouldn't use a regex, nor Perl. =) > > Please share you thoughts. > > Thanks, > Kevin Connor ARPE > Hongkong > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.darcy at oracle.com Mon Aug 5 01:04:41 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Sun, 04 Aug 2013 18:04:41 -0700 Subject: RFR JDK 8: 8022190 Fix varargs lint warnings in the JDK Message-ID: <51FEFA29.9000008@oracle.com> Hello, Please review this fix for 8022190: Fix varargs lint warnings in the JDK http://cr.openjdk.java.net/~darcy/8022190.0/ Full patch below. While the @SafeVarargs annotation generally suppresses compiler warnings about methods, when the varargs lint option is enabled, javac does some checking of the body to see if it is indeed safe. If it cannot be proven safe, javac will issue a warning. The the four cases below, javac is unable to determine that the methods are safe. The @SuppressWarnings("varargs") annotations added below help javac out in this regard. Thanks, -Joe diff -r 33617583c545 src/share/classes/java/util/stream/Stream.java --- a/src/share/classes/java/util/stream/Stream.java Wed Jul 31 10:53:33 2013 -0700 +++ b/src/share/classes/java/util/stream/Stream.java Sun Aug 04 18:02:15 2013 -0700 @@ -827,6 +827,7 @@ * @return the new stream */ @SafeVarargs + @SuppressWarnings("varargs") // Creating a stream for an array is safe public static Stream of(T... values) { return Arrays.stream(values); } diff -r 33617583c545 src/share/classes/javax/swing/SwingWorker.java --- a/src/share/classes/javax/swing/SwingWorker.java Wed Jul 31 10:53:33 2013 -0700 +++ b/src/share/classes/javax/swing/SwingWorker.java Sun Aug 04 18:02:15 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -405,6 +405,7 @@ * */ @SafeVarargs + @SuppressWarnings("varargs") // Passing chunks to add is safe protected final void publish(V... chunks) { synchronized (this) { if (doProcess == null) { diff -r 33617583c545 src/share/classes/sun/reflect/annotation/AnnotationParser.java --- a/src/share/classes/sun/reflect/annotation/AnnotationParser.java Wed Jul 31 10:53:33 2013 -0700 +++ b/src/share/classes/sun/reflect/annotation/AnnotationParser.java Sun Aug 04 18:02:15 2013 -0700 @@ -88,6 +88,7 @@ * @param selectAnnotationClasses an array of annotation types to select when parsing */ @SafeVarargs + @SuppressWarnings("varargs") // selectAnnotationClasses is used safely static Map, Annotation> parseSelectAnnotations( byte[] rawAnnotations, ConstantPool constPool, diff -r 33617583c545 src/share/classes/sun/swing/AccumulativeRunnable.java --- a/src/share/classes/sun/swing/AccumulativeRunnable.java Wed Jul 31 10:53:33 2013 -0700 +++ b/src/share/classes/sun/swing/AccumulativeRunnable.java Sun Aug 04 18:02:15 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -121,6 +121,7 @@ * @param args the arguments to accumulate */ @SafeVarargs + @SuppressWarnings("varargs") // Copying args is safe public final synchronized void add(T... args) { boolean isSubmitted = true; if (arguments == null) { From Alan.Bateman at oracle.com Mon Aug 5 02:53:22 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sun, 04 Aug 2013 19:53:22 -0700 Subject: RFR JDK 8: 8022190 Fix varargs lint warnings in the JDK In-Reply-To: <51FEFA29.9000008@oracle.com> References: <51FEFA29.9000008@oracle.com> Message-ID: <51FF13A2.7080509@oracle.com> On 04/08/2013 18:04, Joe Darcy wrote: > Hello, > > Please review this fix for > > 8022190: Fix varargs lint warnings in the JDK > http://cr.openjdk.java.net/~darcy/8022190.0/ > > Full patch below. > > While the @SafeVarargs annotation generally suppresses compiler > warnings about methods, when the varargs lint option is enabled, javac > does some checking of the body to see if it is indeed safe. If it > cannot be proven safe, javac will issue a warning. > > The the four cases below, javac is unable to determine that the > methods are safe. The @SuppressWarnings("varargs") annotations added > below help javac out in this regard. > > Thanks, > > -Joe This looks okay to me (although I have to admit that I initially scratched my head as to why the @SafeVarargs wasn't enough). -Alan. From alexandr.scherbatiy at oracle.com Mon Aug 5 12:07:36 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 05 Aug 2013 16:07:36 +0400 Subject: RFR JDK 8: 8022190 Fix varargs lint warnings in the JDK In-Reply-To: <51FEFA29.9000008@oracle.com> References: <51FEFA29.9000008@oracle.com> Message-ID: <51FF9588.4050700@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/5/2013 5:04 AM, Joe Darcy wrote: > Hello, > > Please review this fix for > > 8022190: Fix varargs lint warnings in the JDK > http://cr.openjdk.java.net/~darcy/8022190.0/ > > Full patch below. > > While the @SafeVarargs annotation generally suppresses compiler > warnings about methods, when the varargs lint option is enabled, javac > does some checking of the body to see if it is indeed safe. If it > cannot be proven safe, javac will issue a warning. > > The the four cases below, javac is unable to determine that the > methods are safe. The @SuppressWarnings("varargs") annotations added > below help javac out in this regard. > > Thanks, > > -Joe > > diff -r 33617583c545 src/share/classes/java/util/stream/Stream.java > --- a/src/share/classes/java/util/stream/Stream.java Wed Jul 31 > 10:53:33 2013 -0700 > +++ b/src/share/classes/java/util/stream/Stream.java Sun Aug 04 > 18:02:15 2013 -0700 > @@ -827,6 +827,7 @@ > * @return the new stream > */ > @SafeVarargs > + @SuppressWarnings("varargs") // Creating a stream for an array is > safe > public static Stream of(T... values) { > return Arrays.stream(values); > } > diff -r 33617583c545 src/share/classes/javax/swing/SwingWorker.java > --- a/src/share/classes/javax/swing/SwingWorker.java Wed Jul 31 > 10:53:33 2013 -0700 > +++ b/src/share/classes/javax/swing/SwingWorker.java Sun Aug 04 > 18:02:15 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -405,6 +405,7 @@ > * > */ > @SafeVarargs > + @SuppressWarnings("varargs") // Passing chunks to add is safe > protected final void publish(V... chunks) { > synchronized (this) { > if (doProcess == null) { > diff -r 33617583c545 > src/share/classes/sun/reflect/annotation/AnnotationParser.java > --- a/src/share/classes/sun/reflect/annotation/AnnotationParser.java > Wed Jul 31 10:53:33 2013 -0700 > +++ b/src/share/classes/sun/reflect/annotation/AnnotationParser.java > Sun Aug 04 18:02:15 2013 -0700 > @@ -88,6 +88,7 @@ > * @param selectAnnotationClasses an array of annotation types to > select when parsing > */ > @SafeVarargs > + @SuppressWarnings("varargs") // selectAnnotationClasses is used > safely > static Map, Annotation> > parseSelectAnnotations( > byte[] rawAnnotations, > ConstantPool constPool, > diff -r 33617583c545 > src/share/classes/sun/swing/AccumulativeRunnable.java > --- a/src/share/classes/sun/swing/AccumulativeRunnable.java Wed Jul > 31 10:53:33 2013 -0700 > +++ b/src/share/classes/sun/swing/AccumulativeRunnable.java Sun Aug > 04 18:02:15 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -121,6 +121,7 @@ > * @param args the arguments to accumulate > */ > @SafeVarargs > + @SuppressWarnings("varargs") // Copying args is safe > public final synchronized void add(T... args) { > boolean isSubmitted = true; > if (arguments == null) { > From alexandr.scherbatiy at oracle.com Mon Aug 5 14:10:51 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 05 Aug 2013 18:10:51 +0400 Subject: javax.swing.plaf.basic.BasicHTML.isHTMLString(String) In-Reply-To: References: Message-ID: <51FFB26B.3090304@oracle.com> On 8/2/2013 12:47 PM, Kevin Connor Arpe wrote: > Hello, > > My original message is still awaiting approval by the list moderator. > If my mail was sent to the wrong list, please let me know. Otherwise, > please kindly approve the previous mail. Your email has been already approved. You need to be subscribed to the swing-dev at openjdk.java.net alias (http://mail.openjdk.java.net/mailman/listinfo/swing-dev) to read the replay: http://mail.openjdk.java.net/pipermail/swing-dev/2013-July/002835.html Thanks, Alexandr. > > Kind regards, > Kevin > > > On Fri, Jul 26, 2013 at 7:27 PM, Kevin Connor Arpe > > wrote: > > Hello, > > This is my first post to this mailing list. > > I was playing around with HTML + text labels on Swing widgets > today. I noticed that the sniff test for HTML is defined by this > static method: javax.swing.plaf.basic.BasicHTML.isHTMLString(String) > > The test is quite strict. Basically, the string must start with > "" -- no whitespace allowed, but it is case insensitive. > > If there is a good reason for this strictness, please let me > know. Otherwise, I would like to submit a small patch (+ test) to > improve this static method to be more forgiving. If OK, please > also advise about JDK7u vs JDK8. (I don't know if a [simple] > patch can be applied to both releases easily.) > > In Perl regex parlance, something like: m/\s*/i > Of course, my solution probably wouldn't use a regex, nor Perl. =) > > Please share you thoughts. > > Thanks, > Kevin Connor ARPE > Hongkong > > From kevinarpe at gmail.com Mon Aug 5 14:44:36 2013 From: kevinarpe at gmail.com (Kevin Connor Arpe) Date: Mon, 5 Aug 2013 22:44:36 +0800 Subject: javax.swing.plaf.basic.BasicHTML.isHTMLString(String) Message-ID: Tom, [ Apologies for my late reply. I forgot to confirm original request for mailing list subscribe. Duh. ] I agree with your reasoning. It makes sense. Can I submit a Javadoc-only patch for widgets with text labels? Examples: JLabel & AbstractButton subclasses: ctors + .setText(String) Maybe I could point people here: http://docs.oracle.com/javase/tutorial/uiswing/components/html.html And make a reference to BasicHTML.isHTMLString(String) ... and update its docs to explain the match algo -- very precise, intentionally. Re: "client property", are you referencing BasicHTML.htmlDisable? Ref: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/javax/swing/plaf/basic/BasicHTML.java#BasicHTML.0htmlDisable Woah, if so, that is pretty deep in the woods. It would be nice if there was a method to toggle that feature on relevant widgets. Perhaps few others have found this rather esoteric feature reference & docs. Making the connection from a ctor or method setText(String) on a widget to BasicHTML was a leap for me... and then I missed this interesting and important feature via "htmlDisable". Maybe some docs to help point the way? I only found this stuff by digging through the OpenJDK source code. Thanks, Arpe >I wouldn't want the html detection to be any more lenient. It's already >problematic in that programmers need to ensure that they don't allow >user text to switch modes. Whilst it's best to do this with the client >property, that isn't always done in practice. Currently it just requires >that whoever edits the text uses the correct form, with any errors being >obvious. >Tom >On 26/07/2013 12:27, Kevin Connor Arpe wrote: >> Hello, >> >> This is my first post to this mailing list. >> >> I was playing around with HTML + text labels on Swing widgets today. I >> noticed that the sniff test for HTML is defined by this static method: >> javax.swing.plaf.basic.BasicHTML.isHTMLString(String) >> >> The test is quite strict. Basically, the string must start with >> "" -- no whitespace allowed, but it is case insensitive. >> >> If there is a good reason for this strictness, please let me know. >> Otherwise, I would like to submit a small patch (+ test) to improve this >> static method to be more forgiving. If OK, please also advise about >> JDK7u vs JDK8. (I don't know if a [simple] patch can be applied to both >> releases easily.) >> >> In Perl regex parlance, something like: m/\s*/i >> Of course, my solution probably wouldn't use a regex, nor Perl. =) >> >> Please share you thoughts. >> >> Thanks, >> Kevin Connor ARPE >> Hongkong -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.darcy at oracle.com Tue Aug 6 23:27:54 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 06 Aug 2013 16:27:54 -0700 Subject: RFR JDK 8 8022453: Fix doclint issues in javax.accessibility Message-ID: <5201867A.1060104@oracle.com> Hello, Please review this change to fix the doclint issues in javax.accessibility; full patch below. http://cr.openjdk.java.net/~darcy/8022453.0/ Thanks, -Joe diff -r d5694d78ebc6 src/share/classes/javax/accessibility/Accessible.java --- a/src/share/classes/javax/accessibility/Accessible.java Tue Aug 06 16:01:39 2013 -0700 +++ b/src/share/classes/javax/accessibility/Accessible.java Tue Aug 06 16:26:49 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,7 @@ * of an object that implements Accessible, and that subclass * is not Accessible, the developer should override the * getAccessibleContext method to return null. + * @return the AccessibleContext associated with this object */ public AccessibleContext getAccessibleContext(); } diff -r d5694d78ebc6 src/share/classes/javax/accessibility/AccessibleBundle.java --- a/src/share/classes/javax/accessibility/AccessibleBundle.java Tue Aug 06 16:01:39 2013 -0700 +++ b/src/share/classes/javax/accessibility/AccessibleBundle.java Tue Aug 06 16:26:49 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,6 +53,9 @@ private final String defaultResourceBundleName = "com.sun.accessibility.internal.resources.accessibility"; + /** + * Construct an {@code AccessibleBundle}. + */ public AccessibleBundle() { } diff -r d5694d78ebc6 src/share/classes/javax/accessibility/AccessibleExtendedTable.java --- a/src/share/classes/javax/accessibility/AccessibleExtendedTable.java Tue Aug 06 16:01:39 2013 -0700 +++ b/src/share/classes/javax/accessibility/AccessibleExtendedTable.java Tue Aug 06 16:26:49 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ */ public int getAccessibleColumn(int index); - /* + /** * Returns the index at a row and column in the table. * * @param r zero-based row of the table diff -r d5694d78ebc6 src/share/classes/javax/accessibility/AccessibleRelationSet.java --- a/src/share/classes/javax/accessibility/AccessibleRelationSet.java Tue Aug 06 16:01:39 2013 -0700 +++ b/src/share/classes/javax/accessibility/AccessibleRelationSet.java Tue Aug 06 16:26:49 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -163,6 +163,7 @@ /** * Returns the number of relations in the relation set. + * @return the number of relations in the relation set */ public int size() { if (relations == null) { diff -r d5694d78ebc6 src/share/classes/javax/accessibility/AccessibleTable.java --- a/src/share/classes/javax/accessibility/AccessibleTable.java Tue Aug 06 16:01:39 2013 -0700 +++ b/src/share/classes/javax/accessibility/AccessibleTable.java Tue Aug 06 16:26:49 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,6 +90,8 @@ * Returns the number of rows occupied by the Accessible at * a specified row and column in the table. * + * @param r zero-based row of the table + * @param c zero-based column of the table * @return the number of rows occupied by the Accessible at a * given specified (row, column) */ @@ -99,6 +101,8 @@ * Returns the number of columns occupied by the Accessible at * a specified row and column in the table. * + * @param r zero-based row of the table + * @param c zero-based column of the table * @return the number of columns occupied by the Accessible at a * given specified row and column */ diff -r d5694d78ebc6 src/share/classes/javax/accessibility/AccessibleTableModelChange.java --- a/src/share/classes/javax/accessibility/AccessibleTableModelChange.java Tue Aug 06 16:01:39 2013 -0700 +++ b/src/share/classes/javax/accessibility/AccessibleTableModelChange.java Tue Aug 06 16:26:49 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,8 +71,8 @@ public static final int DELETE = -1; /** - * Returns the type of event - * + * Returns the type of event. + * @return the type of event * @see #INSERT * @see #UPDATE * @see #DELETE @@ -81,21 +81,25 @@ /** * Returns the first row that changed. + * @return the first row that changed */ public int getFirstRow(); /** * Returns the last row that changed. + * @return the last row that changed */ public int getLastRow(); /** * Returns the first column that changed. + * @return the first column that changed */ public int getFirstColumn(); /** * Returns the last column that changed. + * @return the last column that changed */ public int getLastColumn(); } diff -r d5694d78ebc6 src/share/classes/javax/accessibility/AccessibleTextSequence.java --- a/src/share/classes/javax/accessibility/AccessibleTextSequence.java Tue Aug 06 16:01:39 2013 -0700 +++ b/src/share/classes/javax/accessibility/AccessibleTextSequence.java Tue Aug 06 16:26:49 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ */ public class AccessibleTextSequence { - /* The start index of the text sequence */ + /** The start index of the text sequence */ public int startIndex; /** The end index of the text sequence */ diff -r d5694d78ebc6 src/share/classes/javax/accessibility/AccessibleValue.java --- a/src/share/classes/javax/accessibility/AccessibleValue.java Tue Aug 06 16:01:39 2013 -0700 +++ b/src/share/classes/javax/accessibility/AccessibleValue.java Tue Aug 06 16:26:49 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,6 +60,7 @@ /** * Set the value of this object as a Number. * + * @param n the number to use for the value * @return True if the value was set; else False * @see #getCurrentAccessibleValue */ From philip.race at oracle.com Tue Aug 6 23:31:20 2013 From: philip.race at oracle.com (Phil Race) Date: Tue, 06 Aug 2013 16:31:20 -0700 Subject: RFR JDK 8 8022453: Fix doclint issues in javax.accessibility In-Reply-To: <5201867A.1060104@oracle.com> References: <5201867A.1060104@oracle.com> Message-ID: <52018748.1010608@oracle.com> Looks fine to me. -phil. On 8/6/13 4:27 PM, Joe Darcy wrote: > Hello, > > Please review this change to fix the doclint issues in > javax.accessibility; full patch below. > > http://cr.openjdk.java.net/~darcy/8022453.0/ > > Thanks, > > -Joe > > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/Accessible.java > --- a/src/share/classes/javax/accessibility/Accessible.java Tue Aug > 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/Accessible.java Tue Aug > 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -45,6 +45,7 @@ > * of an object that implements Accessible, and that subclass > * is not Accessible, the developer should override the > * getAccessibleContext method to return null. > + * @return the AccessibleContext associated with this object > */ > public AccessibleContext getAccessibleContext(); > } > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleBundle.java > --- a/src/share/classes/javax/accessibility/AccessibleBundle.java Tue > Aug 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/AccessibleBundle.java Tue > Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -53,6 +53,9 @@ > private final String defaultResourceBundleName > = "com.sun.accessibility.internal.resources.accessibility"; > > + /** > + * Construct an {@code AccessibleBundle}. > + */ > public AccessibleBundle() { > } > > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleExtendedTable.java > --- > a/src/share/classes/javax/accessibility/AccessibleExtendedTable.java > Tue Aug 06 16:01:39 2013 -0700 > +++ > b/src/share/classes/javax/accessibility/AccessibleExtendedTable.java > Tue Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -60,7 +60,7 @@ > */ > public int getAccessibleColumn(int index); > > - /* > + /** > * Returns the index at a row and column in the table. > * > * @param r zero-based row of the table > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleRelationSet.java > --- a/src/share/classes/javax/accessibility/AccessibleRelationSet.java > Tue Aug 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/AccessibleRelationSet.java > Tue Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -163,6 +163,7 @@ > > /** > * Returns the number of relations in the relation set. > + * @return the number of relations in the relation set > */ > public int size() { > if (relations == null) { > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleTable.java > --- a/src/share/classes/javax/accessibility/AccessibleTable.java Tue > Aug 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/AccessibleTable.java Tue > Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -90,6 +90,8 @@ > * Returns the number of rows occupied by the Accessible at > * a specified row and column in the table. > * > + * @param r zero-based row of the table > + * @param c zero-based column of the table > * @return the number of rows occupied by the Accessible at a > * given specified (row, column) > */ > @@ -99,6 +101,8 @@ > * Returns the number of columns occupied by the Accessible at > * a specified row and column in the table. > * > + * @param r zero-based row of the table > + * @param c zero-based column of the table > * @return the number of columns occupied by the Accessible at a > * given specified row and column > */ > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleTableModelChange.java > --- > a/src/share/classes/javax/accessibility/AccessibleTableModelChange.java Tue > Aug 06 16:01:39 2013 -0700 > +++ > b/src/share/classes/javax/accessibility/AccessibleTableModelChange.java Tue > Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -71,8 +71,8 @@ > public static final int DELETE = -1; > > /** > - * Returns the type of event > - * > + * Returns the type of event. > + * @return the type of event > * @see #INSERT > * @see #UPDATE > * @see #DELETE > @@ -81,21 +81,25 @@ > > /** > * Returns the first row that changed. > + * @return the first row that changed > */ > public int getFirstRow(); > > /** > * Returns the last row that changed. > + * @return the last row that changed > */ > public int getLastRow(); > > /** > * Returns the first column that changed. > + * @return the first column that changed > */ > public int getFirstColumn(); > > /** > * Returns the last column that changed. > + * @return the last column that changed > */ > public int getLastColumn(); > } > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleTextSequence.java > --- > a/src/share/classes/javax/accessibility/AccessibleTextSequence.java > Tue Aug 06 16:01:39 2013 -0700 > +++ > b/src/share/classes/javax/accessibility/AccessibleTextSequence.java > Tue Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -49,7 +49,7 @@ > */ > public class AccessibleTextSequence { > > - /* The start index of the text sequence */ > + /** The start index of the text sequence */ > public int startIndex; > > /** The end index of the text sequence */ > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleValue.java > --- a/src/share/classes/javax/accessibility/AccessibleValue.java Tue > Aug 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/AccessibleValue.java Tue > Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -60,6 +60,7 @@ > /** > * Set the value of this object as a Number. > * > + * @param n the number to use for the value > * @return True if the value was set; else False > * @see #getCurrentAccessibleValue > */ > From alexandr.scherbatiy at oracle.com Wed Aug 7 12:38:40 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 07 Aug 2013 16:38:40 +0400 Subject: RFR JDK 8 8022453: Fix doclint issues in javax.accessibility In-Reply-To: <5201867A.1060104@oracle.com> References: <5201867A.1060104@oracle.com> Message-ID: <52023FD0.905@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/7/2013 3:27 AM, Joe Darcy wrote: > Hello, > > Please review this change to fix the doclint issues in > javax.accessibility; full patch below. > > http://cr.openjdk.java.net/~darcy/8022453.0/ > > Thanks, > > -Joe > > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/Accessible.java > --- a/src/share/classes/javax/accessibility/Accessible.java Tue Aug > 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/Accessible.java Tue Aug > 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -45,6 +45,7 @@ > * of an object that implements Accessible, and that subclass > * is not Accessible, the developer should override the > * getAccessibleContext method to return null. > + * @return the AccessibleContext associated with this object > */ > public AccessibleContext getAccessibleContext(); > } > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleBundle.java > --- a/src/share/classes/javax/accessibility/AccessibleBundle.java Tue > Aug 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/AccessibleBundle.java Tue > Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -53,6 +53,9 @@ > private final String defaultResourceBundleName > = "com.sun.accessibility.internal.resources.accessibility"; > > + /** > + * Construct an {@code AccessibleBundle}. > + */ > public AccessibleBundle() { > } > > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleExtendedTable.java > --- > a/src/share/classes/javax/accessibility/AccessibleExtendedTable.java > Tue Aug 06 16:01:39 2013 -0700 > +++ > b/src/share/classes/javax/accessibility/AccessibleExtendedTable.java > Tue Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -60,7 +60,7 @@ > */ > public int getAccessibleColumn(int index); > > - /* > + /** > * Returns the index at a row and column in the table. > * > * @param r zero-based row of the table > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleRelationSet.java > --- a/src/share/classes/javax/accessibility/AccessibleRelationSet.java > Tue Aug 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/AccessibleRelationSet.java > Tue Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -163,6 +163,7 @@ > > /** > * Returns the number of relations in the relation set. > + * @return the number of relations in the relation set > */ > public int size() { > if (relations == null) { > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleTable.java > --- a/src/share/classes/javax/accessibility/AccessibleTable.java Tue > Aug 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/AccessibleTable.java Tue > Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -90,6 +90,8 @@ > * Returns the number of rows occupied by the Accessible at > * a specified row and column in the table. > * > + * @param r zero-based row of the table > + * @param c zero-based column of the table > * @return the number of rows occupied by the Accessible at a > * given specified (row, column) > */ > @@ -99,6 +101,8 @@ > * Returns the number of columns occupied by the Accessible at > * a specified row and column in the table. > * > + * @param r zero-based row of the table > + * @param c zero-based column of the table > * @return the number of columns occupied by the Accessible at a > * given specified row and column > */ > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleTableModelChange.java > --- > a/src/share/classes/javax/accessibility/AccessibleTableModelChange.java Tue > Aug 06 16:01:39 2013 -0700 > +++ > b/src/share/classes/javax/accessibility/AccessibleTableModelChange.java Tue > Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -71,8 +71,8 @@ > public static final int DELETE = -1; > > /** > - * Returns the type of event > - * > + * Returns the type of event. > + * @return the type of event > * @see #INSERT > * @see #UPDATE > * @see #DELETE > @@ -81,21 +81,25 @@ > > /** > * Returns the first row that changed. > + * @return the first row that changed > */ > public int getFirstRow(); > > /** > * Returns the last row that changed. > + * @return the last row that changed > */ > public int getLastRow(); > > /** > * Returns the first column that changed. > + * @return the first column that changed > */ > public int getFirstColumn(); > > /** > * Returns the last column that changed. > + * @return the last column that changed > */ > public int getLastColumn(); > } > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleTextSequence.java > --- > a/src/share/classes/javax/accessibility/AccessibleTextSequence.java > Tue Aug 06 16:01:39 2013 -0700 > +++ > b/src/share/classes/javax/accessibility/AccessibleTextSequence.java > Tue Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -49,7 +49,7 @@ > */ > public class AccessibleTextSequence { > > - /* The start index of the text sequence */ > + /** The start index of the text sequence */ > public int startIndex; > > /** The end index of the text sequence */ > diff -r d5694d78ebc6 > src/share/classes/javax/accessibility/AccessibleValue.java > --- a/src/share/classes/javax/accessibility/AccessibleValue.java Tue > Aug 06 16:01:39 2013 -0700 > +++ b/src/share/classes/javax/accessibility/AccessibleValue.java Tue > Aug 06 16:26:49 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -60,6 +60,7 @@ > /** > * Set the value of this object as a Number. > * > + * @param n the number to use for the value > * @return True if the value was set; else False > * @see #getCurrentAccessibleValue > */ > From alexandr.scherbatiy at oracle.com Wed Aug 7 14:44:00 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 07 Aug 2013 18:44:00 +0400 Subject: [8] Review request for 7121409 Two conformance tests for AccessibleText.getCharacterBounds(int i) fail Message-ID: <52025D30.9020607@oracle.com> Hello, Could you review the fix: bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7121409 webrev: http://cr.openjdk.java.net/~alexsch/7121409/webrev.00 The javadoc for the method "Rectangle getCharacterBounds(int i)" from javax.swing.JLabel class declares: "Determines the bounding box of the character at the given index into the string. The bounds are returned in local coordinates. If the index is invalid an empty rectangle is returned." But the method always returns null for an invalid index since JDK 1.4.0. The fix updates the javadoc to mention that the method returns null for the invalid index. The necessary CCC request has been approved. Thanks, Alexandr. From alexandr.scherbatiy at oracle.com Wed Aug 7 15:31:39 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 07 Aug 2013 19:31:39 +0400 Subject: javax.swing.plaf.basic.BasicHTML.isHTMLString(String) In-Reply-To: References: Message-ID: <5202685B.9030801@oracle.com> On 8/5/2013 6:44 PM, Kevin Connor Arpe wrote: > Tom, > > [ Apologies for my late reply. I forgot to confirm original request > for mailing list subscribe. Duh. ] > > I agree with your reasoning. It makes sense. Can I submit a > Javadoc-only patch for widgets with text labels? Make sure that you signed the Oracle Contributor Agreement before contributing to the Open JDK: http://openjdk.java.net/contribute/ > Examples: JLabel & AbstractButton subclasses: ctors + .setText(String) > Maybe I could point people here: > http://docs.oracle.com/javase/tutorial/uiswing/components/html.html > And make a reference to BasicHTML.isHTMLString(String) ... and update > its docs to explain the match algo -- very precise, intentionally. > > Re: "client property", are you referencing BasicHTML.htmlDisable? > Ref: > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/javax/swing/plaf/basic/BasicHTML.java#BasicHTML.0htmlDisable > Woah, if so, that is pretty deep in the woods. It would be nice if > there was a method to toggle that feature on relevant widgets. > Perhaps few others have found this rather esoteric feature reference & > docs. Making the connection from a ctor or method setText(String) on > a widget to BasicHTML was a leap for me... and then I missed this > interesting and important feature via "htmlDisable". Maybe some docs > to help point the way? I only found this stuff by digging through the > OpenJDK source code. I agree that the better idea is to have a client property like "treat text as html" that allows to not break the backward compatibility. Thanks, Alexandr. > > Thanks, > Arpe > > >I wouldn't want the html detection to be any more lenient. It's already > >problematic in that programmers need to ensure that they don't allow > >user text to switch modes. Whilst it's best to do this with the client > >property, that isn't always done in practice. Currently it just requires > >that whoever edits the text uses the correct form, with any errors being > >obvious. > > >Tom > > >On 26/07/2013 12:27, Kevin Connor Arpe wrote: > >> Hello, > >> > >> This is my first post to this mailing list. > >> > >> I was playing around with HTML + text labels on Swing widgets today. I > >> noticed that the sniff test for HTML is defined by this static method: > >> javax.swing.plaf.basic.BasicHTML.isHTMLString(String) > >> > >> The test is quite strict. Basically, the string must start with > >> "" -- no whitespace allowed, but it is case insensitive. > >> > >> If there is a good reason for this strictness, please let me know. > >> Otherwise, I would like to submit a small patch (+ test) to improve > this > >> static method to be more forgiving. If OK, please also advise about > >> JDK7u vs JDK8. (I don't know if a [simple] patch can be applied to > both > >> releases easily.) > >> > >> In Perl regex parlance, something like: m/\s*/i > >> Of course, my solution probably wouldn't use a regex, nor Perl. =) > >> > >> Please share you thoughts. > >> > >> Thanks, > >> Kevin Connor ARPE > >> Hongkong From Sergey.Bylokhov at oracle.com Wed Aug 7 17:12:25 2013 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Wed, 07 Aug 2013 21:12:25 +0400 Subject: [8] Review request for 7121409 Two conformance tests for AccessibleText.getCharacterBounds(int i) fail In-Reply-To: <52025D30.9020607@oracle.com> References: <52025D30.9020607@oracle.com> Message-ID: <52027FF9.3090905@oracle.com> Hi, Alexander. Fix looks fine. On 07.08.2013 18:44, Alexander Scherbatiy wrote: > > Hello, > > Could you review the fix: > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7121409 > webrev: http://cr.openjdk.java.net/~alexsch/7121409/webrev.00 > > > The javadoc for the method "Rectangle getCharacterBounds(int i)" from > javax.swing.JLabel class declares: > "Determines the bounding box of the character at the given index into > the string. The bounds are returned in local coordinates. If the index > is invalid an empty rectangle is returned." > But the method always returns null for an invalid index since JDK 1.4.0. > > The fix updates the javadoc to mention that the method returns null > for the invalid index. > > The necessary CCC request has been approved. > > > Thanks, > Alexandr. > -- Best regards, Sergey. From joe.darcy at oracle.com Tue Aug 13 23:28:45 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 13 Aug 2013 16:28:45 -0700 Subject: JDK 8 RFR for JDK-8022990, Fix dep_ann lint warnings in swing code Message-ID: <520AC12D.5070501@oracle.com> Hello, Please review the patch below to resolve the "dep_ann" category of javac lint warnings in the client area. In brief, an @Deprecated annotation is added to several types that only have the @deprecated javadoc tag. Thanks, -Joe diff -r a4b0be7341ef src/share/classes/com/sun/java/swing/Painter.java --- a/src/share/classes/com/sun/java/swing/Painter.java Tue Aug 13 19:10:54 2013 +0100 +++ b/src/share/classes/com/sun/java/swing/Painter.java Tue Aug 13 16:26:48 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,5 +29,6 @@ * * @deprecated Use {@link javax.swing.Painter} instead. */ + at Deprecated public interface Painter extends javax.swing.Painter { } diff -r a4b0be7341ef src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java --- a/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java Tue Aug 13 19:10:54 2013 +0100 +++ b/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java Tue Aug 13 16:26:48 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,5 +29,6 @@ * * @deprecated Use {@link javax.swing.plaf.nimbus.AbstractRegionPainter} instead. */ + at Deprecated public abstract class AbstractRegionPainter extends javax.swing.plaf.nimbus.AbstractRegionPainter { } diff -r a4b0be7341ef src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java --- a/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java Tue Aug 13 19:10:54 2013 +0100 +++ b/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java Tue Aug 13 16:26:48 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,5 +29,6 @@ * * @deprecated Use {@link javax.swing.plaf.nimbus.NimbusLookAndFeel} instead. */ + at Deprecated public class NimbusLookAndFeel extends javax.swing.plaf.nimbus.NimbusLookAndFeel { } From alexandr.scherbatiy at oracle.com Wed Aug 14 09:50:49 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 14 Aug 2013 13:50:49 +0400 Subject: JDK 8 RFR for JDK-8022990, Fix dep_ann lint warnings in swing code In-Reply-To: <520AC12D.5070501@oracle.com> References: <520AC12D.5070501@oracle.com> Message-ID: <520B52F9.8030000@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/14/2013 3:28 AM, Joe Darcy wrote: > Hello, > > Please review the patch below to resolve the "dep_ann" category of > javac lint warnings in the client area. In brief, an @Deprecated > annotation is added to several types that only have the @deprecated > javadoc tag. > > Thanks, > > -Joe > > diff -r a4b0be7341ef src/share/classes/com/sun/java/swing/Painter.java > --- a/src/share/classes/com/sun/java/swing/Painter.java Tue Aug 13 > 19:10:54 2013 +0100 > +++ b/src/share/classes/com/sun/java/swing/Painter.java Tue Aug 13 > 16:26:48 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -29,5 +29,6 @@ > * > * @deprecated Use {@link javax.swing.Painter} instead. > */ > + at Deprecated > public interface Painter extends javax.swing.Painter { > } > diff -r a4b0be7341ef > src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java > --- > a/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java > Tue Aug 13 19:10:54 2013 +0100 > +++ > b/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java > Tue Aug 13 16:26:48 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -29,5 +29,6 @@ > * > * @deprecated Use {@link > javax.swing.plaf.nimbus.AbstractRegionPainter} instead. > */ > + at Deprecated > public abstract class AbstractRegionPainter extends > javax.swing.plaf.nimbus.AbstractRegionPainter { > } > diff -r a4b0be7341ef > src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java > --- > a/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java > Tue Aug 13 19:10:54 2013 +0100 > +++ > b/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java > Tue Aug 13 16:26:48 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -29,5 +29,6 @@ > * > * @deprecated Use {@link javax.swing.plaf.nimbus.NimbusLookAndFeel} > instead. > */ > + at Deprecated > public class NimbusLookAndFeel extends > javax.swing.plaf.nimbus.NimbusLookAndFeel { > } > From joe.darcy at oracle.com Wed Aug 14 18:32:50 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 14 Aug 2013 11:32:50 -0700 Subject: JDK 8 RFR for JDK-8022990, Fix dep_ann lint warnings in swing code In-Reply-To: <520B52F9.8030000@oracle.com> References: <520AC12D.5070501@oracle.com> <520B52F9.8030000@oracle.com> Message-ID: <520BCD52.3070100@oracle.com> Hi Alexandr, Fix pushed to TL; thanks, -Joe On 08/14/2013 02:50 AM, Alexander Scherbatiy wrote: > > The fix looks good for me. > > Thanks, > Alexandr. > > On 8/14/2013 3:28 AM, Joe Darcy wrote: >> Hello, >> >> Please review the patch below to resolve the "dep_ann" category of >> javac lint warnings in the client area. In brief, an @Deprecated >> annotation is added to several types that only have the @deprecated >> javadoc tag. >> >> Thanks, >> >> -Joe >> >> diff -r a4b0be7341ef src/share/classes/com/sun/java/swing/Painter.java >> --- a/src/share/classes/com/sun/java/swing/Painter.java Tue Aug 13 >> 19:10:54 2013 +0100 >> +++ b/src/share/classes/com/sun/java/swing/Painter.java Tue Aug 13 >> 16:26:48 2013 -0700 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All >> rights reserved. >> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >> * >> * This code is free software; you can redistribute it and/or modify it >> @@ -29,5 +29,6 @@ >> * >> * @deprecated Use {@link javax.swing.Painter} instead. >> */ >> + at Deprecated >> public interface Painter extends javax.swing.Painter { >> } >> diff -r a4b0be7341ef >> src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java >> --- >> a/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java >> Tue Aug 13 19:10:54 2013 +0100 >> +++ >> b/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java >> Tue Aug 13 16:26:48 2013 -0700 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All >> rights reserved. >> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >> * >> * This code is free software; you can redistribute it and/or modify it >> @@ -29,5 +29,6 @@ >> * >> * @deprecated Use {@link >> javax.swing.plaf.nimbus.AbstractRegionPainter} instead. >> */ >> + at Deprecated >> public abstract class AbstractRegionPainter extends >> javax.swing.plaf.nimbus.AbstractRegionPainter { >> } >> diff -r a4b0be7341ef >> src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java >> --- >> a/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java >> Tue Aug 13 19:10:54 2013 +0100 >> +++ >> b/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java >> Tue Aug 13 16:26:48 2013 -0700 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All >> rights reserved. >> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >> * >> * This code is free software; you can redistribute it and/or modify it >> @@ -29,5 +29,6 @@ >> * >> * @deprecated Use {@link javax.swing.plaf.nimbus.NimbusLookAndFeel} >> instead. >> */ >> + at Deprecated >> public class NimbusLookAndFeel extends >> javax.swing.plaf.nimbus.NimbusLookAndFeel { >> } >> > From alexandr.scherbatiy at oracle.com Thu Aug 15 13:57:47 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 15 Aug 2013 17:57:47 +0400 Subject: [8] Review request for 7083457 Incomplete specification for javax/swing/text/DefaultCaret.html#setVisible(boolean) Message-ID: <520CDE5B.5050309@oracle.com> Hello, Could you review the fix: bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7083457 webrev: http://cr.openjdk.java.net/~alexsch/7083457/webrev.00 According to the javadoc the DefaultCaret.setVisible(boolean e) should always update the getActive() state. Thanks, Alexandr. From Sergey.Bylokhov at oracle.com Thu Aug 15 14:16:05 2013 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 15 Aug 2013 18:16:05 +0400 Subject: [8] Review request for 7083457 Incomplete specification for javax/swing/text/DefaultCaret.html#setVisible(boolean) In-Reply-To: <520CDE5B.5050309@oracle.com> References: <520CDE5B.5050309@oracle.com> Message-ID: <520CE2A5.2040104@oracle.com> Hi, Alexander. Fix looks fine. On 15.08.2013 17:57, Alexander Scherbatiy wrote: > > Hello, > > Could you review the fix: > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7083457 > webrev: http://cr.openjdk.java.net/~alexsch/7083457/webrev.00 > > According to the javadoc the DefaultCaret.setVisible(boolean e) > should always update the getActive() state. > > Thanks, > Alexandr. > -- Best regards, Sergey. From sergey.malenkov at oracle.com Thu Aug 15 14:47:24 2013 From: sergey.malenkov at oracle.com (sergey malenkov) Date: Thu, 15 Aug 2013 18:47:24 +0400 Subject: [8] Review request for 7083457 Incomplete specification for javax/swing/text/DefaultCaret.html#setVisible(boolean) In-Reply-To: <520CDE5B.5050309@oracle.com> References: <520CDE5B.5050309@oracle.com> Message-ID: <520CE9FC.4020502@oracle.com> Hi Alexander, The fix is good, but there is no test in webrev. Thanks, SAM On 15.08.2013 17:57, Alexander Scherbatiy wrote: > > Hello, > > Could you review the fix: > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7083457 > webrev: http://cr.openjdk.java.net/~alexsch/7083457/webrev.00 > > According to the javadoc the DefaultCaret.setVisible(boolean e) > should always update the getActive() state. > > Thanks, > Alexandr. > From sergey.malenkov at oracle.com Thu Aug 15 15:34:39 2013 From: sergey.malenkov at oracle.com (sergey malenkov) Date: Thu, 15 Aug 2013 19:34:39 +0400 Subject: [8] Review request for 8022398: javax/swing/JFileChooser/8013442/Test8013442.java fails Message-ID: <520CF50F.7060609@oracle.com> Hello, Could you please review the following fix: fix: http://cr.openjdk.java.net/~malenkov/8022398.8.0/ bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8022398 The FilterComboBoxModel class is the inner class of every *FileChooserUI class, but the implementation from the Aqua L&F differs from other implementations. It should be aligned with other implementations. The following test can be used to ensure that the problem is fixed: javax/swing/JFileChooser/8013442/Test8013442.java Thanks, SAM From alexandr.scherbatiy at oracle.com Fri Aug 16 11:39:30 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 16 Aug 2013 15:39:30 +0400 Subject: [8] Review request for 7083457 Incomplete specification for javax/swing/text/DefaultCaret.html#setVisible(boolean) In-Reply-To: <520CE9FC.4020502@oracle.com> References: <520CDE5B.5050309@oracle.com> <520CE9FC.4020502@oracle.com> Message-ID: <520E0F72.1020704@oracle.com> Could you review the same fix with the added test: http://cr.openjdk.java.net/~alexsch/7083457/webrev.01/ Thanks, Alexandr. On 8/15/2013 6:47 PM, sergey malenkov wrote: > Hi Alexander, > > The fix is good, but there is no test in webrev. > > Thanks, > SAM > > On 15.08.2013 17:57, Alexander Scherbatiy wrote: >> >> Hello, >> >> Could you review the fix: >> bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7083457 >> webrev: http://cr.openjdk.java.net/~alexsch/7083457/webrev.00 >> >> According to the javadoc the DefaultCaret.setVisible(boolean e) >> should always update the getActive() state. >> >> Thanks, >> Alexandr. >> > From sergey.malenkov at oracle.com Mon Aug 19 13:50:21 2013 From: sergey.malenkov at oracle.com (Sergey Malenkov) Date: Mon, 19 Aug 2013 17:50:21 +0400 Subject: Approved: [8] Review request for 7083457 Incomplete specification for javax/swing/text/DefaultCaret.html#setVisible(boolean) Message-ID: I approve. ?????????? ? Samsung Mobile -------- ???????? ????????? -------- ??: Alexander Scherbatiy ????: 16.08.2013 15:39 (GMT+04:00) ????: sergey malenkov ,swing-dev at openjdk.java.net,Sergey Bylokhov ????: Re: [8] Review request for 7083457 Incomplete specification for javax/swing/text/DefaultCaret.html#setVisible(boolean) ?? Could you review the same fix with the added test: ???? http://cr.openjdk.java.net/~alexsch/7083457/webrev.01/ ?? Thanks, ?? Alexandr. On 8/15/2013 6:47 PM, sergey malenkov wrote: > Hi Alexander, > > The fix is good, but there is no test in webrev. > > Thanks, > SAM > > On 15.08.2013 17:57, Alexander Scherbatiy wrote: >> >> Hello, >> >> Could you review the fix: >>?? bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7083457 >>?? webrev: http://cr.openjdk.java.net/~alexsch/7083457/webrev.00 >> >>?? According to the javadoc the DefaultCaret.setVisible(boolean e) >> should always update the getActive() state. >> >> Thanks, >> Alexandr. >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergey.malenkov at oracle.com Thu Aug 22 04:50:34 2013 From: sergey.malenkov at oracle.com (sergey malenkov) Date: Thu, 22 Aug 2013 08:50:34 +0400 Subject: [8] Review request for 7057769: JScrollBar spec should specify that unit increment & decrement functionality may not be present Message-ID: <5215989A.9050904@oracle.com> Hello, Could you please review the following fix: fix: http://cr.openjdk.java.net/~malenkov/7057769.8.0/ bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7057769 This is a javadoc change that describes current behavior. Thanks, SAM From alexandr.scherbatiy at oracle.com Thu Aug 22 09:22:46 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 22 Aug 2013 13:22:46 +0400 Subject: [8] Review request for 7057769: JScrollBar spec should specify that unit increment & decrement functionality may not be present In-Reply-To: <5215989A.9050904@oracle.com> References: <5215989A.9050904@oracle.com> Message-ID: <5215D866.50905@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/22/2013 8:50 AM, sergey malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/7057769.8.0/ > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7057769 > > This is a javadoc change that describes current behavior. > > Thanks, > SAM From artem.ananiev at oracle.com Thu Aug 22 10:18:40 2013 From: artem.ananiev at oracle.com (Artem Ananiev) Date: Thu, 22 Aug 2013 14:18:40 +0400 Subject: [8] Review request for 7057769: JScrollBar spec should specify that unit increment & decrement functionality may not be present In-Reply-To: <5215989A.9050904@oracle.com> References: <5215989A.9050904@oracle.com> Message-ID: <5215E580.40602@oracle.com> Hi, Sergey, the fix looks fine, however it required API change request (CCC). Thanks, Artem On 8/22/2013 8:50 AM, sergey malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/7057769.8.0/ > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7057769 > > This is a javadoc change that describes current behavior. > > Thanks, > SAM From dmitry.markov at oracle.com Thu Aug 22 11:08:22 2013 From: dmitry.markov at oracle.com (dmitry markov) Date: Thu, 22 Aug 2013 15:08:22 +0400 Subject: [8] Review request for 8023474: First mousepress doesn't start editing in JTree Message-ID: <5215F126.4050607@oracle.com> Hello, Could you review the fix, please? bug: http://bugs.sun.com/view_bug.do?bug_id=8023474 webrev: http://cr.openjdk.java.net/~dmarkov/8023474/webrev.00/ The method BasicTreeUI.startEditing() should find the first valid root for the editingComponent and call validateUnconditionally() for it instead of editingComponent.revalidate() invocation. Thanks, Dmitry From anton.nashatyrev at oracle.com Thu Aug 22 11:57:17 2013 From: anton.nashatyrev at oracle.com (anton nashatyrev) Date: Thu, 22 Aug 2013 15:57:17 +0400 Subject: [8] Review request for 8023392: Swing text components printed with spaces between chars Message-ID: <5215FC9D.4010003@oracle.com> Hello, could you please review the following fix: fix: http://cr.openjdk.java.net/~vkarnauk/8023392/jdk8/webrev.00/ bug: http://bugs.sun.com/view_bug.do?bug_id=80223392 (the bug is still not replicated here, so internal link might be used if available) The problem description: While printing the text output is handled a bit differently: the text layout is justified for the text width (in theory on the screen this text should look identically as without justification), which helps printer to output text more evenly (https://bugs.openjdk.java.net/browse/JDK-6488219). But the problem is the TextLayout.getJustifiedLayout() trim the trailing spaces from the string before laying it out. In the case when the string contains trailing spaces it is justified for the width greater than required. The fix description: as far as we likely don't want to change TextLayout.getJustifiedLayout() behavior, we should respect that implementation feature and justify the text for the width of the string without trailing spaces. I.e. trim trailing spaces before TextLayout.getAdvance(). Thanks! Anton. From sergey.malenkov at oracle.com Thu Aug 22 13:10:01 2013 From: sergey.malenkov at oracle.com (sergey malenkov) Date: Thu, 22 Aug 2013 17:10:01 +0400 Subject: [8] Review request for 8023536: Some regression tests have a wrong header Message-ID: <52160DA9.8090904@oracle.com> Hello, Could you please review the following fix: fix: http://cr.openjdk.java.net/~malenkov/8023536.8.0/ bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8023536 This is a sumple cleanup. Thanks, SAM From alexandr.scherbatiy at oracle.com Thu Aug 22 13:12:11 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 22 Aug 2013 17:12:11 +0400 Subject: [8] Review request for 8023536: Some regression tests have a wrong header In-Reply-To: <52160DA9.8090904@oracle.com> References: <52160DA9.8090904@oracle.com> Message-ID: <52160E2B.1050609@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/22/2013 5:10 PM, sergey malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/8023536.8.0/ > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8023536 > > This is a sumple cleanup. > > Thanks, > SAM From anthony.petrov at oracle.com Thu Aug 22 13:28:57 2013 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Thu, 22 Aug 2013 17:28:57 +0400 Subject: [8] Review request for 8023474: First mousepress doesn't start editing in JTree In-Reply-To: <5215F126.4050607@oracle.com> References: <5215F126.4050607@oracle.com> Message-ID: <52161219.5090606@oracle.com> Hi Dmitry, A few comments: 1. The concept of validate roots has been extended to AWT components since JDK 7. Therefore, I suggest to use the same logic regardless of whether the editor is an instance of JComponent or not. 2. What you're trying to implement here, is actually called revalidateSynchronously(), as opposed to the regular revalidate() method, which in Swing is asynchronous. I believe that rS() might be very much useful in many cases. Therefore, I suggest to add a package-private java.awt.Component.revalidateSynchronously(), and call it via the AWTAccessor from BasicTreeUI.java. Note that the current Component.revalidate() should simply call the new rS() directly, and the rS() may reuse the current implementation of the Component.revalidate(). 3. > 2230 // The implementation of the method is copied from SwingUtilities Copying an implementation is almost always wrong. It might be better to access a method from another package via e.g. an accessor, or reflection, or otherwise find a way to share this code rather than copy it. However, I think you won't need this code anyway if we implement the suggestion #2 above. 4. Is there a similar problem with JTable custom editors? What else Swing components allow for editors? -- best regards, Anthony On 08/22/13 15:08, dmitry markov wrote: > Hello, > > Could you review the fix, please? > bug: http://bugs.sun.com/view_bug.do?bug_id=8023474 > webrev: http://cr.openjdk.java.net/~dmarkov/8023474/webrev.00/ > > The method BasicTreeUI.startEditing() should find the first valid root > for the editingComponent and call validateUnconditionally() for it > instead of editingComponent.revalidate() invocation. > > Thanks, > Dmitry From sergey.malenkov at oracle.com Fri Aug 23 11:32:20 2013 From: sergey.malenkov at oracle.com (Sergey Malenkov) Date: Fri, 23 Aug 2013 04:32:20 -0700 (PDT) Subject: [8] Review request for 7080613: java.beans.DefaultPersistenceDelegate.instantiate(..) doesn't throw NPE Message-ID: <26e31ec9-5200-4873-802e-76208e6c2c5c@default> Hello, Could you please review the following fix: fix: http://cr.openjdk.java.net/~malenkov/7080613.8.0/ bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7080613 This is a javadoc change that describes current behavior. CCC request is approved. Thanks, SAM From alexandr.scherbatiy at oracle.com Fri Aug 23 11:36:01 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 23 Aug 2013 15:36:01 +0400 Subject: [8] Review request for 8007716 Add FunctionalInterface annotation to swing interfaces Message-ID: <52174921.1020902@oracle.com> Hello, Could you review the fix: bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8007716 webrev: http://cr.openjdk.java.net/~alexsch/8007716/webrev.00 There is the suggested functional interface candidates list in the issue description. I selected only listeners and Acive/Lazy values. However, I am not sure that listeners are good candidates for the functional interface annotation because there will be mix in the code that MouseWheelListener can be used as functional interface and MouseMotionListener not. ------------------------------ The FunctionalInterface annotation has been added for the following interfaces in the fix: jdk/src/share/classes/javax/swing/event/ChangeListener.java:36: Note: Candidate functional interface public interface ChangeListener extends EventListener { jdk/src/share/classes/javax/swing/event/HyperlinkListener.java:35: Note: Candidate functional interface public interface HyperlinkListener extends EventListener { jdk/src/share/classes/javax/swing/event/RowSorterListener.java:34: Note: Candidate functional interface public interface RowSorterListener extends java.util.EventListener { jdk/src/share/classes/javax/swing/event/CaretListener.java:36: Note: Candidate functional interface public interface CaretListener extends EventListener { ^ jdk/src/share/classes/javax/swing/event/ListSelectionListener.java:41: Note: Candidate functional interface public interface ListSelectionListener extends EventListener ^ jdk/src/share/classes/javax/swing/event/UndoableEditListener.java:37: Note: Candidate functional interface public interface UndoableEditListener extends java.util.EventListener { ^ jdk/src/share/classes/javax/swing/event/TableModelListener.java:38: Note: Candidate functional interface public interface TableModelListener extends java.util.EventListener ^ jdk/src/share/classes/javax/swing/event/TreeSelectionListener.java:43: Note: Candidate functional interface public interface TreeSelectionListener extends EventListener jdk/src/share/classes/javax/swing/text/ViewFactory.java:36: Note: Candidate functional interface public interface ViewFactory { jdk/src/share/classes/javax/swing/UIDefaults.java:951: Note: Candidate functional interface public interface LazyValue { jdk/src/share/classes/javax/swing/UIDefaults.java:984: Note: Candidate functional interface public interface ActiveValue { ------------------------------ The FunctionalInterface annotation has not been added for the following interfaces in the fix because they mostly designed for the UI components painting rather to use as single action or function calculation: jdk/src/share/classes/javax/swing/tree/TreeCellRenderer.java:42: Note: Candidate functional interface public interface TreeCellRenderer { jdk/src/share/classes/javax/swing/tree/RowMapper.java:36: Note: Candidate functional interface public interface RowMapper jdk/src/share/classes/javax/swing/table/TableCellRenderer.java:38: Note: Candidate functional interface public interface TableCellRenderer { jdk/src/share/classes/javax/swing/ListCellRenderer.java:89: Note: Candidate functional interface public interface ListCellRenderer jdk/src/share/classes/javax/swing/text/TabExpander.java:34: Note: Candidate functional interface public interface TabExpander { jdk/src/share/classes/javax/swing/text/Position.java:49: Note: Candidate functional interface public interface Position { jdk/src/share/classes/javax/swing/text/Highlighter.java:112: Note: Candidate functional interface public interface HighlightPainter { jdk/src/share/classes/javax/swing/Painter.java:63: Note: Candidate functional interface public interface Painter { jdk/src/share/classes/javax/swing/JComboBox.java:1484: Note: Candidate functional interface public interface KeySelectionManager { ------------------------------ The FunctionalInterface annotation has not been added for the following interfaces in the fix because they are not public and so are not part of the public API: jdk/src/share/classes/javax/swing/TransferHandler.java:128: Note: Candidate functional interface interface HasGetTransferHandler { jdk/src/share/classes/javax/swing/text/html/CSSBorder.java:257: Note: Candidate functional interface interface BorderPainter { ^ jdk/src/share/classes/javax/swing/text/html/Map.java:234: Note: Candidate functional interface interface RegionContainment { jdk/src/share/classes/javax/swing/plaf/basic/DragRecognitionSupport.java:52: Note: Candidate functional interface class DragRecognitionSupport { public static interface BeforeDrag { Thanks, Alexandr. From dmitry.markov at oracle.com Fri Aug 23 12:18:09 2013 From: dmitry.markov at oracle.com (dmitry markov) Date: Fri, 23 Aug 2013 16:18:09 +0400 Subject: [8] Review request for 8023474: First mousepress doesn't start editing in JTree In-Reply-To: <52161219.5090606@oracle.com> References: <5215F126.4050607@oracle.com> <52161219.5090606@oracle.com> Message-ID: <52175301.4070804@oracle.com> Hi Anthony, Thank you for your comments. I changed the fix based on your suggestions. Please find new webrev at http://cr.openjdk.java.net/~dmarkov/8023474/webrev.01/. Could you review it, please? Thanks, Dmitry On 22/08/2013 17:28, Anthony Petrov wrote: > Hi Dmitry, > > A few comments: > > 1. The concept of validate roots has been extended to AWT components > since JDK 7. Therefore, I suggest to use the same logic regardless of > whether the editor is an instance of JComponent or not. > > 2. What you're trying to implement here, is actually called > revalidateSynchronously(), as opposed to the regular revalidate() > method, which in Swing is asynchronous. I believe that rS() might be > very much useful in many cases. Therefore, I suggest to add a > package-private java.awt.Component.revalidateSynchronously(), and call > it via the AWTAccessor from BasicTreeUI.java. Note that the current > Component.revalidate() should simply call the new rS() directly, and > the rS() may reuse the current implementation of the > Component.revalidate(). > > 3. >> 2230 // The implementation of the method is copied from >> SwingUtilities > > Copying an implementation is almost always wrong. It might be better > to access a method from another package via e.g. an accessor, or > reflection, or otherwise find a way to share this code rather than > copy it. However, I think you won't need this code anyway if we > implement the suggestion #2 above. > > 4. Is there a similar problem with JTable custom editors? What else > Swing components allow for editors? > As far as I know, JTable does not have this problem. > -- > best regards, > Anthony > > On 08/22/13 15:08, dmitry markov wrote: >> Hello, >> >> Could you review the fix, please? >> bug: http://bugs.sun.com/view_bug.do?bug_id=8023474 >> webrev: http://cr.openjdk.java.net/~dmarkov/8023474/webrev.00/ >> >> The method BasicTreeUI.startEditing() should find the first valid root >> for the editingComponent and call validateUnconditionally() for it >> instead of editingComponent.revalidate() invocation. >> >> Thanks, >> Dmitry From alexandr.scherbatiy at oracle.com Fri Aug 23 13:39:17 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 23 Aug 2013 17:39:17 +0400 Subject: [8] Review request for 8022398: javax/swing/JFileChooser/8013442/Test8013442.java fails In-Reply-To: <520CF50F.7060609@oracle.com> References: <520CF50F.7060609@oracle.com> Message-ID: <52176605.9020707@oracle.com> The fix looks good for me. Is it possible to unify all FilterComboBoxModels in one place rather to duplicate the code in all L&Fs? Thanks, Alexandr. On 8/15/2013 7:34 PM, sergey malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/8022398.8.0/ > > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8022398 > > The FilterComboBoxModel class is the inner class of every > *FileChooserUI class, but the implementation from the Aqua L&F differs > from other implementations. It should be aligned with other > implementations. > > The following test can be used to ensure that the problem is fixed: > javax/swing/JFileChooser/8013442/Test8013442.java > > Thanks, > SAM From alexandr.scherbatiy at oracle.com Fri Aug 23 13:48:23 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 23 Aug 2013 17:48:23 +0400 Subject: [8] Review request for 7080613: java.beans.DefaultPersistenceDelegate.instantiate(..) doesn't throw NPE In-Reply-To: <26e31ec9-5200-4873-802e-76208e6c2c5c@default> References: <26e31ec9-5200-4873-802e-76208e6c2c5c@default> Message-ID: <52176827.2060001@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/23/2013 3:32 PM, Sergey Malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/7080613.8.0/ > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7080613 > > This is a javadoc change that describes current behavior. > CCC request is approved. > > Thanks, > SAM From anthony.petrov at oracle.com Fri Aug 23 13:59:26 2013 From: anthony.petrov at oracle.com (Anthony Petrov) Date: Fri, 23 Aug 2013 17:59:26 +0400 Subject: [8] Review request for 8023474: First mousepress doesn't start editing in JTree In-Reply-To: <52175301.4070804@oracle.com> References: <5215F126.4050607@oracle.com> <52161219.5090606@oracle.com> <52175301.4070804@oracle.com> Message-ID: <52176ABE.5040308@oracle.com> Hi Dmitry, The fix looks good to me. As to the test, you should dispose() the frame before the if (!result){} statement, so that the test could exit when it passes. -- best regards, Anthony On 08/23/2013 04:18 PM, dmitry markov wrote: > Hi Anthony, > > Thank you for your comments. I changed the fix based on your > suggestions. Please find new webrev at > http://cr.openjdk.java.net/~dmarkov/8023474/webrev.01/. > Could you review it, please? > > Thanks, > Dmitry > > On 22/08/2013 17:28, Anthony Petrov wrote: >> Hi Dmitry, >> >> A few comments: >> >> 1. The concept of validate roots has been extended to AWT components >> since JDK 7. Therefore, I suggest to use the same logic regardless of >> whether the editor is an instance of JComponent or not. >> >> 2. What you're trying to implement here, is actually called >> revalidateSynchronously(), as opposed to the regular revalidate() >> method, which in Swing is asynchronous. I believe that rS() might be >> very much useful in many cases. Therefore, I suggest to add a >> package-private java.awt.Component.revalidateSynchronously(), and call >> it via the AWTAccessor from BasicTreeUI.java. Note that the current >> Component.revalidate() should simply call the new rS() directly, and >> the rS() may reuse the current implementation of the >> Component.revalidate(). >> >> 3. >>> 2230 // The implementation of the method is copied from >>> SwingUtilities >> >> Copying an implementation is almost always wrong. It might be better >> to access a method from another package via e.g. an accessor, or >> reflection, or otherwise find a way to share this code rather than >> copy it. However, I think you won't need this code anyway if we >> implement the suggestion #2 above. >> >> 4. Is there a similar problem with JTable custom editors? What else >> Swing components allow for editors? >> > As far as I know, JTable does not have this problem. >> -- >> best regards, >> Anthony >> >> On 08/22/13 15:08, dmitry markov wrote: >>> Hello, >>> >>> Could you review the fix, please? >>> bug: http://bugs.sun.com/view_bug.do?bug_id=8023474 >>> webrev: http://cr.openjdk.java.net/~dmarkov/8023474/webrev.00/ >>> >>> The method BasicTreeUI.startEditing() should find the first valid root >>> for the editingComponent and call validateUnconditionally() for it >>> instead of editingComponent.revalidate() invocation. >>> >>> Thanks, >>> Dmitry > From sergey.malenkov at oracle.com Sat Aug 24 10:42:30 2013 From: sergey.malenkov at oracle.com (Sergey Malenkov) Date: Sat, 24 Aug 2013 03:42:30 -0700 (PDT) Subject: [8] Review request for 8022398: javax/swing/JFileChooser/8013442/Test8013442.java fails Message-ID: <46731416-c9ed-4f97-8e5e-c84713597bf4@default> Hi Alexandr, What do you think about the following changes? http://cr.openjdk.java.net/~malenkov/8022398.8.1/ Thanks, SAM ----- Original Message ----- From: alexandr.scherbatiy at oracle.com To: sergey.malenkov at oracle.com Cc: swing-dev at openjdk.java.net Sent: Friday, August 23, 2013 5:39:25 PM GMT +04:00 Abu Dhabi / Muscat Subject: Re: [8] Review request for 8022398: javax/swing/JFileChooser/8013442/Test8013442.java fails The fix looks good for me. Is it possible to unify all FilterComboBoxModels in one place rather to duplicate the code in all L&Fs? Thanks, Alexandr. On 8/15/2013 7:34 PM, sergey malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/8022398.8.0/ > > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8022398 > > The FilterComboBoxModel class is the inner class of every > *FileChooserUI class, but the implementation from the Aqua L&F differs > from other implementations. It should be aligned with other > implementations. > > The following test can be used to ensure that the problem is fixed: > javax/swing/JFileChooser/8013442/Test8013442.java > > Thanks, > SAM From sergey.malenkov at oracle.com Sat Aug 24 17:45:54 2013 From: sergey.malenkov at oracle.com (Sergey Malenkov) Date: Sat, 24 Aug 2013 10:45:54 -0700 (PDT) Subject: [8] Review request for 8021379: JFileChooser Create New Folder button enabled in write proteced directory Message-ID: <45659ad1-bf27-4722-a55a-d30831516a00@default> Hello, Could you please review the following fix: fix: http://cr.openjdk.java.net/~malenkov/8021379.8.1/ bug: http://bugs.sun.com/view_bug.do?bug_id=8021379 The File.Pane.canWrite method must call the File.canWrite method, not the ShellFolder.isFileSystem. Thanks, SAM From sergey.malenkov at oracle.com Sun Aug 25 12:56:18 2013 From: sergey.malenkov at oracle.com (Sergey Malenkov) Date: Sun, 25 Aug 2013 05:56:18 -0700 (PDT) Subject: [8] Review request for 7195179: ClassCastException for null values in JComboBox Message-ID: Hello, Could you please review the following fix: fix: http://cr.openjdk.java.net/~malenkov/7195179.8.0/ bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7195179 We should not change the type of generified value ob fly. Later we should replace empty string of JLabel to get correct baseline. Thanks, SAM From paul.sandoz at oracle.com Mon Aug 26 09:06:08 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 26 Aug 2013 11:06:08 +0200 Subject: [8] Review request for 8007716 Add FunctionalInterface annotation to swing interfaces In-Reply-To: <52174921.1020902@oracle.com> References: <52174921.1020902@oracle.com> Message-ID: On Aug 23, 2013, at 1:36 PM, Alexander Scherbatiy wrote: > > Hello, > > Could you review the fix: > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8007716 > webrev: http://cr.openjdk.java.net/~alexsch/8007716/webrev.00 > > There is the suggested functional interface candidates list in the > issue description. > I selected only listeners and Acive/Lazy values. > > However, I am not sure that listeners are good candidates for the > functional interface annotation > because there will be mix in the code that MouseWheelListener can be > used as functional interface and MouseMotionListener not. > I suspect many implementations of these interfaces are likely to hold state and/or have side-effects. In that respect they are like java.util.function.Consumer: /** * Represents an operation that accepts a single input argument and returns no * result. Unlike most other functional interfaces, {@code Consumer} is expected * to operate via side-effects. * *

This is a functional interface * whose functional method is {@link #accept(Object)}. * * @param the type of the input to the operation * * @since 1.8 */ @FunctionalInterface public interface Consumer { My view is if it looks and quacks like a functional interface stick a @FunctionaInterface on it, regardless of whether other related interfaces cannot, such as MouseMotionListener since it has two abstract methods. So in general i think the listeners are a good category. I tend to agree with your categorisation below, although i am not very familiar with Swing, and of course that does not mean lambda expressions or method references cannot be used with non-annotated interfaces. Paul. > ------------------------------ > The FunctionalInterface annotation has been added for the following > interfaces in the fix: > > jdk/src/share/classes/javax/swing/event/ChangeListener.java:36: Note: > Candidate functional interface > public interface ChangeListener extends EventListener { > > jdk/src/share/classes/javax/swing/event/HyperlinkListener.java:35: > Note: Candidate functional interface > public interface HyperlinkListener extends EventListener { > > jdk/src/share/classes/javax/swing/event/RowSorterListener.java:34: > Note: Candidate functional interface > public interface RowSorterListener extends java.util.EventListener { > > jdk/src/share/classes/javax/swing/event/CaretListener.java:36: Note: > Candidate functional interface > public interface CaretListener extends EventListener { > ^ > jdk/src/share/classes/javax/swing/event/ListSelectionListener.java:41: > Note: Candidate functional interface > public interface ListSelectionListener extends EventListener > ^ > jdk/src/share/classes/javax/swing/event/UndoableEditListener.java:37: > Note: Candidate functional interface > public interface UndoableEditListener extends java.util.EventListener { > ^ > jdk/src/share/classes/javax/swing/event/TableModelListener.java:38: > Note: Candidate functional interface > public interface TableModelListener extends java.util.EventListener > ^ > jdk/src/share/classes/javax/swing/event/TreeSelectionListener.java:43: > Note: Candidate functional interface > public interface TreeSelectionListener extends EventListener > > jdk/src/share/classes/javax/swing/text/ViewFactory.java:36: Note: > Candidate functional interface > public interface ViewFactory { > > jdk/src/share/classes/javax/swing/UIDefaults.java:951: Note: > Candidate functional interface > public interface LazyValue { > > jdk/src/share/classes/javax/swing/UIDefaults.java:984: Note: > Candidate functional interface > public interface ActiveValue { > > ------------------------------ > The FunctionalInterface annotation has not been added for the following > interfaces in the fix > because they mostly designed for the UI components painting rather to > use as single action or function calculation: > > jdk/src/share/classes/javax/swing/tree/TreeCellRenderer.java:42: > Note: Candidate functional interface > public interface TreeCellRenderer { > > jdk/src/share/classes/javax/swing/tree/RowMapper.java:36: Note: > Candidate functional interface > public interface RowMapper > > jdk/src/share/classes/javax/swing/table/TableCellRenderer.java:38: > Note: Candidate functional interface > public interface TableCellRenderer { > > jdk/src/share/classes/javax/swing/ListCellRenderer.java:89: Note: > Candidate functional interface > public interface ListCellRenderer > > jdk/src/share/classes/javax/swing/text/TabExpander.java:34: Note: > Candidate functional interface > public interface TabExpander { > > jdk/src/share/classes/javax/swing/text/Position.java:49: Note: > Candidate functional interface > public interface Position { > > jdk/src/share/classes/javax/swing/text/Highlighter.java:112: Note: > Candidate functional interface > public interface HighlightPainter { > > jdk/src/share/classes/javax/swing/Painter.java:63: Note: Candidate > functional interface > public interface Painter { > > jdk/src/share/classes/javax/swing/JComboBox.java:1484: Note: > Candidate functional interface > public interface KeySelectionManager { > > ------------------------------ > The FunctionalInterface annotation has not been added for the following > interfaces in the fix > because they are not public and so are not part of the public API: > > jdk/src/share/classes/javax/swing/TransferHandler.java:128: Note: > Candidate functional interface > interface HasGetTransferHandler { > > jdk/src/share/classes/javax/swing/text/html/CSSBorder.java:257: Note: > Candidate functional interface > interface BorderPainter { > ^ > jdk/src/share/classes/javax/swing/text/html/Map.java:234: Note: > Candidate functional interface > interface RegionContainment { > > jdk/src/share/classes/javax/swing/plaf/basic/DragRecognitionSupport.java:52: > Note: Candidate functional interface > class DragRecognitionSupport { > public static interface BeforeDrag { > > > Thanks, > Alexandr. > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 841 bytes Desc: Message signed with OpenPGP using GPGMail URL: From alexandr.scherbatiy at oracle.com Mon Aug 26 09:59:47 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 26 Aug 2013 13:59:47 +0400 Subject: [8] Review request for 8022398: javax/swing/JFileChooser/8013442/Test8013442.java fails In-Reply-To: <46731416-c9ed-4f97-8e5e-c84713597bf4@default> References: <46731416-c9ed-4f97-8e5e-c84713597bf4@default> Message-ID: <521B2713.9040607@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/24/2013 2:42 PM, Sergey Malenkov wrote: > Hi Alexandr, > > What do you think about the following changes? > http://cr.openjdk.java.net/~malenkov/8022398.8.1/ > > Thanks, > SAM > > ----- Original Message ----- > From: alexandr.scherbatiy at oracle.com > To: sergey.malenkov at oracle.com > Cc: swing-dev at openjdk.java.net > Sent: Friday, August 23, 2013 5:39:25 PM GMT +04:00 Abu Dhabi / Muscat > Subject: Re: [8] Review request for 8022398: javax/swing/JFileChooser/8013442/Test8013442.java fails > > > The fix looks good for me. > > Is it possible to unify all FilterComboBoxModels in one place rather > to duplicate the code in all L&Fs? > > Thanks, > Alexandr. > > On 8/15/2013 7:34 PM, sergey malenkov wrote: >> Hello, >> >> Could you please review the following fix: >> fix: http://cr.openjdk.java.net/~malenkov/8022398.8.0/ >> >> bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8022398 >> >> The FilterComboBoxModel class is the inner class of every >> *FileChooserUI class, but the implementation from the Aqua L&F differs >> from other implementations. It should be aligned with other >> implementations. >> >> The following test can be used to ensure that the problem is fixed: >> javax/swing/JFileChooser/8013442/Test8013442.java >> >> Thanks, >> SAM From alexandr.scherbatiy at oracle.com Mon Aug 26 10:55:38 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 26 Aug 2013 14:55:38 +0400 Subject: [8] Review request for 7195179: ClassCastException for null values in JComboBox In-Reply-To: References: Message-ID: <521B342A.4040605@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/25/2013 4:56 PM, Sergey Malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/7195179.8.0/ > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7195179 > > We should not change the type of generified value ob fly. > Later we should replace empty string of JLabel > to get correct baseline. > > Thanks, > SAM From alexandr.scherbatiy at oracle.com Mon Aug 26 11:15:12 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 26 Aug 2013 15:15:12 +0400 Subject: [8] Review request for 8021379: JFileChooser Create New Folder button enabled in write proteced directory In-Reply-To: <45659ad1-bf27-4722-a55a-d30831516a00@default> References: <45659ad1-bf27-4722-a55a-d30831516a00@default> Message-ID: <521B38C0.8060500@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/24/2013 9:45 PM, Sergey Malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/8021379.8.1/ > bug: http://bugs.sun.com/view_bug.do?bug_id=8021379 > > The File.Pane.canWrite method must call the File.canWrite method, > not the ShellFolder.isFileSystem. > > Thanks, > SAM From alexandr.scherbatiy at oracle.com Mon Aug 26 12:05:00 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 26 Aug 2013 16:05:00 +0400 Subject: [8] Review request for 8023392: Swing text components printed with spaces between chars In-Reply-To: <5215FC9D.4010003@oracle.com> References: <5215FC9D.4010003@oracle.com> Message-ID: <521B446C.5080609@oracle.com> I see that SwingUtilities2.drawString(..) and SwingUtilities2.drawChars(...) are used a lot in the Swing but the issue is only about printing. Could removing trailing spaces in these methods affect other non-printed components? Is it possible to add a test for the fix? Thanks, Alexandr. On 8/22/2013 3:57 PM, anton nashatyrev wrote: > Hello, > could you please review the following fix: > > fix: http://cr.openjdk.java.net/~vkarnauk/8023392/jdk8/webrev.00/ > > bug: http://bugs.sun.com/view_bug.do?bug_id=80223392 (the bug is still > not replicated here, so internal link might be used if available) > > The problem description: While printing the text output is handled > a bit differently: the text layout is justified for the text width (in > theory on the screen this text should look identically as without > justification), which helps printer to output text more evenly > (https://bugs.openjdk.java.net/browse/JDK-6488219). > But the problem is the TextLayout.getJustifiedLayout() trim the > trailing spaces from the string before laying it out. In the case when > the string contains trailing spaces it is justified for the width > greater than required. > > The fix description: as far as we likely don't want to change > TextLayout.getJustifiedLayout() behavior, we should respect that > implementation feature and justify the text for the width of the > string without trailing spaces. I.e. trim trailing spaces before > TextLayout.getAdvance(). > > Thanks! > Anton. From alexander.potochkin at oracle.com Mon Aug 26 12:37:40 2013 From: alexander.potochkin at oracle.com (Alexander Potochkin) Date: Mon, 26 Aug 2013 16:37:40 +0400 Subject: [8] Review request for 8023474: First mousepress doesn't start editing in JTree In-Reply-To: <52175301.4070804@oracle.com> References: <5215F126.4050607@oracle.com> <52161219.5090606@oracle.com> <52175301.4070804@oracle.com> Message-ID: <521B4C14.30205@oracle.com> Hello Dmitry The fix looks good to me as well I should say that the final version is much better than the first one, thank you Anthony for the thorough review! alexp On 8/23/2013 4:18 PM, dmitry markov wrote: > Hi Anthony, > > Thank you for your comments. I changed the fix based on your > suggestions. Please find new webrev at > http://cr.openjdk.java.net/~dmarkov/8023474/webrev.01/. > Could you review it, please? > > Thanks, > Dmitry > > On 22/08/2013 17:28, Anthony Petrov wrote: >> Hi Dmitry, >> >> A few comments: >> >> 1. The concept of validate roots has been extended to AWT components >> since JDK 7. Therefore, I suggest to use the same logic regardless of >> whether the editor is an instance of JComponent or not. >> >> 2. What you're trying to implement here, is actually called >> revalidateSynchronously(), as opposed to the regular revalidate() >> method, which in Swing is asynchronous. I believe that rS() might be >> very much useful in many cases. Therefore, I suggest to add a >> package-private java.awt.Component.revalidateSynchronously(), and >> call it via the AWTAccessor from BasicTreeUI.java. Note that the >> current Component.revalidate() should simply call the new rS() >> directly, and the rS() may reuse the current implementation of the >> Component.revalidate(). >> >> 3. >>> 2230 // The implementation of the method is copied from >>> SwingUtilities >> >> Copying an implementation is almost always wrong. It might be better >> to access a method from another package via e.g. an accessor, or >> reflection, or otherwise find a way to share this code rather than >> copy it. However, I think you won't need this code anyway if we >> implement the suggestion #2 above. >> >> 4. Is there a similar problem with JTable custom editors? What else >> Swing components allow for editors? >> > As far as I know, JTable does not have this problem. >> -- >> best regards, >> Anthony >> >> On 08/22/13 15:08, dmitry markov wrote: >>> Hello, >>> >>> Could you review the fix, please? >>> bug: http://bugs.sun.com/view_bug.do?bug_id=8023474 >>> webrev: http://cr.openjdk.java.net/~dmarkov/8023474/webrev.00/ >>> >>> The method BasicTreeUI.startEditing() should find the first valid root >>> for the editingComponent and call validateUnconditionally() for it >>> instead of editingComponent.revalidate() invocation. >>> >>> Thanks, >>> Dmitry > From anton.nashatyrev at oracle.com Mon Aug 26 12:41:52 2013 From: anton.nashatyrev at oracle.com (anton nashatyrev) Date: Mon, 26 Aug 2013 16:41:52 +0400 Subject: [8] Review request for 8023392: Swing text components printed with spaces between chars In-Reply-To: <521B446C.5080609@oracle.com> References: <5215FC9D.4010003@oracle.com> <521B446C.5080609@oracle.com> Message-ID: <521B4D10.9010704@oracle.com> Hello Alexander, On 26.08.2013 16:05, Alexander Scherbatiy wrote: > I see that SwingUtilities2.drawString(..) and > SwingUtilities2.drawChars(...) are used a lot in the Swing but the > issue is only about printing. > Could removing trailing spaces in these methods affect other > non-printed components? All the changes are made under isPrinting() condition, so the behavior when rendering on screen/buffer should remain the same. > Is it possible to add a test for the fix? Sure, but I believe only manual is suitable for this case. I will add one... Thanks! Anton. > > Thanks, > Alexandr. > > > On 8/22/2013 3:57 PM, anton nashatyrev wrote: >> Hello, >> could you please review the following fix: >> >> fix: http://cr.openjdk.java.net/~vkarnauk/8023392/jdk8/webrev.00/ >> >> bug: http://bugs.sun.com/view_bug.do?bug_id=80223392 (the bug is >> still not replicated here, so internal link might be used if available) >> >> The problem description: While printing the text output is >> handled a bit differently: the text layout is justified for the text >> width (in theory on the screen this text should look identically as >> without justification), which helps printer to output text more >> evenly (https://bugs.openjdk.java.net/browse/JDK-6488219). >> But the problem is the TextLayout.getJustifiedLayout() trim the >> trailing spaces from the string before laying it out. In the case >> when the string contains trailing spaces it is justified for the >> width greater than required. >> >> The fix description: as far as we likely don't want to change >> TextLayout.getJustifiedLayout() behavior, we should respect that >> implementation feature and justify the text for the width of the >> string without trailing spaces. I.e. trim trailing spaces before >> TextLayout.getAdvance(). >> >> Thanks! >> Anton. > From alexandr.scherbatiy at oracle.com Mon Aug 26 13:27:41 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 26 Aug 2013 17:27:41 +0400 Subject: [8] Review request for 8023392: Swing text components printed with spaces between chars In-Reply-To: <521B4D10.9010704@oracle.com> References: <5215FC9D.4010003@oracle.com> <521B446C.5080609@oracle.com> <521B4D10.9010704@oracle.com> Message-ID: <521B57CD.9020800@oracle.com> On 8/26/2013 4:41 PM, anton nashatyrev wrote: > Hello Alexander, > > On 26.08.2013 16:05, Alexander Scherbatiy wrote: >> I see that SwingUtilities2.drawString(..) and >> SwingUtilities2.drawChars(...) are used a lot in the Swing but the >> issue is only about printing. >> Could removing trailing spaces in these methods affect other >> non-printed components? > All the changes are made under isPrinting() condition, so the behavior > when rendering on screen/buffer should remain the same. I see now. >> Is it possible to add a test for the fix? > Sure, but I believe only manual is suitable for this case. > I will add one... I would suggest to rename the 'AttributedCharacterIterator trimTrailingSpaces(AttributedCharacterIterator iterator)' method to something like getTrimmedTrailingSpacesIterator. Could you also split long lines added in the fix so they fit to a page? Otherwise the fix looks good for me. Thanks, Alexandr. > > > Thanks! > Anton. > >> >> Thanks, >> Alexandr. >> >> >> On 8/22/2013 3:57 PM, anton nashatyrev wrote: >>> Hello, >>> could you please review the following fix: >>> >>> fix: http://cr.openjdk.java.net/~vkarnauk/8023392/jdk8/webrev.00/ >>> >>> bug: http://bugs.sun.com/view_bug.do?bug_id=80223392 (the bug is >>> still not replicated here, so internal link might be used if available) >>> >>> The problem description: While printing the text output is >>> handled a bit differently: the text layout is justified for the text >>> width (in theory on the screen this text should look identically as >>> without justification), which helps printer to output text more >>> evenly (https://bugs.openjdk.java.net/browse/JDK-6488219). >>> But the problem is the TextLayout.getJustifiedLayout() trim the >>> trailing spaces from the string before laying it out. In the case >>> when the string contains trailing spaces it is justified for the >>> width greater than required. >>> >>> The fix description: as far as we likely don't want to change >>> TextLayout.getJustifiedLayout() behavior, we should respect that >>> implementation feature and justify the text for the width of the >>> string without trailing spaces. I.e. trim trailing spaces before >>> TextLayout.getAdvance(). >>> >>> Thanks! >>> Anton. >> > From anton.nashatyrev at oracle.com Mon Aug 26 16:46:40 2013 From: anton.nashatyrev at oracle.com (anton nashatyrev) Date: Mon, 26 Aug 2013 20:46:40 +0400 Subject: [8] Review request for 8023392: Swing text components printed with spaces between chars In-Reply-To: <521B57CD.9020800@oracle.com> References: <5215FC9D.4010003@oracle.com> <521B446C.5080609@oracle.com> <521B4D10.9010704@oracle.com> <521B57CD.9020800@oracle.com> Message-ID: <521B8670.2010501@oracle.com> Hello, here is the new webrev (including manual regression test and proposed changes): http://cr.openjdk.java.net/~dmarkov/8023392/webrev.01/ . Could you please review it? Thanks! Anton. On 26.08.2013 17:27, Alexander Scherbatiy wrote: > On 8/26/2013 4:41 PM, anton nashatyrev wrote: >> Hello Alexander, >> >> On 26.08.2013 16:05, Alexander Scherbatiy wrote: >>> I see that SwingUtilities2.drawString(..) and >>> SwingUtilities2.drawChars(...) are used a lot in the Swing but the >>> issue is only about printing. >>> Could removing trailing spaces in these methods affect other >>> non-printed components? >> All the changes are made under isPrinting() condition, so the >> behavior when rendering on screen/buffer should remain the same. > I see now. >>> Is it possible to add a test for the fix? >> Sure, but I believe only manual is suitable for this case. >> I will add one... > > I would suggest to rename the 'AttributedCharacterIterator > trimTrailingSpaces(AttributedCharacterIterator iterator)' method to > something like getTrimmedTrailingSpacesIterator. > > Could you also split long lines added in the fix so they fit to a > page? > > Otherwise the fix looks good for me. > > Thanks, > Alexandr. > >> >> >> Thanks! >> Anton. >> >>> >>> Thanks, >>> Alexandr. >>> >>> >>> On 8/22/2013 3:57 PM, anton nashatyrev wrote: >>>> Hello, >>>> could you please review the following fix: >>>> >>>> fix: http://cr.openjdk.java.net/~vkarnauk/8023392/jdk8/webrev.00/ >>>> >>>> bug: http://bugs.sun.com/view_bug.do?bug_id=80223392 (the bug is >>>> still not replicated here, so internal link might be used if >>>> available) >>>> >>>> The problem description: While printing the text output is >>>> handled a bit differently: the text layout is justified for the >>>> text width (in theory on the screen this text should look >>>> identically as without justification), which helps printer to >>>> output text more evenly >>>> (https://bugs.openjdk.java.net/browse/JDK-6488219). >>>> But the problem is the TextLayout.getJustifiedLayout() trim the >>>> trailing spaces from the string before laying it out. In the case >>>> when the string contains trailing spaces it is justified for the >>>> width greater than required. >>>> >>>> The fix description: as far as we likely don't want to change >>>> TextLayout.getJustifiedLayout() behavior, we should respect that >>>> implementation feature and justify the text for the width of the >>>> string without trailing spaces. I.e. trim trailing spaces before >>>> TextLayout.getAdvance(). >>>> >>>> Thanks! >>>> Anton. >>> >> > From alexandr.scherbatiy at oracle.com Tue Aug 27 08:07:22 2013 From: alexandr.scherbatiy at oracle.com (Alexandr Scherbatiy) Date: Tue, 27 Aug 2013 12:07:22 +0400 Subject: [8] Review request for 8023392: Swing text components printed with spaces between chars In-Reply-To: <521B8670.2010501@oracle.com> References: <5215FC9D.4010003@oracle.com> <521B446C.5080609@oracle.com> <521B4D10.9010704@oracle.com> <521B57CD.9020800@oracle.com> <521B8670.2010501@oracle.com> Message-ID: <521C5E3A.1040002@oracle.com> The fix looks good for me. Thanks, Alexandr. 26.08.2013 20:46, anton nashatyrev ?????: > Hello, > > here is the new webrev (including manual regression test and > proposed changes): > http://cr.openjdk.java.net/~dmarkov/8023392/webrev.01/ > . Could you > please review it? > > Thanks! > Anton. > > On 26.08.2013 17:27, Alexander Scherbatiy wrote: >> On 8/26/2013 4:41 PM, anton nashatyrev wrote: >>> Hello Alexander, >>> >>> On 26.08.2013 16:05, Alexander Scherbatiy wrote: >>>> I see that SwingUtilities2.drawString(..) and >>>> SwingUtilities2.drawChars(...) are used a lot in the Swing but the >>>> issue is only about printing. >>>> Could removing trailing spaces in these methods affect other >>>> non-printed components? >>> All the changes are made under isPrinting() condition, so the >>> behavior when rendering on screen/buffer should remain the same. >> I see now. >>>> Is it possible to add a test for the fix? >>> Sure, but I believe only manual is suitable for this case. >>> I will add one... >> >> I would suggest to rename the 'AttributedCharacterIterator >> trimTrailingSpaces(AttributedCharacterIterator iterator)' method to >> something like getTrimmedTrailingSpacesIterator. >> >> Could you also split long lines added in the fix so they fit to a >> page? >> >> Otherwise the fix looks good for me. >> >> Thanks, >> Alexandr. >> >>> >>> >>> Thanks! >>> Anton. >>> >>>> >>>> Thanks, >>>> Alexandr. >>>> >>>> >>>> On 8/22/2013 3:57 PM, anton nashatyrev wrote: >>>>> Hello, >>>>> could you please review the following fix: >>>>> >>>>> fix: http://cr.openjdk.java.net/~vkarnauk/8023392/jdk8/webrev.00/ >>>>> >>>>> bug: http://bugs.sun.com/view_bug.do?bug_id=80223392 (the bug is >>>>> still not replicated here, so internal link might be used if >>>>> available) >>>>> >>>>> The problem description: While printing the text output is >>>>> handled a bit differently: the text layout is justified for the >>>>> text width (in theory on the screen this text should look >>>>> identically as without justification), which helps printer to >>>>> output text more evenly >>>>> (https://bugs.openjdk.java.net/browse/JDK-6488219). >>>>> But the problem is the TextLayout.getJustifiedLayout() trim >>>>> the trailing spaces from the string before laying it out. In the >>>>> case when the string contains trailing spaces it is justified for >>>>> the width greater than required. >>>>> >>>>> The fix description: as far as we likely don't want to change >>>>> TextLayout.getJustifiedLayout() behavior, we should respect that >>>>> implementation feature and justify the text for the width of the >>>>> string without trailing spaces. I.e. trim trailing spaces before >>>>> TextLayout.getAdvance(). >>>>> >>>>> Thanks! >>>>> Anton. >>>> >>> >> > From sergey.malenkov at oracle.com Wed Aug 28 09:02:42 2013 From: sergey.malenkov at oracle.com (Sergey Malenkov) Date: Wed, 28 Aug 2013 02:02:42 -0700 (PDT) Subject: [8] Review request for 6968363: ClassCastException while entering HINDI characters with CustomDocument Message-ID: <3c54dadb-09c0-40a1-9e4c-a0edf3488a82@default> Hello, Could you please review the following fix: fix: http://cr.openjdk.java.net/~malenkov/6968363.8.0/ bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6968363 I've refactored the isLeftToRight method of the AbstractDocument class. Now it supports any Document with correct validation. All usages are fixed. Thanks, SAM From sitnikov.vladimir at gmail.com Wed Aug 28 11:00:43 2013 From: sitnikov.vladimir at gmail.com (Vladimir Sitnikov) Date: Wed, 28 Aug 2013 15:00:43 +0400 Subject: javax.swing.RepaintManager volatileMap Message-ID: Hi, In the heapdump of SQL Developer 4.0 I found that RepaintManager holds 23 items of sun.awt.image.BufImgVolatileSurfaceManager 5-10MiB each. All the images are contained in "volatileMap" HashMap. I identified that the key of the map is sun.awt.Win32GraphicsConfig and that class does not override equals/hashCode. Can you please tell me if "using GraphicsConfig as a key knowing the fact this key does not ovveride equals/hashCode" is intentional or not? I have checked several keys of the map (Win32GraphicsConfig) and they have identical value (even screen and sTypeOrig references point to the same objects), however as the Win32GraphicsConfig objects itself are different java objects they occupy different entries in valueMap. -- Regards, Vladimir Sitnikov -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandr.scherbatiy at oracle.com Wed Aug 28 12:14:59 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 28 Aug 2013 16:14:59 +0400 Subject: javax.swing.RepaintManager volatileMap In-Reply-To: References: Message-ID: <521DE9C3.3060301@oracle.com> forwarded the question to awt-dev alias. On 8/28/2013 3:00 PM, Vladimir Sitnikov wrote: > Hi, > > In the heapdump of SQL Developer 4.0 I found that RepaintManager holds > 23 items of sun.awt.image.BufImgVolatileSurfaceManager 5-10MiB each. > > All the images are contained in "volatileMap" HashMap. > > I identified that the key of the map is sun.awt.Win32GraphicsConfig > and that class does not override equals/hashCode. > > Can you please tell me if "using GraphicsConfig as a key knowing the > fact this key does not ovveride equals/hashCode" is intentional or not? > > I have checked several keys of the map (Win32GraphicsConfig) and they > have identical value (even screen and sTypeOrig references point to > the same objects), however as the Win32GraphicsConfig objects itself > are different java objects they occupy different entries in valueMap. > > -- > Regards, > Vladimir Sitnikov From alexandr.scherbatiy at oracle.com Wed Aug 28 12:26:45 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 28 Aug 2013 16:26:45 +0400 Subject: [8] Review request for 6968363: ClassCastException while entering HINDI characters with CustomDocument In-Reply-To: <3c54dadb-09c0-40a1-9e4c-a0edf3488a82@default> References: <3c54dadb-09c0-40a1-9e4c-a0edf3488a82@default> Message-ID: <521DEC85.6050508@oracle.com> The fix looks good for me. Thanks, Alexandr. On 8/28/2013 1:02 PM, Sergey Malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/6968363.8.0/ > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6968363 > > I've refactored the isLeftToRight method of the AbstractDocument class. > Now it supports any Document with correct validation. > All usages are fixed. > > Thanks, > SAM From artem.ananiev at oracle.com Wed Aug 28 13:52:48 2013 From: artem.ananiev at oracle.com (Artem Ananiev) Date: Wed, 28 Aug 2013 17:52:48 +0400 Subject: javax.swing.RepaintManager volatileMap In-Reply-To: References: Message-ID: <521E00B0.5080205@oracle.com> Hi, Vladimir, I agree that using a class with no equals/hashCode overridden as a key for HashMap is not the best thing to do. However, in this case the problem seems to be caused by something else. I'm not an expert in RepaintManager, but here is what I observe: 1. When graphics environment changes, we get displayChanged() notification (it's not a public API yet, unfortunately). 2. RepaintManager.displayChanged() clears all the volatile images, as they depend on the GraphicsConfiguration objects and may be invalid 3. In clearImages(), we iterate through volatileMap and remove the images. Note that despite GraphicsConfiguration doesn't override equals/hashCode, iteration should still work. Anyway, it indeed looks like a bug, no matter of what it's caused by. Do you have a test case that can be used to reproduce it, other than to run JDeveloper? Thanks, Artem On 8/28/2013 3:00 PM, Vladimir Sitnikov wrote: > Hi, > > In the heapdump of SQL Developer 4.0 I found that RepaintManager holds > 23 items of sun.awt.image.BufImgVolatileSurfaceManager 5-10MiB each. > > All the images are contained in "volatileMap" HashMap. > > I identified that the key of the map is sun.awt.Win32GraphicsConfig and > that class does not override equals/hashCode. > > Can you please tell me if "using GraphicsConfig as a key knowing the > fact this key does not ovveride equals/hashCode" is intentional or not? > > I have checked several keys of the map (Win32GraphicsConfig) and they > have identical value (even screen and sTypeOrig references point to the > same objects), however as the Win32GraphicsConfig objects itself are > different java objects they occupy different entries in valueMap. > > -- > Regards, > Vladimir Sitnikov From sergey.malenkov at oracle.com Wed Aug 28 15:05:13 2013 From: sergey.malenkov at oracle.com (Sergey Malenkov) Date: Wed, 28 Aug 2013 08:05:13 -0700 (PDT) Subject: [8] Review request for 6943780: JTabbedPane throws ArrayIndexOutOfBoundsException sometimes Message-ID: Hello, Could you please review the following fix: fix: http://cr.openjdk.java.net/~malenkov/6943780.8.0/ bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6943780 I found the test case that reproduces the problem always. The suggested fix solves it. Thanks, SAM From alexandr.scherbatiy at oracle.com Thu Aug 29 09:28:23 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 29 Aug 2013 13:28:23 +0400 Subject: [8] Review request for 6943780: JTabbedPane throws ArrayIndexOutOfBoundsException sometimes In-Reply-To: References: Message-ID: <521F1437.6080200@oracle.com> The fix looks good for me. Just check, that Aqua L&F does not have the same problem. Thanks, Alexandr. On 8/28/2013 7:05 PM, Sergey Malenkov wrote: > Hello, > > Could you please review the following fix: > fix: http://cr.openjdk.java.net/~malenkov/6943780.8.0/ > bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6943780 > > I found the test case that reproduces the problem always. > The suggested fix solves it. > > Thanks, > SAM From alexandr.scherbatiy at oracle.com Fri Aug 30 07:29:12 2013 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 30 Aug 2013 11:29:12 +0400 Subject: [8] Review request for 8021253 JFileChooser does not react on pressing enter since java 7 Message-ID: <522049C8.6040606@oracle.com> Hello, Could you review the fix: bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8021253 webrev: http://cr.openjdk.java.net/~alexsch/8021253/webrev.00 The default button is only set for a dialog created in methods show*Dialog() after the 5035693 fix and is not set if put a filechooser on a user frame. The fix installs hierarchy listener that set the default button when the filechooser parent is changed. Thanks, Alexandr.