From joe.darcy at oracle.com Thu Jan 9 01:08:11 2014 From: joe.darcy at oracle.com (Joseph Darcy) Date: Wed, 08 Jan 2014 17:08:11 -0800 Subject: JDK 9 RFR of JDK-8031082 Fix non-missing doclint problems in client libraries In-Reply-To: <52C285A8.9060207@oracle.com> References: <52C285A8.9060207@oracle.com> Message-ID: <52CDF67B.3020207@oracle.com> Happy new year! In case this was overlooked during the new year's holiday, please look over the changes in http://cr.openjdk.java.net/~darcy/8031082.0/ which resolve many of the outstanding doclint issues in the client libraries. Thanks, -Joe On 12/31/2013 12:51 AM, Joe Darcy wrote: > Hello, > > Please review my fix for > > JDK-8031082 Fix non-missing doclint problems in client libraries > > The fix resolves nearly all of the outstanding doclint issues in the > client libraries, others than the missing javadoc tags. The affected > files are > > src/share/classes/java/awt/Graphics2D.java > src/share/classes/java/awt/MediaTracker.java > src/share/classes/java/awt/font/TextAttribute.java > src/share/classes/java/awt/peer/ComponentPeer.java > src/share/classes/java/awt/peer/DialogPeer.java > src/share/classes/java/awt/peer/KeyboardFocusManagerPeer.java > src/share/classes/java/awt/peer/MouseInfoPeer.java > src/share/classes/java/awt/peer/PanelPeer.java > src/share/classes/java/awt/peer/TextAreaPeer.java > src/share/classes/java/awt/peer/WindowPeer.java > src/share/classes/java/awt/print/Paper.java > src/share/classes/java/awt/print/Printable.java > src/share/classes/java/beans/XMLEncoder.java > src/share/classes/javax/accessibility/AccessibleContext.java > src/share/classes/javax/imageio/ImageWriter.java > src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java > src/share/classes/javax/imageio/stream/ImageInputStream.java > src/share/classes/javax/imageio/stream/ImageOutputStream.java > src/share/classes/javax/print/Doc.java > src/share/classes/javax/print/DocFlavor.java > src/share/classes/javax/print/MultiDoc.java > src/share/classes/javax/print/MultiDocPrintJob.java > src/share/classes/javax/print/ServiceUI.java > src/share/classes/javax/print/StreamPrintServiceFactory.java > src/share/classes/javax/print/attribute/AttributeSet.java > src/share/classes/javax/print/attribute/standard/Chromaticity.java > src/share/classes/javax/print/attribute/standard/Copies.java > src/share/classes/javax/print/attribute/standard/Fidelity.java > src/share/classes/javax/print/attribute/standard/Finishings.java > src/share/classes/javax/print/attribute/standard/JobKOctets.java > src/share/classes/javax/print/attribute/standard/JobState.java > src/share/classes/javax/print/attribute/standard/MediaName.java > src/share/classes/javax/print/attribute/standard/MediaSize.java > src/share/classes/javax/print/attribute/standard/MediaSizeName.java > src/share/classes/javax/print/attribute/standard/MediaTray.java > src/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java > > src/share/classes/javax/print/attribute/standard/NumberUp.java > src/share/classes/javax/print/attribute/standard/PageRanges.java > src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java > > src/share/classes/javax/print/attribute/standard/PrinterResolution.java > src/share/classes/javax/print/attribute/standard/SheetCollate.java > src/share/classes/javax/print/attribute/standard/Sides.java > src/share/classes/javax/sound/sampled/AudioInputStream.java > src/share/classes/javax/sound/sampled/AudioPermission.java > src/share/classes/javax/sound/sampled/ReverbType.java > src/share/classes/javax/swing/DefaultComboBoxModel.java > src/share/classes/javax/swing/JComboBox.java > src/share/classes/javax/swing/JEditorPane.java > src/share/classes/javax/swing/JLabel.java > src/share/classes/javax/swing/JLayeredPane.java > src/share/classes/javax/swing/JOptionPane.java > src/share/classes/javax/swing/JTextArea.java > src/share/classes/javax/swing/JTextPane.java > src/share/classes/javax/swing/plaf/TextUI.java > src/share/classes/javax/swing/plaf/basic/BasicTextUI.java > src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java > src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java > src/share/classes/javax/swing/text/CompositeView.java > src/share/classes/javax/swing/text/DefaultEditorKit.java > src/share/classes/javax/swing/text/Document.java > src/share/classes/javax/swing/text/GlyphView.java > src/share/classes/javax/swing/text/JTextComponent.java > src/share/classes/javax/swing/text/NavigationFilter.java > src/share/classes/javax/swing/text/html/HTMLDocument.java > src/share/classes/javax/swing/text/html/StyleSheet.java > > and the full webrev is hosted at > > http://cr.openjdk.java.net/~darcy/8031082.0/ > > Thanks, > > -Joe From Sergey.Bylokhov at oracle.com Thu Jan 9 07:53:48 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 09 Jan 2014 11:53:48 +0400 Subject: JDK 9 RFR of JDK-8031082 Fix non-missing doclint problems in client libraries In-Reply-To: <52CDF67B.3020207@oracle.com> References: <52C285A8.9060207@oracle.com> <52CDF67B.3020207@oracle.com> Message-ID: <52CE558C.7000808@oracle.com> Hello, Joe. Why @see tag was removed in the ComponentPeer.java? In the JLabel.java @exception was removed is this change of specifications? It would be good to split the changed line in the MouseInfoPeer.java. On 09.01.2014 5:08, Joseph Darcy wrote: > Happy new year! Happy new year! > > In case this was overlooked during the new year's holiday, please look > over the changes in > > http://cr.openjdk.java.net/~darcy/8031082.0/ > > which resolve many of the outstanding doclint issues in the client > libraries. > > Thanks, > > -Joe > > On 12/31/2013 12:51 AM, Joe Darcy wrote: >> Hello, >> >> Please review my fix for >> >> JDK-8031082 Fix non-missing doclint problems in client libraries >> >> The fix resolves nearly all of the outstanding doclint issues in the >> client libraries, others than the missing javadoc tags. The affected >> files are >> >> src/share/classes/java/awt/Graphics2D.java >> src/share/classes/java/awt/MediaTracker.java >> src/share/classes/java/awt/font/TextAttribute.java >> src/share/classes/java/awt/peer/ComponentPeer.java >> src/share/classes/java/awt/peer/DialogPeer.java >> src/share/classes/java/awt/peer/KeyboardFocusManagerPeer.java >> src/share/classes/java/awt/peer/MouseInfoPeer.java >> src/share/classes/java/awt/peer/PanelPeer.java >> src/share/classes/java/awt/peer/TextAreaPeer.java >> src/share/classes/java/awt/peer/WindowPeer.java >> src/share/classes/java/awt/print/Paper.java >> src/share/classes/java/awt/print/Printable.java >> src/share/classes/java/beans/XMLEncoder.java >> src/share/classes/javax/accessibility/AccessibleContext.java >> src/share/classes/javax/imageio/ImageWriter.java >> src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java >> src/share/classes/javax/imageio/stream/ImageInputStream.java >> src/share/classes/javax/imageio/stream/ImageOutputStream.java >> src/share/classes/javax/print/Doc.java >> src/share/classes/javax/print/DocFlavor.java >> src/share/classes/javax/print/MultiDoc.java >> src/share/classes/javax/print/MultiDocPrintJob.java >> src/share/classes/javax/print/ServiceUI.java >> src/share/classes/javax/print/StreamPrintServiceFactory.java >> src/share/classes/javax/print/attribute/AttributeSet.java >> src/share/classes/javax/print/attribute/standard/Chromaticity.java >> src/share/classes/javax/print/attribute/standard/Copies.java >> src/share/classes/javax/print/attribute/standard/Fidelity.java >> src/share/classes/javax/print/attribute/standard/Finishings.java >> src/share/classes/javax/print/attribute/standard/JobKOctets.java >> src/share/classes/javax/print/attribute/standard/JobState.java >> src/share/classes/javax/print/attribute/standard/MediaName.java >> src/share/classes/javax/print/attribute/standard/MediaSize.java >> src/share/classes/javax/print/attribute/standard/MediaSizeName.java >> src/share/classes/javax/print/attribute/standard/MediaTray.java >> src/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java >> >> src/share/classes/javax/print/attribute/standard/NumberUp.java >> src/share/classes/javax/print/attribute/standard/PageRanges.java >> src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java >> >> src/share/classes/javax/print/attribute/standard/PrinterResolution.java >> src/share/classes/javax/print/attribute/standard/SheetCollate.java >> src/share/classes/javax/print/attribute/standard/Sides.java >> src/share/classes/javax/sound/sampled/AudioInputStream.java >> src/share/classes/javax/sound/sampled/AudioPermission.java >> src/share/classes/javax/sound/sampled/ReverbType.java >> src/share/classes/javax/swing/DefaultComboBoxModel.java >> src/share/classes/javax/swing/JComboBox.java >> src/share/classes/javax/swing/JEditorPane.java >> src/share/classes/javax/swing/JLabel.java >> src/share/classes/javax/swing/JLayeredPane.java >> src/share/classes/javax/swing/JOptionPane.java >> src/share/classes/javax/swing/JTextArea.java >> src/share/classes/javax/swing/JTextPane.java >> src/share/classes/javax/swing/plaf/TextUI.java >> src/share/classes/javax/swing/plaf/basic/BasicTextUI.java >> src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java >> src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java >> src/share/classes/javax/swing/text/CompositeView.java >> src/share/classes/javax/swing/text/DefaultEditorKit.java >> src/share/classes/javax/swing/text/Document.java >> src/share/classes/javax/swing/text/GlyphView.java >> src/share/classes/javax/swing/text/JTextComponent.java >> src/share/classes/javax/swing/text/NavigationFilter.java >> src/share/classes/javax/swing/text/html/HTMLDocument.java >> src/share/classes/javax/swing/text/html/StyleSheet.java >> >> and the full webrev is hosted at >> >> http://cr.openjdk.java.net/~darcy/8031082.0/ >> >> Thanks, >> >> -Joe > -- Best regards, Sergey. From joe.darcy at oracle.com Thu Jan 9 19:56:11 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 09 Jan 2014 11:56:11 -0800 Subject: JDK 9 RFR of JDK-8031082 Fix non-missing doclint problems in client libraries In-Reply-To: <52CE558C.7000808@oracle.com> References: <52C285A8.9060207@oracle.com> <52CDF67B.3020207@oracle.com> <52CE558C.7000808@oracle.com> Message-ID: <52CEFEDB.6030706@oracle.com> Hello Sergey, On 1/8/2014 11:53 PM, Sergey Bylokhov wrote: > Hello, Joe. > Why @see tag was removed in the ComponentPeer.java? Because they were resulting in "error: reference not found" messages. The syntax appears correct, but the error is generated anyway. Since the peer package doesn't seem to be included in the main doc bundle, I didn't think removing the @see tags would be that much of a loss of functionality. > In the JLabel.java @exception was removed is this change of > specifications? The @exception tag was for an unchecked exception and was blank; removing it is not a specification change since it doesn't specify anything ;-) > It would be good to split the changed line in the MouseInfoPeer.java. Reformatted. Updated webrev: http://cr.openjdk.java.net/~darcy/8031082.1/ Thanks, -Joe > > On 09.01.2014 5:08, Joseph Darcy wrote: >> Happy new year! > Happy new year! >> >> In case this was overlooked during the new year's holiday, please >> look over the changes in >> >> http://cr.openjdk.java.net/~darcy/8031082.0/ >> >> which resolve many of the outstanding doclint issues in the client >> libraries. >> >> Thanks, >> >> -Joe >> >> On 12/31/2013 12:51 AM, Joe Darcy wrote: >>> Hello, >>> >>> Please review my fix for >>> >>> JDK-8031082 Fix non-missing doclint problems in client libraries >>> >>> The fix resolves nearly all of the outstanding doclint issues in the >>> client libraries, others than the missing javadoc tags. The affected >>> files are >>> >>> src/share/classes/java/awt/Graphics2D.java >>> src/share/classes/java/awt/MediaTracker.java >>> src/share/classes/java/awt/font/TextAttribute.java >>> src/share/classes/java/awt/peer/ComponentPeer.java >>> src/share/classes/java/awt/peer/DialogPeer.java >>> src/share/classes/java/awt/peer/KeyboardFocusManagerPeer.java >>> src/share/classes/java/awt/peer/MouseInfoPeer.java >>> src/share/classes/java/awt/peer/PanelPeer.java >>> src/share/classes/java/awt/peer/TextAreaPeer.java >>> src/share/classes/java/awt/peer/WindowPeer.java >>> src/share/classes/java/awt/print/Paper.java >>> src/share/classes/java/awt/print/Printable.java >>> src/share/classes/java/beans/XMLEncoder.java >>> src/share/classes/javax/accessibility/AccessibleContext.java >>> src/share/classes/javax/imageio/ImageWriter.java >>> src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java >>> src/share/classes/javax/imageio/stream/ImageInputStream.java >>> src/share/classes/javax/imageio/stream/ImageOutputStream.java >>> src/share/classes/javax/print/Doc.java >>> src/share/classes/javax/print/DocFlavor.java >>> src/share/classes/javax/print/MultiDoc.java >>> src/share/classes/javax/print/MultiDocPrintJob.java >>> src/share/classes/javax/print/ServiceUI.java >>> src/share/classes/javax/print/StreamPrintServiceFactory.java >>> src/share/classes/javax/print/attribute/AttributeSet.java >>> src/share/classes/javax/print/attribute/standard/Chromaticity.java >>> src/share/classes/javax/print/attribute/standard/Copies.java >>> src/share/classes/javax/print/attribute/standard/Fidelity.java >>> src/share/classes/javax/print/attribute/standard/Finishings.java >>> src/share/classes/javax/print/attribute/standard/JobKOctets.java >>> src/share/classes/javax/print/attribute/standard/JobState.java >>> src/share/classes/javax/print/attribute/standard/MediaName.java >>> src/share/classes/javax/print/attribute/standard/MediaSize.java >>> src/share/classes/javax/print/attribute/standard/MediaSizeName.java >>> src/share/classes/javax/print/attribute/standard/MediaTray.java >>> src/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java >>> >>> src/share/classes/javax/print/attribute/standard/NumberUp.java >>> src/share/classes/javax/print/attribute/standard/PageRanges.java >>> src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java >>> >>> src/share/classes/javax/print/attribute/standard/PrinterResolution.java >>> src/share/classes/javax/print/attribute/standard/SheetCollate.java >>> src/share/classes/javax/print/attribute/standard/Sides.java >>> src/share/classes/javax/sound/sampled/AudioInputStream.java >>> src/share/classes/javax/sound/sampled/AudioPermission.java >>> src/share/classes/javax/sound/sampled/ReverbType.java >>> src/share/classes/javax/swing/DefaultComboBoxModel.java >>> src/share/classes/javax/swing/JComboBox.java >>> src/share/classes/javax/swing/JEditorPane.java >>> src/share/classes/javax/swing/JLabel.java >>> src/share/classes/javax/swing/JLayeredPane.java >>> src/share/classes/javax/swing/JOptionPane.java >>> src/share/classes/javax/swing/JTextArea.java >>> src/share/classes/javax/swing/JTextPane.java >>> src/share/classes/javax/swing/plaf/TextUI.java >>> src/share/classes/javax/swing/plaf/basic/BasicTextUI.java >>> src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java >>> src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java >>> src/share/classes/javax/swing/text/CompositeView.java >>> src/share/classes/javax/swing/text/DefaultEditorKit.java >>> src/share/classes/javax/swing/text/Document.java >>> src/share/classes/javax/swing/text/GlyphView.java >>> src/share/classes/javax/swing/text/JTextComponent.java >>> src/share/classes/javax/swing/text/NavigationFilter.java >>> src/share/classes/javax/swing/text/html/HTMLDocument.java >>> src/share/classes/javax/swing/text/html/StyleSheet.java >>> >>> and the full webrev is hosted at >>> >>> http://cr.openjdk.java.net/~darcy/8031082.0/ >>> >>> Thanks, >>> >>> -Joe >> > > From dmitry.markov at oracle.com Fri Jan 10 11:06:41 2014 From: dmitry.markov at oracle.com (dmitry markov) Date: Fri, 10 Jan 2014 15:06:41 +0400 Subject: [9] Review request: 8028616 Htmleditorkit parser doesn't handle leading slash (/) Message-ID: <52CFD441.8070504@oracle.com> Hello, Could you review the fix for jdk9, please? bug: https://bugs.openjdk.java.net/browse/JDK-8028616 webrev: http://cr.openjdk.java.net/~dmarkov/8028616/jdk9/webrev.00/ The method Parser.parseContent() should invoke legalElementContext(), if the parsed text is not wrapped by tags and starts with slash (/). Thanks, Dmitry From Sergey.Bylokhov at oracle.com Fri Jan 10 12:55:45 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 10 Jan 2014 16:55:45 +0400 Subject: JDK 9 RFR of JDK-8031082 Fix non-missing doclint problems in client libraries In-Reply-To: <52CEFEDB.6030706@oracle.com> References: <52C285A8.9060207@oracle.com> <52CDF67B.3020207@oracle.com> <52CE558C.7000808@oracle.com> <52CEFEDB.6030706@oracle.com> Message-ID: <52CFEDD1.7010500@oracle.com> On 09.01.2014 23:56, Joe Darcy wrote: > Hello Sergey, > > On 1/8/2014 11:53 PM, Sergey Bylokhov wrote: >> Hello, Joe. >> Why @see tag was removed in the ComponentPeer.java? > > Because they were resulting in "error: reference not found" messages. > The syntax appears correct, but the error is generated anyway. Since > the peer package doesn't seem to be included in the main doc bundle, I > didn't think removing the @see tags would be that much of a loss of > functionality. I suppose too, but I think a separate issue should be filed on doclint. Anyway the fix looks good, but note that the new year in headers should be 2014. > >> In the JLabel.java @exception was removed is this change of >> specifications? > > The @exception tag was for an unchecked exception and was blank; > removing it is not a specification change since it doesn't specify > anything ;-) > >> It would be good to split the changed line in the MouseInfoPeer.java. > > Reformatted. Updated webrev: > > http://cr.openjdk.java.net/~darcy/8031082.1/ > > Thanks, > > -Joe > >> >> On 09.01.2014 5:08, Joseph Darcy wrote: >>> Happy new year! >> Happy new year! >>> >>> In case this was overlooked during the new year's holiday, please >>> look over the changes in >>> >>> http://cr.openjdk.java.net/~darcy/8031082.0/ >>> >>> which resolve many of the outstanding doclint issues in the client >>> libraries. >>> >>> Thanks, >>> >>> -Joe >>> >>> On 12/31/2013 12:51 AM, Joe Darcy wrote: >>>> Hello, >>>> >>>> Please review my fix for >>>> >>>> JDK-8031082 Fix non-missing doclint problems in client libraries >>>> >>>> The fix resolves nearly all of the outstanding doclint issues in >>>> the client libraries, others than the missing javadoc tags. The >>>> affected files are >>>> >>>> src/share/classes/java/awt/Graphics2D.java >>>> src/share/classes/java/awt/MediaTracker.java >>>> src/share/classes/java/awt/font/TextAttribute.java >>>> src/share/classes/java/awt/peer/ComponentPeer.java >>>> src/share/classes/java/awt/peer/DialogPeer.java >>>> src/share/classes/java/awt/peer/KeyboardFocusManagerPeer.java >>>> src/share/classes/java/awt/peer/MouseInfoPeer.java >>>> src/share/classes/java/awt/peer/PanelPeer.java >>>> src/share/classes/java/awt/peer/TextAreaPeer.java >>>> src/share/classes/java/awt/peer/WindowPeer.java >>>> src/share/classes/java/awt/print/Paper.java >>>> src/share/classes/java/awt/print/Printable.java >>>> src/share/classes/java/beans/XMLEncoder.java >>>> src/share/classes/javax/accessibility/AccessibleContext.java >>>> src/share/classes/javax/imageio/ImageWriter.java >>>> src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java >>>> src/share/classes/javax/imageio/stream/ImageInputStream.java >>>> src/share/classes/javax/imageio/stream/ImageOutputStream.java >>>> src/share/classes/javax/print/Doc.java >>>> src/share/classes/javax/print/DocFlavor.java >>>> src/share/classes/javax/print/MultiDoc.java >>>> src/share/classes/javax/print/MultiDocPrintJob.java >>>> src/share/classes/javax/print/ServiceUI.java >>>> src/share/classes/javax/print/StreamPrintServiceFactory.java >>>> src/share/classes/javax/print/attribute/AttributeSet.java >>>> src/share/classes/javax/print/attribute/standard/Chromaticity.java >>>> src/share/classes/javax/print/attribute/standard/Copies.java >>>> src/share/classes/javax/print/attribute/standard/Fidelity.java >>>> src/share/classes/javax/print/attribute/standard/Finishings.java >>>> src/share/classes/javax/print/attribute/standard/JobKOctets.java >>>> src/share/classes/javax/print/attribute/standard/JobState.java >>>> src/share/classes/javax/print/attribute/standard/MediaName.java >>>> src/share/classes/javax/print/attribute/standard/MediaSize.java >>>> src/share/classes/javax/print/attribute/standard/MediaSizeName.java >>>> src/share/classes/javax/print/attribute/standard/MediaTray.java >>>> src/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java >>>> >>>> src/share/classes/javax/print/attribute/standard/NumberUp.java >>>> src/share/classes/javax/print/attribute/standard/PageRanges.java >>>> src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java >>>> >>>> src/share/classes/javax/print/attribute/standard/PrinterResolution.java >>>> >>>> src/share/classes/javax/print/attribute/standard/SheetCollate.java >>>> src/share/classes/javax/print/attribute/standard/Sides.java >>>> src/share/classes/javax/sound/sampled/AudioInputStream.java >>>> src/share/classes/javax/sound/sampled/AudioPermission.java >>>> src/share/classes/javax/sound/sampled/ReverbType.java >>>> src/share/classes/javax/swing/DefaultComboBoxModel.java >>>> src/share/classes/javax/swing/JComboBox.java >>>> src/share/classes/javax/swing/JEditorPane.java >>>> src/share/classes/javax/swing/JLabel.java >>>> src/share/classes/javax/swing/JLayeredPane.java >>>> src/share/classes/javax/swing/JOptionPane.java >>>> src/share/classes/javax/swing/JTextArea.java >>>> src/share/classes/javax/swing/JTextPane.java >>>> src/share/classes/javax/swing/plaf/TextUI.java >>>> src/share/classes/javax/swing/plaf/basic/BasicTextUI.java >>>> src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java >>>> src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java >>>> src/share/classes/javax/swing/text/CompositeView.java >>>> src/share/classes/javax/swing/text/DefaultEditorKit.java >>>> src/share/classes/javax/swing/text/Document.java >>>> src/share/classes/javax/swing/text/GlyphView.java >>>> src/share/classes/javax/swing/text/JTextComponent.java >>>> src/share/classes/javax/swing/text/NavigationFilter.java >>>> src/share/classes/javax/swing/text/html/HTMLDocument.java >>>> src/share/classes/javax/swing/text/html/StyleSheet.java >>>> >>>> and the full webrev is hosted at >>>> >>>> http://cr.openjdk.java.net/~darcy/8031082.0/ >>>> >>>> Thanks, >>>> >>>> -Joe >>> >> >> > -- Best regards, Sergey. From alexandr.scherbatiy at oracle.com Fri Jan 10 13:12:26 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 10 Jan 2014 17:12:26 +0400 Subject: [9] Review request: 8028616 Htmleditorkit parser doesn't handle leading slash (/) In-Reply-To: <52CFD441.8070504@oracle.com> References: <52CFD441.8070504@oracle.com> Message-ID: <52CFF1BA.4050804@oracle.com> It would be good to check the data and position in the handleText callback in the test and pass the test immediately if the check in the handleText is correct. Otherwise, the fix looks good for me. Thanks, Alexandr. On 1/10/2014 3:06 PM, dmitry markov wrote: > Hello, > > Could you review the fix for jdk9, please? > > bug: https://bugs.openjdk.java.net/browse/JDK-8028616 > webrev: http://cr.openjdk.java.net/~dmarkov/8028616/jdk9/webrev.00/ > > The method Parser.parseContent() should invoke legalElementContext(), > if the parsed text is not wrapped by tags and starts with slash (/). > > Thanks, > Dmitry From joe.darcy at oracle.com Sat Jan 11 02:00:56 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 10 Jan 2014 18:00:56 -0800 Subject: JDK 9 RFR of JDK-8031082 Fix non-missing doclint problems in client libraries In-Reply-To: <52CFEDD1.7010500@oracle.com> References: <52C285A8.9060207@oracle.com> <52CDF67B.3020207@oracle.com> <52CE558C.7000808@oracle.com> <52CEFEDB.6030706@oracle.com> <52CFEDD1.7010500@oracle.com> Message-ID: <52D0A5D8.80602@oracle.com> On 01/10/2014 04:55 AM, Sergey Bylokhov wrote: > On 09.01.2014 23:56, Joe Darcy wrote: >> Hello Sergey, >> >> On 1/8/2014 11:53 PM, Sergey Bylokhov wrote: >>> Hello, Joe. >>> Why @see tag was removed in the ComponentPeer.java? >> >> Because they were resulting in "error: reference not found" messages. >> The syntax appears correct, but the error is generated anyway. Since >> the peer package doesn't seem to be included in the main doc bundle, >> I didn't think removing the @see tags would be that much of a loss of >> functionality. > I suppose too, but I think a separate issue should be filed on doclint. > Anyway the fix looks good, but note that the new year in headers > should be 2014. Hello Sergey (Since I initially published the proposed changes in (late) 2013, 2013 is the proper copyright year.) Thanks for the review, -Joe From dmitry.markov at oracle.com Mon Jan 13 10:23:11 2014 From: dmitry.markov at oracle.com (dmitry markov) Date: Mon, 13 Jan 2014 14:23:11 +0400 Subject: [9] Review request: 8028616 Htmleditorkit parser doesn't handle leading slash (/) In-Reply-To: <52CFF1BA.4050804@oracle.com> References: <52CFD441.8070504@oracle.com> <52CFF1BA.4050804@oracle.com> Message-ID: <52D3BE8F.3040204@oracle.com> Hello Alexandr, Thank you for the review. I updated the test as you suggested. Please find new version here - http://cr.openjdk.java.net/~dmarkov/8028616/jdk9/webrev.01/ Thanks, Dmitry On 10/01/2014 17:12, Alexander Scherbatiy wrote: > > It would be good to check the data and position in the handleText > callback in the test and pass the test immediately if the check in the > handleText is correct. > Otherwise, the fix looks good for me. > > Thanks, > Alexandr. > > > On 1/10/2014 3:06 PM, dmitry markov wrote: >> Hello, >> >> Could you review the fix for jdk9, please? >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8028616 >> webrev: http://cr.openjdk.java.net/~dmarkov/8028616/jdk9/webrev.00/ >> >> The method Parser.parseContent() should invoke legalElementContext(), >> if the parsed text is not wrapped by tags and starts with slash (/). >> >> Thanks, >> Dmitry > From alexandr.scherbatiy at oracle.com Tue Jan 14 08:13:52 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Tue, 14 Jan 2014 12:13:52 +0400 Subject: [9] Review request: 8028616 Htmleditorkit parser doesn't handle leading slash (/) In-Reply-To: <52D3BE8F.3040204@oracle.com> References: <52CFD441.8070504@oracle.com> <52CFF1BA.4050804@oracle.com> <52D3BE8F.3040204@oracle.com> Message-ID: <52D4F1C0.7050107@oracle.com> The fix looks good for me. Thanks, Alexandr. On 1/13/2014 2:23 PM, dmitry markov wrote: > Hello Alexandr, > > Thank you for the review. I updated the test as you suggested. Please > find new version here - > http://cr.openjdk.java.net/~dmarkov/8028616/jdk9/webrev.01/ > > Thanks, > Dmitry > > On 10/01/2014 17:12, Alexander Scherbatiy wrote: >> >> It would be good to check the data and position in the handleText >> callback in the test and pass the test immediately if the check in >> the handleText is correct. >> Otherwise, the fix looks good for me. >> >> Thanks, >> Alexandr. >> >> >> On 1/10/2014 3:06 PM, dmitry markov wrote: >>> Hello, >>> >>> Could you review the fix for jdk9, please? >>> >>> bug: https://bugs.openjdk.java.net/browse/JDK-8028616 >>> webrev: http://cr.openjdk.java.net/~dmarkov/8028616/jdk9/webrev.00/ >>> >>> The method Parser.parseContent() should invoke >>> legalElementContext(), if the parsed text is not wrapped by tags and >>> starts with slash (/). >>> >>> Thanks, >>> Dmitry >> > From alexander.potochkin at oracle.com Tue Jan 14 11:57:23 2014 From: alexander.potochkin at oracle.com (Alexander Potochkin) Date: Tue, 14 Jan 2014 15:57:23 +0400 Subject: [9] Review request: 8028616 Htmleditorkit parser doesn't handle leading slash (/) In-Reply-To: <52D3BE8F.3040204@oracle.com> References: <52CFD441.8070504@oracle.com> <52CFF1BA.4050804@oracle.com> <52D3BE8F.3040204@oracle.com> Message-ID: <52D52623.2020801@oracle.com> looks good Thanks alexp On 1/13/2014 2:23 PM, dmitry markov wrote: > Hello Alexandr, > > Thank you for the review. I updated the test as you suggested. Please > find new version here - > http://cr.openjdk.java.net/~dmarkov/8028616/jdk9/webrev.01/ > > Thanks, > Dmitry > > On 10/01/2014 17:12, Alexander Scherbatiy wrote: >> >> It would be good to check the data and position in the handleText >> callback in the test and pass the test immediately if the check in >> the handleText is correct. >> Otherwise, the fix looks good for me. >> >> Thanks, >> Alexandr. >> >> >> On 1/10/2014 3:06 PM, dmitry markov wrote: >>> Hello, >>> >>> Could you review the fix for jdk9, please? >>> >>> bug: https://bugs.openjdk.java.net/browse/JDK-8028616 >>> webrev: http://cr.openjdk.java.net/~dmarkov/8028616/jdk9/webrev.00/ >>> >>> The method Parser.parseContent() should invoke >>> legalElementContext(), if the parsed text is not wrapped by tags and >>> starts with slash (/). >>> >>> Thanks, >>> Dmitry >> > From petr.pchelko at oracle.com Thu Jan 16 14:27:05 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Thu, 16 Jan 2014 18:27:05 +0400 Subject: Proposal: make all methods in all listeners default. Message-ID: <025C951F-4D8A-4505-BF9B-AE3F7EC71A4E@oracle.com> Hello, AWT and Swing Team. I want to discuss an idea with you. What do you think making almost all methods in all listener interfaces in Swing and AWT default with empty implementation, the same way it's done in adapters? This would be convenient if we are writing something like this: public class MyPanel extends Panel implements MouseListener but do not need all methods in a MouseListener. So, without this change we would need to override the methods with empty implementation ourselves, and if all of the methods are default we can choose which methods to implement. Actually, if done like this we could take one step further and deprecate adapters.. What do you think? With best regards. Petr. From joe.darcy at oracle.com Fri Jan 17 06:55:06 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 16 Jan 2014 22:55:06 -0800 Subject: JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries Message-ID: <52D8D3CA.9040409@oracle.com> Hello, Please view my proposed fix for JDK-8032047: Fix static lint warnings in client libraries http://cr.openjdk.java.net/~darcy/8032047.0/ Mostly this fix consisted of just replacing a variable name with the class name mentioned by javac in the warning message. In a few cases where the expression allocated a new object, I choose to just suppress the warning since I didn't feel motivated to analyze the possible side-effects of the allocation. Thanks, -Joe From petr.pchelko at oracle.com Fri Jan 17 07:20:39 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Fri, 17 Jan 2014 11:20:39 +0400 Subject: JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D8D3CA.9040409@oracle.com> References: <52D8D3CA.9040409@oracle.com> Message-ID: <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> Hello, Joe. A couple of small comments: AffineTransformOp.java: Could you please split a long line #241 ClipboardTransferable.java: You can safely remove the DataTransferer.getInstance in this place. The DataTransferer is a singleton and it's already created by this time. SunDragSourceContextPeer.java: same here, you can safely remove the getInstance D3DDrawImage.java: you've mistyped the copyright update. D3DSurfaceDataProxy.java: Why did you choose to suppress a warning here? the getD3DDevice is just a getter, it does not allocate new object and has no side effects.. With best regards. Petr. On 17.01.2014, at 10:55, Joe Darcy wrote: > Hello, > > Please view my proposed fix for > > JDK-8032047: Fix static lint warnings in client libraries > http://cr.openjdk.java.net/~darcy/8032047.0/ > > Mostly this fix consisted of just replacing a variable name with the class name mentioned by javac in the warning message. In a few cases where the expression allocated a new object, I choose to just suppress the warning since I didn't feel motivated to analyze the possible side-effects of the allocation. > > Thanks, > > -Joe > From joe.darcy at oracle.com Fri Jan 17 07:31:26 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 16 Jan 2014 23:31:26 -0800 Subject: JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> Message-ID: <52D8DC4E.8050906@oracle.com> Hi Petr, On 01/16/2014 11:20 PM, Petr Pchelko wrote: > Hello, Joe. > > A couple of small comments: > > AffineTransformOp.java: Could you please split a long line #241 Done. > > ClipboardTransferable.java: You can safely remove the DataTransferer.getInstance in this place. > The DataTransferer is a singleton and it's already created by this time. > > SunDragSourceContextPeer.java: same here, you can safely remove the getInstance Changed. > > D3DDrawImage.java: you've mistyped the copyright update. Fixed. > > D3DSurfaceDataProxy.java: Why did you choose to suppress a warning here? the getD3DDevice is > just a getter, it does not allocate new object and has no side effects.. Changed. Revised webrev at http://cr.openjdk.java.net/~darcy/8032047.0/ Thanks for the careful review, -Joe > > With best regards. Petr. > > On 17.01.2014, at 10:55, Joe Darcy wrote: > >> Hello, >> >> Please view my proposed fix for >> >> JDK-8032047: Fix static lint warnings in client libraries >> http://cr.openjdk.java.net/~darcy/8032047.0/ >> >> Mostly this fix consisted of just replacing a variable name with the class name mentioned by javac in the warning message. In a few cases where the expression allocated a new object, I choose to just suppress the warning since I didn't feel motivated to analyze the possible side-effects of the allocation. >> >> Thanks, >> >> -Joe >> From petr.pchelko at oracle.com Fri Jan 17 08:33:03 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Fri, 17 Jan 2014 12:33:03 +0400 Subject: JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D8DC4E.8050906@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> Message-ID: Hello, Joe. The fix looks good. For the next reviewer - the correct link to the new version is http://cr.openjdk.java.net/~darcy/8032047.1/ With best regards. Petr. On 17.01.2014, at 11:31, Joe Darcy wrote: > Hi Petr, > > On 01/16/2014 11:20 PM, Petr Pchelko wrote: >> Hello, Joe. >> >> A couple of small comments: >> >> AffineTransformOp.java: Could you please split a long line #241 > > Done. > >> >> ClipboardTransferable.java: You can safely remove the DataTransferer.getInstance in this place. >> The DataTransferer is a singleton and it's already created by this time. >> >> SunDragSourceContextPeer.java: same here, you can safely remove the getInstance > > Changed. > >> >> D3DDrawImage.java: you've mistyped the copyright update. > > Fixed. > >> >> D3DSurfaceDataProxy.java: Why did you choose to suppress a warning here? the getD3DDevice is >> just a getter, it does not allocate new object and has no side effects.. > > Changed. > > Revised webrev at > > http://cr.openjdk.java.net/~darcy/8032047.0/ > > Thanks for the careful review, > > -Joe > >> >> With best regards. Petr. >> >> On 17.01.2014, at 10:55, Joe Darcy wrote: >> >>> Hello, >>> >>> Please view my proposed fix for >>> >>> JDK-8032047: Fix static lint warnings in client libraries >>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>> >>> Mostly this fix consisted of just replacing a variable name with the class name mentioned by javac in the warning message. In a few cases where the expression allocated a new object, I choose to just suppress the warning since I didn't feel motivated to analyze the possible side-effects of the allocation. >>> >>> Thanks, >>> >>> -Joe >>> > From Sergey.Bylokhov at oracle.com Fri Jan 17 10:28:00 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 17 Jan 2014 14:28:00 +0400 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D8DC4E.8050906@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> Message-ID: <52D905B0.40509@oracle.com> Hello, Joe. Some comments: - in the SunDropTargetContextPeer.java file header changed only - Incorrect modification of if statement in D3DSurfaceDataProxy.java - It is not necessary to use class name in StyledEditorKit.java and HTMLEditorKit.java, because defaultActions is a private static field and it can be accessed directly. On 17.01.2014 11:31, Joe Darcy wrote: > Hi Petr, > > On 01/16/2014 11:20 PM, Petr Pchelko wrote: >> Hello, Joe. >> >> A couple of small comments: >> >> AffineTransformOp.java: Could you please split a long line #241 > > Done. > >> >> ClipboardTransferable.java: You can safely remove the >> DataTransferer.getInstance in this place. >> The DataTransferer is a singleton and it's already created by this time. >> >> SunDragSourceContextPeer.java: same here, you can safely remove the >> getInstance > > Changed. > >> >> D3DDrawImage.java: you've mistyped the copyright update. > > Fixed. > >> >> D3DSurfaceDataProxy.java: Why did you choose to suppress a warning >> here? the getD3DDevice is >> just a getter, it does not allocate new object and has no side effects.. > > Changed. > > Revised webrev at > > http://cr.openjdk.java.net/~darcy/8032047.0/ > > Thanks for the careful review, > > -Joe > >> >> With best regards. Petr. >> >> On 17.01.2014, at 10:55, Joe Darcy wrote: >> >>> Hello, >>> >>> Please view my proposed fix for >>> >>> JDK-8032047: Fix static lint warnings in client libraries >>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>> >>> Mostly this fix consisted of just replacing a variable name with the >>> class name mentioned by javac in the warning message. In a few cases >>> where the expression allocated a new object, I choose to just >>> suppress the warning since I didn't feel motivated to analyze the >>> possible side-effects of the allocation. >>> >>> Thanks, >>> >>> -Joe >>> > -- Best regards, Sergey. From joe.darcy at oracle.com Fri Jan 17 19:30:29 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 17 Jan 2014 11:30:29 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D905B0.40509@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> Message-ID: <52D984D5.2050307@oracle.com> Hi Sergey, On 01/17/2014 02:28 AM, Sergey Bylokhov wrote: > Hello, Joe. > Some comments: > - in the SunDropTargetContextPeer.java file header changed only Reverted. > - Incorrect modification of if statement in D3DSurfaceDataProxy.java Fixed. > - It is not necessary to use class name in StyledEditorKit.java and > HTMLEditorKit.java, because defaultActions is a private static field > and it can be accessed directly. Improved. New webrev: http://cr.openjdk.java.net/~darcy/8032047.2 Thanks for the review, -Joe > > On 17.01.2014 11:31, Joe Darcy wrote: >> Hi Petr, >> >> On 01/16/2014 11:20 PM, Petr Pchelko wrote: >>> Hello, Joe. >>> >>> A couple of small comments: >>> >>> AffineTransformOp.java: Could you please split a long line #241 >> >> Done. >> >>> >>> ClipboardTransferable.java: You can safely remove the >>> DataTransferer.getInstance in this place. >>> The DataTransferer is a singleton and it's already created by this >>> time. >>> >>> SunDragSourceContextPeer.java: same here, you can safely remove the >>> getInstance >> >> Changed. >> >>> >>> D3DDrawImage.java: you've mistyped the copyright update. >> >> Fixed. >> >>> >>> D3DSurfaceDataProxy.java: Why did you choose to suppress a warning >>> here? the getD3DDevice is >>> just a getter, it does not allocate new object and has no side >>> effects.. >> >> Changed. >> >> Revised webrev at >> >> http://cr.openjdk.java.net/~darcy/8032047.0/ >> >> Thanks for the careful review, >> >> -Joe >> >>> >>> With best regards. Petr. >>> >>> On 17.01.2014, at 10:55, Joe Darcy wrote: >>> >>>> Hello, >>>> >>>> Please view my proposed fix for >>>> >>>> JDK-8032047: Fix static lint warnings in client libraries >>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>> >>>> Mostly this fix consisted of just replacing a variable name with >>>> the class name mentioned by javac in the warning message. In a few >>>> cases where the expression allocated a new object, I choose to just >>>> suppress the warning since I didn't feel motivated to analyze the >>>> possible side-effects of the allocation. >>>> >>>> Thanks, >>>> >>>> -Joe >>>> >> > > From Sergey.Bylokhov at oracle.com Fri Jan 17 21:10:11 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Sat, 18 Jan 2014 01:10:11 +0400 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D984D5.2050307@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> <52D984D5.2050307@oracle.com> Message-ID: <52D99C33.2070206@oracle.com> Hello, Joe. Thanks. The fix looks good. On 17.01.2014 23:30, Joe Darcy wrote: > Hi Sergey, > > On 01/17/2014 02:28 AM, Sergey Bylokhov wrote: >> Hello, Joe. >> Some comments: >> - in the SunDropTargetContextPeer.java file header changed only > > Reverted. > >> - Incorrect modification of if statement in D3DSurfaceDataProxy.java > > Fixed. > >> - It is not necessary to use class name in StyledEditorKit.java and >> HTMLEditorKit.java, because defaultActions is a private static field >> and it can be accessed directly. > > Improved. > > New webrev: > > http://cr.openjdk.java.net/~darcy/8032047.2 > > Thanks for the review, > > -Joe > >> >> On 17.01.2014 11:31, Joe Darcy wrote: >>> Hi Petr, >>> >>> On 01/16/2014 11:20 PM, Petr Pchelko wrote: >>>> Hello, Joe. >>>> >>>> A couple of small comments: >>>> >>>> AffineTransformOp.java: Could you please split a long line #241 >>> >>> Done. >>> >>>> >>>> ClipboardTransferable.java: You can safely remove the >>>> DataTransferer.getInstance in this place. >>>> The DataTransferer is a singleton and it's already created by this >>>> time. >>>> >>>> SunDragSourceContextPeer.java: same here, you can safely remove the >>>> getInstance >>> >>> Changed. >>> >>>> >>>> D3DDrawImage.java: you've mistyped the copyright update. >>> >>> Fixed. >>> >>>> >>>> D3DSurfaceDataProxy.java: Why did you choose to suppress a warning >>>> here? the getD3DDevice is >>>> just a getter, it does not allocate new object and has no side >>>> effects.. >>> >>> Changed. >>> >>> Revised webrev at >>> >>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>> >>> Thanks for the careful review, >>> >>> -Joe >>> >>>> >>>> With best regards. Petr. >>>> >>>> On 17.01.2014, at 10:55, Joe Darcy wrote: >>>> >>>>> Hello, >>>>> >>>>> Please view my proposed fix for >>>>> >>>>> JDK-8032047: Fix static lint warnings in client libraries >>>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>>> >>>>> Mostly this fix consisted of just replacing a variable name with >>>>> the class name mentioned by javac in the warning message. In a few >>>>> cases where the expression allocated a new object, I choose to >>>>> just suppress the warning since I didn't feel motivated to analyze >>>>> the possible side-effects of the allocation. >>>>> >>>>> Thanks, >>>>> >>>>> -Joe >>>>> >>> >> >> > -- Best regards, Sergey. From joe.darcy at oracle.com Fri Jan 17 21:13:07 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 17 Jan 2014 13:13:07 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D984D5.2050307@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> <52D984D5.2050307@oracle.com> Message-ID: <52D99CE3.4000602@oracle.com> PS I neglected to include some affected files under src/solaris/classes/sun/* previously. Those files are included in the new webrev http://cr.openjdk.java.net/~darcy/8032047.3 and the differential patch below. Thanks, -Joe --- old/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-01-17 12:51:36.000000000 -0800 +++ new/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-01-17 12:51:36.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -184,7 +184,7 @@ XWindowPeer wpeer = (XWindowPeer)(container.getPeer()); if (wpeer != null) { return (wpeer.winAttr.visibilityState != - wpeer.winAttr.AWT_UNOBSCURED); + XWindowAttributesData.AWT_UNOBSCURED); } } return true; --- old/src/solaris/classes/sun/awt/X11/XDialogPeer.java 2014-01-17 12:51:37.000000000 -0800 +++ new/src/solaris/classes/sun/awt/X11/XDialogPeer.java 2014-01-17 12:51:36.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -47,9 +47,9 @@ undecorated = Boolean.valueOf(target.isUndecorated()); winAttr.nativeDecor = !target.isUndecorated(); if (winAttr.nativeDecor) { - winAttr.decorations = winAttr.AWT_DECOR_ALL; + winAttr.decorations = XWindowAttributesData.AWT_DECOR_ALL; } else { - winAttr.decorations = winAttr.AWT_DECOR_NONE; + winAttr.decorations = XWindowAttributesData.AWT_DECOR_NONE; } winAttr.functions = MWMConstants.MWM_FUNC_ALL; winAttr.isResizable = true; //target.isResizable(); --- old/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java 2014-01-17 12:51:37.000000000 -0800 +++ new/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java 2014-01-17 12:51:37.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -1005,6 +1005,7 @@ } } + @SuppressWarnings("static") private void notifyProtocolListener(XWindow xwindow, int x, int y, int dropAction, XClientMessageEvent xclient, @@ -1147,7 +1148,7 @@ event while it still can be referenced from other Java events. */ { XClientMessageEvent copy = new XClientMessageEvent(); - unsafe.copyMemory(xclient.pData, copy.pData, copy.getSize()); + unsafe.copyMemory(xclient.pData, copy.pData, XClientMessageEvent.getSize()); copy.set_data(0, xclient.get_window()); --- old/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java 2014-01-17 12:51:37.000000000 -0800 +++ new/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java 2014-01-17 12:51:37.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -654,9 +654,9 @@ if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Client message to embedder: " + msg); } - if (msg.get_message_type() == xembed.XEmbed.getAtom()) { + if (msg.get_message_type() == XEmbedHelper.XEmbed.getAtom()) { if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { - xembedLog.fine(xembed.XEmbedMessageToString(msg)); + xembedLog.fine(XEmbedHelper.XEmbedMessageToString(msg)); } } if (isXEmbedActive()) { --- old/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java 2014-01-17 12:51:38.000000000 -0800 +++ new/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java 2014-01-17 12:51:38.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -647,7 +647,7 @@ public void dispatchEvent(XEvent ev) { if (ev.get_type() == ClientMessage) { XClientMessageEvent msg = ev.get_xclient(); - if (msg.get_message_type() == xembed.XEmbed.getAtom()) { + if (msg.get_message_type() == XEmbedHelper.XEmbed.getAtom()) { if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Embedded message: " + XEmbedHelper.msgidToString((int)msg.get_data(1))); } --- old/src/solaris/classes/sun/awt/X11/XFramePeer.java 2014-01-17 12:51:39.000000000 -0800 +++ new/src/solaris/classes/sun/awt/X11/XFramePeer.java 2014-01-17 12:51:38.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -67,9 +67,9 @@ undecorated = Boolean.valueOf(target.isUndecorated()); winAttr.nativeDecor = !target.isUndecorated(); if (winAttr.nativeDecor) { - winAttr.decorations = winAttr.AWT_DECOR_ALL; + winAttr.decorations = XWindowAttributesData.AWT_DECOR_ALL; } else { - winAttr.decorations = winAttr.AWT_DECOR_NONE; + winAttr.decorations = XWindowAttributesData.AWT_DECOR_NONE; } winAttr.functions = MWMConstants.MWM_FUNC_ALL; winAttr.isResizable = true; // target.isResizable(); --- old/src/solaris/classes/sun/awt/X11/XToolkit.java 2014-01-17 12:51:39.000000000 -0800 +++ new/src/solaris/classes/sun/awt/X11/XToolkit.java 2014-01-17 12:51:39.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -1542,7 +1542,7 @@ */ if (desktopProperties.get(SunToolkit.DESKTOPFONTHINTS) == null) { if (XWM.isKDE2()) { - Object hint = fcManager.getFontConfigAAHint(); + Object hint = FontConfigManager.getFontConfigAAHint(); if (hint != null) { /* set the fontconfig/KDE property so that * getDesktopHints() below will see it --- old/src/solaris/classes/sun/font/FcFontConfiguration.java 2014-01-17 12:51:40.000000000 -0800 +++ new/src/solaris/classes/sun/font/FcFontConfiguration.java 2014-01-17 12:51:39.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2014, 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 @@ -441,7 +441,7 @@ try { fcVersion = Integer.parseInt(fcVersionStr); if (fcVersion != 0 && - fcVersion != fcm.getFontConfigVersion()) { + fcVersion != FontConfigManager.getFontConfigVersion()) { return; } } catch (Exception e) { --- old/src/solaris/classes/sun/font/X11TextRenderer.java 2014-01-17 12:51:40.000000000 -0800 +++ new/src/solaris/classes/sun/font/X11TextRenderer.java 2014-01-17 12:51:40.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -57,11 +57,11 @@ super.drawGlyphVector(sg2d, g, x, y); return; case SunHints.INTVAL_TEXT_ANTIALIAS_ON: - sg2d.surfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y); + SurfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y); return; case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB: case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB: - sg2d.surfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y); + SurfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y); return; default: } On 01/17/2014 11:30 AM, Joe Darcy wrote: > Hi Sergey, > > On 01/17/2014 02:28 AM, Sergey Bylokhov wrote: >> Hello, Joe. >> Some comments: >> - in the SunDropTargetContextPeer.java file header changed only > > Reverted. > >> - Incorrect modification of if statement in D3DSurfaceDataProxy.java > > Fixed. > >> - It is not necessary to use class name in StyledEditorKit.java and >> HTMLEditorKit.java, because defaultActions is a private static field >> and it can be accessed directly. > > Improved. > > New webrev: > > http://cr.openjdk.java.net/~darcy/8032047.2 > > Thanks for the review, > > -Joe > >> >> On 17.01.2014 11:31, Joe Darcy wrote: >>> Hi Petr, >>> >>> On 01/16/2014 11:20 PM, Petr Pchelko wrote: >>>> Hello, Joe. >>>> >>>> A couple of small comments: >>>> >>>> AffineTransformOp.java: Could you please split a long line #241 >>> >>> Done. >>> >>>> >>>> ClipboardTransferable.java: You can safely remove the >>>> DataTransferer.getInstance in this place. >>>> The DataTransferer is a singleton and it's already created by this >>>> time. >>>> >>>> SunDragSourceContextPeer.java: same here, you can safely remove the >>>> getInstance >>> >>> Changed. >>> >>>> >>>> D3DDrawImage.java: you've mistyped the copyright update. >>> >>> Fixed. >>> >>>> >>>> D3DSurfaceDataProxy.java: Why did you choose to suppress a warning >>>> here? the getD3DDevice is >>>> just a getter, it does not allocate new object and has no side >>>> effects.. >>> >>> Changed. >>> >>> Revised webrev at >>> >>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>> >>> Thanks for the careful review, >>> >>> -Joe >>> >>>> >>>> With best regards. Petr. >>>> >>>> On 17.01.2014, at 10:55, Joe Darcy wrote: >>>> >>>>> Hello, >>>>> >>>>> Please view my proposed fix for >>>>> >>>>> JDK-8032047: Fix static lint warnings in client libraries >>>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>>> >>>>> Mostly this fix consisted of just replacing a variable name with >>>>> the class name mentioned by javac in the warning message. In a few >>>>> cases where the expression allocated a new object, I choose to >>>>> just suppress the warning since I didn't feel motivated to analyze >>>>> the possible side-effects of the allocation. >>>>> >>>>> Thanks, >>>>> >>>>> -Joe >>>>> >>> >> >> > g From Sergey.Bylokhov at oracle.com Fri Jan 17 21:47:01 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Sat, 18 Jan 2014 01:47:01 +0400 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D99CE3.4000602@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> <52D984D5.2050307@oracle.com> <52D99CE3.4000602@oracle.com> Message-ID: <52D9A4D5.1050306@oracle.com> Hello, Joe. This version looks good to me too. On 18.01.2014 1:13, Joe Darcy wrote: > PS I neglected to include some affected files under > src/solaris/classes/sun/* previously. > > Those files are included in the new webrev > > http://cr.openjdk.java.net/~darcy/8032047.3 > > and the differential patch below. > > Thanks, > > -Joe > > --- old/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-01-17 > 12:51:36.000000000 -0800 > +++ new/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-01-17 > 12:51:36.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2002, 2014, 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 > @@ -184,7 +184,7 @@ > XWindowPeer wpeer = (XWindowPeer)(container.getPeer()); > if (wpeer != null) { > return (wpeer.winAttr.visibilityState != > - wpeer.winAttr.AWT_UNOBSCURED); > + XWindowAttributesData.AWT_UNOBSCURED); > } > } > return true; > --- old/src/solaris/classes/sun/awt/X11/XDialogPeer.java 2014-01-17 > 12:51:37.000000000 -0800 > +++ new/src/solaris/classes/sun/awt/X11/XDialogPeer.java 2014-01-17 > 12:51:36.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2002, 2014, 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 > @@ -47,9 +47,9 @@ > undecorated = Boolean.valueOf(target.isUndecorated()); > winAttr.nativeDecor = !target.isUndecorated(); > if (winAttr.nativeDecor) { > - winAttr.decorations = winAttr.AWT_DECOR_ALL; > + winAttr.decorations = XWindowAttributesData.AWT_DECOR_ALL; > } else { > - winAttr.decorations = winAttr.AWT_DECOR_NONE; > + winAttr.decorations = XWindowAttributesData.AWT_DECOR_NONE; > } > winAttr.functions = MWMConstants.MWM_FUNC_ALL; > winAttr.isResizable = true; //target.isResizable(); > --- old/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java > 2014-01-17 12:51:37.000000000 -0800 > +++ new/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java > 2014-01-17 12:51:37.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -1005,6 +1005,7 @@ > } > } > > + @SuppressWarnings("static") > private void notifyProtocolListener(XWindow xwindow, int x, int y, > int dropAction, > XClientMessageEvent xclient, > @@ -1147,7 +1148,7 @@ > event while it still can be referenced from other Java > events. */ > { > XClientMessageEvent copy = new XClientMessageEvent(); > - unsafe.copyMemory(xclient.pData, copy.pData, > copy.getSize()); > + unsafe.copyMemory(xclient.pData, copy.pData, > XClientMessageEvent.getSize()); > > copy.set_data(0, xclient.get_window()); > > --- old/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java > 2014-01-17 12:51:37.000000000 -0800 > +++ new/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java > 2014-01-17 12:51:37.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -654,9 +654,9 @@ > if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { > xembedLog.finer("Client message to embedder: " + msg); > } > - if (msg.get_message_type() == xembed.XEmbed.getAtom()) { > + if (msg.get_message_type() == XEmbedHelper.XEmbed.getAtom()) { > if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { > - xembedLog.fine(xembed.XEmbedMessageToString(msg)); > + xembedLog.fine(XEmbedHelper.XEmbedMessageToString(msg)); > } > } > if (isXEmbedActive()) { > --- old/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java > 2014-01-17 12:51:38.000000000 -0800 > +++ new/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java > 2014-01-17 12:51:38.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -647,7 +647,7 @@ > public void dispatchEvent(XEvent ev) { > if (ev.get_type() == ClientMessage) { > XClientMessageEvent msg = ev.get_xclient(); > - if (msg.get_message_type() == xembed.XEmbed.getAtom()) { > + if (msg.get_message_type() == > XEmbedHelper.XEmbed.getAtom()) { > if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { > xembedLog.fine("Embedded message: " + > XEmbedHelper.msgidToString((int)msg.get_data(1))); > } > --- old/src/solaris/classes/sun/awt/X11/XFramePeer.java 2014-01-17 > 12:51:39.000000000 -0800 > +++ new/src/solaris/classes/sun/awt/X11/XFramePeer.java 2014-01-17 > 12:51:38.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2002, 2014, 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 > @@ -67,9 +67,9 @@ > undecorated = Boolean.valueOf(target.isUndecorated()); > winAttr.nativeDecor = !target.isUndecorated(); > if (winAttr.nativeDecor) { > - winAttr.decorations = winAttr.AWT_DECOR_ALL; > + winAttr.decorations = XWindowAttributesData.AWT_DECOR_ALL; > } else { > - winAttr.decorations = winAttr.AWT_DECOR_NONE; > + winAttr.decorations = XWindowAttributesData.AWT_DECOR_NONE; > } > winAttr.functions = MWMConstants.MWM_FUNC_ALL; > winAttr.isResizable = true; // target.isResizable(); > --- old/src/solaris/classes/sun/awt/X11/XToolkit.java 2014-01-17 > 12:51:39.000000000 -0800 > +++ new/src/solaris/classes/sun/awt/X11/XToolkit.java 2014-01-17 > 12:51:39.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2002, 2014, 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 > @@ -1542,7 +1542,7 @@ > */ > if > (desktopProperties.get(SunToolkit.DESKTOPFONTHINTS) == null) { > if (XWM.isKDE2()) { > - Object hint = fcManager.getFontConfigAAHint(); > + Object hint = > FontConfigManager.getFontConfigAAHint(); > if (hint != null) { > /* set the fontconfig/KDE property so that > * getDesktopHints() below will see it > --- old/src/solaris/classes/sun/font/FcFontConfiguration.java > 2014-01-17 12:51:40.000000000 -0800 > +++ new/src/solaris/classes/sun/font/FcFontConfiguration.java > 2014-01-17 12:51:39.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2008, 2014, 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 > @@ -441,7 +441,7 @@ > try { > fcVersion = Integer.parseInt(fcVersionStr); > if (fcVersion != 0 && > - fcVersion != fcm.getFontConfigVersion()) { > + fcVersion != > FontConfigManager.getFontConfigVersion()) { > return; > } > } catch (Exception e) { > --- old/src/solaris/classes/sun/font/X11TextRenderer.java 2014-01-17 > 12:51:40.000000000 -0800 > +++ new/src/solaris/classes/sun/font/X11TextRenderer.java 2014-01-17 > 12:51:40.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2000, 2014, 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 > @@ -57,11 +57,11 @@ > super.drawGlyphVector(sg2d, g, x, y); > return; > case SunHints.INTVAL_TEXT_ANTIALIAS_ON: > - sg2d.surfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y); > + SurfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y); > return; > case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB: > case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB: > - sg2d.surfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y); > + SurfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y); > return; > default: > } > > > On 01/17/2014 11:30 AM, Joe Darcy wrote: >> Hi Sergey, >> >> On 01/17/2014 02:28 AM, Sergey Bylokhov wrote: >>> Hello, Joe. >>> Some comments: >>> - in the SunDropTargetContextPeer.java file header changed only >> >> Reverted. >> >>> - Incorrect modification of if statement in D3DSurfaceDataProxy.java >> >> Fixed. >> >>> - It is not necessary to use class name in StyledEditorKit.java >>> and HTMLEditorKit.java, because defaultActions is a private static >>> field and it can be accessed directly. >> >> Improved. >> >> New webrev: >> >> http://cr.openjdk.java.net/~darcy/8032047.2 >> >> Thanks for the review, >> >> -Joe >> >>> >>> On 17.01.2014 11:31, Joe Darcy wrote: >>>> Hi Petr, >>>> >>>> On 01/16/2014 11:20 PM, Petr Pchelko wrote: >>>>> Hello, Joe. >>>>> >>>>> A couple of small comments: >>>>> >>>>> AffineTransformOp.java: Could you please split a long line #241 >>>> >>>> Done. >>>> >>>>> >>>>> ClipboardTransferable.java: You can safely remove the >>>>> DataTransferer.getInstance in this place. >>>>> The DataTransferer is a singleton and it's already created by this >>>>> time. >>>>> >>>>> SunDragSourceContextPeer.java: same here, you can safely remove >>>>> the getInstance >>>> >>>> Changed. >>>> >>>>> >>>>> D3DDrawImage.java: you've mistyped the copyright update. >>>> >>>> Fixed. >>>> >>>>> >>>>> D3DSurfaceDataProxy.java: Why did you choose to suppress a warning >>>>> here? the getD3DDevice is >>>>> just a getter, it does not allocate new object and has no side >>>>> effects.. >>>> >>>> Changed. >>>> >>>> Revised webrev at >>>> >>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>> >>>> Thanks for the careful review, >>>> >>>> -Joe >>>> >>>>> >>>>> With best regards. Petr. >>>>> >>>>> On 17.01.2014, at 10:55, Joe Darcy wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> Please view my proposed fix for >>>>>> >>>>>> JDK-8032047: Fix static lint warnings in client libraries >>>>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>>>> >>>>>> Mostly this fix consisted of just replacing a variable name with >>>>>> the class name mentioned by javac in the warning message. In a >>>>>> few cases where the expression allocated a new object, I choose >>>>>> to just suppress the warning since I didn't feel motivated to >>>>>> analyze the possible side-effects of the allocation. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> -Joe >>>>>> >>>> >>> >>> >> > g -- Best regards, Sergey. From petr.pchelko at oracle.com Fri Jan 17 22:12:41 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Sat, 18 Jan 2014 02:12:41 +0400 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D9A4D5.1050306@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> <52D984D5.2050307@oracle.com> <52D99CE3.4000602@oracle.com> <52D9A4D5.1050306@oracle.com> Message-ID: <644C04B0-67ED-456D-97A3-F86171BF54AC@oracle.com> Hello, Joe. The final version still looks good. With best regards. Petr. 18 ???. 2014 ?., ? 1:47 ?? ???????, Sergey Bylokhov ???????(?): > Hello, Joe. > This version looks good to me too. > > On 18.01.2014 1:13, Joe Darcy wrote: >> PS I neglected to include some affected files under src/solaris/classes/sun/* previously. >> >> Those files are included in the new webrev >> >> http://cr.openjdk.java.net/~darcy/8032047.3 >> >> and the differential patch below. >> >> Thanks, >> >> -Joe >> >> --- old/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-01-17 12:51:36.000000000 -0800 >> +++ new/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-01-17 12:51:36.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2002, 2014, 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 >> @@ -184,7 +184,7 @@ >> XWindowPeer wpeer = (XWindowPeer)(container.getPeer()); >> if (wpeer != null) { >> return (wpeer.winAttr.visibilityState != >> - wpeer.winAttr.AWT_UNOBSCURED); >> + XWindowAttributesData.AWT_UNOBSCURED); >> } >> } >> return true; >> --- old/src/solaris/classes/sun/awt/X11/XDialogPeer.java 2014-01-17 12:51:37.000000000 -0800 >> +++ new/src/solaris/classes/sun/awt/X11/XDialogPeer.java 2014-01-17 12:51:36.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2002, 2014, 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 >> @@ -47,9 +47,9 @@ >> undecorated = Boolean.valueOf(target.isUndecorated()); >> winAttr.nativeDecor = !target.isUndecorated(); >> if (winAttr.nativeDecor) { >> - winAttr.decorations = winAttr.AWT_DECOR_ALL; >> + winAttr.decorations = XWindowAttributesData.AWT_DECOR_ALL; >> } else { >> - winAttr.decorations = winAttr.AWT_DECOR_NONE; >> + winAttr.decorations = XWindowAttributesData.AWT_DECOR_NONE; >> } >> winAttr.functions = MWMConstants.MWM_FUNC_ALL; >> winAttr.isResizable = true; //target.isResizable(); >> --- old/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java 2014-01-17 12:51:37.000000000 -0800 >> +++ new/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java 2014-01-17 12:51:37.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2003, 2014, 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 >> @@ -1005,6 +1005,7 @@ >> } >> } >> >> + @SuppressWarnings("static") >> private void notifyProtocolListener(XWindow xwindow, int x, int y, >> int dropAction, >> XClientMessageEvent xclient, >> @@ -1147,7 +1148,7 @@ >> event while it still can be referenced from other Java events. */ >> { >> XClientMessageEvent copy = new XClientMessageEvent(); >> - unsafe.copyMemory(xclient.pData, copy.pData, copy.getSize()); >> + unsafe.copyMemory(xclient.pData, copy.pData, XClientMessageEvent.getSize()); >> >> copy.set_data(0, xclient.get_window()); >> >> --- old/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java 2014-01-17 12:51:37.000000000 -0800 >> +++ new/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java 2014-01-17 12:51:37.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2003, 2014, 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 >> @@ -654,9 +654,9 @@ >> if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { >> xembedLog.finer("Client message to embedder: " + msg); >> } >> - if (msg.get_message_type() == xembed.XEmbed.getAtom()) { >> + if (msg.get_message_type() == XEmbedHelper.XEmbed.getAtom()) { >> if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { >> - xembedLog.fine(xembed.XEmbedMessageToString(msg)); >> + xembedLog.fine(XEmbedHelper.XEmbedMessageToString(msg)); >> } >> } >> if (isXEmbedActive()) { >> --- old/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java 2014-01-17 12:51:38.000000000 -0800 >> +++ new/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java 2014-01-17 12:51:38.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2003, 2014, 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 >> @@ -647,7 +647,7 @@ >> public void dispatchEvent(XEvent ev) { >> if (ev.get_type() == ClientMessage) { >> XClientMessageEvent msg = ev.get_xclient(); >> - if (msg.get_message_type() == xembed.XEmbed.getAtom()) { >> + if (msg.get_message_type() == XEmbedHelper.XEmbed.getAtom()) { >> if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { >> xembedLog.fine("Embedded message: " + XEmbedHelper.msgidToString((int)msg.get_data(1))); >> } >> --- old/src/solaris/classes/sun/awt/X11/XFramePeer.java 2014-01-17 12:51:39.000000000 -0800 >> +++ new/src/solaris/classes/sun/awt/X11/XFramePeer.java 2014-01-17 12:51:38.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2002, 2014, 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 >> @@ -67,9 +67,9 @@ >> undecorated = Boolean.valueOf(target.isUndecorated()); >> winAttr.nativeDecor = !target.isUndecorated(); >> if (winAttr.nativeDecor) { >> - winAttr.decorations = winAttr.AWT_DECOR_ALL; >> + winAttr.decorations = XWindowAttributesData.AWT_DECOR_ALL; >> } else { >> - winAttr.decorations = winAttr.AWT_DECOR_NONE; >> + winAttr.decorations = XWindowAttributesData.AWT_DECOR_NONE; >> } >> winAttr.functions = MWMConstants.MWM_FUNC_ALL; >> winAttr.isResizable = true; // target.isResizable(); >> --- old/src/solaris/classes/sun/awt/X11/XToolkit.java 2014-01-17 12:51:39.000000000 -0800 >> +++ new/src/solaris/classes/sun/awt/X11/XToolkit.java 2014-01-17 12:51:39.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2002, 2014, 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 >> @@ -1542,7 +1542,7 @@ >> */ >> if (desktopProperties.get(SunToolkit.DESKTOPFONTHINTS) == null) { >> if (XWM.isKDE2()) { >> - Object hint = fcManager.getFontConfigAAHint(); >> + Object hint = FontConfigManager.getFontConfigAAHint(); >> if (hint != null) { >> /* set the fontconfig/KDE property so that >> * getDesktopHints() below will see it >> --- old/src/solaris/classes/sun/font/FcFontConfiguration.java 2014-01-17 12:51:40.000000000 -0800 >> +++ new/src/solaris/classes/sun/font/FcFontConfiguration.java 2014-01-17 12:51:39.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2008, 2014, 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 >> @@ -441,7 +441,7 @@ >> try { >> fcVersion = Integer.parseInt(fcVersionStr); >> if (fcVersion != 0 && >> - fcVersion != fcm.getFontConfigVersion()) { >> + fcVersion != FontConfigManager.getFontConfigVersion()) { >> return; >> } >> } catch (Exception e) { >> --- old/src/solaris/classes/sun/font/X11TextRenderer.java 2014-01-17 12:51:40.000000000 -0800 >> +++ new/src/solaris/classes/sun/font/X11TextRenderer.java 2014-01-17 12:51:40.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. >> + * Copyright (c) 2000, 2014, 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 >> @@ -57,11 +57,11 @@ >> super.drawGlyphVector(sg2d, g, x, y); >> return; >> case SunHints.INTVAL_TEXT_ANTIALIAS_ON: >> - sg2d.surfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y); >> + SurfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y); >> return; >> case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB: >> case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB: >> - sg2d.surfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y); >> + SurfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y); >> return; >> default: >> } >> >> >> On 01/17/2014 11:30 AM, Joe Darcy wrote: >>> Hi Sergey, >>> >>> On 01/17/2014 02:28 AM, Sergey Bylokhov wrote: >>>> Hello, Joe. >>>> Some comments: >>>> - in the SunDropTargetContextPeer.java file header changed only >>> >>> Reverted. >>> >>>> - Incorrect modification of if statement in D3DSurfaceDataProxy.java >>> >>> Fixed. >>> >>>> - It is not necessary to use class name in StyledEditorKit.java and HTMLEditorKit.java, because defaultActions is a private static field and it can be accessed directly. >>> >>> Improved. >>> >>> New webrev: >>> >>> http://cr.openjdk.java.net/~darcy/8032047.2 >>> >>> Thanks for the review, >>> >>> -Joe >>> >>>> >>>> On 17.01.2014 11:31, Joe Darcy wrote: >>>>> Hi Petr, >>>>> >>>>> On 01/16/2014 11:20 PM, Petr Pchelko wrote: >>>>>> Hello, Joe. >>>>>> >>>>>> A couple of small comments: >>>>>> >>>>>> AffineTransformOp.java: Could you please split a long line #241 >>>>> >>>>> Done. >>>>> >>>>>> >>>>>> ClipboardTransferable.java: You can safely remove the DataTransferer.getInstance in this place. >>>>>> The DataTransferer is a singleton and it's already created by this time. >>>>>> >>>>>> SunDragSourceContextPeer.java: same here, you can safely remove the getInstance >>>>> >>>>> Changed. >>>>> >>>>>> >>>>>> D3DDrawImage.java: you've mistyped the copyright update. >>>>> >>>>> Fixed. >>>>> >>>>>> >>>>>> D3DSurfaceDataProxy.java: Why did you choose to suppress a warning here? the getD3DDevice is >>>>>> just a getter, it does not allocate new object and has no side effects.. >>>>> >>>>> Changed. >>>>> >>>>> Revised webrev at >>>>> >>>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>>> >>>>> Thanks for the careful review, >>>>> >>>>> -Joe >>>>> >>>>>> >>>>>> With best regards. Petr. >>>>>> >>>>>> On 17.01.2014, at 10:55, Joe Darcy wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> Please view my proposed fix for >>>>>>> >>>>>>> JDK-8032047: Fix static lint warnings in client libraries >>>>>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>>>>> >>>>>>> Mostly this fix consisted of just replacing a variable name with the class name mentioned by javac in the warning message. In a few cases where the expression allocated a new object, I choose to just suppress the warning since I didn't feel motivated to analyze the possible side-effects of the allocation. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> -Joe >>>>>>> >>>>> >>>> >>>> >>> >> g > > > -- > Best regards, Sergey. > From joe.darcy at oracle.com Fri Jan 17 22:50:22 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 17 Jan 2014 14:50:22 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <644C04B0-67ED-456D-97A3-F86171BF54AC@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> <52D984D5.2050307@oracle.com> <52D99CE3.4000602@oracle.com> <52D9A4D5.1050306@oracle.com> <644C04B0-67ED-456D-97A3-F86171BF54AC@oracle.com> Message-ID: <52D9B3AE.4070109@oracle.com> Hello, I've had a jprt job submitted to make sure that aren't any cross-platform build issues (and to flush out any other static warnings in the code base). If the jprt is successful, I'll push the changes proposed so far. Thanks Petr and Sergey for the reviews, -Joe On 01/17/2014 02:12 PM, Petr Pchelko wrote: > Hello, Joe. > > The final version still looks good. > > With best regards. Petr. > > 18 ???. 2014 ?., ? 1:47 ?? ???????, Sergey Bylokhov ???????(?): > >> Hello, Joe. >> This version looks good to me too. >> >> On 18.01.2014 1:13, Joe Darcy wrote: >>> PS I neglected to include some affected files under src/solaris/classes/sun/* previously. >>> >>> Those files are included in the new webrev >>> >>> http://cr.openjdk.java.net/~darcy/8032047.3 >>> >>> and the differential patch below. >>> >>> Thanks, >>> >>> -Joe >>> >>> --- old/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-01-17 12:51:36.000000000 -0800 >>> +++ new/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-01-17 12:51:36.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2002, 2014, 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 >>> @@ -184,7 +184,7 @@ >>> XWindowPeer wpeer = (XWindowPeer)(container.getPeer()); >>> if (wpeer != null) { >>> return (wpeer.winAttr.visibilityState != >>> - wpeer.winAttr.AWT_UNOBSCURED); >>> + XWindowAttributesData.AWT_UNOBSCURED); >>> } >>> } >>> return true; >>> --- old/src/solaris/classes/sun/awt/X11/XDialogPeer.java 2014-01-17 12:51:37.000000000 -0800 >>> +++ new/src/solaris/classes/sun/awt/X11/XDialogPeer.java 2014-01-17 12:51:36.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2002, 2014, 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 >>> @@ -47,9 +47,9 @@ >>> undecorated = Boolean.valueOf(target.isUndecorated()); >>> winAttr.nativeDecor = !target.isUndecorated(); >>> if (winAttr.nativeDecor) { >>> - winAttr.decorations = winAttr.AWT_DECOR_ALL; >>> + winAttr.decorations = XWindowAttributesData.AWT_DECOR_ALL; >>> } else { >>> - winAttr.decorations = winAttr.AWT_DECOR_NONE; >>> + winAttr.decorations = XWindowAttributesData.AWT_DECOR_NONE; >>> } >>> winAttr.functions = MWMConstants.MWM_FUNC_ALL; >>> winAttr.isResizable = true; //target.isResizable(); >>> --- old/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java 2014-01-17 12:51:37.000000000 -0800 >>> +++ new/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java 2014-01-17 12:51:37.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2003, 2014, 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 >>> @@ -1005,6 +1005,7 @@ >>> } >>> } >>> >>> + @SuppressWarnings("static") >>> private void notifyProtocolListener(XWindow xwindow, int x, int y, >>> int dropAction, >>> XClientMessageEvent xclient, >>> @@ -1147,7 +1148,7 @@ >>> event while it still can be referenced from other Java events. */ >>> { >>> XClientMessageEvent copy = new XClientMessageEvent(); >>> - unsafe.copyMemory(xclient.pData, copy.pData, copy.getSize()); >>> + unsafe.copyMemory(xclient.pData, copy.pData, XClientMessageEvent.getSize()); >>> >>> copy.set_data(0, xclient.get_window()); >>> >>> --- old/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java 2014-01-17 12:51:37.000000000 -0800 >>> +++ new/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java 2014-01-17 12:51:37.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2003, 2014, 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 >>> @@ -654,9 +654,9 @@ >>> if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { >>> xembedLog.finer("Client message to embedder: " + msg); >>> } >>> - if (msg.get_message_type() == xembed.XEmbed.getAtom()) { >>> + if (msg.get_message_type() == XEmbedHelper.XEmbed.getAtom()) { >>> if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { >>> - xembedLog.fine(xembed.XEmbedMessageToString(msg)); >>> + xembedLog.fine(XEmbedHelper.XEmbedMessageToString(msg)); >>> } >>> } >>> if (isXEmbedActive()) { >>> --- old/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java 2014-01-17 12:51:38.000000000 -0800 >>> +++ new/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java 2014-01-17 12:51:38.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2003, 2014, 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 >>> @@ -647,7 +647,7 @@ >>> public void dispatchEvent(XEvent ev) { >>> if (ev.get_type() == ClientMessage) { >>> XClientMessageEvent msg = ev.get_xclient(); >>> - if (msg.get_message_type() == xembed.XEmbed.getAtom()) { >>> + if (msg.get_message_type() == XEmbedHelper.XEmbed.getAtom()) { >>> if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { >>> xembedLog.fine("Embedded message: " + XEmbedHelper.msgidToString((int)msg.get_data(1))); >>> } >>> --- old/src/solaris/classes/sun/awt/X11/XFramePeer.java 2014-01-17 12:51:39.000000000 -0800 >>> +++ new/src/solaris/classes/sun/awt/X11/XFramePeer.java 2014-01-17 12:51:38.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2002, 2014, 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 >>> @@ -67,9 +67,9 @@ >>> undecorated = Boolean.valueOf(target.isUndecorated()); >>> winAttr.nativeDecor = !target.isUndecorated(); >>> if (winAttr.nativeDecor) { >>> - winAttr.decorations = winAttr.AWT_DECOR_ALL; >>> + winAttr.decorations = XWindowAttributesData.AWT_DECOR_ALL; >>> } else { >>> - winAttr.decorations = winAttr.AWT_DECOR_NONE; >>> + winAttr.decorations = XWindowAttributesData.AWT_DECOR_NONE; >>> } >>> winAttr.functions = MWMConstants.MWM_FUNC_ALL; >>> winAttr.isResizable = true; // target.isResizable(); >>> --- old/src/solaris/classes/sun/awt/X11/XToolkit.java 2014-01-17 12:51:39.000000000 -0800 >>> +++ new/src/solaris/classes/sun/awt/X11/XToolkit.java 2014-01-17 12:51:39.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2002, 2014, 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 >>> @@ -1542,7 +1542,7 @@ >>> */ >>> if (desktopProperties.get(SunToolkit.DESKTOPFONTHINTS) == null) { >>> if (XWM.isKDE2()) { >>> - Object hint = fcManager.getFontConfigAAHint(); >>> + Object hint = FontConfigManager.getFontConfigAAHint(); >>> if (hint != null) { >>> /* set the fontconfig/KDE property so that >>> * getDesktopHints() below will see it >>> --- old/src/solaris/classes/sun/font/FcFontConfiguration.java 2014-01-17 12:51:40.000000000 -0800 >>> +++ new/src/solaris/classes/sun/font/FcFontConfiguration.java 2014-01-17 12:51:39.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2008, 2014, 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 >>> @@ -441,7 +441,7 @@ >>> try { >>> fcVersion = Integer.parseInt(fcVersionStr); >>> if (fcVersion != 0 && >>> - fcVersion != fcm.getFontConfigVersion()) { >>> + fcVersion != FontConfigManager.getFontConfigVersion()) { >>> return; >>> } >>> } catch (Exception e) { >>> --- old/src/solaris/classes/sun/font/X11TextRenderer.java 2014-01-17 12:51:40.000000000 -0800 >>> +++ new/src/solaris/classes/sun/font/X11TextRenderer.java 2014-01-17 12:51:40.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. >>> + * Copyright (c) 2000, 2014, 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 >>> @@ -57,11 +57,11 @@ >>> super.drawGlyphVector(sg2d, g, x, y); >>> return; >>> case SunHints.INTVAL_TEXT_ANTIALIAS_ON: >>> - sg2d.surfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y); >>> + SurfaceData.aaTextRenderer.drawGlyphVector(sg2d, g, x, y); >>> return; >>> case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB: >>> case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB: >>> - sg2d.surfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y); >>> + SurfaceData.lcdTextRenderer.drawGlyphVector(sg2d, g, x, y); >>> return; >>> default: >>> } >>> >>> >>> On 01/17/2014 11:30 AM, Joe Darcy wrote: >>>> Hi Sergey, >>>> >>>> On 01/17/2014 02:28 AM, Sergey Bylokhov wrote: >>>>> Hello, Joe. >>>>> Some comments: >>>>> - in the SunDropTargetContextPeer.java file header changed only >>>> Reverted. >>>> >>>>> - Incorrect modification of if statement in D3DSurfaceDataProxy.java >>>> Fixed. >>>> >>>>> - It is not necessary to use class name in StyledEditorKit.java and HTMLEditorKit.java, because defaultActions is a private static field and it can be accessed directly. >>>> Improved. >>>> >>>> New webrev: >>>> >>>> http://cr.openjdk.java.net/~darcy/8032047.2 >>>> >>>> Thanks for the review, >>>> >>>> -Joe >>>> >>>>> On 17.01.2014 11:31, Joe Darcy wrote: >>>>>> Hi Petr, >>>>>> >>>>>> On 01/16/2014 11:20 PM, Petr Pchelko wrote: >>>>>>> Hello, Joe. >>>>>>> >>>>>>> A couple of small comments: >>>>>>> >>>>>>> AffineTransformOp.java: Could you please split a long line #241 >>>>>> Done. >>>>>> >>>>>>> ClipboardTransferable.java: You can safely remove the DataTransferer.getInstance in this place. >>>>>>> The DataTransferer is a singleton and it's already created by this time. >>>>>>> >>>>>>> SunDragSourceContextPeer.java: same here, you can safely remove the getInstance >>>>>> Changed. >>>>>> >>>>>>> D3DDrawImage.java: you've mistyped the copyright update. >>>>>> Fixed. >>>>>> >>>>>>> D3DSurfaceDataProxy.java: Why did you choose to suppress a warning here? the getD3DDevice is >>>>>>> just a getter, it does not allocate new object and has no side effects.. >>>>>> Changed. >>>>>> >>>>>> Revised webrev at >>>>>> >>>>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>>>> >>>>>> Thanks for the careful review, >>>>>> >>>>>> -Joe >>>>>> >>>>>>> With best regards. Petr. >>>>>>> >>>>>>> On 17.01.2014, at 10:55, Joe Darcy wrote: >>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> Please view my proposed fix for >>>>>>>> >>>>>>>> JDK-8032047: Fix static lint warnings in client libraries >>>>>>>> http://cr.openjdk.java.net/~darcy/8032047.0/ >>>>>>>> >>>>>>>> Mostly this fix consisted of just replacing a variable name with the class name mentioned by javac in the warning message. In a few cases where the expression allocated a new object, I choose to just suppress the warning since I didn't feel motivated to analyze the possible side-effects of the allocation. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> -Joe >>>>>>>> >>>>> >>> g >> >> -- >> Best regards, Sergey. >> From joe.darcy at oracle.com Fri Jan 17 23:24:59 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 17 Jan 2014 15:24:59 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D9B3AE.4070109@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> <52D984D5.2050307@oracle.com> <52D99CE3.4000602@oracle.com> <52D9A4D5.1050306@oracle.com> <644C04B0-67ED-456D-97A3-F86171BF54AC@oracle.com> <52D9B3AE.4070109@oracle.com> Message-ID: <52D9BBCB.7090502@oracle.com> Hello, An update, good news / bad news from the jprt job; the jprt job failed, but there was only a single missed instance of a static warning in the sources to the jdk repo: src\windows\classes\sun\java2d\d3d\D3DSurfaceData.java:741: warning: [static] static method should be qualified by type name, D3DRenderQueue, instead of by an expression if (rq.isRenderQueueThread()) { ^ I plan to fix it accordingly: @@ -738,7 +738,7 @@ D3DRenderQueue rq = D3DRenderQueue.getInstance(); // swapBuffers can be called from the toolkit thread by swing, we // should detect this and prevent the deadlocks - if (rq.isRenderQueueThread()) { + if (D3DRenderQueue.isRenderQueueThread()) { if (!rq.tryLock()) { // if we could not obtain the lock, repaint the area // that was supposed to be swapped, and no-op this swap Given that the builds were otherwise successful, I plan to get a fix for JDK-8032048: Add static lint warning to build of jdk repository reviewed and then push JDK-8032047 and JDK-8032048 together in a single jprt job. Thanks, -Joe On 01/17/2014 02:50 PM, Joe Darcy wrote: > Hello, > > I've had a jprt job submitted to make sure that aren't any > cross-platform build issues (and to flush out any other static > warnings in the code base). > > If the jprt is successful, I'll push the changes proposed so far. > > Thanks Petr and Sergey for the reviews, > > -Joe > > On 01/17/2014 02:12 PM, Petr Pchelko wrote: >> Hello, Joe. >> >> The final version still looks good. >> >> With best regards. Petr. >> >> 18 ???. 2014 ?., ? 1:47 ?? ???????, Sergey Bylokhov >> ???????(?): >> >>> Hello, Joe. >>> This version looks good to me too. >>> From Sergey.Bylokhov at oracle.com Fri Jan 17 23:45:22 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Sat, 18 Jan 2014 03:45:22 +0400 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D9BBCB.7090502@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> <52D984D5.2050307@oracle.com> <52D99CE3.4000602@oracle.com> <52D9A4D5.1050306@oracle.com> <644C04B0-67ED-456D-97A3-F86171BF54AC@oracle.com> <52D9B3AE.4070109@oracle.com> <52D9BBCB.7090502@oracle.com> Message-ID: <52D9C092.7040802@oracle.com> Fix looks fine. Does this option will apply to the open and closed builds? Since openjdk can use some source code, which was not compiled in oraclejdk. On 18.01.2014 3:24, Joe Darcy wrote: > Hello, > > An update, good news / bad news from the jprt job; the jprt job > failed, but there was only a single missed instance of a static > warning in the sources to the jdk repo: > > src\windows\classes\sun\java2d\d3d\D3DSurfaceData.java:741: warning: > [static] static method should be qualified by type name, > D3DRenderQueue, instead of by an expression > if (rq.isRenderQueueThread()) { > ^ > > I plan to fix it accordingly: > > @@ -738,7 +738,7 @@ > D3DRenderQueue rq = D3DRenderQueue.getInstance(); > // swapBuffers can be called from the toolkit thread by > swing, we > // should detect this and prevent the deadlocks > - if (rq.isRenderQueueThread()) { > + if (D3DRenderQueue.isRenderQueueThread()) { > if (!rq.tryLock()) { > // if we could not obtain the lock, repaint the area > // that was supposed to be swapped, and no-op this swap > > Given that the builds were otherwise successful, I plan to get a fix for > > JDK-8032048: Add static lint warning to build of jdk repository > > reviewed and then push JDK-8032047 and JDK-8032048 together in a > single jprt job. > > Thanks, > > -Joe > > > On 01/17/2014 02:50 PM, Joe Darcy wrote: >> Hello, >> >> I've had a jprt job submitted to make sure that aren't any >> cross-platform build issues (and to flush out any other static >> warnings in the code base). >> >> If the jprt is successful, I'll push the changes proposed so far. >> >> Thanks Petr and Sergey for the reviews, >> >> -Joe >> >> On 01/17/2014 02:12 PM, Petr Pchelko wrote: >>> Hello, Joe. >>> >>> The final version still looks good. >>> >>> With best regards. Petr. >>> >>> 18 ???. 2014 ?., ? 1:47 ?? ???????, Sergey Bylokhov >>> ???????(?): >>> >>>> Hello, Joe. >>>> This version looks good to me too. >>>> > -- Best regards, Sergey. From joe.darcy at oracle.com Sat Jan 18 00:01:30 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 17 Jan 2014 16:01:30 -0800 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032047: Fix static lint warnings in client libraries In-Reply-To: <52D9C092.7040802@oracle.com> References: <52D8D3CA.9040409@oracle.com> <5D967AB9-C9A4-46BA-B059-91533BD2CC07@oracle.com> <52D8DC4E.8050906@oracle.com> <52D905B0.40509@oracle.com> <52D984D5.2050307@oracle.com> <52D99CE3.4000602@oracle.com> <52D9A4D5.1050306@oracle.com> <644C04B0-67ED-456D-97A3-F86171BF54AC@oracle.com> <52D9B3AE.4070109@oracle.com> <52D9BBCB.7090502@oracle.com> <52D9C092.7040802@oracle.com> Message-ID: <52D9C45A.3050300@oracle.com> Hi Sergey, On 01/17/2014 03:45 PM, Sergey Bylokhov wrote: > Fix looks fine. > Does this option will apply to the open and closed builds? Since > openjdk can use some source code, which was not compiled in oraclejdk. The javac options set in $JDK/make/Setup.gmk apply to both the open and closed sources associated with the jdk repository, including any platform-dependent code. Therefore, when increasing the set of lint warnings, doing cross-platform closed builds is required too in case some of that code is afflicted by the warning in questions. My setup I typically use for development is an OpenJDK-only Linux laptop. A build on my laptop succeeds with the latest patch for 8032047 and the jprt job would succeed too with the additional change in D3DSurfaceData.java. I *think* that should cover all the relevant build combinations. Do you think another flavor of build needs to be done too? Thanks, -Joe > > On 18.01.2014 3:24, Joe Darcy wrote: >> Hello, >> >> An update, good news / bad news from the jprt job; the jprt job >> failed, but there was only a single missed instance of a static >> warning in the sources to the jdk repo: >> >> src\windows\classes\sun\java2d\d3d\D3DSurfaceData.java:741: warning: >> [static] static method should be qualified by type name, >> D3DRenderQueue, instead of by an expression >> if (rq.isRenderQueueThread()) { >> ^ >> >> I plan to fix it accordingly: >> >> @@ -738,7 +738,7 @@ >> D3DRenderQueue rq = D3DRenderQueue.getInstance(); >> // swapBuffers can be called from the toolkit thread by >> swing, we >> // should detect this and prevent the deadlocks >> - if (rq.isRenderQueueThread()) { >> + if (D3DRenderQueue.isRenderQueueThread()) { >> if (!rq.tryLock()) { >> // if we could not obtain the lock, repaint the area >> // that was supposed to be swapped, and no-op this swap >> >> Given that the builds were otherwise successful, I plan to get a fix for >> >> JDK-8032048: Add static lint warning to build of jdk repository >> >> reviewed and then push JDK-8032047 and JDK-8032048 together in a >> single jprt job. >> >> Thanks, >> >> -Joe >> >> >> On 01/17/2014 02:50 PM, Joe Darcy wrote: >>> Hello, >>> >>> I've had a jprt job submitted to make sure that aren't any >>> cross-platform build issues (and to flush out any other static >>> warnings in the code base). >>> >>> If the jprt is successful, I'll push the changes proposed so far. >>> >>> Thanks Petr and Sergey for the reviews, >>> >>> -Joe >>> >>> On 01/17/2014 02:12 PM, Petr Pchelko wrote: >>>> Hello, Joe. >>>> >>>> The final version still looks good. >>>> >>>> With best regards. Petr. >>>> >>>> 18 ???. 2014 ?., ? 1:47 ?? ???????, Sergey Bylokhov >>>> ???????(?): >>>> >>>>> Hello, Joe. >>>>> This version looks good to me too. >>>>> >> > > From alexandr.scherbatiy at oracle.com Mon Jan 20 13:50:21 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Mon, 20 Jan 2014 17:50:21 +0400 Subject: [9] Review request for 8008657 JSpinner setComponentOrientation doesn't affect on text orientation Message-ID: <52DD299D.2070803@oracle.com> Hello, Could you review the fix: bug: https://bugs.openjdk.java.net/browse/JDK-8008657 webrev: http://cr.openjdk.java.net/~alexsch/8008657/webrev.00 The "componentOrientation" property change event should be propagated to the JSpinner editor component. Thanks, Alexandr. From alexandr.scherbatiy at oracle.com Wed Jan 22 11:13:22 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 22 Jan 2014 15:13:22 +0400 Subject: [8] Review request for 8032063 Exposing non public API by javax.swing.plaf.metal.MetalFileChooserUI$FilterComboBoxModel Message-ID: <52DFA7D2.1090603@oracle.com> Hello, Could you review the rollback of the fix 8022398: bug: https://bugs.openjdk.java.net/browse/JDK-8032063 webrev: http://cr.openjdk.java.net/~alexsch/8032063/webrev.01 The fix for the 8022398 exposes an internal class sun.swing.AbstractFilterComboBoxModel as a public API. Thanks, Alexandr. From petr.pchelko at oracle.com Wed Jan 22 11:33:19 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Wed, 22 Jan 2014 15:33:19 +0400 Subject: [8] Review request for 8032063 Exposing non public API by javax.swing.plaf.metal.MetalFileChooserUI$FilterComboBoxModel In-Reply-To: <52DFA7D2.1090603@oracle.com> References: <52DFA7D2.1090603@oracle.com> Message-ID: <45E17CF5-35E5-430E-AADA-658973B5F9A9@oracle.com> Hello, Alexander. The fix looks good to me. With best regards. Petr. On 22.01.2014, at 15:13, Alexander Scherbatiy wrote: > > Hello, > > Could you review the rollback of the fix 8022398: > > bug: https://bugs.openjdk.java.net/browse/JDK-8032063 > webrev: http://cr.openjdk.java.net/~alexsch/8032063/webrev.01 > > The fix for the 8022398 exposes an internal class sun.swing.AbstractFilterComboBoxModel as a public API. > > Thanks, > Alexandr. > From Sergey.Bylokhov at oracle.com Wed Jan 22 11:30:14 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Wed, 22 Jan 2014 15:30:14 +0400 Subject: [8] Review request for 8032063 Exposing non public API by javax.swing.plaf.metal.MetalFileChooserUI$FilterComboBoxModel In-Reply-To: <45E17CF5-35E5-430E-AADA-658973B5F9A9@oracle.com> References: <52DFA7D2.1090603@oracle.com> <45E17CF5-35E5-430E-AADA-658973B5F9A9@oracle.com> Message-ID: <52DFABC6.70102@oracle.com> The fix looks good to me too. On 22.01.2014 15:33, Petr Pchelko wrote: > Hello, Alexander. > > The fix looks good to me. > > With best regards. Petr. > > On 22.01.2014, at 15:13, Alexander Scherbatiy wrote: > >> Hello, >> >> Could you review the rollback of the fix 8022398: >> >> bug: https://bugs.openjdk.java.net/browse/JDK-8032063 >> webrev: http://cr.openjdk.java.net/~alexsch/8032063/webrev.01 >> >> The fix for the 8022398 exposes an internal class sun.swing.AbstractFilterComboBoxModel as a public API. >> >> Thanks, >> Alexandr. >> -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Wed Jan 22 14:00:26 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Wed, 22 Jan 2014 18:00:26 +0400 Subject: [9] Review request for 8008657 JSpinner setComponentOrientation doesn't affect on text orientation In-Reply-To: <52DD299D.2070803@oracle.com> References: <52DD299D.2070803@oracle.com> Message-ID: <52DFCEFA.9020108@oracle.com> Hello, Alexander. Is updateUI needed to fix the problem? Since applyComponentOrientation calls invalidateIfValid anyway. On 20.01.2014 17:50, Alexander Scherbatiy wrote: > > Hello, > > Could you review the fix: > bug: https://bugs.openjdk.java.net/browse/JDK-8008657 > webrev: http://cr.openjdk.java.net/~alexsch/8008657/webrev.00 > > The "componentOrientation" property change event should be propagated > to the JSpinner editor component. > > Thanks, > Alexandr. > -- Best regards, Sergey. From alexandr.scherbatiy at oracle.com Wed Jan 22 15:23:00 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Wed, 22 Jan 2014 19:23:00 +0400 Subject: Setting a component orientation in JRSUI Message-ID: <52DFE254.7040408@oracle.com> Hello, Below is the code that shows that setting a component orientation for the JProgressBar in Aqua L&F does not work. My assumption was that the Direction should be properly set to the painter state in the AquaProgressBarUI like: ----------------------------- public void paint(final Graphics g, final JComponent c) { ... painter.state.set(c.getComponentOrientation().isLeftToRight() ? Direction.RIGHT : Direction.LEFT); } ----------------------------- but it does not work. The painter calls the JRSUI library to show components on Mac OS X. Is there any specification for the JRSUI library? What is the right way to set the component direction in the JRSUI. Thanks, Alexandr. ------------------ Code Sample ---------- import java.awt.*; import java.awt.event.*; import javax.swing.*; public class JProgressBarOrientationTest { static boolean leftToRight = true; public static void main(String[] args) throws Exception { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JFrame frame = new JFrame(); frame.setSize(300, 200); final JProgressBar progressBar = new JProgressBar(0, 100); progressBar.setValue(30); progressBar.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); JButton button = new JButton("Change orientation"); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { leftToRight = !leftToRight; progressBar.setComponentOrientation(leftToRight ? ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT); } }); JPanel panel = new JPanel(new BorderLayout()); panel.add(progressBar, BorderLayout.CENTER); panel.add(button, BorderLayout.SOUTH); frame.getContentPane().add(panel); frame.setVisible(true); } }); } } ------------------------------------- From alexandr.scherbatiy at oracle.com Thu Jan 23 15:06:59 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 23 Jan 2014 19:06:59 +0400 Subject: [9] Review request for 8008657 JSpinner setComponentOrientation doesn't affect on text orientation In-Reply-To: <52DFCEFA.9020108@oracle.com> References: <52DD299D.2070803@oracle.com> <52DFCEFA.9020108@oracle.com> Message-ID: <52E13013.3060500@oracle.com> Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8008657/webrev.01 - revalidate()/repaint() is added after component orientation applying in the same way as it is done for the JTextFiled - there is one more issue that a text in the Number editor should stick to the arrows. It is fixed in the NumberEditor class. Thanks, Alexandr. On 1/22/2014 6:00 PM, Sergey Bylokhov wrote: > Hello, Alexander. > Is updateUI needed to fix the problem? Since applyComponentOrientation > calls invalidateIfValid anyway. > > On 20.01.2014 17:50, Alexander Scherbatiy wrote: >> >> Hello, >> >> Could you review the fix: >> bug: https://bugs.openjdk.java.net/browse/JDK-8008657 >> webrev: http://cr.openjdk.java.net/~alexsch/8008657/webrev.00 >> >> The "componentOrientation" property change event should be >> propagated to the JSpinner editor component. >> >> Thanks, >> Alexandr. >> > > From Sergey.Bylokhov at oracle.com Thu Jan 23 22:21:15 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 24 Jan 2014 02:21:15 +0400 Subject: [9] Review request for 8008657 JSpinner setComponentOrientation doesn't affect on text orientation In-Reply-To: <52E13013.3060500@oracle.com> References: <52DD299D.2070803@oracle.com> <52DFCEFA.9020108@oracle.com> <52E13013.3060500@oracle.com> Message-ID: <52E195DB.8020107@oracle.com> Hi, Alexander. Why the change in the BasicSpinnerUI is required? Can we call a revalidate/repaint in the JSpinner.setComponentOrientation()? Note that JSpinner is a JComponent which is Container, so when you call applyComponentOrientation on it you apply new orientation to the whole JSpinner hierarchy, and it looks wrong.(I know that it is unlikely). On 23.01.2014 19:06, Alexander Scherbatiy wrote: > > > Could you review the updated fix: > http://cr.openjdk.java.net/~alexsch/8008657/webrev.01 > > - revalidate()/repaint() is added after component orientation > applying in the same way as it is done for the JTextFiled > - there is one more issue that a text in the Number editor should > stick to the arrows. It is fixed in the NumberEditor class. > > Thanks, > Alexandr. > > On 1/22/2014 6:00 PM, Sergey Bylokhov wrote: >> Hello, Alexander. >> Is updateUI needed to fix the problem? Since >> applyComponentOrientation calls invalidateIfValid anyway. >> >> On 20.01.2014 17:50, Alexander Scherbatiy wrote: >>> >>> Hello, >>> >>> Could you review the fix: >>> bug: https://bugs.openjdk.java.net/browse/JDK-8008657 >>> webrev: http://cr.openjdk.java.net/~alexsch/8008657/webrev.00 >>> >>> The "componentOrientation" property change event should be >>> propagated to the JSpinner editor component. >>> >>> Thanks, >>> Alexandr. >>> >> >> > -- Best regards, Sergey. From joe.darcy at oracle.com Fri Jan 24 06:50:48 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 23 Jan 2014 22:50:48 -0800 Subject: JDK 9 RFR of 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes Message-ID: <52E20D48.1030900@oracle.com> Hello, As part of the JDK 9 warnings cleanup, for all the javax.swing classes which stated "Serialized objects of this class will not be compatible with future Swing releases. ..." I've added a @SuppressWarnings("serial") annotation if one was not already present: http://cr.openjdk.java.net/~darcy/8032627.0/ Thanks, -Joe From alexandr.scherbatiy at oracle.com Fri Jan 24 10:14:07 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 24 Jan 2014 14:14:07 +0400 Subject: [9] Review request for 8008657 JSpinner setComponentOrientation doesn't affect on text orientation In-Reply-To: <52E195DB.8020107@oracle.com> References: <52DD299D.2070803@oracle.com> <52DFCEFA.9020108@oracle.com> <52E13013.3060500@oracle.com> <52E195DB.8020107@oracle.com> Message-ID: <52E23CEF.1000801@oracle.com> Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8008657/webrev.02/ The applyComponentOrientation() method is only invoked for the spinner editor. On 1/24/2014 2:21 AM, Sergey Bylokhov wrote: > Hi, Alexander. > Why the change in the BasicSpinnerUI is required? Can we call a > revalidate/repaint in the JSpinner.setComponentOrientation()? All of the wing classes use the revalidate/repaint for the "componentOrientation" event in L&Fs. Using it in JSpinner.setComponentOrientation() makes a mess in the "componentOrientation" event handling. I think that we should use the unified way in this case. If using revalidate/repaint in L&F for property updating is totally wrong (which is used a lot, see redrawList() for BasicListUI or modelChanged() for BasicTextUI and others) then it is better to file a new issue about events handling refactoring in Swing classes/L&Fs > Note that JSpinner is a JComponent which is Container, so when you > call applyComponentOrientation on it you apply new orientation to the > whole JSpinner hierarchy, and it looks wrong.(I know that it is > unlikely). The only way it can be done in this case is invoking the applyComponentOrientation() for the spinner editor. The editor can be any JComponent. We can go further and check if the editor is the DefaultEditor and set the component orientation only for the editor text field. However, it seems possible that a user can add some other components to the DefaultEditor. Thanks, Alexandr. > > On 23.01.2014 19:06, Alexander Scherbatiy wrote: >> >> >> Could you review the updated fix: >> http://cr.openjdk.java.net/~alexsch/8008657/webrev.01 >> >> - revalidate()/repaint() is added after component orientation >> applying in the same way as it is done for the JTextFiled >> - there is one more issue that a text in the Number editor should >> stick to the arrows. It is fixed in the NumberEditor class. >> >> Thanks, >> Alexandr. >> >> On 1/22/2014 6:00 PM, Sergey Bylokhov wrote: >>> Hello, Alexander. >>> Is updateUI needed to fix the problem? Since >>> applyComponentOrientation calls invalidateIfValid anyway. >>> >>> On 20.01.2014 17:50, Alexander Scherbatiy wrote: >>>> >>>> Hello, >>>> >>>> Could you review the fix: >>>> bug: https://bugs.openjdk.java.net/browse/JDK-8008657 >>>> webrev: http://cr.openjdk.java.net/~alexsch/8008657/webrev.00 >>>> >>>> The "componentOrientation" property change event should be >>>> propagated to the JSpinner editor component. >>>> >>>> Thanks, >>>> Alexandr. >>>> >>> >>> >> > > From alexandr.scherbatiy at oracle.com Fri Jan 24 10:16:00 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 24 Jan 2014 14:16:00 +0400 Subject: JDK 9 RFR of 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes In-Reply-To: <52E20D48.1030900@oracle.com> References: <52E20D48.1030900@oracle.com> Message-ID: <52E23D60.9020502@oracle.com> The fix looks good. Thanks, Alexandr. On 1/24/2014 10:50 AM, Joe Darcy wrote: > Hello, > > As part of the JDK 9 warnings cleanup, for all the javax.swing classes > which stated > > "Serialized objects of this class will not be compatible with > future Swing releases. ..." > > I've added a @SuppressWarnings("serial") annotation if one was not > already present: > > http://cr.openjdk.java.net/~darcy/8032627.0/ > > Thanks, > > -Joe From Alan.Bateman at oracle.com Fri Jan 24 11:41:43 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 24 Jan 2014 11:41:43 +0000 Subject: JDK 9 RFR of 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes In-Reply-To: <52E20D48.1030900@oracle.com> References: <52E20D48.1030900@oracle.com> Message-ID: <52E25177.4080709@oracle.com> On 24/01/2014 06:50, Joe Darcy wrote: > Hello, > > As part of the JDK 9 warnings cleanup, for all the javax.swing classes > which stated > > "Serialized objects of this class will not be compatible with > future Swing releases. ..." > > I've added a @SuppressWarnings("serial") annotation if one was not > already present: > > http://cr.openjdk.java.net/~darcy/8032627.0/ Given the warning in the javadoc then it's surprising that @SuppressWarnings("serial") wasn't there previously. In any case, the change looks okay to me. As I don't know this area then I can't of course say whether there are any others that need this. -Alan From joe.darcy at oracle.com Sat Jan 25 19:10:36 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Sat, 25 Jan 2014 11:10:36 -0800 Subject: JDK 9 RFR of JDK-8032733: Fix cast lint warnings in client libraries Message-ID: <52E40C2C.8070503@oracle.com> Hello, Please review my large, but largely straightforward, changes to fix JDK-8032733: Fix cast lint warnings in client libraries http://cr.openjdk.java.net/~darcy/8032733.0/ Many of the changes were enabled by the clone method of an array being redefined to return the array's type rather than object; IIRC, this was part of the generics set of language changes back in Java SE 5. With these changes as-is, an open-only Linux build succeeds with the "cast" warning enabled and fatal during the build. The build aspects of these changes have already been approved on the build-dev list. I will submit a jprt job before pushing to flush out any other cast instances that need to be corrected; I'll send out another review request for any incremental changes. Alan, there are some non-client changes mixed in here too. Thanks, -Joe From Alan.Bateman at oracle.com Sun Jan 26 09:30:12 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sun, 26 Jan 2014 09:30:12 +0000 Subject: JDK 9 RFR of JDK-8032733: Fix cast lint warnings in client libraries In-Reply-To: <52E40C2C.8070503@oracle.com> References: <52E40C2C.8070503@oracle.com> Message-ID: <52E4D5A4.4040104@oracle.com> On 25/01/2014 19:10, Joe Darcy wrote: > Hello, > > Please review my large, but largely straightforward, changes to fix > > JDK-8032733: Fix cast lint warnings in client libraries > http://cr.openjdk.java.net/~darcy/8032733.0/ > > Many of the changes were enabled by the clone method of an array being > redefined to return the array's type rather than object; IIRC, this > was part of the generics set of language changes back in Java SE 5. > > With these changes as-is, an open-only Linux build succeeds with the > "cast" warning enabled and fatal during the build. The build aspects > of these changes have already been approved on the build-dev list. I > will submit a jprt job before pushing to flush out any other cast > instances that need to be corrected; I'll send out another review > request for any incremental changes. > > Alan, there are some non-client changes mixed in here too. The only non-client changes that I see are to Setup.gmk (previously reviewed on build-dev) and Sdp.java. The update to Sdp.java looks okay. It might actually be possible to put the statement on one line now (at least I assume it was the cast that caused this to spill over into a second line originally). I skimmed over the patch file looking at the other changes and don't see anything obviously wrong. For cases like this then the real test is whether it compiles (and given the platform code here then it means checking all platforms and builds). As a side point, client changes have been going into jdk9/client rather than jdk9/dev so I just wonder if there might be changes backed up in jdk9/client that might cause issues when merged. -Alan From Alan.Bateman at oracle.com Mon Jan 27 08:04:54 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 27 Jan 2014 08:04:54 +0000 Subject: JDK 9 RFR of JDK-8032733: Fix cast lint warnings in client libraries In-Reply-To: <52E4D5A4.4040104@oracle.com> References: <52E40C2C.8070503@oracle.com> <52E4D5A4.4040104@oracle.com> Message-ID: <52E61326.20003@oracle.com> On 26/01/2014 09:30, Alan Bateman wrote: > The only non-client changes that I see are to Setup.gmk (previously > reviewed on build-dev) and Sdp.java. I see the others now, just hard to spot in a large mind-numbing patch :-) All looks good but as I look at this again then I see a few Iterator usages where it might be as quick to just replace the iteration with for-each. One example is ProxyClient. getGarbageCollectorMXBeans, another one might be XOpenTypeView.load. I realize it's going a bit beyond eliminating casts but it's an alternative for a couple of these. -Alan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.darcy at oracle.com Mon Jan 27 19:52:14 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 27 Jan 2014 11:52:14 -0800 Subject: JDK 9 RFR of JDK-8032733: Fix cast lint warnings in client libraries In-Reply-To: <52E61326.20003@oracle.com> References: <52E40C2C.8070503@oracle.com> <52E4D5A4.4040104@oracle.com> <52E61326.20003@oracle.com> Message-ID: <52E6B8EE.9010908@oracle.com> On 01/27/2014 12:04 AM, Alan Bateman wrote: > On 26/01/2014 09:30, Alan Bateman wrote: >> The only non-client changes that I see are to Setup.gmk (previously >> reviewed on build-dev) and Sdp.java. > I see the others now, just hard to spot in a large mind-numbing patch :-) > > All looks good but as I look at this again then I see a few Iterator > usages where it might be as quick to just replace the iteration with > for-each. One example is ProxyClient. getGarbageCollectorMXBeans, > another one might be XOpenTypeView.load. I realize it's going a bit > beyond eliminating casts but it's an alternative for a couple of these. > > -Alan. Hello, Alan, I strongly prefer to limit this patch to just cast cleanup. However, I fully support broader cleanup of this code and other code in the jdk repo; many of these files haven't been touched in over a decade and would certainly benefit from some care and attention! I suggest interested parties do additional cleanup work using the same methodology Paul Sandoz and Brian Goetz have been using in core libs and langtools: sending out IDE-driven single-issue changes to review. I think that keeps the reviews easier and decreases the likelihood of problems being introduced. Based on the results of an exploratory jprt job, listed below is the incremental patch to address the remaining platform-specific cast warnings in open code that wasn't covered in the original webrev. Revised full webrev uploaded to http://cr.openjdk.java.net/~darcy/8032733.1/ There are also a number of closed source files which need to be updated for a cast-free build to succeed; I'll be requesting internal reviews for those changes. Thanks, -Joe --- old/src/macosx/classes/apple/security/KeychainStore.java 2014-01-27 11:17:51.000000000 -0800 +++ new/src/macosx/classes/apple/security/KeychainStore.java 2014-01-27 11:17:50.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -248,7 +248,7 @@ if (((KeyEntry)entry).chain == null) { return null; } else { - return (Certificate[])((KeyEntry)entry).chain.clone(); + return ((KeyEntry)entry).chain.clone(); } } else { return null; @@ -365,7 +365,7 @@ throw new KeyStoreException("Certificate chain does not validate"); } - entry.chain = (Certificate[])chain.clone(); + entry.chain = chain.clone(); entry.chainRefs = new long[entry.chain.length]; } @@ -429,7 +429,7 @@ if ((chain != null) && (chain.length != 0)) { - entry.chain = (Certificate[])chain.clone(); + entry.chain = chain.clone(); entry.chainRefs = new long[entry.chain.length]; } @@ -1122,7 +1122,7 @@ throw uke; } - return ((byte[])key); + return key; } --- old/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java 2014-01-27 11:17:51.000000000 -0800 +++ new/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java 2014-01-27 11:17:51.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -640,7 +640,7 @@ if (onEventThread) { try { EventQueue.invokeAndWait(r); } catch (java.lang.reflect.InvocationTargetException ite) { - Throwable te = (Throwable)ite.getTargetException(); + Throwable te = ite.getTargetException(); if (te instanceof PrinterException) throw (PrinterException)te; else te.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } --- old/src/macosx/classes/sun/font/CFontManager.java 2014-01-27 11:17:52.000000000 -0800 +++ new/src/macosx/classes/sun/font/CFontManager.java 2014-01-27 11:17:51.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -76,7 +76,7 @@ // This is a way to register any kind of Font2D, not just files and composites. public static Font2D[] getGenericFonts() { - return (Font2D[])genericFonts.values().toArray(new Font2D[0]); + return genericFonts.values().toArray(new Font2D[0]); } public Font2D registerGenericFont(Font2D f) @@ -117,7 +117,7 @@ } return f; } else { - return (Font2D)genericFonts.get(fontName); + return genericFonts.get(fontName); } } --- old/src/macosx/classes/sun/java2d/CRenderer.java 2014-01-27 11:17:52.000000000 -0800 +++ new/src/macosx/classes/sun/java2d/CRenderer.java 2014-01-27 11:17:52.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -457,7 +457,7 @@ protected boolean blitImage(SunGraphics2D sg2d, Image img, boolean fliph, boolean flipv, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, Color bgColor) { CPrinterSurfaceData surfaceData = (CPrinterSurfaceData)sg2d.getSurfaceData(); - OSXOffScreenSurfaceData imgSurfaceData = (OSXOffScreenSurfaceData) OSXOffScreenSurfaceData.createNewSurface((BufferedImage)img); + OSXOffScreenSurfaceData imgSurfaceData = OSXOffScreenSurfaceData.createNewSurface((BufferedImage)img); surfaceData.blitImage(this, sg2d, imgSurfaceData, fliph, flipv, sx, sy, sw, sh, dx, dy, dw, dh, bgColor); return true; } --- old/src/windows/classes/sun/awt/Win32GraphicsDevice.java 2014-01-27 11:17:53.000000000 -0800 +++ new/src/windows/classes/sun/awt/Win32GraphicsDevice.java 2014-01-27 11:17:52.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -88,7 +88,7 @@ // is run as an NT service. To prevent the loading of ddraw.dll // completely, sun.awt.nopixfmt should be set as well. Apps which use // OpenGL w/ Java probably don't want to set this. - String nopixfmt = (String)java.security.AccessController.doPrivileged( + String nopixfmt = java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction("sun.awt.nopixfmt")); pfDisabled = (nopixfmt != null); initIDs(); --- old/src/windows/classes/sun/awt/windows/WPathGraphics.java 2014-01-27 11:17:53.000000000 -0800 +++ new/src/windows/classes/sun/awt/windows/WPathGraphics.java 2014-01-27 11:17:53.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -94,7 +94,7 @@ private static boolean preferGDITextLayout = false; static { String textLayoutStr = - (String)java.security.AccessController.doPrivileged( + java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction( "sun.java2d.print.enableGDITextLayout")); --- old/src/windows/classes/sun/io/Win32ErrorMode.java 2014-01-27 11:17:54.000000000 -0800 +++ new/src/windows/classes/sun/io/Win32ErrorMode.java 2014-01-27 11:17:54.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -67,7 +67,7 @@ */ public static void initialize() { if (!sun.misc.VM.isBooted()) { - String s = (String) System.getProperty("sun.io.allowCriticalErrorMessageBox"); + String s = System.getProperty("sun.io.allowCriticalErrorMessageBox"); if (s == null || s.equals(Boolean.FALSE.toString())) { long mode = setErrorMode(0); mode |= SEM_FAILCRITICALERRORS; --- old/src/windows/classes/sun/print/Win32PrintJob.java 2014-01-27 11:17:54.000000000 -0800 +++ new/src/windows/classes/sun/print/Win32PrintJob.java 2014-01-27 11:17:54.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -308,12 +308,10 @@ } } - PrinterState prnState = (PrinterState)service.getAttribute( - PrinterState.class); + PrinterState prnState = service.getAttribute(PrinterState.class); if (prnState == PrinterState.STOPPED) { PrinterStateReasons prnStateReasons = - (PrinterStateReasons)service.getAttribute( - PrinterStateReasons.class); + service.getAttribute(PrinterStateReasons.class); if ((prnStateReasons != null) && (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN))) { @@ -321,9 +319,8 @@ } } - if ((PrinterIsAcceptingJobs)(service.getAttribute( - PrinterIsAcceptingJobs.class)) == - PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS) { + if (service.getAttribute(PrinterIsAcceptingJobs.class) == + PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS) { throw new PrintException("Printer is not accepting job."); } --- old/src/windows/classes/sun/print/Win32PrintService.java 2014-01-27 11:17:55.000000000 -0800 +++ new/src/windows/classes/sun/print/Win32PrintService.java 2014-01-27 11:17:55.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -506,8 +506,7 @@ } } else { // if getting MPA failed, we use MediaSize - MediaSize ms = - MediaSize.getMediaSizeForName((MediaSizeName)mediaName); + MediaSize ms = MediaSize.getMediaSizeForName(mediaName); if (ms != null) { try { -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alan.Bateman at oracle.com Mon Jan 27 21:02:21 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 27 Jan 2014 21:02:21 +0000 Subject: JDK 9 RFR of JDK-8032733: Fix cast lint warnings in client libraries In-Reply-To: <52E6B8EE.9010908@oracle.com> References: <52E40C2C.8070503@oracle.com> <52E4D5A4.4040104@oracle.com> <52E61326.20003@oracle.com> <52E6B8EE.9010908@oracle.com> Message-ID: <52E6C95D.6040505@oracle.com> On 27/01/2014 19:52, Joe Darcy wrote: > : > > Alan, I strongly prefer to limit this patch to just cast cleanup. I understand, I was just pointing it out that some of these could use for-each and that would also eliminate the cast. > : > > Based on the results of an exploratory jprt job, listed below is the > incremental patch to address the remaining platform-specific cast > warnings in open code that wasn't covered in the original webrev. I looked through the extra patch that you inlined in the mail and these look good to me (platform specific classes and multiple build variants make it hard to catch everything). -Alan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmouawad at apache.org Mon Jan 27 21:55:24 2014 From: pmouawad at apache.org (Philippe Mouawad) Date: Mon, 27 Jan 2014 22:55:24 +0100 Subject: Scrolling in a JFileChooser file list garbles content Message-ID: Hello, We recently had a bug report on JMeter : - https://issues.apache.org/bugzilla/show_bug.cgi?id=56048 Code is at: https://github.com/apache/jmeter/blob/trunk/src/core/org/apache/jmeter/gui/util/FileDialoger.java Method : public static JFileChooser promptToOpenFile(String[] exts, String existingFileName) Issue happens with: JMeter 2.11 r1554548 Xubuntu 13.10 64-bit java version "1.7.0_25" or java version "1.7.0_51" Are we making a mistake somewhere in our code ? or could it be a know bug ? Thanks for help. Regards Philippe M. Member of Apache JMeter Team @philmdot -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandr.scherbatiy at oracle.com Tue Jan 28 08:52:00 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Tue, 28 Jan 2014 12:52:00 +0400 Subject: Scrolling in a JFileChooser file list garbles content In-Reply-To: References: Message-ID: <52E76FB0.8020706@oracle.com> Hello Philippe, Is the issue reproduced with the FileChooserDemo? http://docs.oracle.com/javase/tutorial/uiswing/examples/components/FileChooserDemoProject/src/components/FileChooserDemo.java Is the issue reproduced only on the reported by the user Xubuntu 13.10 64-bit machine or is it reproduced on other Xubuntu too? Could you provide an additional info about the video adapter name and driver where the issue is reproduced? You can get the necessary information using the following steps: - set the J2D_TRACE_LEVEL=3 environment variable - run the sample where the issue the issue is reproduced There should be an output with the video adapter info during the sample start. Thanks, Alexandr. On 1/28/2014 1:55 AM, Philippe Mouawad wrote: > Hello, > We recently had a bug report on JMeter : > > * https://issues.apache.org/bugzilla/show_bug.cgi?id=56048 > > Code is at: > > https://github.com/apache/jmeter/blob/trunk/src/core/org/apache/jmeter/gui/util/FileDialoger.java > > Method : > > public static JFileChooser promptToOpenFile(String[] exts, String > existingFileName) > > Issue happens with: > > JMeter 2.11r1554548 > Xubuntu 13.10 64-bit > java version "1.7.0_25" or java version "1.7.0_51" > > Are we making a mistake somewhere in our code ? or could it be a know bug ? > > Thanks for help. > > Regards > Philippe M. > Member of Apache JMeter Team > > @philmdot > > From pmouawad at apache.org Tue Jan 28 20:32:34 2014 From: pmouawad at apache.org (Philippe Mouawad) Date: Tue, 28 Jan 2014 21:32:34 +0100 Subject: Scrolling in a JFileChooser file list garbles content In-Reply-To: <52E76FB0.8020706@oracle.com> References: <52E76FB0.8020706@oracle.com> Message-ID: Hello, Thanks for answer. I forwarded message to reporter as I don't have a linux available. Regards Philippe On Tue, Jan 28, 2014 at 9:52 AM, Alexander Scherbatiy < alexandr.scherbatiy at oracle.com> wrote: > > Hello Philippe, > > Is the issue reproduced with the FileChooserDemo? > http://docs.oracle.com/javase/tutorial/uiswing/examples/components/ > FileChooserDemoProject/src/components/FileChooserDemo.java > > Is the issue reproduced only on the reported by the user Xubuntu 13.10 > 64-bit machine or is it reproduced on other Xubuntu too? > > Could you provide an additional info about the video adapter name and > driver where the issue is reproduced? > You can get the necessary information using the following steps: > - set the J2D_TRACE_LEVEL=3 environment variable > - run the sample where the issue the issue is reproduced > There should be an output with the video adapter info during the sample > start. > > Thanks, > Alexandr. > > > On 1/28/2014 1:55 AM, Philippe Mouawad wrote: > >> Hello, >> We recently had a bug report on JMeter : >> >> * https://issues.apache.org/bugzilla/show_bug.cgi?id=56048 >> >> >> Code is at: >> >> https://github.com/apache/jmeter/blob/trunk/src/core/ >> org/apache/jmeter/gui/util/FileDialoger.java >> >> Method : >> >> public static JFileChooser promptToOpenFile(String[] exts, String >> existingFileName) >> >> Issue happens with: >> >> JMeter 2.11r1554548 > view=revision&revision=1554548> >> >> Xubuntu 13.10 64-bit >> java version "1.7.0_25" or java version "1.7.0_51" >> >> Are we making a mistake somewhere in our code ? or could it be a know bug >> ? >> >> Thanks for help. >> >> Regards >> Philippe M. >> Member of Apache JMeter Team >> >> @philmdot >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.darcy at oracle.com Thu Jan 30 05:17:13 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 29 Jan 2014 21:17:13 -0800 Subject: JDK 9 RFR of JDK-8033221: Fix serial lint warnings in sun.swing.* Message-ID: <52E9E059.1010304@oracle.com> Hello, As the another installment of addressing the serial warnings in the client libraries, please review my changes for: JDK-8033221: Fix serial lint warnings in sun.swing.* http://cr.openjdk.java.net/~darcy/8033221.0/ Patch below. Thanks, -Joe --- old/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java 2014-01-29 21:14:19.000000000 -0800 +++ new/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java 2014-01-29 21:14:19.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, 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 @@ -34,6 +34,7 @@ /** * Data model for a type-face selection combo-box. */ + at SuppressWarnings("serial") // JDK-implementation class public abstract class AbstractFilterComboBoxModel extends AbstractListModel implements ComboBoxModel, PropertyChangeListener { --- old/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 21:14:20.000000000 -0800 +++ new/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 21:14:20.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -43,6 +43,7 @@ * * @author Scott Violet */ + at SuppressWarnings("serial") // JDK-implementation class public class BakedArrayList extends ArrayList { /** * The cached hashCode. --- old/src/share/classes/sun/swing/FilePane.java 2014-01-29 21:14:20.000000000 -0800 +++ new/src/share/classes/sun/swing/FilePane.java 2014-01-29 21:14:20.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -58,6 +58,7 @@ * * @author Leif Samuelsson */ + at SuppressWarnings("serial") // JDK-implementation class public class FilePane extends JPanel implements PropertyChangeListener { // Constants for actions. These are used for the actions' ACTION_COMMAND_KEY // and as keys in the action maps for FilePane and the corresponding UI classes @@ -391,6 +392,7 @@ firePropertyChange("viewType", oldValue, viewType); } + @SuppressWarnings("serial") // JDK-implementation class class ViewTypeAction extends AbstractAction { private int viewType; @@ -470,6 +472,7 @@ */ public Action[] getActions() { if (actions == null) { + @SuppressWarnings("serial") // JDK-implementation class class FilePaneAction extends AbstractAction { FilePaneAction(String name) { this(name, name); @@ -577,6 +580,8 @@ public JPanel createList() { JPanel p = new JPanel(new BorderLayout()); final JFileChooser fileChooser = getFileChooser(); + + @SuppressWarnings("serial") // anonymous class final JList list = new JList() { public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { ListModel model = getModel(); @@ -651,6 +656,7 @@ /** * This model allows for sorting JList */ + @SuppressWarnings("serial") // JDK-implementation class private class SortableListModel extends AbstractListModel implements TableModelListener, RowSorterListener { @@ -684,6 +690,7 @@ return detailsTableModel; } + @SuppressWarnings("serial") // JDK-implementation class class DetailsTableModel extends AbstractTableModel implements ListDataListener { JFileChooser chooser; BasicDirectoryModel directoryModel; @@ -1003,6 +1010,7 @@ return tableCellEditor; } + @SuppressWarnings("serial") // JDK-implementation class private class DetailsTableCellEditor extends DefaultCellEditor { private final JTextField tf; @@ -1025,7 +1033,7 @@ } } - + @SuppressWarnings("serial") // JDK-implementation class class DetailsTableCellRenderer extends DefaultTableCellRenderer { JFileChooser chooser; DateFormat df; @@ -1129,6 +1137,7 @@ JPanel p = new JPanel(new BorderLayout()); + @SuppressWarnings("serial") // anonymous class final JTable detailsTable = new JTable(getDetailsTableModel()) { // Handle Escape key events here protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { @@ -1447,6 +1456,7 @@ protected Action newFolderAction; + @SuppressWarnings("serial") // anonymous class inside public Action getNewFolderAction() { if (!readOnly && newFolderAction == null) { newFolderAction = new AbstractAction(newFolderActionLabelText) { @@ -1479,8 +1489,9 @@ return newFolderAction; } + @SuppressWarnings("serial") // JDK-implementation class protected class FileRenderer extends DefaultListCellRenderer { - + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { --- old/src/share/classes/sun/swing/ImageIconUIResource.java 2014-01-29 21:14:21.000000000 -0800 +++ new/src/share/classes/sun/swing/ImageIconUIResource.java 2014-01-29 21:14:21.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, 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 @@ -35,6 +35,7 @@ * @author Shannon Hickey * */ + at SuppressWarnings("serial") // JDK-implementation class public class ImageIconUIResource extends ImageIcon implements UIResource { /** --- old/src/share/classes/sun/swing/JLightweightFrame.java 2014-01-29 21:14:21.000000000 -0800 +++ new/src/share/classes/sun/swing/JLightweightFrame.java 2014-01-29 21:14:21.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, 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 @@ -64,6 +64,7 @@ * @author Artem Ananiev * @author Anton Tarasov */ + at SuppressWarnings("serial") // JDK-implementation class public final class JLightweightFrame extends LightweightFrame implements RootPaneContainer { private final JRootPane rootPane = new JRootPane(); @@ -209,6 +210,7 @@ } } + @SuppressWarnings("serial") // anonymous class inside private void initInterior() { contentPane = new JPanel() { @Override --- old/src/share/classes/sun/swing/PrintColorUIResource.java 2014-01-29 21:14:22.000000000 -0800 +++ new/src/share/classes/sun/swing/PrintColorUIResource.java 2014-01-29 21:14:22.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, 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 @@ -36,6 +36,7 @@ * @author Shannon Hickey * */ + at SuppressWarnings("serial") // JDK-implementation class public class PrintColorUIResource extends ColorUIResource { /** The color to use during printing */ --- old/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 21:14:22.000000000 -0800 +++ new/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 21:14:22.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -62,6 +62,7 @@ private final AtomicBoolean isAborted = new AtomicBoolean(false); // the action that will abort printing + @SuppressWarnings("serial") // anonymous class private final Action abortAction = new AbstractAction() { public void actionPerformed(ActionEvent ae) { if (!isAborted.get()) { --- old/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 21:14:23.000000000 -0800 +++ new/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 21:14:23.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -47,6 +47,7 @@ * * @author Leif Samuelsson */ + at SuppressWarnings("serial") // JDK-implementation class public class WindowsPlacesBar extends JToolBar implements ActionListener, PropertyChangeListener { JFileChooser fc; --- old/src/share/classes/sun/swing/icon/SortArrowIcon.java 2014-01-29 21:14:23.000000000 -0800 +++ new/src/share/classes/sun/swing/icon/SortArrowIcon.java 2014-01-29 21:14:23.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -36,6 +36,7 @@ * Sorting icon. * */ + at SuppressWarnings("serial") // JDK-implementation class public class SortArrowIcon implements Icon, UIResource, Serializable { // Height of the arrow, the width is ARROW_HEIGHT private static final int ARROW_HEIGHT = 5; --- old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java 2014-01-29 21:14:24.000000000 -0800 +++ new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java 2014-01-29 21:14:24.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -303,6 +303,7 @@ /** * Responds to a File Name completion request (e.g. Tab) */ + @SuppressWarnings("serial") // JDK-implementation class private class FileNameCompletionAction extends AbstractAction { protected FileNameCompletionAction() { super("fileNameCompletion"); @@ -538,6 +539,7 @@ public void clearIconCache() { } // Copied as SynthBorder is package private in synth + @SuppressWarnings("serial") // JDK-implementation clas private class UIBorder extends AbstractBorder implements UIResource { private Insets _insets; UIBorder(Insets insets) { --- old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java 2014-01-29 21:14:25.000000000 -0800 +++ new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java 2014-01-29 21:14:24.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -190,6 +190,7 @@ readOnly = UIManager.getBoolean("FileChooser.readOnly"); } + @SuppressWarnings("serial") // anonymous classes inside public void installComponents(JFileChooser fc) { super.installComponents(fc); @@ -734,6 +735,7 @@ /** * Data model for a type-face selection combo-box. */ + @SuppressWarnings("serial") // JDK-implementation class protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { Vector directories = new Vector(); int[] depths = null; @@ -863,6 +865,7 @@ /** * Acts when DirectoryComboBox has changed the selected item. */ + @SuppressWarnings("serial") // JDK-implementation class protected class DirectoryComboBoxAction extends AbstractAction { protected DirectoryComboBoxAction() { super("DirectoryComboBoxAction"); @@ -923,6 +926,7 @@ /** * Data model for a type-face selection combo-box. */ + @SuppressWarnings("serial") // JDK-implementation class protected class FilterComboBoxModel extends AbstractFilterComboBoxModel { protected JFileChooser getFileChooser() { return SynthFileChooserUIImpl.this.getFileChooser(); @@ -1012,6 +1016,7 @@ } } + @SuppressWarnings("serial") // JDK-implementation class private class AlignedLabel extends JLabel { private AlignedLabel[] group; private int maxWidth = 0; --- old/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java 2014-01-29 21:14:25.000000000 -0800 +++ new/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java 2014-01-29 21:14:25.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -36,6 +36,7 @@ * Classic sort icons. * */ + at SuppressWarnings("serial") // JDK-implementation class public class ClassicSortArrowIcon implements Icon, UIResource, Serializable{ private static final int X_OFFSET = 9; private boolean ascending; --- old/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java 2014-01-29 21:14:26.000000000 -0800 +++ new/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java 2014-01-29 21:14:26.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -39,6 +39,7 @@ import javax.swing.border.Border; import javax.swing.table.*; + at SuppressWarnings("serial") // JDK-implementation class public class DefaultTableCellHeaderRenderer extends DefaultTableCellRenderer implements UIResource { private boolean horizontalTextPositionSet; @@ -187,6 +188,7 @@ return new Point(x, y); } + @SuppressWarnings("serial") // JDK-implementation class private class EmptyIcon implements Icon, Serializable { int width = 0; int height = 0; --- old/src/share/classes/sun/swing/text/TextComponentPrintable.java 2014-01-29 21:14:26.000000000 -0800 +++ new/src/share/classes/sun/swing/text/TextComponentPrintable.java 2014-01-29 21:14:26.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -324,6 +324,7 @@ } } } + @SuppressWarnings("serial") // anonymous class inside private JTextComponent createPrintShellOnEDT(final JTextComponent textComponent) { assert SwingUtilities.isEventDispatchThread(); From alexandr.scherbatiy at oracle.com Thu Jan 30 08:41:47 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 30 Jan 2014 12:41:47 +0400 Subject: JDK 9 RFR of JDK-8033221: Fix serial lint warnings in sun.swing.* In-Reply-To: <52E9E059.1010304@oracle.com> References: <52E9E059.1010304@oracle.com> Message-ID: <52EA104B.5060605@oracle.com> The fix looks good. Thanks, Alexandr. On 1/30/2014 9:17 AM, Joe Darcy wrote: > Hello, > > As the another installment of addressing the serial warnings in the > client libraries, please review my changes for: > > JDK-8033221: Fix serial lint warnings in sun.swing.* > http://cr.openjdk.java.net/~darcy/8033221.0/ > > Patch below. > > Thanks, > > -Joe > > --- old/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java > 2014-01-29 21:14:19.000000000 -0800 > +++ new/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java > 2014-01-29 21:14:19.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2013, 2014, 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 > @@ -34,6 +34,7 @@ > /** > * Data model for a type-face selection combo-box. > */ > + at SuppressWarnings("serial") // JDK-implementation class > public abstract class AbstractFilterComboBoxModel > extends AbstractListModel > implements ComboBoxModel, PropertyChangeListener { > --- old/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 > 21:14:20.000000000 -0800 > +++ new/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 > 21:14:20.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -43,6 +43,7 @@ > * > * @author Scott Violet > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class BakedArrayList extends ArrayList { > /** > * The cached hashCode. > --- old/src/share/classes/sun/swing/FilePane.java 2014-01-29 > 21:14:20.000000000 -0800 > +++ new/src/share/classes/sun/swing/FilePane.java 2014-01-29 > 21:14:20.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -58,6 +58,7 @@ > * > * @author Leif Samuelsson > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class FilePane extends JPanel implements PropertyChangeListener { > // Constants for actions. These are used for the actions' > ACTION_COMMAND_KEY > // and as keys in the action maps for FilePane and the > corresponding UI classes > @@ -391,6 +392,7 @@ > firePropertyChange("viewType", oldValue, viewType); > } > > + @SuppressWarnings("serial") // JDK-implementation class > class ViewTypeAction extends AbstractAction { > private int viewType; > > @@ -470,6 +472,7 @@ > */ > public Action[] getActions() { > if (actions == null) { > + @SuppressWarnings("serial") // JDK-implementation class > class FilePaneAction extends AbstractAction { > FilePaneAction(String name) { > this(name, name); > @@ -577,6 +580,8 @@ > public JPanel createList() { > JPanel p = new JPanel(new BorderLayout()); > final JFileChooser fileChooser = getFileChooser(); > + > + @SuppressWarnings("serial") // anonymous class > final JList list = new JList() { > public int getNextMatch(String prefix, int startIndex, > Position.Bias bias) { > ListModel model = getModel(); > @@ -651,6 +656,7 @@ > /** > * This model allows for sorting JList > */ > + @SuppressWarnings("serial") // JDK-implementation class > private class SortableListModel extends AbstractListModel > implements TableModelListener, RowSorterListener { > > @@ -684,6 +690,7 @@ > return detailsTableModel; > } > > + @SuppressWarnings("serial") // JDK-implementation class > class DetailsTableModel extends AbstractTableModel implements > ListDataListener { > JFileChooser chooser; > BasicDirectoryModel directoryModel; > @@ -1003,6 +1010,7 @@ > return tableCellEditor; > } > > + @SuppressWarnings("serial") // JDK-implementation class > private class DetailsTableCellEditor extends DefaultCellEditor { > private final JTextField tf; > > @@ -1025,7 +1033,7 @@ > } > } > > - > + @SuppressWarnings("serial") // JDK-implementation class > class DetailsTableCellRenderer extends DefaultTableCellRenderer { > JFileChooser chooser; > DateFormat df; > @@ -1129,6 +1137,7 @@ > > JPanel p = new JPanel(new BorderLayout()); > > + @SuppressWarnings("serial") // anonymous class > final JTable detailsTable = new JTable(getDetailsTableModel()) { > // Handle Escape key events here > protected boolean processKeyBinding(KeyStroke ks, > KeyEvent e, int condition, boolean pressed) { > @@ -1447,6 +1456,7 @@ > > protected Action newFolderAction; > > + @SuppressWarnings("serial") // anonymous class inside > public Action getNewFolderAction() { > if (!readOnly && newFolderAction == null) { > newFolderAction = new > AbstractAction(newFolderActionLabelText) { > @@ -1479,8 +1489,9 @@ > return newFolderAction; > } > > + @SuppressWarnings("serial") // JDK-implementation class > protected class FileRenderer extends DefaultListCellRenderer { > - > + > public Component getListCellRendererComponent(JList list, > Object value, > int index, > boolean isSelected, > boolean > cellHasFocus) { > --- old/src/share/classes/sun/swing/ImageIconUIResource.java > 2014-01-29 21:14:21.000000000 -0800 > +++ new/src/share/classes/sun/swing/ImageIconUIResource.java > 2014-01-29 21:14:21.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2004, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2004, 2014, 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 > @@ -35,6 +35,7 @@ > * @author Shannon Hickey > * > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class ImageIconUIResource extends ImageIcon implements > UIResource { > > /** > --- old/src/share/classes/sun/swing/JLightweightFrame.java 2014-01-29 > 21:14:21.000000000 -0800 > +++ new/src/share/classes/sun/swing/JLightweightFrame.java 2014-01-29 > 21:14:21.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2013, 2014, 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 > @@ -64,6 +64,7 @@ > * @author Artem Ananiev > * @author Anton Tarasov > */ > + at SuppressWarnings("serial") // JDK-implementation class > public final class JLightweightFrame extends LightweightFrame > implements RootPaneContainer { > > private final JRootPane rootPane = new JRootPane(); > @@ -209,6 +210,7 @@ > } > } > > + @SuppressWarnings("serial") // anonymous class inside > private void initInterior() { > contentPane = new JPanel() { > @Override > --- old/src/share/classes/sun/swing/PrintColorUIResource.java > 2014-01-29 21:14:22.000000000 -0800 > +++ new/src/share/classes/sun/swing/PrintColorUIResource.java > 2014-01-29 21:14:22.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2004, 2014, 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 > @@ -36,6 +36,7 @@ > * @author Shannon Hickey > * > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class PrintColorUIResource extends ColorUIResource { > > /** The color to use during printing */ > --- old/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 > 21:14:22.000000000 -0800 > +++ new/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 > 21:14:22.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -62,6 +62,7 @@ > private final AtomicBoolean isAborted = new AtomicBoolean(false); > > // the action that will abort printing > + @SuppressWarnings("serial") // anonymous class > private final Action abortAction = new AbstractAction() { > public void actionPerformed(ActionEvent ae) { > if (!isAborted.get()) { > --- old/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 > 21:14:23.000000000 -0800 > +++ new/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 > 21:14:23.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -47,6 +47,7 @@ > * > * @author Leif Samuelsson > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class WindowsPlacesBar extends JToolBar > implements ActionListener, > PropertyChangeListener { > JFileChooser fc; > --- old/src/share/classes/sun/swing/icon/SortArrowIcon.java 2014-01-29 > 21:14:23.000000000 -0800 > +++ new/src/share/classes/sun/swing/icon/SortArrowIcon.java 2014-01-29 > 21:14:23.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -36,6 +36,7 @@ > * Sorting icon. > * > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class SortArrowIcon implements Icon, UIResource, Serializable { > // Height of the arrow, the width is ARROW_HEIGHT > private static final int ARROW_HEIGHT = 5; > --- old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java > 2014-01-29 21:14:24.000000000 -0800 > +++ new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java > 2014-01-29 21:14:24.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2002, 2014, 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 > @@ -303,6 +303,7 @@ > /** > * Responds to a File Name completion request (e.g. Tab) > */ > + @SuppressWarnings("serial") // JDK-implementation class > private class FileNameCompletionAction extends AbstractAction { > protected FileNameCompletionAction() { > super("fileNameCompletion"); > @@ -538,6 +539,7 @@ > public void clearIconCache() { } > > // Copied as SynthBorder is package private in synth > + @SuppressWarnings("serial") // JDK-implementation clas > private class UIBorder extends AbstractBorder implements > UIResource { > private Insets _insets; > UIBorder(Insets insets) { > --- > old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java > 2014-01-29 21:14:25.000000000 -0800 > +++ > new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java > 2014-01-29 21:14:24.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -190,6 +190,7 @@ > readOnly = UIManager.getBoolean("FileChooser.readOnly"); > } > > + @SuppressWarnings("serial") // anonymous classes inside > public void installComponents(JFileChooser fc) { > super.installComponents(fc); > > @@ -734,6 +735,7 @@ > /** > * Data model for a type-face selection combo-box. > */ > + @SuppressWarnings("serial") // JDK-implementation class > protected class DirectoryComboBoxModel extends > AbstractListModel implements ComboBoxModel { > Vector directories = new Vector(); > int[] depths = null; > @@ -863,6 +865,7 @@ > /** > * Acts when DirectoryComboBox has changed the selected item. > */ > + @SuppressWarnings("serial") // JDK-implementation class > protected class DirectoryComboBoxAction extends AbstractAction { > protected DirectoryComboBoxAction() { > super("DirectoryComboBoxAction"); > @@ -923,6 +926,7 @@ > /** > * Data model for a type-face selection combo-box. > */ > + @SuppressWarnings("serial") // JDK-implementation class > protected class FilterComboBoxModel extends > AbstractFilterComboBoxModel { > protected JFileChooser getFileChooser() { > return SynthFileChooserUIImpl.this.getFileChooser(); > @@ -1012,6 +1016,7 @@ > } > } > > + @SuppressWarnings("serial") // JDK-implementation class > private class AlignedLabel extends JLabel { > private AlignedLabel[] group; > private int maxWidth = 0; > --- > old/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java > 2014-01-29 21:14:25.000000000 -0800 > +++ > new/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java > 2014-01-29 21:14:25.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -36,6 +36,7 @@ > * Classic sort icons. > * > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class ClassicSortArrowIcon implements Icon, UIResource, > Serializable{ > private static final int X_OFFSET = 9; > private boolean ascending; > --- > old/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java > 2014-01-29 21:14:26.000000000 -0800 > +++ > new/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java > 2014-01-29 21:14:26.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -39,6 +39,7 @@ > import javax.swing.border.Border; > import javax.swing.table.*; > > + at SuppressWarnings("serial") // JDK-implementation class > public class DefaultTableCellHeaderRenderer extends > DefaultTableCellRenderer > implements UIResource { > private boolean horizontalTextPositionSet; > @@ -187,6 +188,7 @@ > return new Point(x, y); > } > > + @SuppressWarnings("serial") // JDK-implementation class > private class EmptyIcon implements Icon, Serializable { > int width = 0; > int height = 0; > --- old/src/share/classes/sun/swing/text/TextComponentPrintable.java > 2014-01-29 21:14:26.000000000 -0800 > +++ new/src/share/classes/sun/swing/text/TextComponentPrintable.java > 2014-01-29 21:14:26.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -324,6 +324,7 @@ > } > } > } > + @SuppressWarnings("serial") // anonymous class inside > private JTextComponent createPrintShellOnEDT(final JTextComponent > textComponent) { > assert SwingUtilities.isEventDispatchThread(); > > From alexandr.scherbatiy at oracle.com Thu Jan 30 10:45:21 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 30 Jan 2014 14:45:21 +0400 Subject: Proposal: make all methods in all listeners default. In-Reply-To: <025C951F-4D8A-4505-BF9B-AE3F7EC71A4E@oracle.com> References: <025C951F-4D8A-4505-BF9B-AE3F7EC71A4E@oracle.com> Message-ID: <52EA2D41.8000700@oracle.com> Suppose there is a class that extends an adapter and an another class that implements an interface with default methods. Are there any difference between these classes usage (method invocation time, class file size and so on)? If all AWT/Swing listeners are have default methods does it have sense to add one interface that will extend all of them, so there is no need to list all interfaces in my class like: class MyPanel implements KeyListener, MouseListener, MouseMotionListener ... Thanks, Alexandr. On 1/16/2014 6:27 PM, Petr Pchelko wrote: > Hello, AWT and Swing Team. > > I want to discuss an idea with you. What do you think making almost all methods in all listener interfaces in Swing and AWT default with empty implementation, > the same way it's done in adapters? This would be convenient if we are writing something like this: > > public class MyPanel extends Panel implements MouseListener > > but do not need all methods in a MouseListener. So, without this change we would need to override the methods with empty implementation ourselves, > and if all of the methods are default we can choose which methods to implement. Actually, if done like this we could take one step further and deprecate adapters.. > > What do you think? > > With best regards. Petr. From Sergey.Bylokhov at oracle.com Thu Jan 30 13:05:27 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 30 Jan 2014 17:05:27 +0400 Subject: JDK 9 RFR of JDK-8033221: Fix serial lint warnings in sun.swing.* In-Reply-To: <52E9E059.1010304@oracle.com> References: <52E9E059.1010304@oracle.com> Message-ID: <52EA4E17.8040406@oracle.com> Hi, Joe. It seems to me that in this fix we actually suppress a bugs. These classes can be extended from the public classes, and can be assigned to the parent. If serialization of these classes are not supported, we should block it via readObject+writeObject with assertion error, if it is supported it should be implemented. On 30.01.2014 9:17, Joe Darcy wrote: > Hello, > > As the another installment of addressing the serial warnings in the > client libraries, please review my changes for: > > JDK-8033221: Fix serial lint warnings in sun.swing.* > http://cr.openjdk.java.net/~darcy/8033221.0/ > > Patch below. > > Thanks, > > -Joe > > --- old/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java > 2014-01-29 21:14:19.000000000 -0800 > +++ new/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java > 2014-01-29 21:14:19.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2013, 2014, 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 > @@ -34,6 +34,7 @@ > /** > * Data model for a type-face selection combo-box. > */ > + at SuppressWarnings("serial") // JDK-implementation class > public abstract class AbstractFilterComboBoxModel > extends AbstractListModel > implements ComboBoxModel, PropertyChangeListener { > --- old/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 > 21:14:20.000000000 -0800 > +++ new/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 > 21:14:20.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -43,6 +43,7 @@ > * > * @author Scott Violet > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class BakedArrayList extends ArrayList { > /** > * The cached hashCode. > --- old/src/share/classes/sun/swing/FilePane.java 2014-01-29 > 21:14:20.000000000 -0800 > +++ new/src/share/classes/sun/swing/FilePane.java 2014-01-29 > 21:14:20.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -58,6 +58,7 @@ > * > * @author Leif Samuelsson > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class FilePane extends JPanel implements PropertyChangeListener { > // Constants for actions. These are used for the actions' > ACTION_COMMAND_KEY > // and as keys in the action maps for FilePane and the > corresponding UI classes > @@ -391,6 +392,7 @@ > firePropertyChange("viewType", oldValue, viewType); > } > > + @SuppressWarnings("serial") // JDK-implementation class > class ViewTypeAction extends AbstractAction { > private int viewType; > > @@ -470,6 +472,7 @@ > */ > public Action[] getActions() { > if (actions == null) { > + @SuppressWarnings("serial") // JDK-implementation class > class FilePaneAction extends AbstractAction { > FilePaneAction(String name) { > this(name, name); > @@ -577,6 +580,8 @@ > public JPanel createList() { > JPanel p = new JPanel(new BorderLayout()); > final JFileChooser fileChooser = getFileChooser(); > + > + @SuppressWarnings("serial") // anonymous class > final JList list = new JList() { > public int getNextMatch(String prefix, int startIndex, > Position.Bias bias) { > ListModel model = getModel(); > @@ -651,6 +656,7 @@ > /** > * This model allows for sorting JList > */ > + @SuppressWarnings("serial") // JDK-implementation class > private class SortableListModel extends AbstractListModel > implements TableModelListener, RowSorterListener { > > @@ -684,6 +690,7 @@ > return detailsTableModel; > } > > + @SuppressWarnings("serial") // JDK-implementation class > class DetailsTableModel extends AbstractTableModel implements > ListDataListener { > JFileChooser chooser; > BasicDirectoryModel directoryModel; > @@ -1003,6 +1010,7 @@ > return tableCellEditor; > } > > + @SuppressWarnings("serial") // JDK-implementation class > private class DetailsTableCellEditor extends DefaultCellEditor { > private final JTextField tf; > > @@ -1025,7 +1033,7 @@ > } > } > > - > + @SuppressWarnings("serial") // JDK-implementation class > class DetailsTableCellRenderer extends DefaultTableCellRenderer { > JFileChooser chooser; > DateFormat df; > @@ -1129,6 +1137,7 @@ > > JPanel p = new JPanel(new BorderLayout()); > > + @SuppressWarnings("serial") // anonymous class > final JTable detailsTable = new JTable(getDetailsTableModel()) { > // Handle Escape key events here > protected boolean processKeyBinding(KeyStroke ks, > KeyEvent e, int condition, boolean pressed) { > @@ -1447,6 +1456,7 @@ > > protected Action newFolderAction; > > + @SuppressWarnings("serial") // anonymous class inside > public Action getNewFolderAction() { > if (!readOnly && newFolderAction == null) { > newFolderAction = new > AbstractAction(newFolderActionLabelText) { > @@ -1479,8 +1489,9 @@ > return newFolderAction; > } > > + @SuppressWarnings("serial") // JDK-implementation class > protected class FileRenderer extends DefaultListCellRenderer { > - > + > public Component getListCellRendererComponent(JList list, > Object value, > int index, > boolean isSelected, > boolean > cellHasFocus) { > --- old/src/share/classes/sun/swing/ImageIconUIResource.java > 2014-01-29 21:14:21.000000000 -0800 > +++ new/src/share/classes/sun/swing/ImageIconUIResource.java > 2014-01-29 21:14:21.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2004, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2004, 2014, 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 > @@ -35,6 +35,7 @@ > * @author Shannon Hickey > * > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class ImageIconUIResource extends ImageIcon implements > UIResource { > > /** > --- old/src/share/classes/sun/swing/JLightweightFrame.java 2014-01-29 > 21:14:21.000000000 -0800 > +++ new/src/share/classes/sun/swing/JLightweightFrame.java 2014-01-29 > 21:14:21.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2013, 2014, 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 > @@ -64,6 +64,7 @@ > * @author Artem Ananiev > * @author Anton Tarasov > */ > + at SuppressWarnings("serial") // JDK-implementation class > public final class JLightweightFrame extends LightweightFrame > implements RootPaneContainer { > > private final JRootPane rootPane = new JRootPane(); > @@ -209,6 +210,7 @@ > } > } > > + @SuppressWarnings("serial") // anonymous class inside > private void initInterior() { > contentPane = new JPanel() { > @Override > --- old/src/share/classes/sun/swing/PrintColorUIResource.java > 2014-01-29 21:14:22.000000000 -0800 > +++ new/src/share/classes/sun/swing/PrintColorUIResource.java > 2014-01-29 21:14:22.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2004, 2014, 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 > @@ -36,6 +36,7 @@ > * @author Shannon Hickey > * > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class PrintColorUIResource extends ColorUIResource { > > /** The color to use during printing */ > --- old/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 > 21:14:22.000000000 -0800 > +++ new/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 > 21:14:22.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -62,6 +62,7 @@ > private final AtomicBoolean isAborted = new AtomicBoolean(false); > > // the action that will abort printing > + @SuppressWarnings("serial") // anonymous class > private final Action abortAction = new AbstractAction() { > public void actionPerformed(ActionEvent ae) { > if (!isAborted.get()) { > --- old/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 > 21:14:23.000000000 -0800 > +++ new/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 > 21:14:23.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -47,6 +47,7 @@ > * > * @author Leif Samuelsson > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class WindowsPlacesBar extends JToolBar > implements ActionListener, > PropertyChangeListener { > JFileChooser fc; > --- old/src/share/classes/sun/swing/icon/SortArrowIcon.java 2014-01-29 > 21:14:23.000000000 -0800 > +++ new/src/share/classes/sun/swing/icon/SortArrowIcon.java 2014-01-29 > 21:14:23.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -36,6 +36,7 @@ > * Sorting icon. > * > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class SortArrowIcon implements Icon, UIResource, Serializable { > // Height of the arrow, the width is ARROW_HEIGHT > private static final int ARROW_HEIGHT = 5; > --- old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java > 2014-01-29 21:14:24.000000000 -0800 > +++ new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java > 2014-01-29 21:14:24.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2002, 2014, 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 > @@ -303,6 +303,7 @@ > /** > * Responds to a File Name completion request (e.g. Tab) > */ > + @SuppressWarnings("serial") // JDK-implementation class > private class FileNameCompletionAction extends AbstractAction { > protected FileNameCompletionAction() { > super("fileNameCompletion"); > @@ -538,6 +539,7 @@ > public void clearIconCache() { } > > // Copied as SynthBorder is package private in synth > + @SuppressWarnings("serial") // JDK-implementation clas > private class UIBorder extends AbstractBorder implements > UIResource { > private Insets _insets; > UIBorder(Insets insets) { > --- > old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java > 2014-01-29 21:14:25.000000000 -0800 > +++ > new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java > 2014-01-29 21:14:24.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2003, 2014, 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 > @@ -190,6 +190,7 @@ > readOnly = UIManager.getBoolean("FileChooser.readOnly"); > } > > + @SuppressWarnings("serial") // anonymous classes inside > public void installComponents(JFileChooser fc) { > super.installComponents(fc); > > @@ -734,6 +735,7 @@ > /** > * Data model for a type-face selection combo-box. > */ > + @SuppressWarnings("serial") // JDK-implementation class > protected class DirectoryComboBoxModel extends > AbstractListModel implements ComboBoxModel { > Vector directories = new Vector(); > int[] depths = null; > @@ -863,6 +865,7 @@ > /** > * Acts when DirectoryComboBox has changed the selected item. > */ > + @SuppressWarnings("serial") // JDK-implementation class > protected class DirectoryComboBoxAction extends AbstractAction { > protected DirectoryComboBoxAction() { > super("DirectoryComboBoxAction"); > @@ -923,6 +926,7 @@ > /** > * Data model for a type-face selection combo-box. > */ > + @SuppressWarnings("serial") // JDK-implementation class > protected class FilterComboBoxModel extends > AbstractFilterComboBoxModel { > protected JFileChooser getFileChooser() { > return SynthFileChooserUIImpl.this.getFileChooser(); > @@ -1012,6 +1016,7 @@ > } > } > > + @SuppressWarnings("serial") // JDK-implementation class > private class AlignedLabel extends JLabel { > private AlignedLabel[] group; > private int maxWidth = 0; > --- > old/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java > 2014-01-29 21:14:25.000000000 -0800 > +++ > new/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java > 2014-01-29 21:14:25.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -36,6 +36,7 @@ > * Classic sort icons. > * > */ > + at SuppressWarnings("serial") // JDK-implementation class > public class ClassicSortArrowIcon implements Icon, UIResource, > Serializable{ > private static final int X_OFFSET = 9; > private boolean ascending; > --- > old/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java > 2014-01-29 21:14:26.000000000 -0800 > +++ > new/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java > 2014-01-29 21:14:26.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -39,6 +39,7 @@ > import javax.swing.border.Border; > import javax.swing.table.*; > > + at SuppressWarnings("serial") // JDK-implementation class > public class DefaultTableCellHeaderRenderer extends > DefaultTableCellRenderer > implements UIResource { > private boolean horizontalTextPositionSet; > @@ -187,6 +188,7 @@ > return new Point(x, y); > } > > + @SuppressWarnings("serial") // JDK-implementation class > private class EmptyIcon implements Icon, Serializable { > int width = 0; > int height = 0; > --- old/src/share/classes/sun/swing/text/TextComponentPrintable.java > 2014-01-29 21:14:26.000000000 -0800 > +++ new/src/share/classes/sun/swing/text/TextComponentPrintable.java > 2014-01-29 21:14:26.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2005, 2014, 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 > @@ -324,6 +324,7 @@ > } > } > } > + @SuppressWarnings("serial") // anonymous class inside > private JTextComponent createPrintShellOnEDT(final JTextComponent > textComponent) { > assert SwingUtilities.isEventDispatchThread(); > > -- Best regards, Sergey. From anton.tarasov at oracle.com Thu Jan 30 13:49:11 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Thu, 30 Jan 2014 17:49:11 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE Message-ID: <52EA5857.3060801@oracle.com> Hi all, Please review the fix. jira: https://bugs.openjdk.java.net/browse/JDK-8033233 webrev: http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 Here I'm duplicating JIRA: The point of the fix is that it introduces a RepaintListener which can be added to a RepaintManager in order to get back notifications of repaints performed as BLITs. JLightweightFrame registers such a listener to its RM instance. JViewport is the source of those notifications. Now it works in default BLIT_SCROLL_MODE. Shortly, the mechanism of repainting of a JLF is the following. Once a JLF's child component is requesting repaint, an appropriate repaint runnable is scheduled by the RepaintManager (RM). The runnable is then gets dispatched by the RM which calls the paint() method of the root component, that is the JLF. JLF overrides this method in the way that after all the painting is done (super.paint) it initiates a pixel bits transfer to the host application (e.g. SwingNode). In case of JViewport, when it works in the default BLIT scroll mode, scrolling of the JViewport doesn't lead to a repaint runnable being dispatched. Instead, JViewport immediately repaints its content (via blitting + repainting a dirty area) and then tells the RM there's nothing to repaint (so the runnable scheduled is just skipped). As the result, the JLF doesn't get any notification of the update. As a workaround to this problem, JViewport had been forcibly switched to the BACKINGSTORE scroll mode, in which case it passes the whole repainting cycle. Regards, Anton. From petr.pchelko at oracle.com Thu Jan 30 14:16:17 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Thu, 30 Jan 2014 18:16:17 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE In-Reply-To: <52EA5857.3060801@oracle.com> References: <52EA5857.3060801@oracle.com> Message-ID: <780768C7-DDEF-4F56-A55C-DA8B345052BD@oracle.com> Hello, Anton. Great, you are removing the dirty JViewPort hack) I have one question: is JViewport a single place where we use the "blit" rendering? Also, could you please update the copyright years. Also, may be we could replace the RepaintListener instantiation in JLWF with a lambda? What do you think? With best regards. Petr. On 30.01.2014, at 17:49, "Anton V. Tarasov" wrote: > Hi all, > > Please review the fix. > > jira: https://bugs.openjdk.java.net/browse/JDK-8033233 > webrev: http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 > > Here I'm duplicating JIRA: > > The point of the fix is that it introduces a RepaintListener which can be added to a RepaintManager in order to get back notifications of repaints performed as BLITs. JLightweightFrame registers such a listener to its RM instance. JViewport is the source of those notifications. Now it works in default BLIT_SCROLL_MODE. > > Shortly, the mechanism of repainting of a JLF is the following. Once a JLF's child component is requesting repaint, an appropriate repaint runnable is scheduled by the RepaintManager (RM). The runnable is then gets dispatched by the RM which calls the paint() method of the root component, that is the JLF. JLF overrides this method in the way that after all the painting is done (super.paint) it initiates a pixel bits transfer to the host application (e.g. SwingNode). In case of JViewport, when it works in the default BLIT scroll mode, scrolling of the JViewport doesn't lead to a repaint runnable being dispatched. Instead, JViewport immediately repaints its content (via blitting + repainting a dirty area) and then tells the RM there's nothing to repaint (so the runnable scheduled is just skipped). As the result, the JLF doesn't get any notification of the update. > > As a workaround to this problem, JViewport had been forcibly switched to the BACKINGSTORE scroll mode, in which case it passes the whole repainting cycle. > > Regards, > Anton. From alexandr.scherbatiy at oracle.com Thu Jan 30 14:18:29 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Thu, 30 Jan 2014 18:18:29 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE In-Reply-To: <52EA5857.3060801@oracle.com> References: <52EA5857.3060801@oracle.com> Message-ID: <52EA5F35.1050505@oracle.com> Could you add a test to the fix? Thanks, Alexandr. On 1/30/2014 5:49 PM, Anton V. Tarasov wrote: > Hi all, > > Please review the fix. > > jira: https://bugs.openjdk.java.net/browse/JDK-8033233 > webrev: http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 > > Here I'm duplicating JIRA: > > The point of the fix is that it introduces a RepaintListener which can > be added to a RepaintManager in order to get back notifications of > repaints performed as BLITs. JLightweightFrame registers such a > listener to its RM instance. JViewport is the source of those > notifications. Now it works in default BLIT_SCROLL_MODE. > > Shortly, the mechanism of repainting of a JLF is the following. Once a > JLF's child component is requesting repaint, an appropriate repaint > runnable is scheduled by the RepaintManager (RM). The runnable is then > gets dispatched by the RM which calls the paint() method of the root > component, that is the JLF. JLF overrides this method in the way that > after all the painting is done (super.paint) it initiates a pixel bits > transfer to the host application (e.g. SwingNode). In case of > JViewport, when it works in the default BLIT scroll mode, scrolling of > the JViewport doesn't lead to a repaint runnable being dispatched. > Instead, JViewport immediately repaints its content (via blitting + > repainting a dirty area) and then tells the RM there's nothing to > repaint (so the runnable scheduled is just skipped). As the result, > the JLF doesn't get any notification of the update. > > As a workaround to this problem, JViewport had been forcibly switched > to the BACKINGSTORE scroll mode, in which case it passes the whole > repainting cycle. > > Regards, > Anton. From joe.darcy at oracle.com Thu Jan 30 16:19:41 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 30 Jan 2014 08:19:41 -0800 Subject: JDK 9 RFR of JDK-8033221: Fix serial lint warnings in sun.swing.* In-Reply-To: <52EA4E17.8040406@oracle.com> References: <52E9E059.1010304@oracle.com> <52EA4E17.8040406@oracle.com> Message-ID: <52EA7B9D.60703@oracle.com> On 01/30/2014 05:05 AM, Sergey Bylokhov wrote: > Hi, Joe. > It seems to me that in this fix we actually suppress a bugs. These > classes can be extended from the public classes, and can be assigned > to the parent. > If serialization of these classes are not supported, we should block > it via readObject+writeObject with assertion error, if it is supported > it should be implemented. Many of the public javax.* swing classes contain a disclaimer "this class is marked serializable, but instead of the usual guarantees that provides about cross-version migration, we only promise you can serialize and deserialize on the same version of the platform." Those classes don't define serialVersionUIDs and a recently pushed a changeset to suppress serial warnings on those classes. 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes The classes in question here are sun.* classes and therefore *not* part of the public API of the JDK. Therefore, there should be no implied expectation about serial compatibility across versions; therefore, to address the lint warning, I choose to suppress the warning rather than add a serialVersionUID. Thanks, -Joe > > On 30.01.2014 9:17, Joe Darcy wrote: >> Hello, >> >> As the another installment of addressing the serial warnings in the >> client libraries, please review my changes for: >> >> JDK-8033221: Fix serial lint warnings in sun.swing.* >> http://cr.openjdk.java.net/~darcy/8033221.0/ >> >> Patch below. >> >> Thanks, >> >> -Joe >> >> --- old/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java >> 2014-01-29 21:14:19.000000000 -0800 >> +++ new/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java >> 2014-01-29 21:14:19.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2013, Oracle and/or its affiliates. All rights >> reserved. >> + * Copyright (c) 2013, 2014, 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 >> @@ -34,6 +34,7 @@ >> /** >> * Data model for a type-face selection combo-box. >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public abstract class AbstractFilterComboBoxModel >> extends AbstractListModel >> implements ComboBoxModel, PropertyChangeListener { >> --- old/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 >> 21:14:20.000000000 -0800 >> +++ new/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 >> 21:14:20.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2003, Oracle and/or its affiliates. All rights >> reserved. >> + * Copyright (c) 2003, 2014, 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 >> @@ -43,6 +43,7 @@ >> * >> * @author Scott Violet >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public class BakedArrayList extends ArrayList { >> /** >> * The cached hashCode. >> --- old/src/share/classes/sun/swing/FilePane.java 2014-01-29 >> 21:14:20.000000000 -0800 >> +++ new/src/share/classes/sun/swing/FilePane.java 2014-01-29 >> 21:14:20.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2003, 2014, 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 >> @@ -58,6 +58,7 @@ >> * >> * @author Leif Samuelsson >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public class FilePane extends JPanel implements >> PropertyChangeListener { >> // Constants for actions. These are used for the actions' >> ACTION_COMMAND_KEY >> // and as keys in the action maps for FilePane and the >> corresponding UI classes >> @@ -391,6 +392,7 @@ >> firePropertyChange("viewType", oldValue, viewType); >> } >> >> + @SuppressWarnings("serial") // JDK-implementation class >> class ViewTypeAction extends AbstractAction { >> private int viewType; >> >> @@ -470,6 +472,7 @@ >> */ >> public Action[] getActions() { >> if (actions == null) { >> + @SuppressWarnings("serial") // JDK-implementation class >> class FilePaneAction extends AbstractAction { >> FilePaneAction(String name) { >> this(name, name); >> @@ -577,6 +580,8 @@ >> public JPanel createList() { >> JPanel p = new JPanel(new BorderLayout()); >> final JFileChooser fileChooser = getFileChooser(); >> + >> + @SuppressWarnings("serial") // anonymous class >> final JList list = new JList() { >> public int getNextMatch(String prefix, int startIndex, >> Position.Bias bias) { >> ListModel model = getModel(); >> @@ -651,6 +656,7 @@ >> /** >> * This model allows for sorting JList >> */ >> + @SuppressWarnings("serial") // JDK-implementation class >> private class SortableListModel extends AbstractListModel >> implements TableModelListener, RowSorterListener { >> >> @@ -684,6 +690,7 @@ >> return detailsTableModel; >> } >> >> + @SuppressWarnings("serial") // JDK-implementation class >> class DetailsTableModel extends AbstractTableModel implements >> ListDataListener { >> JFileChooser chooser; >> BasicDirectoryModel directoryModel; >> @@ -1003,6 +1010,7 @@ >> return tableCellEditor; >> } >> >> + @SuppressWarnings("serial") // JDK-implementation class >> private class DetailsTableCellEditor extends DefaultCellEditor { >> private final JTextField tf; >> >> @@ -1025,7 +1033,7 @@ >> } >> } >> >> - >> + @SuppressWarnings("serial") // JDK-implementation class >> class DetailsTableCellRenderer extends DefaultTableCellRenderer { >> JFileChooser chooser; >> DateFormat df; >> @@ -1129,6 +1137,7 @@ >> >> JPanel p = new JPanel(new BorderLayout()); >> >> + @SuppressWarnings("serial") // anonymous class >> final JTable detailsTable = new >> JTable(getDetailsTableModel()) { >> // Handle Escape key events here >> protected boolean processKeyBinding(KeyStroke ks, >> KeyEvent e, int condition, boolean pressed) { >> @@ -1447,6 +1456,7 @@ >> >> protected Action newFolderAction; >> >> + @SuppressWarnings("serial") // anonymous class inside >> public Action getNewFolderAction() { >> if (!readOnly && newFolderAction == null) { >> newFolderAction = new >> AbstractAction(newFolderActionLabelText) { >> @@ -1479,8 +1489,9 @@ >> return newFolderAction; >> } >> >> + @SuppressWarnings("serial") // JDK-implementation class >> protected class FileRenderer extends DefaultListCellRenderer { >> - >> + >> public Component getListCellRendererComponent(JList list, >> Object value, >> int index, >> boolean isSelected, >> boolean >> cellHasFocus) { >> --- old/src/share/classes/sun/swing/ImageIconUIResource.java >> 2014-01-29 21:14:21.000000000 -0800 >> +++ new/src/share/classes/sun/swing/ImageIconUIResource.java >> 2014-01-29 21:14:21.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2004, Oracle and/or its affiliates. All rights >> reserved. >> + * Copyright (c) 2004, 2014, 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 >> @@ -35,6 +35,7 @@ >> * @author Shannon Hickey >> * >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public class ImageIconUIResource extends ImageIcon implements >> UIResource { >> >> /** >> --- old/src/share/classes/sun/swing/JLightweightFrame.java 2014-01-29 >> 21:14:21.000000000 -0800 >> +++ new/src/share/classes/sun/swing/JLightweightFrame.java 2014-01-29 >> 21:14:21.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2013, Oracle and/or its affiliates. All rights >> reserved. >> + * Copyright (c) 2013, 2014, 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 >> @@ -64,6 +64,7 @@ >> * @author Artem Ananiev >> * @author Anton Tarasov >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public final class JLightweightFrame extends LightweightFrame >> implements RootPaneContainer { >> >> private final JRootPane rootPane = new JRootPane(); >> @@ -209,6 +210,7 @@ >> } >> } >> >> + @SuppressWarnings("serial") // anonymous class inside >> private void initInterior() { >> contentPane = new JPanel() { >> @Override >> --- old/src/share/classes/sun/swing/PrintColorUIResource.java >> 2014-01-29 21:14:22.000000000 -0800 >> +++ new/src/share/classes/sun/swing/PrintColorUIResource.java >> 2014-01-29 21:14:22.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2004, 2014, 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 >> @@ -36,6 +36,7 @@ >> * @author Shannon Hickey >> * >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public class PrintColorUIResource extends ColorUIResource { >> >> /** The color to use during printing */ >> --- old/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 >> 21:14:22.000000000 -0800 >> +++ new/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 >> 21:14:22.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2005, 2014, 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 >> @@ -62,6 +62,7 @@ >> private final AtomicBoolean isAborted = new AtomicBoolean(false); >> >> // the action that will abort printing >> + @SuppressWarnings("serial") // anonymous class >> private final Action abortAction = new AbstractAction() { >> public void actionPerformed(ActionEvent ae) { >> if (!isAborted.get()) { >> --- old/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 >> 21:14:23.000000000 -0800 >> +++ new/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 >> 21:14:23.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2003, 2014, 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 >> @@ -47,6 +47,7 @@ >> * >> * @author Leif Samuelsson >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public class WindowsPlacesBar extends JToolBar >> implements ActionListener, >> PropertyChangeListener { >> JFileChooser fc; >> --- old/src/share/classes/sun/swing/icon/SortArrowIcon.java >> 2014-01-29 21:14:23.000000000 -0800 >> +++ new/src/share/classes/sun/swing/icon/SortArrowIcon.java >> 2014-01-29 21:14:23.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2005, Oracle and/or its affiliates. All rights >> reserved. >> + * Copyright (c) 2005, 2014, 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 >> @@ -36,6 +36,7 @@ >> * Sorting icon. >> * >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public class SortArrowIcon implements Icon, UIResource, Serializable { >> // Height of the arrow, the width is ARROW_HEIGHT >> private static final int ARROW_HEIGHT = 5; >> --- >> old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java >> 2014-01-29 21:14:24.000000000 -0800 >> +++ >> new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java >> 2014-01-29 21:14:24.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2002, 2014, 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 >> @@ -303,6 +303,7 @@ >> /** >> * Responds to a File Name completion request (e.g. Tab) >> */ >> + @SuppressWarnings("serial") // JDK-implementation class >> private class FileNameCompletionAction extends AbstractAction { >> protected FileNameCompletionAction() { >> super("fileNameCompletion"); >> @@ -538,6 +539,7 @@ >> public void clearIconCache() { } >> >> // Copied as SynthBorder is package private in synth >> + @SuppressWarnings("serial") // JDK-implementation clas >> private class UIBorder extends AbstractBorder implements >> UIResource { >> private Insets _insets; >> UIBorder(Insets insets) { >> --- >> old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java 2014-01-29 >> 21:14:25.000000000 -0800 >> +++ >> new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java 2014-01-29 >> 21:14:24.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2003, 2014, 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 >> @@ -190,6 +190,7 @@ >> readOnly = UIManager.getBoolean("FileChooser.readOnly"); >> } >> >> + @SuppressWarnings("serial") // anonymous classes inside >> public void installComponents(JFileChooser fc) { >> super.installComponents(fc); >> >> @@ -734,6 +735,7 @@ >> /** >> * Data model for a type-face selection combo-box. >> */ >> + @SuppressWarnings("serial") // JDK-implementation class >> protected class DirectoryComboBoxModel extends >> AbstractListModel implements ComboBoxModel { >> Vector directories = new Vector(); >> int[] depths = null; >> @@ -863,6 +865,7 @@ >> /** >> * Acts when DirectoryComboBox has changed the selected item. >> */ >> + @SuppressWarnings("serial") // JDK-implementation class >> protected class DirectoryComboBoxAction extends AbstractAction { >> protected DirectoryComboBoxAction() { >> super("DirectoryComboBoxAction"); >> @@ -923,6 +926,7 @@ >> /** >> * Data model for a type-face selection combo-box. >> */ >> + @SuppressWarnings("serial") // JDK-implementation class >> protected class FilterComboBoxModel extends >> AbstractFilterComboBoxModel { >> protected JFileChooser getFileChooser() { >> return SynthFileChooserUIImpl.this.getFileChooser(); >> @@ -1012,6 +1016,7 @@ >> } >> } >> >> + @SuppressWarnings("serial") // JDK-implementation class >> private class AlignedLabel extends JLabel { >> private AlignedLabel[] group; >> private int maxWidth = 0; >> --- >> old/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java 2014-01-29 >> 21:14:25.000000000 -0800 >> +++ >> new/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java 2014-01-29 >> 21:14:25.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2005, Oracle and/or its affiliates. All rights >> reserved. >> + * Copyright (c) 2005, 2014, 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 >> @@ -36,6 +36,7 @@ >> * Classic sort icons. >> * >> */ >> + at SuppressWarnings("serial") // JDK-implementation class >> public class ClassicSortArrowIcon implements Icon, UIResource, >> Serializable{ >> private static final int X_OFFSET = 9; >> private boolean ascending; >> --- >> old/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java >> 2014-01-29 21:14:26.000000000 -0800 >> +++ >> new/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java >> 2014-01-29 21:14:26.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2005, 2014, 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 >> @@ -39,6 +39,7 @@ >> import javax.swing.border.Border; >> import javax.swing.table.*; >> >> + at SuppressWarnings("serial") // JDK-implementation class >> public class DefaultTableCellHeaderRenderer extends >> DefaultTableCellRenderer >> implements UIResource { >> private boolean horizontalTextPositionSet; >> @@ -187,6 +188,7 @@ >> return new Point(x, y); >> } >> >> + @SuppressWarnings("serial") // JDK-implementation class >> private class EmptyIcon implements Icon, Serializable { >> int width = 0; >> int height = 0; >> --- old/src/share/classes/sun/swing/text/TextComponentPrintable.java >> 2014-01-29 21:14:26.000000000 -0800 >> +++ new/src/share/classes/sun/swing/text/TextComponentPrintable.java >> 2014-01-29 21:14:26.000000000 -0800 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2005, 2014, 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 >> @@ -324,6 +324,7 @@ >> } >> } >> } >> + @SuppressWarnings("serial") // anonymous class inside >> private JTextComponent createPrintShellOnEDT(final >> JTextComponent textComponent) { >> assert SwingUtilities.isEventDispatchThread(); >> >> > > From nmiyake at palantir.com Thu Jan 30 17:55:54 2014 From: nmiyake at palantir.com (Nick Miyake) Date: Thu, 30 Jan 2014 17:55:54 +0000 Subject: Swing memory leak caused by JFrame.setLocation? Message-ID: Hello, I believe I have found an issue that causes a memory leak in the Java process when using "JFrame.setLocation". If you launch the application in the sample program below (which simply calls "setLocation" on a JFrame repeatedly) in MacOS using JDK 1.7.0_06 or later and observe the memory usage of the application using Activity Monitor and click the "setLocation x 1000" button, the memory usage of the program nearly triples (on my machine, it goes from 50MB to 150MB) and never decreases after that. The issue seems to be with the Java process itself, as the heap/memory usage reported by JConsole does not change. Repeating the same steps using JDK 1.7.0_05 or earlier shows that this leak does not seem to happen. Sample code: ---------------------------- public final class MemoryLeakRepro { private static final int NUM_SET_LOCATIONS = 1000; public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { final JFrame frame = new JFrame("Test"); JPanel content = new JPanel(new GridLayout(1, 1)); JButton button = new JButton("setLocation x " + NUM_SET_LOCATIONS); content.add(button); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { for (int i = 0; i < NUM_SET_LOCATIONS; i++) { int delta = (i % 2 == 0 ? 1 : -1); frame.setLocation(frame.getX() + delta, frame.getY() + delta); } } }); frame.setContentPane(content); frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }); } } ---------------------------- A similar issue seems to reproduce on Windows as well (although not using the same "setLocation" button method). If you use the other sample program below, increase the window size and then drag the JPanel all over the screen repeatedly, the memory usage goes from around 28MB to 34MB or so and never comes back down. Repeating the process can cause it to take up more and more memory, which never seems to be released. The same behavior is not observed when dragging the native title bar. This behavior occurs in both JDK 1.6.0_45 and in all versions of JDK 7 I tested. Sample code: ---------------------------- public final class MemoryLeakRepro { private static final int NUM_SET_LOCATIONS = 1000; public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { final JFrame frame = new JFrame("Test"); JPanel content = new JPanel(new GridLayout(1, 1)); JPanel dragPanel = new JPanel(); dragPanel.setPreferredSize(new Dimension(100, 100)); FrameDragger frameDragger = new FrameDragger(frame); dragPanel.addMouseListener(frameDragger); dragPanel.addMouseMotionListener(frameDragger); content.add(dragPanel); frame.setContentPane(content); frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }); } private static final class FrameDragger extends MouseAdapter { private final JFrame frame; private int prevMouseX; private int prevMouseY; public FrameDragger(JFrame frame) { this.frame = frame; } @Override public void mousePressed(MouseEvent e) { prevMouseX = e.getX(); prevMouseY = e.getY(); } @Override public void mouseDragged(MouseEvent e) { int currMouseX = e.getX(); int currMouseY = e.getY(); int currWindowX = frame.getX(); int currWindowY = frame.getY(); int moveX = currMouseX - prevMouseX; int moveY = currMouseY - prevMouseY; if (moveX == 0 && moveY == 0) return; int newFrameX = currWindowX + moveX; int newFrameY = currWindowY + moveY; frame.setLocation(newFrameX, newFrameY); } } } ---------------------------- Has anyone here seen this issue in the past or have any ideas about what we could do to fix it? Thanks, -Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5034 bytes Desc: not available URL: From Sergey.Bylokhov at oracle.com Thu Jan 30 19:25:28 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 30 Jan 2014 23:25:28 +0400 Subject: JDK 9 RFR of JDK-8033221: Fix serial lint warnings in sun.swing.* In-Reply-To: <52EA7B9D.60703@oracle.com> References: <52E9E059.1010304@oracle.com> <52EA4E17.8040406@oracle.com> <52EA7B9D.60703@oracle.com> Message-ID: <52EAA728.3080309@oracle.com> On 30.01.2014 20:19, Joe Darcy wrote: > On 01/30/2014 05:05 AM, Sergey Bylokhov wrote: >> Hi, Joe. >> It seems to me that in this fix we actually suppress a bugs. These >> classes can be extended from the public classes, and can be assigned >> to the parent. >> If serialization of these classes are not supported, we should block >> it via readObject+writeObject with assertion error, if it is >> supported it should be implemented. > > Many of the public javax.* swing classes contain a disclaimer "this > class is marked serializable, but instead of the usual guarantees that > provides about cross-version migration, we only promise you can > serialize and deserialize on the same version of the platform." Those > classes don't define serialVersionUIDs and a recently pushed a > changeset to suppress serial warnings on those classes. I agree that if class define that it could be marked as @SuppressWarnings("serial") . Classes which technically cannot be serialised can be marked as well, for example serialisable inner non-static class, where the outer class is not serialisable. Or when read/writeObject is throw an exception. But this situation is different, these classes could be used in serialization by the mistake. So we cannot just add this annotation, because we should prove that classes never use in serialization( objects of this class are stored in the transient fields in the public classes, or not used in public classes, etc.) > > 8032627: Add @SuppressWarnings("serial") to appropriate > javax.swing classes > > The classes in question here are sun.* classes and therefore *not* > part of the public API of the JDK. Therefore, there should be no > implied expectation about serial compatibility across versions; > therefore, to address the lint warning, I choose to suppress the > warning rather than add a serialVersionUID. > > Thanks, > > -Joe > >> >> On 30.01.2014 9:17, Joe Darcy wrote: >>> Hello, >>> >>> As the another installment of addressing the serial warnings in the >>> client libraries, please review my changes for: >>> >>> JDK-8033221: Fix serial lint warnings in sun.swing.* >>> http://cr.openjdk.java.net/~darcy/8033221.0/ >>> >>> Patch below. >>> >>> Thanks, >>> >>> -Joe >>> >>> --- old/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java >>> 2014-01-29 21:14:19.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/AbstractFilterComboBoxModel.java >>> 2014-01-29 21:14:19.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2013, Oracle and/or its affiliates. All rights >>> reserved. >>> + * Copyright (c) 2013, 2014, 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 >>> @@ -34,6 +34,7 @@ >>> /** >>> * Data model for a type-face selection combo-box. >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public abstract class AbstractFilterComboBoxModel >>> extends AbstractListModel >>> implements ComboBoxModel, PropertyChangeListener { >>> --- old/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 >>> 21:14:20.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/BakedArrayList.java 2014-01-29 >>> 21:14:20.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2003, Oracle and/or its affiliates. All rights >>> reserved. >>> + * Copyright (c) 2003, 2014, 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 >>> @@ -43,6 +43,7 @@ >>> * >>> * @author Scott Violet >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public class BakedArrayList extends ArrayList { >>> /** >>> * The cached hashCode. >>> --- old/src/share/classes/sun/swing/FilePane.java 2014-01-29 >>> 21:14:20.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/FilePane.java 2014-01-29 >>> 21:14:20.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All >>> rights reserved. >>> + * Copyright (c) 2003, 2014, 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 >>> @@ -58,6 +58,7 @@ >>> * >>> * @author Leif Samuelsson >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public class FilePane extends JPanel implements >>> PropertyChangeListener { >>> // Constants for actions. These are used for the actions' >>> ACTION_COMMAND_KEY >>> // and as keys in the action maps for FilePane and the >>> corresponding UI classes >>> @@ -391,6 +392,7 @@ >>> firePropertyChange("viewType", oldValue, viewType); >>> } >>> >>> + @SuppressWarnings("serial") // JDK-implementation class >>> class ViewTypeAction extends AbstractAction { >>> private int viewType; >>> >>> @@ -470,6 +472,7 @@ >>> */ >>> public Action[] getActions() { >>> if (actions == null) { >>> + @SuppressWarnings("serial") // JDK-implementation class >>> class FilePaneAction extends AbstractAction { >>> FilePaneAction(String name) { >>> this(name, name); >>> @@ -577,6 +580,8 @@ >>> public JPanel createList() { >>> JPanel p = new JPanel(new BorderLayout()); >>> final JFileChooser fileChooser = getFileChooser(); >>> + >>> + @SuppressWarnings("serial") // anonymous class >>> final JList list = new JList() { >>> public int getNextMatch(String prefix, int startIndex, >>> Position.Bias bias) { >>> ListModel model = getModel(); >>> @@ -651,6 +656,7 @@ >>> /** >>> * This model allows for sorting JList >>> */ >>> + @SuppressWarnings("serial") // JDK-implementation class >>> private class SortableListModel extends AbstractListModel >>> implements TableModelListener, RowSorterListener { >>> >>> @@ -684,6 +690,7 @@ >>> return detailsTableModel; >>> } >>> >>> + @SuppressWarnings("serial") // JDK-implementation class >>> class DetailsTableModel extends AbstractTableModel implements >>> ListDataListener { >>> JFileChooser chooser; >>> BasicDirectoryModel directoryModel; >>> @@ -1003,6 +1010,7 @@ >>> return tableCellEditor; >>> } >>> >>> + @SuppressWarnings("serial") // JDK-implementation class >>> private class DetailsTableCellEditor extends DefaultCellEditor { >>> private final JTextField tf; >>> >>> @@ -1025,7 +1033,7 @@ >>> } >>> } >>> >>> - >>> + @SuppressWarnings("serial") // JDK-implementation class >>> class DetailsTableCellRenderer extends DefaultTableCellRenderer { >>> JFileChooser chooser; >>> DateFormat df; >>> @@ -1129,6 +1137,7 @@ >>> >>> JPanel p = new JPanel(new BorderLayout()); >>> >>> + @SuppressWarnings("serial") // anonymous class >>> final JTable detailsTable = new >>> JTable(getDetailsTableModel()) { >>> // Handle Escape key events here >>> protected boolean processKeyBinding(KeyStroke ks, >>> KeyEvent e, int condition, boolean pressed) { >>> @@ -1447,6 +1456,7 @@ >>> >>> protected Action newFolderAction; >>> >>> + @SuppressWarnings("serial") // anonymous class inside >>> public Action getNewFolderAction() { >>> if (!readOnly && newFolderAction == null) { >>> newFolderAction = new >>> AbstractAction(newFolderActionLabelText) { >>> @@ -1479,8 +1489,9 @@ >>> return newFolderAction; >>> } >>> >>> + @SuppressWarnings("serial") // JDK-implementation class >>> protected class FileRenderer extends DefaultListCellRenderer { >>> - >>> + >>> public Component getListCellRendererComponent(JList list, >>> Object value, >>> int index, >>> boolean isSelected, >>> boolean >>> cellHasFocus) { >>> --- old/src/share/classes/sun/swing/ImageIconUIResource.java >>> 2014-01-29 21:14:21.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/ImageIconUIResource.java >>> 2014-01-29 21:14:21.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2004, Oracle and/or its affiliates. All rights >>> reserved. >>> + * Copyright (c) 2004, 2014, 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 >>> @@ -35,6 +35,7 @@ >>> * @author Shannon Hickey >>> * >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public class ImageIconUIResource extends ImageIcon implements >>> UIResource { >>> >>> /** >>> --- old/src/share/classes/sun/swing/JLightweightFrame.java >>> 2014-01-29 21:14:21.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/JLightweightFrame.java >>> 2014-01-29 21:14:21.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2013, Oracle and/or its affiliates. All rights >>> reserved. >>> + * Copyright (c) 2013, 2014, 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 >>> @@ -64,6 +64,7 @@ >>> * @author Artem Ananiev >>> * @author Anton Tarasov >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public final class JLightweightFrame extends LightweightFrame >>> implements RootPaneContainer { >>> >>> private final JRootPane rootPane = new JRootPane(); >>> @@ -209,6 +210,7 @@ >>> } >>> } >>> >>> + @SuppressWarnings("serial") // anonymous class inside >>> private void initInterior() { >>> contentPane = new JPanel() { >>> @Override >>> --- old/src/share/classes/sun/swing/PrintColorUIResource.java >>> 2014-01-29 21:14:22.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/PrintColorUIResource.java >>> 2014-01-29 21:14:22.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All >>> rights reserved. >>> + * Copyright (c) 2004, 2014, 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 >>> @@ -36,6 +36,7 @@ >>> * @author Shannon Hickey >>> * >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public class PrintColorUIResource extends ColorUIResource { >>> >>> /** The color to use during printing */ >>> --- old/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 >>> 21:14:22.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/PrintingStatus.java 2014-01-29 >>> 21:14:22.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All >>> rights reserved. >>> + * Copyright (c) 2005, 2014, 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 >>> @@ -62,6 +62,7 @@ >>> private final AtomicBoolean isAborted = new AtomicBoolean(false); >>> >>> // the action that will abort printing >>> + @SuppressWarnings("serial") // anonymous class >>> private final Action abortAction = new AbstractAction() { >>> public void actionPerformed(ActionEvent ae) { >>> if (!isAborted.get()) { >>> --- old/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 >>> 21:14:23.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/WindowsPlacesBar.java 2014-01-29 >>> 21:14:23.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All >>> rights reserved. >>> + * Copyright (c) 2003, 2014, 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 >>> @@ -47,6 +47,7 @@ >>> * >>> * @author Leif Samuelsson >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public class WindowsPlacesBar extends JToolBar >>> implements ActionListener, >>> PropertyChangeListener { >>> JFileChooser fc; >>> --- old/src/share/classes/sun/swing/icon/SortArrowIcon.java >>> 2014-01-29 21:14:23.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/icon/SortArrowIcon.java >>> 2014-01-29 21:14:23.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2005, Oracle and/or its affiliates. All rights >>> reserved. >>> + * Copyright (c) 2005, 2014, 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 >>> @@ -36,6 +36,7 @@ >>> * Sorting icon. >>> * >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public class SortArrowIcon implements Icon, UIResource, Serializable { >>> // Height of the arrow, the width is ARROW_HEIGHT >>> private static final int ARROW_HEIGHT = 5; >>> --- >>> old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java >>> 2014-01-29 21:14:24.000000000 -0800 >>> +++ >>> new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java >>> 2014-01-29 21:14:24.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All >>> rights reserved. >>> + * Copyright (c) 2002, 2014, 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 >>> @@ -303,6 +303,7 @@ >>> /** >>> * Responds to a File Name completion request (e.g. Tab) >>> */ >>> + @SuppressWarnings("serial") // JDK-implementation class >>> private class FileNameCompletionAction extends AbstractAction { >>> protected FileNameCompletionAction() { >>> super("fileNameCompletion"); >>> @@ -538,6 +539,7 @@ >>> public void clearIconCache() { } >>> >>> // Copied as SynthBorder is package private in synth >>> + @SuppressWarnings("serial") // JDK-implementation clas >>> private class UIBorder extends AbstractBorder implements >>> UIResource { >>> private Insets _insets; >>> UIBorder(Insets insets) { >>> --- >>> old/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java >>> 2014-01-29 21:14:25.000000000 -0800 >>> +++ >>> new/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java >>> 2014-01-29 21:14:24.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All >>> rights reserved. >>> + * Copyright (c) 2003, 2014, 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 >>> @@ -190,6 +190,7 @@ >>> readOnly = UIManager.getBoolean("FileChooser.readOnly"); >>> } >>> >>> + @SuppressWarnings("serial") // anonymous classes inside >>> public void installComponents(JFileChooser fc) { >>> super.installComponents(fc); >>> >>> @@ -734,6 +735,7 @@ >>> /** >>> * Data model for a type-face selection combo-box. >>> */ >>> + @SuppressWarnings("serial") // JDK-implementation class >>> protected class DirectoryComboBoxModel extends >>> AbstractListModel implements ComboBoxModel { >>> Vector directories = new Vector(); >>> int[] depths = null; >>> @@ -863,6 +865,7 @@ >>> /** >>> * Acts when DirectoryComboBox has changed the selected item. >>> */ >>> + @SuppressWarnings("serial") // JDK-implementation class >>> protected class DirectoryComboBoxAction extends AbstractAction { >>> protected DirectoryComboBoxAction() { >>> super("DirectoryComboBoxAction"); >>> @@ -923,6 +926,7 @@ >>> /** >>> * Data model for a type-face selection combo-box. >>> */ >>> + @SuppressWarnings("serial") // JDK-implementation class >>> protected class FilterComboBoxModel extends >>> AbstractFilterComboBoxModel { >>> protected JFileChooser getFileChooser() { >>> return SynthFileChooserUIImpl.this.getFileChooser(); >>> @@ -1012,6 +1016,7 @@ >>> } >>> } >>> >>> + @SuppressWarnings("serial") // JDK-implementation class >>> private class AlignedLabel extends JLabel { >>> private AlignedLabel[] group; >>> private int maxWidth = 0; >>> --- >>> old/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java >>> 2014-01-29 21:14:25.000000000 -0800 >>> +++ >>> new/src/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java >>> 2014-01-29 21:14:25.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2005, Oracle and/or its affiliates. All rights >>> reserved. >>> + * Copyright (c) 2005, 2014, 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 >>> @@ -36,6 +36,7 @@ >>> * Classic sort icons. >>> * >>> */ >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public class ClassicSortArrowIcon implements Icon, UIResource, >>> Serializable{ >>> private static final int X_OFFSET = 9; >>> private boolean ascending; >>> --- >>> old/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java >>> 2014-01-29 21:14:26.000000000 -0800 >>> +++ >>> new/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java >>> 2014-01-29 21:14:26.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All >>> rights reserved. >>> + * Copyright (c) 2005, 2014, 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 >>> @@ -39,6 +39,7 @@ >>> import javax.swing.border.Border; >>> import javax.swing.table.*; >>> >>> + at SuppressWarnings("serial") // JDK-implementation class >>> public class DefaultTableCellHeaderRenderer extends >>> DefaultTableCellRenderer >>> implements UIResource { >>> private boolean horizontalTextPositionSet; >>> @@ -187,6 +188,7 @@ >>> return new Point(x, y); >>> } >>> >>> + @SuppressWarnings("serial") // JDK-implementation class >>> private class EmptyIcon implements Icon, Serializable { >>> int width = 0; >>> int height = 0; >>> --- old/src/share/classes/sun/swing/text/TextComponentPrintable.java >>> 2014-01-29 21:14:26.000000000 -0800 >>> +++ new/src/share/classes/sun/swing/text/TextComponentPrintable.java >>> 2014-01-29 21:14:26.000000000 -0800 >>> @@ -1,5 +1,5 @@ >>> /* >>> - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All >>> rights reserved. >>> + * Copyright (c) 2005, 2014, 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 >>> @@ -324,6 +324,7 @@ >>> } >>> } >>> } >>> + @SuppressWarnings("serial") // anonymous class inside >>> private JTextComponent createPrintShellOnEDT(final >>> JTextComponent textComponent) { >>> assert SwingUtilities.isEventDispatchThread(); >>> >>> >> >> > -- Best regards, Sergey. From tom.hawtin at oracle.com Thu Jan 30 19:36:48 2014 From: tom.hawtin at oracle.com (Tom Hawtin) Date: Thu, 30 Jan 2014 19:36:48 +0000 Subject: JDK 9 RFR of JDK-8033221: Fix serial lint warnings in sun.swing.* In-Reply-To: <52EA4E17.8040406@oracle.com> References: <52E9E059.1010304@oracle.com> <52EA4E17.8040406@oracle.com> Message-ID: <52EAA9D0.30203@oracle.com> On 30/01/2014 13:05, Sergey Bylokhov wrote: > It seems to me that in this fix we actually suppress a bugs. These > classes can be extended from the public classes, and can be assigned to > the parent. > If serialization of these classes are not supported, we should block it > via readObject+writeObject with assertion error, if it is supported it > should be implemented. + readObjectNoData. Correctly spelt serialPersistenFields as an array containing null appeared to be most effective, though implementation dependent. Really the legacy serialisation mechanism should be extended with a @NotActuallySerializable annotation. Apply that to sun.swing.-, com.sun.swing.-, javax.swing.- and others. Tom From petr.pchelko at oracle.com Fri Jan 31 06:50:29 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Fri, 31 Jan 2014 10:50:29 +0400 Subject: [9] URGENT Review Request: 8033326 9 build failure after merge with dev Message-ID: Hello, AWT team. Please review the simple fix for the issue: https://bugs.openjdk.java.net/browse/JDK-8033326 The fix is available at: http://cr.openjdk.java.net/~pchelko/9/8033326/webrev/ 9 build failed due to an incorrect merge between dev and client. Thank you, With best regards. Petr. From anton.tarasov at oracle.com Fri Jan 31 07:55:21 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Fri, 31 Jan 2014 11:55:21 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE In-Reply-To: <780768C7-DDEF-4F56-A55C-DA8B345052BD@oracle.com> References: <52EA5857.3060801@oracle.com> <780768C7-DDEF-4F56-A55C-DA8B345052BD@oracle.com> Message-ID: <52EB56E9.3040800@oracle.com> Hi Petr, On 30.01.2014 18:16, Petr Pchelko wrote: > Hello, Anton. > > Great, you are removing the dirty JViewPort hack) > > I have one question: is JViewport a single place where we use the "blit" rendering? Yes, there's one more place - in DefaultDesktopManager. It BLITs on dragging a JInternalFrame instance but only in FASTER_DRAG_MODE which is not its default mode. I hadn't test it, but I tried. I switched the mode and what I see is that w/o any modifications a dragged JIF is, as expected, not repainted. I've put the notifications into the code. This made a JIF instance repaint on drag. However, there's an issue with the shadow. The shadow is not repainted, but background artifacts instead. I didn't yet find the reason, I suspect there's some async repaint which I probably don't catch. I suggest not to spend time in DefaultDesktopManager for now, as a) this functionality has less priority for SwingNode (than JViewport) b) it works fine in the default mode. So, I'll file a P5 against it. Please, look at the new webrev: http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.1 Besides modifications to DDM, I've put additional bounds constraint to JLF/RepaintListener.repaintPerformed. > Also, could you please update the copyright years. Sure, I did. > Also, may be we could replace the RepaintListener instantiation in JLWF with a lambda? What do you think? Sure, we can. Thanks, Anton. > > With best regards. Petr. > > On 30.01.2014, at 17:49, "Anton V. Tarasov" wrote: > >> Hi all, >> >> Please review the fix. >> >> jira:https://bugs.openjdk.java.net/browse/JDK-8033233 >> webrev:http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 >> >> Here I'm duplicating JIRA: >> >> The point of the fix is that it introduces a RepaintListener which can be added to a RepaintManager in order to get back notifications of repaints performed as BLITs. JLightweightFrame registers such a listener to its RM instance. JViewport is the source of those notifications. Now it works in default BLIT_SCROLL_MODE. >> >> Shortly, the mechanism of repainting of a JLF is the following. Once a JLF's child component is requesting repaint, an appropriate repaint runnable is scheduled by the RepaintManager (RM). The runnable is then gets dispatched by the RM which calls the paint() method of the root component, that is the JLF. JLF overrides this method in the way that after all the painting is done (super.paint) it initiates a pixel bits transfer to the host application (e.g. SwingNode). In case of JViewport, when it works in the default BLIT scroll mode, scrolling of the JViewport doesn't lead to a repaint runnable being dispatched. Instead, JViewport immediately repaints its content (via blitting + repainting a dirty area) and then tells the RM there's nothing to repaint (so the runnable scheduled is just skipped). As the result, the JLF doesn't get any notification of the update. >> >> As a workaround to this problem, JViewport had been forcibly switched to the BACKINGSTORE scroll mode, in which case it passes the whole repainting cycle. >> >> Regards, >> Anton. From anton.tarasov at oracle.com Fri Jan 31 08:00:30 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Fri, 31 Jan 2014 12:00:30 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE In-Reply-To: <52EA5F35.1050505@oracle.com> References: <52EA5857.3060801@oracle.com> <52EA5F35.1050505@oracle.com> Message-ID: <52EB581E.7090001@oracle.com> Hi Alexandr, Actually, we don't add tests against JDK issues related to JLightweightFrame... You can see that "swing-interop" tagged bugs are noreg-hard. There are two reasons, first is that they are indeed hard (possible, but requires additional efforts), second is that they require the host app, namely SwingNode. But we have some tests on the JFX side. Thanks, Anton. On 1/30/14 6:18 PM, Alexander Scherbatiy wrote: > > Could you add a test to the fix? > > Thanks, > Alexandr. > > On 1/30/2014 5:49 PM, Anton V. Tarasov wrote: >> Hi all, >> >> Please review the fix. >> >> jira: https://bugs.openjdk.java.net/browse/JDK-8033233 >> webrev: http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 >> >> Here I'm duplicating JIRA: >> >> The point of the fix is that it introduces a RepaintListener which >> can be added to a RepaintManager in order to get back notifications >> of repaints performed as BLITs. JLightweightFrame registers such a >> listener to its RM instance. JViewport is the source of those >> notifications. Now it works in default BLIT_SCROLL_MODE. >> >> Shortly, the mechanism of repainting of a JLF is the following. Once >> a JLF's child component is requesting repaint, an appropriate repaint >> runnable is scheduled by the RepaintManager (RM). The runnable is >> then gets dispatched by the RM which calls the paint() method of the >> root component, that is the JLF. JLF overrides this method in the way >> that after all the painting is done (super.paint) it initiates a >> pixel bits transfer to the host application (e.g. SwingNode). In case >> of JViewport, when it works in the default BLIT scroll mode, >> scrolling of the JViewport doesn't lead to a repaint runnable being >> dispatched. Instead, JViewport immediately repaints its content (via >> blitting + repainting a dirty area) and then tells the RM there's >> nothing to repaint (so the runnable scheduled is just skipped). As >> the result, the JLF doesn't get any notification of the update. >> >> As a workaround to this problem, JViewport had been forcibly switched >> to the BACKINGSTORE scroll mode, in which case it passes the whole >> repainting cycle. >> >> Regards, >> Anton. > From petr.pchelko at oracle.com Fri Jan 31 08:17:37 2014 From: petr.pchelko at oracle.com (Petr Pchelko) Date: Fri, 31 Jan 2014 12:17:37 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE In-Reply-To: <52EB56E9.3040800@oracle.com> References: <52EA5857.3060801@oracle.com> <780768C7-DDEF-4F56-A55C-DA8B345052BD@oracle.com> <52EB56E9.3040800@oracle.com> Message-ID: <55EBF8FD-F48A-40D7-BC7F-7F02979DDCFA@oracle.com> Great, thank you, Anton. The fix looks good to me. With best regards. Petr. 31 ???. 2014 ?., ? 11:55 ?? ???????, Anton V. Tarasov ???????(?): > Hi Petr, > > On 30.01.2014 18:16, Petr Pchelko wrote: >> Hello, Anton. >> >> Great, you are removing the dirty JViewPort hack) >> >> I have one question: is JViewport a single place where we use the "blit" rendering? > > Yes, there's one more place - in DefaultDesktopManager. It BLITs on dragging a JInternalFrame instance but only in FASTER_DRAG_MODE which is not its default mode. I hadn't test it, but I tried. I switched the mode and what I see is that w/o any modifications a dragged JIF is, as expected, not repainted. I've put the notifications into the code. This made a JIF instance repaint on drag. However, there's an issue with the shadow. The shadow is not repainted, but background artifacts instead. I didn't yet find the reason, I suspect there's some async repaint which I probably don't catch. > > I suggest not to spend time in DefaultDesktopManager for now, as a) this functionality has less priority for SwingNode (than JViewport) b) it works fine in the default mode. So, I'll file a P5 against it. > > Please, look at the new webrev: > > http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.1 > > Besides modifications to DDM, I've put additional bounds constraint to JLF/RepaintListener.repaintPerformed. > >> Also, could you please update the copyright years. > Sure, I did. > >> Also, may be we could replace the RepaintListener instantiation in JLWF with a lambda? What do you think? > > Sure, we can. > > Thanks, > Anton. > >> >> With best regards. Petr. >> >> On 30.01.2014, at 17:49, "Anton V. Tarasov" wrote: >> >>> Hi all, >>> >>> Please review the fix. >>> >>> jira:https://bugs.openjdk.java.net/browse/JDK-8033233 >>> webrev:http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 >>> >>> Here I'm duplicating JIRA: >>> >>> The point of the fix is that it introduces a RepaintListener which can be added to a RepaintManager in order to get back notifications of repaints performed as BLITs. JLightweightFrame registers such a listener to its RM instance. JViewport is the source of those notifications. Now it works in default BLIT_SCROLL_MODE. >>> >>> Shortly, the mechanism of repainting of a JLF is the following. Once a JLF's child component is requesting repaint, an appropriate repaint runnable is scheduled by the RepaintManager (RM). The runnable is then gets dispatched by the RM which calls the paint() method of the root component, that is the JLF. JLF overrides this method in the way that after all the painting is done (super.paint) it initiates a pixel bits transfer to the host application (e.g. SwingNode). In case of JViewport, when it works in the default BLIT scroll mode, scrolling of the JViewport doesn't lead to a repaint runnable being dispatched. Instead, JViewport immediately repaints its content (via blitting + repainting a dirty area) and then tells the RM there's nothing to repaint (so the runnable scheduled is just skipped). As the result, the JLF doesn't get any notification of the update. >>> >>> As a workaround to this problem, JViewport had been forcibly switched to the BACKINGSTORE scroll mode, in which case it passes the whole repainting cycle. >>> >>> Regards, >>> Anton. > From Sergey.Bylokhov at oracle.com Fri Jan 31 09:08:02 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 31 Jan 2014 13:08:02 +0400 Subject: [OpenJDK 2D-Dev] JDK 9 RFR of JDK-8032733: Fix cast lint warnings in client libraries In-Reply-To: <52E4D5A4.4040104@oracle.com> References: <52E40C2C.8070503@oracle.com> <52E4D5A4.4040104@oracle.com> Message-ID: <52EB67F2.7030800@oracle.com> On 26.01.2014 13:30, Alan Bateman wrote: > As a side point, client changes have been going into jdk9/client > rather than jdk9/dev so I just wonder if there might be changes backed > up in jdk9/client that might cause issues when merged. It will be really good to push all fixes related to client to the jdk9/client. The first merge between dev and client already broke the build: https://bugs.openjdk.java.net/browse/JDK-8033326 > -Alan -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Fri Jan 31 09:09:12 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 31 Jan 2014 13:09:12 +0400 Subject: [9] URGENT Review Request: 8033326 9 build failure after merge with dev In-Reply-To: References: Message-ID: <52EB6838.3020700@oracle.com> Hi, Petr. The fix looks good. On 31.01.2014 10:50, Petr Pchelko wrote: > Hello, AWT team. > > Please review the simple fix for the issue: > https://bugs.openjdk.java.net/browse/JDK-8033326 > The fix is available at: > http://cr.openjdk.java.net/~pchelko/9/8033326/webrev/ > > 9 build failed due to an incorrect merge between dev and client. > > Thank you, > With best regards. Petr. -- Best regards, Sergey. From alexandr.scherbatiy at oracle.com Fri Jan 31 09:15:55 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 31 Jan 2014 13:15:55 +0400 Subject: [9] URGENT Review Request: 8033326 9 build failure after merge with dev In-Reply-To: <52EB6838.3020700@oracle.com> References: <52EB6838.3020700@oracle.com> Message-ID: <52EB69CB.7040206@oracle.com> The fix looks good. Thanks, Alexandr. On 1/31/2014 1:09 PM, Sergey Bylokhov wrote: > Hi, Petr. > The fix looks good. > > On 31.01.2014 10:50, Petr Pchelko wrote: >> Hello, AWT team. >> >> Please review the simple fix for the issue: >> https://bugs.openjdk.java.net/browse/JDK-8033326 >> The fix is available at: >> http://cr.openjdk.java.net/~pchelko/9/8033326/webrev/ >> >> 9 build failed due to an incorrect merge between dev and client. >> >> Thank you, >> With best regards. Petr. > > From Alan.Bateman at oracle.com Fri Jan 31 10:05:00 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 31 Jan 2014 10:05:00 +0000 Subject: Should changes to client libraries be pushed to jdk9/dev instead of jdk9/client In-Reply-To: <52EB67F2.7030800@oracle.com> References: <52E40C2C.8070503@oracle.com> <52E4D5A4.4040104@oracle.com> <52EB67F2.7030800@oracle.com> Message-ID: <52EB754C.6040904@oracle.com> On 31/01/2014 09:08, Sergey Bylokhov wrote: > On 26.01.2014 13:30, Alan Bateman wrote: >> As a side point, client changes have been going into jdk9/client >> rather than jdk9/dev so I just wonder if there might be changes >> backed up in jdk9/client that might cause issues when merged. > It will be really good to push all fixes related to client to the > jdk9/client. The first merge between dev and client already broke the > build: > https://bugs.openjdk.java.net/browse/JDK-8033326 I've changed the subject line as I think this topic deserves its own discussion. On this specific merge issue then I guess part of the issue is that jdk9/client had not been sync'ed up in a long time. The changes to SecurityManager (which involved changes to both core and client libraries) were pushed to jdk9/dev on December 18. Also if the build breakage (due to the merge issue) wasn't detected until it was pushed to jdk9/client then something else is wrong. When doing a huge sync up (and it looks like 300+ changes were being pulled from jdk9/dev in this case) then I would think that the merge should involve doing at least sanity builds on all platforms before pushing to jdk9/client. In any case, I think the discussion item here is where should changes to client libraries be pushed. The discussion on jdk9-dev about this issue wasn't very clear, I think it came down to whether any manual testing would be required before integrating into master. At least for jdk9/dev then my understanding is that there is a desire to integrate into master every week, maybe more often and eventually (longer term) continuously. I'm sure Joe will have suggestions on this issue. -Alan From alexandr.scherbatiy at oracle.com Fri Jan 31 10:08:39 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 31 Jan 2014 14:08:39 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE In-Reply-To: <52EB56E9.3040800@oracle.com> References: <52EA5857.3060801@oracle.com> <780768C7-DDEF-4F56-A55C-DA8B345052BD@oracle.com> <52EB56E9.3040800@oracle.com> Message-ID: <52EB7627.40204@oracle.com> The fix looks good for me. Just a minor comment. It seem that the condition in DefaultDesktopManager: "if (!floaterCollision) { .. } if(floaterCollision) {...}" is the same as "if (!floaterCollision) { ... } else {...} ". Thanks, Alexandr. On 1/31/2014 11:55 AM, Anton V. Tarasov wrote: > Hi Petr, > > On 30.01.2014 18:16, Petr Pchelko wrote: >> Hello, Anton. >> >> Great, you are removing the dirty JViewPort hack) >> >> I have one question: is JViewport a single place where we use the >> "blit" rendering? > > Yes, there's one more place - in DefaultDesktopManager. It BLITs on > dragging a JInternalFrame instance but only in FASTER_DRAG_MODE which > is not its default mode. I hadn't test it, but I tried. I switched the > mode and what I see is that w/o any modifications a dragged JIF is, as > expected, not repainted. I've put the notifications into the code. > This made a JIF instance repaint on drag. However, there's an issue > with the shadow. The shadow is not repainted, but background artifacts > instead. I didn't yet find the reason, I suspect there's some async > repaint which I probably don't catch. > > I suggest not to spend time in DefaultDesktopManager for now, as a) > this functionality has less priority for SwingNode (than JViewport) b) > it works fine in the default mode. So, I'll file a P5 against it. > > Please, look at the new webrev: > > http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.1 > > Besides modifications to DDM, I've put additional bounds constraint to > JLF/RepaintListener.repaintPerformed. > >> Also, could you please update the copyright years. > Sure, I did. > >> Also, may be we could replace the RepaintListener instantiation in >> JLWF with a lambda? What do you think? > > Sure, we can. > > Thanks, > Anton. > >> >> With best regards. Petr. >> >> On 30.01.2014, at 17:49, "Anton V. >> Tarasov" wrote: >> >>> Hi all, >>> >>> Please review the fix. >>> >>> jira:https://bugs.openjdk.java.net/browse/JDK-8033233 >>> webrev:http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 >>> >>> Here I'm duplicating JIRA: >>> >>> The point of the fix is that it introduces a RepaintListener which >>> can be added to a RepaintManager in order to get back notifications >>> of repaints performed as BLITs. JLightweightFrame registers such a >>> listener to its RM instance. JViewport is the source of those >>> notifications. Now it works in default BLIT_SCROLL_MODE. >>> >>> Shortly, the mechanism of repainting of a JLF is the following. Once >>> a JLF's child component is requesting repaint, an appropriate >>> repaint runnable is scheduled by the RepaintManager (RM). The >>> runnable is then gets dispatched by the RM which calls the paint() >>> method of the root component, that is the JLF. JLF overrides this >>> method in the way that after all the painting is done (super.paint) >>> it initiates a pixel bits transfer to the host application (e.g. >>> SwingNode). In case of JViewport, when it works in the default BLIT >>> scroll mode, scrolling of the JViewport doesn't lead to a repaint >>> runnable being dispatched. Instead, JViewport immediately repaints >>> its content (via blitting + repainting a dirty area) and then tells >>> the RM there's nothing to repaint (so the runnable scheduled is just >>> skipped). As the result, the JLF doesn't get any notification of the >>> update. >>> >>> As a workaround to this problem, JViewport had been forcibly >>> switched to the BACKINGSTORE scroll mode, in which case it passes >>> the whole repainting cycle. >>> >>> Regards, >>> Anton. > From anton.tarasov at oracle.com Fri Jan 31 10:39:28 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Fri, 31 Jan 2014 14:39:28 +0400 Subject: [9] URGENT Review Request: 8033326 9 build failure after merge with dev In-Reply-To: References: Message-ID: <52EB7D60.2020504@oracle.com> Looks fine. Thanks, Anton. On 31.01.2014 10:50, Petr Pchelko wrote: > Hello, AWT team. > > Please review the simple fix for the issue: > https://bugs.openjdk.java.net/browse/JDK-8033326 > The fix is available at: > http://cr.openjdk.java.net/~pchelko/9/8033326/webrev/ > > 9 build failed due to an incorrect merge between dev and client. > > Thank you, > With best regards. Petr. From anton.tarasov at oracle.com Fri Jan 31 11:12:44 2014 From: anton.tarasov at oracle.com (Anton V. Tarasov) Date: Fri, 31 Jan 2014 15:12:44 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE In-Reply-To: <52EB7627.40204@oracle.com> References: <52EA5857.3060801@oracle.com> <780768C7-DDEF-4F56-A55C-DA8B345052BD@oracle.com> <52EB56E9.3040800@oracle.com> <52EB7627.40204@oracle.com> Message-ID: <52EB852C.3000402@oracle.com> On 31.01.2014 14:08, Alexander Scherbatiy wrote: > > The fix looks good for me. > > Just a minor comment. It seem that the condition in DefaultDesktopManager: "if > (!floaterCollision) { .. } if(floaterCollision) {...}" > is the same as "if (!floaterCollision) { ... } else {...} ". I just wanted to keep it close to the copyArea (I had to let f.setBounds(currentBounds) go first). But I'm Ok to change it, I'll do that with push, if you don't object. Thanks, Anton. > > Thanks, > Alexandr. > > > On 1/31/2014 11:55 AM, Anton V. Tarasov wrote: >> Hi Petr, >> >> On 30.01.2014 18:16, Petr Pchelko wrote: >>> Hello, Anton. >>> >>> Great, you are removing the dirty JViewPort hack) >>> >>> I have one question: is JViewport a single place where we use the "blit" rendering? >> >> Yes, there's one more place - in DefaultDesktopManager. It BLITs on dragging a JInternalFrame >> instance but only in FASTER_DRAG_MODE which is not its default mode. I hadn't test it, but I >> tried. I switched the mode and what I see is that w/o any modifications a dragged JIF is, as >> expected, not repainted. I've put the notifications into the code. This made a JIF instance >> repaint on drag. However, there's an issue with the shadow. The shadow is not repainted, but >> background artifacts instead. I didn't yet find the reason, I suspect there's some async repaint >> which I probably don't catch. >> >> I suggest not to spend time in DefaultDesktopManager for now, as a) this functionality has less >> priority for SwingNode (than JViewport) b) it works fine in the default mode. So, I'll file a P5 >> against it. >> >> Please, look at the new webrev: >> >> http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.1 >> >> Besides modifications to DDM, I've put additional bounds constraint to >> JLF/RepaintListener.repaintPerformed. >> >>> Also, could you please update the copyright years. >> Sure, I did. >> >>> Also, may be we could replace the RepaintListener instantiation in JLWF with a lambda? What do >>> you think? >> >> Sure, we can. >> >> Thanks, >> Anton. >> >>> >>> With best regards. Petr. >>> >>> On 30.01.2014, at 17:49, "Anton V. Tarasov" wrote: >>> >>>> Hi all, >>>> >>>> Please review the fix. >>>> >>>> jira:https://bugs.openjdk.java.net/browse/JDK-8033233 >>>> webrev:http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 >>>> >>>> Here I'm duplicating JIRA: >>>> >>>> The point of the fix is that it introduces a RepaintListener which can be added to a >>>> RepaintManager in order to get back notifications of repaints performed as BLITs. >>>> JLightweightFrame registers such a listener to its RM instance. JViewport is the source of >>>> those notifications. Now it works in default BLIT_SCROLL_MODE. >>>> >>>> Shortly, the mechanism of repainting of a JLF is the following. Once a JLF's child component is >>>> requesting repaint, an appropriate repaint runnable is scheduled by the RepaintManager (RM). >>>> The runnable is then gets dispatched by the RM which calls the paint() method of the root >>>> component, that is the JLF. JLF overrides this method in the way that after all the painting is >>>> done (super.paint) it initiates a pixel bits transfer to the host application (e.g. SwingNode). >>>> In case of JViewport, when it works in the default BLIT scroll mode, scrolling of the JViewport >>>> doesn't lead to a repaint runnable being dispatched. Instead, JViewport immediately repaints >>>> its content (via blitting + repainting a dirty area) and then tells the RM there's nothing to >>>> repaint (so the runnable scheduled is just skipped). As the result, the JLF doesn't get any >>>> notification of the update. >>>> >>>> As a workaround to this problem, JViewport had been forcibly switched to the BACKINGSTORE >>>> scroll mode, in which case it passes the whole repainting cycle. >>>> >>>> Regards, >>>> Anton. >> > From alexandr.scherbatiy at oracle.com Fri Jan 31 11:57:12 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 31 Jan 2014 15:57:12 +0400 Subject: [9] Review request: 8033233 [JLightweightFrame] support default JViewport BLIT_SCROLL_MODE In-Reply-To: <52EB852C.3000402@oracle.com> References: <52EA5857.3060801@oracle.com> <780768C7-DDEF-4F56-A55C-DA8B345052BD@oracle.com> <52EB56E9.3040800@oracle.com> <52EB7627.40204@oracle.com> <52EB852C.3000402@oracle.com> Message-ID: <52EB8F98.8060704@oracle.com> Do not worry. The fix looks good for me. Thanks, Alexandr. On 1/31/2014 3:12 PM, Anton V. Tarasov wrote: > On 31.01.2014 14:08, Alexander Scherbatiy wrote: >> >> The fix looks good for me. >> >> Just a minor comment. It seem that the condition in >> DefaultDesktopManager: "if (!floaterCollision) { .. } >> if(floaterCollision) {...}" >> is the same as "if (!floaterCollision) { ... } else {...} ". > > I just wanted to keep it close to the copyArea (I had to let > f.setBounds(currentBounds) go first). But I'm Ok to change it, I'll do > that with push, if you don't object. > > Thanks, > Anton. > >> >> Thanks, >> Alexandr. >> >> >> On 1/31/2014 11:55 AM, Anton V. Tarasov wrote: >>> Hi Petr, >>> >>> On 30.01.2014 18:16, Petr Pchelko wrote: >>>> Hello, Anton. >>>> >>>> Great, you are removing the dirty JViewPort hack) >>>> >>>> I have one question: is JViewport a single place where we use the >>>> "blit" rendering? >>> >>> Yes, there's one more place - in DefaultDesktopManager. It BLITs on >>> dragging a JInternalFrame instance but only in FASTER_DRAG_MODE >>> which is not its default mode. I hadn't test it, but I tried. I >>> switched the mode and what I see is that w/o any modifications a >>> dragged JIF is, as expected, not repainted. I've put the >>> notifications into the code. This made a JIF instance repaint on >>> drag. However, there's an issue with the shadow. The shadow is not >>> repainted, but background artifacts instead. I didn't yet find the >>> reason, I suspect there's some async repaint which I probably don't >>> catch. >>> >>> I suggest not to spend time in DefaultDesktopManager for now, as a) >>> this functionality has less priority for SwingNode (than JViewport) >>> b) it works fine in the default mode. So, I'll file a P5 against it. >>> >>> Please, look at the new webrev: >>> >>> http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.1 >>> >>> Besides modifications to DDM, I've put additional bounds constraint >>> to JLF/RepaintListener.repaintPerformed. >>> >>>> Also, could you please update the copyright years. >>> Sure, I did. >>> >>>> Also, may be we could replace the RepaintListener instantiation in >>>> JLWF with a lambda? What do you think? >>> >>> Sure, we can. >>> >>> Thanks, >>> Anton. >>> >>>> >>>> With best regards. Petr. >>>> >>>> On 30.01.2014, at 17:49, "Anton V. >>>> Tarasov" wrote: >>>> >>>>> Hi all, >>>>> >>>>> Please review the fix. >>>>> >>>>> jira:https://bugs.openjdk.java.net/browse/JDK-8033233 >>>>> webrev:http://cr.openjdk.java.net/~ant/JDK-8033233/webrev.0 >>>>> >>>>> Here I'm duplicating JIRA: >>>>> >>>>> The point of the fix is that it introduces a RepaintListener which >>>>> can be added to a RepaintManager in order to get back >>>>> notifications of repaints performed as BLITs. JLightweightFrame >>>>> registers such a listener to its RM instance. JViewport is the >>>>> source of those notifications. Now it works in default >>>>> BLIT_SCROLL_MODE. >>>>> >>>>> Shortly, the mechanism of repainting of a JLF is the following. >>>>> Once a JLF's child component is requesting repaint, an appropriate >>>>> repaint runnable is scheduled by the RepaintManager (RM). The >>>>> runnable is then gets dispatched by the RM which calls the paint() >>>>> method of the root component, that is the JLF. JLF overrides this >>>>> method in the way that after all the painting is done >>>>> (super.paint) it initiates a pixel bits transfer to the host >>>>> application (e.g. SwingNode). In case of JViewport, when it works >>>>> in the default BLIT scroll mode, scrolling of the JViewport >>>>> doesn't lead to a repaint runnable being dispatched. Instead, >>>>> JViewport immediately repaints its content (via blitting + >>>>> repainting a dirty area) and then tells the RM there's nothing to >>>>> repaint (so the runnable scheduled is just skipped). As the >>>>> result, the JLF doesn't get any notification of the update. >>>>> >>>>> As a workaround to this problem, JViewport had been forcibly >>>>> switched to the BACKINGSTORE scroll mode, in which case it passes >>>>> the whole repainting cycle. >>>>> >>>>> Regards, >>>>> Anton. >>> >> > From alexandr.scherbatiy at oracle.com Fri Jan 31 15:47:10 2014 From: alexandr.scherbatiy at oracle.com (Alexander Scherbatiy) Date: Fri, 31 Jan 2014 19:47:10 +0400 Subject: Swing memory leak caused by JFrame.setLocation? In-Reply-To: References: Message-ID: <52EBC57E.2070908@oracle.com> Hello Nick, Could you create an issue on it http://bugreport.java.com/bugreport ? Thanks, Alexandr. On 1/30/2014 9:55 PM, Nick Miyake wrote: > Hello, > > I believe I have found an issue that causes a memory leak in the Java > process when using "JFrame.setLocation". > > If you launch the application in the sample program below (which > simply calls "setLocation" on a JFrame repeatedly) in MacOS using JDK > 1.7.0_06 or later and observe the memory usage of the application > using Activity Monitor and click the "setLocation x 1000" button, the > memory usage of the program nearly triples (on my machine, it goes > from 50MB to 150MB) and never decreases after that. The issue seems to > be with the Java process itself, as the heap/memory usage reported by > JConsole does not change. Repeating the same steps using JDK 1.7.0_05 > or earlier shows that this leak does not seem to happen. > > Sample code: > ---------------------------- > public final class MemoryLeakRepro { > private static final int NUM_SET_LOCATIONS = 1000; > public static void main(String[] args) { > javax.swing.SwingUtilities.invokeLater(new Runnable() { > public void run() { > final JFrame frame = new JFrame("Test"); > JPanel content = new JPanel(new GridLayout(1, 1)); > > JButton button = new JButton("setLocation x " + NUM_SET_LOCATIONS); > content.add(button); > button.addActionListener(new ActionListener() { > @Override > public void actionPerformed(ActionEvent e) { > for (int i = 0; i < NUM_SET_LOCATIONS; i++) { > int delta = (i % 2 == 0 ? 1 : -1); > frame.setLocation(frame.getX() + delta, frame.getY() + delta); > } > } > }); > frame.setContentPane(content); > frame.pack(); > frame.setVisible(true); > frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > } > }); > } > } > ---------------------------- > > A similar issue seems to reproduce on Windows as well (although not > using the same "setLocation" button method). If you use the other > sample program below, increase the window size and then drag the > JPanel all over the screen repeatedly, the memory usage goes from > around 28MB to 34MB or so and never comes back down. Repeating the > process can cause it to take up more and more memory, which never > seems to be released. The same behavior is not observed when dragging > the native title bar. This behavior occurs in both JDK 1.6.0_45 and in > all versions of JDK 7 I tested. > > Sample code: > ---------------------------- > public final class MemoryLeakRepro { > private static final int NUM_SET_LOCATIONS = 1000; > public static void main(String[] args) { > javax.swing.SwingUtilities.invokeLater(new Runnable() { > public void run() { > final JFrame frame = new JFrame("Test"); > JPanel content = new JPanel(new GridLayout(1, 1)); > > JPanel dragPanel = new JPanel(); > dragPanel.setPreferredSize(new Dimension(100, 100)); > FrameDragger frameDragger = new FrameDragger(frame); > dragPanel.addMouseListener(frameDragger); > dragPanel.addMouseMotionListener(frameDragger); > content.add(dragPanel); > frame.setContentPane(content); > frame.pack(); > frame.setVisible(true); > frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > } > }); > } > private static final class FrameDragger extends MouseAdapter { > private final JFrame frame; > private int prevMouseX; > private int prevMouseY; > public FrameDragger(JFrame frame) { > this.frame = frame; > } > @Override > public void mousePressed(MouseEvent e) { > prevMouseX = e.getX(); > prevMouseY = e.getY(); > } > @Override > public void mouseDragged(MouseEvent e) { > int currMouseX = e.getX(); > int currMouseY = e.getY(); > int currWindowX = frame.getX(); > int currWindowY = frame.getY(); > > int moveX = currMouseX - prevMouseX; > int moveY = currMouseY - prevMouseY; > if (moveX == 0 && moveY == 0) return; > > int newFrameX = currWindowX + moveX; > int newFrameY = currWindowY + moveY; > > frame.setLocation(newFrameX, newFrameY); > } > } > } > ---------------------------- > > Has anyone here seen this issue in the past or have any ideas about > what we could do to fix it? > > Thanks, > -Nick From joe.darcy at oracle.com Fri Jan 31 17:49:25 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 31 Jan 2014 09:49:25 -0800 Subject: JDK 9 RFR of JDK-8033221: Fix serial lint warnings in sun.swing.* In-Reply-To: <52EAA9D0.30203@oracle.com> References: <52E9E059.1010304@oracle.com> <52EA4E17.8040406@oracle.com> <52EAA9D0.30203@oracle.com> Message-ID: <52EBE225.9050901@oracle.com> Hello, On 01/30/2014 11:36 AM, Tom Hawtin wrote: > On 30/01/2014 13:05, Sergey Bylokhov wrote: >> It seems to me that in this fix we actually suppress a bugs. These >> classes can be extended from the public classes, and can be assigned to >> the parent. >> If serialization of these classes are not supported, we should block it >> via readObject+writeObject with assertion error, if it is supported it >> should be implemented. > > + readObjectNoData. Correctly spelt serialPersistenFields as an array > containing null appeared to be most effective, though implementation > dependent. > > Really the legacy serialisation mechanism should be extended with a > @NotActuallySerializable annotation. Apply that to sun.swing.-, > com.sun.swing.-, javax.swing.- and others. > > Tom > Especially for the JDK, javac should be a first-line static analysis tool to help find and prevent problems. Since the JDK can use a version of the Java language not supported anywhere else (while a feature release is in development), javac may be the only such static tool available. In my estimation, we are being hampered by not being able to use javac in this capacity to a greater degree in the JDK build. For example, during JDK 8 I pushed a fix for JDK-8021109 Add serialVersionUID to LambdaConversionException.java Another engineer had added an exception type and forgot to add a serialVersionUID (since all exception types are serializable, thanks RMI!). I've made this sort of omission myself and had to correct it later; this sort of omission would be kicked out immediately if the serial javac lint warning was enabled during the build. I am not a client engineer by training or inclination, but in JDK 9, I've been working on clearing the client libraries of lint and doclint warnings [1] to help complete the larger effort of clearing the jdk repository of such warnings, a stated goal for JDK 9 [2]. As a result, hundreds of lint warnings have been removed and three additional lint warning categories have been enabled in the build of the jdk repo so far in JDK 9 [3]. The serial warning is the lint category I'm currently working on. Many of the files I've been modifying haven't been updated for a decade or more and didn't seem likely to be updated absent a cleanup effort. I would welcome (and actually prefer!) more direct involvement from engineers with experience in the client code in the effort of clearing warnings in that code. If a more comprehensive update to the serialization status of the sun.* libraries is in order, I in no way oppose that. But, the better is the enemy of the good, and in the mean time I think we need a JDK build that is clean on javac lint warnings. Cheers, -Joe [1] JDK-8033221 Fix serial lint warnings in sun.swing.* JDK-8032733 Fix cast lint warnings in client libraries JDK-8032627 Add @SuppressWarnings("serial") to appropriate javax.swing classes JDK-8032616 Fix non-deprecation warnings in com.sun.beans.* JDK-8032047 Fix static lint warnings in client libraries JDK-8031736 Fix doclint issue in javax.print JDK-8031589 Fix doclint issues in java.beans.beancontext JDK-8031550 Fix overloads lint warnings in client code JDK-8031467 Fix doclint missing issues in java.awt.{dnd[.peer], datatransfer} JDK-8031082 Fix non-missing doclint problems in client libraries JDK-8030845 Fix doclint missing issues in java.awt.event [2] http://mail.openjdk.java.net/pipermail/jdk9-dev/2013-December/000141.html [3] JDK-8032734: Add cast lint warning to build of jdk repository JDK-8032048: Add static lint warning to build of jdk repository JDK-8031747: Add overloads lint warning to build of jdk repository From joe.darcy at oracle.com Fri Jan 31 23:46:07 2014 From: joe.darcy at oracle.com (Joseph Darcy) Date: Fri, 31 Jan 2014 15:46:07 -0800 Subject: Should changes to client libraries be pushed to jdk9/dev instead of jdk9/client In-Reply-To: <52EB754C.6040904@oracle.com> References: <52E40C2C.8070503@oracle.com> <52E4D5A4.4040104@oracle.com> <52EB67F2.7030800@oracle.com> <52EB754C.6040904@oracle.com> Message-ID: <52EC35BF.60505@oracle.com> On 1/31/2014 2:05 AM, Alan Bateman wrote: > On 31/01/2014 09:08, Sergey Bylokhov wrote: >> On 26.01.2014 13:30, Alan Bateman wrote: >>> As a side point, client changes have been going into jdk9/client >>> rather than jdk9/dev so I just wonder if there might be changes >>> backed up in jdk9/client that might cause issues when merged. >> It will be really good to push all fixes related to client to the >> jdk9/client. The first merge between dev and client already broke the >> build: >> https://bugs.openjdk.java.net/browse/JDK-8033326 > I've changed the subject line as I think this topic deserves its own > discussion. > > On this specific merge issue then I guess part of the issue is that > jdk9/client had not been sync'ed up in a long time. The changes to > SecurityManager (which involved changes to both core and client > libraries) were pushed to jdk9/dev on December 18. Also if the build > breakage (due to the merge issue) wasn't detected until it was pushed > to jdk9/client then something else is wrong. When doing a huge sync up > (and it looks like 300+ changes were being pulled from jdk9/dev in > this case) then I would think that the merge should involve doing at > least sanity builds on all platforms before pushing to jdk9/client. > > In any case, I think the discussion item here is where should changes > to client libraries be pushed. The discussion on jdk9-dev about this > issue wasn't very clear, I think it came down to whether any manual > testing would be required before integrating into master. At least for > jdk9/dev then my understanding is that there is a desire to integrate > into master every week, maybe more often and eventually (longer term) > continuously. I'm sure Joe will have suggestions on this issue. > Discussions are on going as to which forest client libraries fixes should go into, the client forest (where closed-source deployment changes happen to be going) or to the dev forest where all the other libraries work is going; FWIW, I favor the latter. In any case, for all the forests which will be integrating into dev, including the client and hotspot forests, the maintainers of those forests are responsible for regularly pulling down changes from dev and merging them in. In my estimation, unless there is a reason for temporary isolation, the frequency of syncing with dev should be closer to daily than weekly or monthly. The dev forest was open for business on Dec. 13, 2013, and fixes started going into it that day. From my reading of the JDK 9 master (http://hg.openjdk.java.net/jdk9/jdk9/jdk/), the tag for jdk9-b01 was added about three weeks ago. So if the first sync from dev into client has only done in the last day or two, that would seem to be tardy to me. The goal for dev is to have integrations into master no less than weekly, but I'd like us to transition to having smaller and more frequent integrations. We are laying the foundational work, cleaning up intermittent test failures, etc. to allow that to happen. Cheers, -Joe