Integrated: 8288067: Avoid redundant HashMap.containsKey call in Type1Font.expandAbbreviation

2022-07-13 Thread Andrey Turbanov
On Wed, 8 Jun 2022 17:50:35 GMT, Andrey Turbanov wrote: > Instead of pair HashMap.containsKey/HashMap.get method calls, we can use > single call HashMap.getOrDefault. > It's faster and clearer. This pull request has now been integrated. Changeset: 02fae607 Author:Andrey Turbanov URL:

Re: RFR: 8288067: Avoid redundant HashMap.containsKey call in Type1Font.expandAbbreviation

2022-07-13 Thread Andrey Turbanov
On Wed, 8 Jun 2022 17:50:35 GMT, Andrey Turbanov wrote: > Instead of pair HashMap.containsKey/HashMap.get method calls, we can use > single call HashMap.getOrDefault. > It's faster and clearer. Thanks for the review! - PR: https://git.openjdk.org/jdk/pull/9089

Re: RFR: 8282526: Default icon is not painted properly [v7]

2022-07-13 Thread Alexander Zuev
On Wed, 13 Jul 2022 23:12:55 GMT, Phil Race wrote: > It isn't in this webrev but i jyst noticed > // We only care about width since we don't support non-rectangular icons > I think that meant non-square ??? Yes. Now it seems to be apparent that English is not my native language... -

Re: RFR: 8054572: [macosx] JComboBox paints the border incorrectly [v2]

2022-07-13 Thread Prasanta Sadhukhan
On Tue, 12 Jul 2022 22:56:37 GMT, Damon Nguyen wrote: >> When a JComboBox is editable, the button segment of the combo box is >> misaligned vertically and has a different height. This change fixes these >> issues and adds a manual test that checks the appearance of an editable and >> non-edita

Re: RFR: 8284767: Create an automated test for JDK-4422535 [v4]

