Re: [11] JDK-8194873: right ALT key hotkeys no longer work in Swing components

2018-04-10 Thread Andrej Golovnin
(modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK)); Applying '||' on the same value does not make sense. I think the line 3541 should use 'java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK': 3541 (modifiers & java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK)); Best regards, Andrej Golovnin

Re: [11][JDK-4842658] RFR: DefaultListModel and DefaultComboBoxModel should support addAll (Collection c)

2018-04-09 Thread Andrej Golovnin
ed(this, index, index + c.size() - 1); src/java.desktop/share/classes/javax/swing/DefaultListModel.java 574 if(c.isEmpty()) { There should be a space after 'if'. Best regards, Andrej Golovnin

Re: [11] [JDK-8201173] Remove duplicated code in AbstractListModel class

2018-04-09 Thread Andrej Golovnin
mple code. The code in the AbstractListModel class exists in his current form for decades and does not have any bug and there is no real need to change it. Best regards, Andrej Golovnin PS: FYI, I know all lambda related articles/papers which were produced by the Core, HotSpot and Performanc

Re: [11] [JDK-8201173] Remove duplicated code in AbstractListModel class

2018-04-06 Thread Andrej Golovnin
the holy grail. Just because lambdas exists it does not mean we should change every piece of code to use it. Your change will introduce a performance regression to every application that makes huge use of JLists and fires many events. Best regards, Andrej Golovnin On Fri, Apr 6, 2018 at 11:59

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Andrej Golovnin
Hi Pankaj, > Webrev: http://cr.openjdk.java.net/~pbansal/5076761/webrev.03/ src/java.desktop/share/classes/javax/swing/JList.java 2379 for(i = 0, c = dm.getSize(); i < c; i++) { There should be a space after "for". Otherwise looks good. Thanks! Best regards, Andrej Golovnin

Re: [11] Review Request: JDK-6257207 : JTable.getDefaultEditor throws undocumented NullPointerException

2018-01-05 Thread Andrej Golovnin
would throw NPE. Best regards, Andrej Golovnin On Fri, Jan 5, 2018 at 1:16 PM, Pankaj Bansal wrote: > Hi All, > > > > Please review the fix for JDK 11. > > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-6257207 > > > > Webrev: > > ht

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Andrej Golovnin
e/index-v6.html#toc-whitespace for details). Best regards, Andrej Golovnin

Re: [10] Review Request: JDK-7108280 : JList.getSelectedValuesList fails if JList.setSelectionInterval larger than list

2017-12-07 Thread Andrej Golovnin
. Best regards, Andrej Golovnin On Fri, Dec 8, 2017 at 8:13 AM, Pankaj Bansal wrote: > Hi All, > > Thank you for your reviews. > > I think we need to finalize on where to make changes, before going any > further . We have following few options > > 1. Change setSelectionInt

Re: [10] Review Request: JDK-7108280 : JList.getSelectedValuesList fails if JList.setSelectionInterval larger than list

2017-12-06 Thread Andrej Golovnin
. Best regards, Andrej Golovnin On Tue, Dec 5, 2017 at 11:29 PM, Sergey Bylokhov wrote: > Hello. > On 01/12/2017 02:47, Jayathirth D V wrote: >> >> As you have mentioned I also feel that adding check in >> setSelectionInterval() or addSelectionInterval() would be a good app

Re: [10] Review Request: 5031664 Increase thread safety of EventListenerList

2017-11-09 Thread Andrej Golovnin
Hi Sergey, the order of modifiers is wrong. It should be "protected transient volatile". See http://cr.openjdk.java.net/~alundblad/styleguide/index-v6.html#toc-modifiers for details. Best regards, Andrej Golovnin On Fri, Oct 27, 2017 at 1:18 AM, Sergey Bylokhov wrote: > Hello, &g

Re: [9] Review request for 8165594 Bad rendering of Swing UI controls with Windows Classic L&F on HiDPI display

2016-09-21 Thread Andrej Golovnin
Hi Alexandr, looks good. Thanks! Best regards, Andrej Golovnin > On 20 Sep 2016, at 18:35, Alexandr Scherbatiy > wrote: > > > Thank you for the suggested code. > > Could you review the updated fix: >http://cr.openjdk.java.net/~alexsch/8165594/webrev.04 >

Re: [9] Review request for 8165594 Bad rendering of Swing UI controls with Windows Classic L&F on HiDPI display

2016-09-16 Thread Andrej Golovnin
n the other hand I'm not sure, whether we should invest a lot of time into making Windows Classic L&f to look perfect on HiDPI screens. Best regards, Andrej Golovnin [1] http://cr.openjdk.java.net/~alundblad/styleguide/

Re: [9] Review request for 8165485 Bad rendering of Swing UI controls with Motif L&F on HiDPI display

2016-09-08 Thread Andrej Golovnin
Hi Alexandr, this looks much better now. Thanks! Best regards, Andrej Golovnin On Thu, Sep 8, 2016 at 9:52 PM, Alexandr Scherbatiy wrote: > > Hello, > > Could you review the updated fix: > http://cr.openjdk.java.net/~alexsch/8165485/webrev.02 > > - shadow lines are up

Re: [9] Review request for 8165485 Bad rendering of Swing UI controls with Motif L&F on HiDPI display

2016-09-08 Thread Andrej Golovnin
The combobox icon does not look right for me. The shadow line goes to far at the top. Best regards, Andrej Golovnin

Re: [9] Review request for 8165594 Bad rendering of Swing UI controls with Windows Classic L&F on HiDPI display

2016-09-08 Thread Andrej Golovnin
ts for comparison. Personally when I would make changes like that, then my code would look like this: if (isNotHiDPI() || itMakesMoreSenseToUseTheOldCode()) { // use the old good code. } else { // use the new code } Best regards, Andrej Golovnin > [2] > http://cr.openjdk.java.

Re: [9] Fix for JDK-6567433 : JComponent.updateUI() may create StackOverflowError

2016-07-12 Thread Andrej Golovnin
Hi Ajit, it looks good for me. Thanks! And you need a reviewer from the Swing team as I don’t have the reviewer role. Best regards, Andrej Golovnin > > -Original Message- > From: Ajit Ghaisas > Sent: Friday, July 08, 2016 10:32 AM > To: Andrej Golovnin > Cc: Rajeev

Re: [9] Fix for JDK-6567433 : JComponent.updateUI() may create StackOverflowError

2016-07-07 Thread Andrej Golovnin
component, then the call of the #updateUI()-method on the deserialized instance would never update the UI of the deserialized component because the flag updateInProgress will never change from true to false. Best regards, Andrej Golovnin

Re: [9] Fix for JDK-6567433 : JComponent.updateUI() may create StackOverflowError

2016-07-07 Thread Andrej Golovnin
Hi Ajit, src/java.desktop/share/classes/javax/swing/JList.java In the line 545 there are unnecessary brackets: 545 if ((renderer instanceof Component)) { It should look like this: 545 if (renderer instanceof Component) { Best regards, Andrej Golovnin

Re: Programmatically clicking a JLabel in a JList

2016-06-08 Thread Andrej Golovnin
7:44 AM, Andrej Golovnin wrote: > Hi Pete, > > you can either use java.awt.Robot or you can dispatch an event by > calling java.awt.Component.dispatchEvent(AWTEvent). > > Best regards, > Andrej Golovnin > > On Wed, Jun 8, 2016 at 10:46 PM, Pete Brunet wrote: >> To

Re: Programmatically clicking a JLabel in a JList

2016-06-08 Thread Andrej Golovnin
Hi Pete, you can either use java.awt.Robot or you can dispatch an event by calling java.awt.Component.dispatchEvent(AWTEvent). Best regards, Andrej Golovnin On Wed, Jun 8, 2016 at 10:46 PM, Pete Brunet wrote: > To add some accessibility support I need to programmatically click a > JLabe

Re: RfR, JDK-8145228 , Java Access Bridge, getAccessibleStatesStringFromContext doesn't wrap the call to getAccessibleRole

2016-03-19 Thread Andrej Golovnin
e(); 1413 }, ac); You can rewrite it as: 1411 AccessibleRole role = InvocationUtils.invokeAndWait(ac::getAccessibleRole, ac); In the first case the Java compiler would generate a syntactic method and in the second case not. Best regards, Andrej Golovnin

Re: [9] Review request for 8132119 Provide public API for text related methods in SwingUtilities2

2016-01-25 Thread Andrej Golovnin
to create a composite font, a method to convert DLUs to pixels. Best regards, Andrej Golovnin

Re: Review Request for Bug 8146320 JTextField ignores setPreferredSize when having columns

2016-01-22 Thread Andrej Golovnin
o see bug reports as soon as JDK 9 is released. Best regards, Andrej Golovnin > > However, this really looks like a corner case between a real bug and > already used public API. > It would be better to have more opinions about it. > > Thanks, > Alexandr. >> >> >> Best regards, >> Andrej Golovnin > >

Re: Review Request for Bug 8146320 JTextField ignores setPreferredSize when having columns

2016-01-21 Thread Andrej Golovnin
ut).). But your change would break now this implementation. After your change the field would have only the size of 10 pixels x 20 pixels ant not the expected 10 columns x 20 pixels. Best regards, Andrej Golovnin