2022-07-13 Thread Srinivas Mandalika
On Wed, 22 Jun 2022 11:42:06 GMT, Srinivas Mandalika wrote: >> Create an automated test for >> [JDK-4422535](https://bugs.openjdk.java.net/browse/JDK-4422535) >> AccessibleValue implementation only accept Integers >> The AccessibleValue implementations of the following components: >> >> java.a

Re: RFR: 8286172: Create an automated test for JDK-4516019 [v4]

2022-07-13 Thread Srinivas Mandalika
On Thu, 9 Jun 2022 07:32:29 GMT, Srinivas Mandalika wrote: >> Create an automated test for >> [JDK-4516019](https://bugs.openjdk.java.net/browse/JDK-4516019) >> >> Clicking on the increment/decrement buttons of the spinner does not install >> focus on the spinner or one of its focusable child

Re: RFR: 8284524: Create an automated test for JDK-4422362 [v4]

2022-07-13 Thread Srinivas Mandalika
On Wed, 22 Jun 2022 12:52:42 GMT, Srinivas Mandalika wrote: >> Create an automated test for >> [JDK-4422362](https://bugs.openjdk.java.net/browse/JDK-4422362) >> >> The BoundedRangeModel components (JScrollBar, JSlider, JProgressBar) return >> BoundedRangeModel.getMaximum() from getMaximumAcce

Re: RFR: 8286270: [java.desktop] Replace color search in XColors with a switch statement [v3]

2022-07-13 Thread Julian Waters
On Thu, 14 Jul 2022 00:22:39 GMT, Phil Race wrote: > I've hesitated asking for help, but the builds aren't working and I can't > tell _why_. Don't worry about it, sometimes the tests fail due to issues unrelated to the PR, you can check the tests that failed from within the PR itself

Re: RFR: 8286270: [java.desktop] Replace color search in XColors with a switch statement [v3]

2022-07-13 Thread Phil Race
On Fri, 20 May 2022 00:53:27 GMT, SWinxy wrote: >> The current implementation creates ~750 new objects on load, and uses a >> binary array search with a Comparable implementation. This implementation is >> probably bad. Instead, we can use the enhanced switch feature to possibly >> save time,

Re: RFR: 8286270: [java.desktop] Replace color search in XColors with a switch statement [v3]

2022-07-13 Thread SWinxy
On Fri, 20 May 2022 00:53:27 GMT, SWinxy wrote: >> The current implementation creates ~750 new objects on load, and uses a >> binary array search with a Comparable implementation. This implementation is >> probably bad. Instead, we can use the enhanced switch feature to possibly >> save time,

Re: RFR: 8282526: Default icon is not painted properly [v7]

2022-07-13 Thread Phil Race
On Wed, 6 Jul 2022 18:17:41 GMT, Alexander Zuev wrote: >> Detect the situation where we do need to perform interpolation during >> ImageIcon >> painting and set a hint to the rendering to perform bicubic approximation so >> image details are preserved during transition. > > Alexander Zuev has up

Re: RFR: 8286270: [java.desktop] Replace color search in XColors with a switch statement [v2]

2022-07-13 Thread Phil Race
On Fri, 20 May 2022 00:49:23 GMT, SWinxy wrote: >> SWinxy has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Remove @author tags per request > > I did an automated test to see if those were the only other things wrong. > Those were the onl

Integrated: 8289559 : java/awt/a11y/AccessibleJPopupMenuTest.java test fails with java.lang.NullPointerException

2022-07-13 Thread lawrence . andrews
On Thu, 30 Jun 2022 23:58:44 GMT, lawrence.andrews wrote: > Fixed the java.lang.NullPointerException & tested . > > @shurymury This pull request has now been integrated. Changeset: 3216d198 Author:lawrence.andrews Committer: Phil Race URL: https://git.openjdk.org/jdk/commit/3216d1

Re: RFR: 8288067: Avoid redundant HashMap.containsKey call in Type1Font.expandAbbreviation

2022-07-13 Thread Phil Race
On Wed, 8 Jun 2022 17:50:35 GMT, Andrey Turbanov wrote: > Instead of pair HashMap.containsKey/HashMap.get method calls, we can use > single call HashMap.getOrDefault. > It's faster and clearer. Marked as reviewed by prr (Reviewer). - PR: https://git.openjdk.org/jdk/pull/9089

Re: RFR: 8054572: [macosx] JComboBox paints the border incorrectly [v2]

2022-07-13 Thread Damon Nguyen
On Wed, 13 Jul 2022 11:31:07 GMT, Prasanta Sadhukhan wrote: > Can you please show before and after fix image of the editable combobox? It > seems the border around the button makes it feel it's still not aligned > properly which gives the impression that the button is bigger than textfield. >

Re: RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v4]

2022-07-13 Thread Andy Goryachev
On Wed, 13 Jul 2022 16:54:48 GMT, Naoto Sato wrote: >> I would like to emphasize that this issue is complicated. Plural rules vary >> from language to language, adding plural strings to resource bundles adds >> costs in terms of translation and testing. >> >> If we were to support proper pl

Re: RFR: 8289908: Skip bounds check for cases when String is constructed from entirely used byte[] [v4]

2022-07-13 Thread Сергей Цыпанов
On Wed, 13 Jul 2022 15:44:04 GMT, Roger Riggs wrote: >> Сергей Цыпанов has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains six additional >> commits

Re: RFR: 8289908: Skip bounds check for cases when String is constructed from entirely used byte[] [v5]

2022-07-13 Thread Сергей Цыпанов
> We can skip bounds check and null check for Charset in case we use the array > entirely and the Charset is either default one or proven to be non-null. > > Benchmark results: > > before > > Benchmark Mode Cnt Score > Error Units > StringC

Re: RFR: 8288948: Few J2DBench tests indicate lower primitive drawing performance with metal rendering pipeline [v2]

2022-07-13 Thread Ajit Ghaisas
On Wed, 13 Jul 2022 09:25:08 GMT, Sergey Bylokhov wrote: >> Earlier logic used to draw a rectangle with MTLPrimitiveTypeLineStrip. >> Hence, 5 vertices were specified to draw 4 sides of the rectangle. >> Now, the logic has been changed to use MTLPrimitiveTypeLine. Hence, 4 lines >> need to be

Re: RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v4]

2022-07-13 Thread Naoto Sato
On Wed, 13 Jul 2022 15:23:28 GMT, Andy Goryachev wrote: >> ok, should I revert back "B" to "bytes" in basic.properties and commit? > > I would like to emphasize that this issue is complicated. Plural rules vary > from language to language, adding plural strings to resource bundles adds > costs

Re: RFR: 8289908: Skip bounds check for cases when String is constructed from entirely used byte[] [v4]

2022-07-13 Thread Roger Riggs
On Wed, 13 Jul 2022 15:11:25 GMT, Сергей Цыпанов wrote: >> We can skip bounds check and null check for Charset in case we use the array >> entirely and the Charset is either default one or proven to be non-null. >> >> Benchmark results: >> >> before >> >> Benchmark

Re: RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v4]

2022-07-13 Thread Andy Goryachev
On Wed, 13 Jul 2022 07:22:56 GMT, Abhishek Kumar wrote: >> am not sure if resource file can support {1} byte case...if that is >> supported, then you can use that...but likelihood of 1 byte file is very >> rare so I guess we can ignore it, that's my opinion. > > ok, should I revert back "B" to

Re: RFR: 8289908: Skip bounds check for cases when String is constructed from entirely used byte[] [v4]

2022-07-13 Thread Сергей Цыпанов
> We can skip bounds check and null check for Charset in case we use the array > entirely and the Charset is either default one or proven to be non-null. > > Benchmark results: > > before > > Benchmark Mode Cnt Score > Error Units > StringC

Re: RFR: 8289908: Skip bounds check for cases when String is constructed from entirely used byte[] [v4]

2022-07-13 Thread Сергей Цыпанов
On Tue, 12 Jul 2022 15:57:12 GMT, Roger Riggs wrote: >> Benchmark results after: >> >> Benchmark Mode Cnt Score >> Error Units >> StringConstructor.newStringFromArray avgt 50 4,354 >> ± 0,195 ns/op >> StringConstru

RFR: 7132413: [macosx] closed/javax/swing/AbstractButton/5049549/bug5049549.java fails on MacOS

2022-07-13 Thread Prasanta Sadhukhan
It was seen that some of the icons like disabled-selected:, rollover icons are not shown. Fixed to get the default selected icon and use that if in case the icon for that state is not set. - Commit messages: - Fix showig proper icon Changes: https://git.openjdk.org/jdk/pull/9481/

Re: RFR: 8267374: (macos) Left Option+Up/Down arrow dont traverse to beginning/end of line in textarea [v5]

2022-07-13 Thread Prasanta Sadhukhan
On Tue, 12 Jul 2022 19:31:42 GMT, Sergey Bylokhov wrote: >> Even if JavaFX, Left and Right Option key is mapped to ALT so I guess we >> will be consistent with that too. > >> > One macOS you will not see the "Alt" key as well, but we use that name. >> >> At least I can see > > Just a clarific

Re: RFR: 8289208: Test DrawRotatedStringUsingRotatedFont.java occasionally crashes on MacOS

2022-07-13 Thread Maxim Kartashev
On Wed, 13 Jul 2022 08:58:38 GMT, Sergey Bylokhov wrote: > Don't we have a similar issue in the usage of records and queue? Is it > possible that the target object in the add method will be deallocated before > ref will be added to the records? Yes, I believe it can be deallocated before the

Re: RFR: 8054572: [macosx] JComboBox paints the border incorrectly [v2]

2022-07-13 Thread Prasanta Sadhukhan
On Tue, 12 Jul 2022 22:56:37 GMT, Damon Nguyen wrote: >> When a JComboBox is editable, the button segment of the combo box is >> misaligned vertically and has a different height. This change fixes these >> issues and adds a manual test that checks the appearance of an editable and >> non-edita

Re: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines [v3]

2022-07-13 Thread Sergey Bylokhov
On Wed, 29 Jun 2022 06:53:29 GMT, Manukumar V S wrote: >> java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS >> machines, especially in MacOSX 12 machines. It seems to be a testbug as >> adding some stability improvements fix the issue. It intermittently fails in >> CI cau