Re: Review Request for Bug 8146320 JTextField ignores setPreferredSize when having columns

2016-01-21 Thread Andrej Golovnin
javax.swing.border.EmptyBorder; /** * @author Andrej Golovnin */ public class Main { public static void main(String... argv) { EventQueue.invokeLater(Main::createAndShowUI); } private static void createAndShowUI() { JTextField jdk8 = new JTextField(10); jdk8

Re: [9] Review Request for 8081722: Provide public API for file hierarchy provided by sun.awt.shell.ShellFolder

2016-01-20 Thread Andrej Golovnin
Hi Semyon, > The webrev is updated: > http://cr.openjdk.java.net/~ssadetsky/8081722/webrev.04/ Thanks! Looks good for me (I'm not a reviewer). Best regards, Andrej Golovnin

Re: [9] Review Request for 8081722: Provide public API for file hierarchy provided by sun.awt.shell.ShellFolder

2016-01-19 Thread Andrej Golovnin
urn value should not start with capital letter (affected lines 112, 126, 151), e.g.: 112 * @return An array of {@code File} objects. should be written as: 112 * @return an array of {@code File} objects. In the line 151 the javadoc tag @code is not used for null. Best regards, Andrej Golovnin

Re: Tool to display Swing control hierarchy

2015-11-25 Thread Andrej Golovnin
On Wed, Nov 25, 2015 at 2:24 PM, Sergey Bylokhov wrote: > Note that in jdk9 this option is disabled by default, to enable it you > should pass -Dsun.awt.nativedebug=true to the java. Sergey, thank you for the hint! I didn't know that. Best regards, Andrej Golovnin

Re: Tool to display Swing control hierarchy

2015-11-24 Thread Andrej Golovnin
Hi Pete, start your Swing application from the console. When you application is started and has focus, then press CTRL-SHIFT-F1. Now you should see the control hierarchy in the console. Best regards, Andrej Golovnin On Wed, Nov 25, 2015 at 5:23 AM, Pete Brunet wrote: > Is there a tool t

Re: [9] Review request for 8132119 Provide public API for text related methods in SwingUtilities2

2015-11-24 Thread Andrej Golovnin
In the most cases the @see tag is placed after @param tags but before the @since tag. Otherwise looks good for me. But I'm not a reviewer. You will still need one. :-) Best regards, Andrej Golovnin

Re: Review request for 8133039 Provide public API to sun.swing.UIAction#isEnabled(Object)

2015-11-11 Thread Andrej Golovnin
Hi Alexander, >You are right. > > There is the updated fix there the sender type is Object: > http://cr.openjdk.java.net/~alexsch/8133039/webrev.01 > this one looks good for me. Best regards, Andrej Golovnin

Re: Review request for 8133039 Provide public API to sun.swing.UIAction#isEnabled(Object)

2015-11-10 Thread Andrej Golovnin
notifyAction(Action action, KeyStroke ks, 1732KeyEvent event, JComponent sender, Don't you think it may break binary compatibility? The method exists since JDK 1.3. Best regards, Andrej Golovnin

Re: Public API for internal Swing classes.

2015-07-27 Thread Andrej Golovnin
Hi Alexander, in our application we make use of sun.font.FontUtilities.fontSupportsDefaultEncoding(Font) sun.font.FontUtilities.getCompositeFontUIResource(Font) to obtain an instance of CompositeFont. Best regards, Andrej Golovnin On Mon, Jul 27, 2015 at 2:30 PM, Alexander Scherbatiy wrote

Re: Replace concat String to append in StringBuilder parameters

2014-08-26 Thread Andrej Golovnin
;) should be changed to: 316 sb.append("Extension unknown: DER encoded OCTET string =\n") same problems are in src/java.base/share/classes/sun/security/x509/X509CRLImpl.java in the line 576 src/java.base/share/classes/sun/security/x509/X509CertInfo.java in the line 332 Best regards, Andrej Golovnin

Re: Replace concat String to append in StringBuilder parameters

2014-08-21 Thread Andrej Golovnin
Hi Martin, you are right. And in the line 297: 297 sb.append(getClass().getName()).append(' ').append(Integer.toString(hashCode())); Integer.toString() can be removed too. Best regards, Andrej Golovnin On Thu, Aug 21, 2014 at 3:26 PM, Martin Desruisseaux < mar

Re: Replace concat String to append in StringBuilder parameters

2014-08-21 Thread Andrej Golovnin
indentation. I looked only at src/java.desktop/share/classes/javax/swing/RepaintManager.java. Best regards, Andrej Golovnin > >http://cr.openjdk.java.net/~weijun/8038277/core/webrev.00/ >http://cr.openjdk.java.net/~weijun/8038277/extra/webrev.00/ > > --Max > > On

Re: Replace concat String to append in StringBuilder parameters

2014-08-12 Thread Andrej Golovnin
urity/cert/X509CertSelector.java src/share/classes/javax/crypto/CryptoPermission.java src/share/classes/javax/management/relation/Role.java In src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj in the line 423 a dot is missed before append: 423 {jjtn000.name.append( '.')append(t.image); }

Re: Replace concat String to append in StringBuilder parameters

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

Re: Replace concat String to append in StringBuilder parameters

2014-08-11 Thread Andrej Golovnin
Hi Otávio, please ignore the previous diff. I'm sorry, there was a small mistake. I have attached the corrected version. Best regards, Andrej Golovnin On Mon, Aug 11, 2014 at 1:55 PM, Andrej Golovnin wrote: > Hi Otávio, > > About the template in Parser.jjt, TokenMgrError.java

Re: Replace concat String to append in StringBuilder parameters

2014-08-11 Thread Andrej Golovnin
ects/javacc/lists on the dev or users mailing lists and send a message to JavaCC project. I'm sure the developers of JavaCC would help you. Best regards, Andrej Golovnin > About readable of code I just renamed this class to sb instead of buf, > strbuf, etc. Because using StringBuilder bey

Re: Replace concat String to append in StringBuilder parameters

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

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

2014-07-11 Thread Andrej Golovnin
side of the range [-127, 128]. Therefore they won't be cached. But this one: 676 Integer four = 4; can be indeed inlined. Best regards, Andrej Golovnin > > With best regards. Petr. > > On Jul 11, 2014, at 5:36 AM, Otávio Gonçalves de Santana < > otaviopolianas