Re: RFR: 8288948: Few J2DBench tests indicate lower primitive drawing performance with metal rendering pipeline [v2]

2022-07-13 Thread Sergey Bylokhov
On Wed, 13 Jul 2022 03:53:28 GMT, Ajit Ghaisas wrote: > We cannot use MTLPrimitiveTypeLineStrip if we want to batch the subsequent > draw calls as it draws an unwanted line between previous rectangle and > current rectangle. Even if the alpha will be transparent? Just curious. -

Re: RFR: 8282526: Default icon is not painted properly [v6]

2022-07-13 Thread Sergey Bylokhov
On Fri, 8 Jul 2022 15:59:57 GMT, Alexey Ivanov wrote: > This sounds reasonable… until you take into account the fact the `Icon` or > `ImageIcon` has no reference to a component. When the icon is requested, the > scale at which will be rendered is unknown. Correct. > When an icon is rendered a

Re: RFR: 8169187: [macosx] Aqua: java/awt/image/multiresolution/MultiresolutionIconTest.java [v2]

2022-07-13 Thread Sergey Bylokhov
On Fri, 8 Jul 2022 22:42:20 GMT, Alisen Chung wrote: >> Removed darkening of icons on button press in Aqua to match other L&Fs. The >> icon darkening was causing this test to fail on MacOS. >> >> The test is passing on all platforms after this change. > > Alisen Chung has updated the pull reque

Re: RFR: 8289208: Test DrawRotatedStringUsingRotatedFont.java occasionally crashes on MacOS

2022-07-13 Thread Sergey Bylokhov
On Mon, 11 Jul 2022 10:01:18 GMT, Maxim Kartashev wrote: > will be executed on the disposer thread simultaneously with the array > relocation of `deferredRecords`. So some of the `get()` calls will return > `null` as they read from initialized, but yet-to-be-relocated chunks, and > some will

Re: RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v4]

2022-07-13 Thread Abhishek Kumar
On Wed, 13 Jul 2022 07:14:31 GMT, Prasanta Sadhukhan wrote: >> In that case to handle 1 byte, do i need to add separate property in >> properties file? >> If filesize=1 then can get "byte" string from properties file and can format >> using MessageFormat? > > am not sure if resource file can s

Re: RFR: 6391806: JLabel and AbstractButton's imageUpdate method should be better specified [v5]

2022-07-13 Thread Abhishek Kumar
On Tue, 12 Jul 2022 22:26:22 GMT, Phil Race wrote: > Will there be an update to reflect the text discussed above ? I have Updated the imageUpdate method description. - PR: https://git.openjdk.org/jdk/pull/9240

Re: RFR: 6391806: JLabel and AbstractButton's imageUpdate method should be better specified [v6]

2022-07-13 Thread Abhishek Kumar
> JLabel and AbstractButton's imageUpdate method description updated. Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: JLabel and AbstractButton imageUpdate method description modified - Changes: - all: https://git.op

Re: RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v4]

2022-07-13 Thread Prasanta Sadhukhan
On Wed, 13 Jul 2022 07:11:16 GMT, Abhishek Kumar wrote: >> i guess it's not right then, no? if you are changing to mimic native, then >> it should be "bytes" and not "B". Just for 1 byte case, you cannot >> compromise on other file size(s), in my opinion. >> Also, what's the likelihood of havin

Re: RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v4]

2022-07-13 Thread Abhishek Kumar
On Wed, 13 Jul 2022 06:51:42 GMT, Prasanta Sadhukhan wrote: >> It will show 433 B now, in ubuntu native it shows 433 bytes. >> bytes replaced by B to handle plural forms, otherwise for 1 byte file it >> show 1 bytes. > > i guess it's not right then, no? if you are changing to mimic native, the

Re: RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v4]

2022-07-13 Thread Prasanta Sadhukhan
On Wed, 13 Jul 2022 06:01:39 GMT, Abhishek Kumar wrote: >> src/java.desktop/share/classes/sun/swing/FilePane.java line 1203: >> >>> 1201: } >>> 1202: } else if (len < 1024L) { >>> 1203: text = MessageFormat.format(byteString, len); >> >> F