Re: [OpenJDK 2D-Dev] RFR: 8273102: Delete deprecated for removal the empty finalize() in java.desktop module

2021-09-07 Thread Alexey Ivanov
On Sun, 29 Aug 2021 01:09:36 GMT, Sergey Bylokhov wrote: > The "java.desktop" module has a few implementations of the finalize() which > do nothing, deprecated since jdk9, and are marked "forRemoval = true" since > jdk16. > > This is a request to delete such empty methods. > > CSR:

Re: [OpenJDK 2D-Dev] RFR: 8272756: Remove unnecessary explicit initialization of volatile variables in java.desktop

2021-08-23 Thread Alexey Ivanov
On Mon, 23 Aug 2021 17:57:52 GMT, Sergey Bylokhov wrote: >> Maybe it's kind of a protection from a race. Yet it's possible either way: >> another thread could see `essentialTags == null` before this one initialises >> the field. > > I think we can drop it completely. Agree. -

Re: [OpenJDK 2D-Dev] RFR: 8272756: Remove unnecessary explicit initialization of volatile variables in java.desktop

2021-08-23 Thread Alexey Ivanov
On Mon, 23 Aug 2021 06:35:34 GMT, Сергей Цыпанов wrote: >> src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java >> line 64: >> >>> 62: Set tags = essentialTags; >>> 63: if (tags == null) { >>> 64: essentialTags = Set.of( >> >> What is the

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v4]

2021-08-04 Thread Alexey Ivanov
On Tue, 3 Aug 2021 23:42:55 GMT, Sergey Bylokhov wrote: >> This is a request to clean up a desktop module as was done in JDK-8233884 >> for "java.base" module. >> >> In many places standard charsets are looked up via their names, for example: >> absolutePath.getBytes("UTF-8"); >> >> This

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v2]

2021-08-03 Thread Alexey Ivanov
On Tue, 3 Aug 2021 22:03:54 GMT, Sergey Bylokhov wrote: > > I am fine to do that, if there are no objections I can change the whole fix. Modifying the entire changeset seems like an overkill. Using static imports in only one file is _inconsistent_, yet it makes the places where the encodings

Re: [OpenJDK 2D-Dev] RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v2]

2021-08-03 Thread Alexey Ivanov
On Tue, 3 Aug 2021 19:37:04 GMT, Sergey Bylokhov wrote: >> This is a request to clean up a desktop module as was done in JDK-8233884 >> for "java.base" module. >> >> In many places standard charsets are looked up via their names, for example: >> absolutePath.getBytes("UTF-8"); >> >> This

Re: [OpenJDK 2D-Dev] RFR: 8269637: javax/swing/JFileChooser/FileSystemView/SystemIconTest.java fails on windows

2021-07-14 Thread Alexey Ivanov
On Wed, 14 Jul 2021 11:19:53 GMT, Alexander Zuev wrote: > Make fallback code for inaccessible file to return multiresolution icon > Remove test from ProblemList Marked as reviewed by aivanov (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/4777

Re: [OpenJDK 2D-Dev] RFR: 8269637: javax/swing/JFileChooser/FileSystemView/SystemIconTest.java fails on windows

2021-07-14 Thread Alexey Ivanov
On Wed, 14 Jul 2021 11:19:53 GMT, Alexander Zuev wrote: > Make fallback code for inaccessible file to return multiresolution icon > Remove test from ProblemList So, essentially all the icons returned are MultiResolutionIcon even if there's only one icon, right? - PR:

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v14]

2021-05-26 Thread Alexey Ivanov
On Wed, 26 May 2021 17:40:44 GMT, Phil Race wrote: >> src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java >> line 300: >> >>> 298: >>> 299: if(!f.exists()) { >>> 300: return null; >> >> Shall it throw `FileNotFoundException` or

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v15]

2021-05-26 Thread Alexey Ivanov
On Wed, 26 May 2021 16:52:38 GMT, Alexander Zuev wrote: >> Fix updated after first round of review. > > Alexander Zuev has updated the pull request incrementally with two additional > commits since the last revision: > > - Fixed small errors >Adjustments in the test > - Grammar fix in

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v14]

2021-05-26 Thread Alexey Ivanov
On Tue, 25 May 2021 23:36:43 GMT, Alexander Zuev wrote: >> Fix updated after first round of review. > > Alexander Zuev has updated the pull request incrementally with one additional > commit since the last revision: > > null file now properly causes IllegalArgumentException > Small fixed

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-21 Thread Alexey Ivanov
On Fri, 21 May 2021 18:16:36 GMT, Sergey Bylokhov wrote: >>> It is accessible from the "JFileChooser" drop-down menu. On my system, the >>> Libraries at that drop down menu contain "GIT", "Documents", "Music". >>> https://docs.microsoft.com/en-us/windows/client-management/windows-libraries >>>

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-20 Thread Alexey Ivanov
On Thu, 20 May 2021 17:37:20 GMT, Sergey Bylokhov wrote: >>> Are we sure that all possible paths can be pointed by the file object? >> >> We specify that we return the icon for a file. If path can not be resolved >> in the file object we can not return the icon for it. > > So the libraries are

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v10]

2021-05-20 Thread Alexey Ivanov
On Thu, 20 May 2021 08:26:07 GMT, Alexander Zuev wrote: >> SurfaceData is not a public class, do we use this term somewhere in the >> spec? If not then it will be better to use size/points in the user space >> coordinate system, it is used already in the java2d. > > The CSR is already approved

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v9]

2021-05-18 Thread Alexey Ivanov
On Tue, 18 May 2021 00:29:21 GMT, Alexander Zuev wrote: >> Fix updated after first round of review. > > Alexander Zuev has updated the pull request incrementally with one additional > commit since the last revision: > > Fixed documentation based on CSR review feedback Marked as reviewed by

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v7]

2021-05-14 Thread Alexey Ivanov
On Fri, 14 May 2021 19:46:03 GMT, Alexander Zuev wrote: >> Fix updated after first round of review. > > Alexander Zuev has updated the pull request incrementally with one additional > commit since the last revision: > > Slight change of wording in javadoc > Fixed

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v4]

2021-05-14 Thread Alexey Ivanov
On Tue, 11 May 2021 21:34:59 GMT, Alexander Zuev wrote: >> No, it isn't wrapped: if `getShell32Icon` is called in `getIcon(final >> boolean getLargeIcon)`, the returned value is immediately returned to the >> caller, see lines 1157–1163 in the updated code: >> >> if

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v6]

2021-05-14 Thread Alexey Ivanov
On Tue, 11 May 2021 21:41:15 GMT, Alexander Zuev wrote: >> Fix updated after first round of review. > > Alexander Zuev has updated the pull request incrementally with one additional > commit since the last revision: > > Make getShell32Icon method return multi-resolition image in case of >

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v4]

2021-05-14 Thread Alexey Ivanov
On Tue, 11 May 2021 19:36:12 GMT, Alexey Ivanov wrote: >> I will create a separate bug to track this - i do not know if library >> loading gets cached on some level and what impact on performance will we >> have if we release it every call. But i will check it out separately

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v4]

2021-05-11 Thread Alexey Ivanov
On Tue, 11 May 2021 18:48:31 GMT, Alexander Zuev wrote: >> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line >> 1196: >> >>> 1194: Image icon = makeIcon(hIcon); >>> 1195: disposeIcon(hIcon); >>> 1196: return icon; >> >> Shall it not

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v4]

2021-05-11 Thread Alexey Ivanov
On Tue, 11 May 2021 18:50:13 GMT, Alexander Zuev wrote: >> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line >> 1192: >> >>> 1190: */ >>> 1191: static Image getShell32Icon(int iconID, int size) { >>> 1192: long hIcon = getIconResource("shell32.dll",

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v4]

2021-05-11 Thread Alexey Ivanov
ellFolder2.cpp > >Select one icon at a time. > >Co-authored-by: Alexey Ivanov > <70774172+aivanov-...@users.noreply.github.com> > - Small fixes >Remived size parameter from makeIcon >Removed useVGAColors usage as irrelevant since it i

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v3]

2021-05-11 Thread Alexey Ivanov
On Fri, 7 May 2021 17:30:15 GMT, Alexander Zuev wrote: >> src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java line 213: >> >>> 211: * Returns the icon of the specified size used to display this >>> shell folder. >>> 212: * >>> 213: * @param size size of the icon > 0

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v4]

2021-05-11 Thread Alexey Ivanov
ellFolder2.cpp > >Select one icon at a time. > >Co-authored-by: Alexey Ivanov > <70774172+aivanov-...@users.noreply.github.com> > - Small fixes >Remived size parameter from makeIcon >Removed useVGAColors usage as irrelevant since it i

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v3]

2021-04-30 Thread Alexey Ivanov
On Wed, 10 Mar 2021 20:53:43 GMT, Alexey Ivanov wrote: >> Alexander Zuev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp >>

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v3]

2021-04-30 Thread Alexey Ivanov
On Wed, 10 Mar 2021 20:40:40 GMT, Alexey Ivanov wrote: >> Alexander Zuev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp >>

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v3]

2021-04-30 Thread Alexey Ivanov
On Thu, 29 Apr 2021 17:04:17 GMT, Alexander Zuev wrote: >> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line >> 1114: >> >>> 1112: bothIcons.put(getLargeIcon? >>> SMALL_ICON_SIZE : LARGE_ICON_SIZE, newIcon2); >>> 1113:

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v3]

2021-04-30 Thread Alexey Ivanov
dows/ShellFolder2.cpp > > Select one icon at a time. > > Co-authored-by: Alexey Ivanov > <70774172+aivanov-...@users.noreply.github.com> src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java line 267: > 265: * returned will be a mu

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons [v3]

2021-04-30 Thread Alexey Ivanov
On Thu, 29 Apr 2021 18:47:27 GMT, Alexander Zuev wrote: >> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line >> 1044: >> >>> 1042: new BufferedImage(iconSize, iconSize, >>> BufferedImage.TYPE_INT_ARGB); >>> 1043: img.setRGB(0,

Re: [OpenJDK 2D-Dev] RFR: 8264428: Cleanup usages of StringBuffer in java.desktop [v4]

2021-04-08 Thread Alexey Ivanov
On Thu, 8 Apr 2021 14:43:50 GMT, Andrey Turbanov wrote: >> There are few possible cleanups in java.desktop related to legacy >> StringBuffer usages: >> 1. In few places StringBuffer can be replaced with plain String >> concatenation. >> 2. StringBuffer can be replaced with StringBuilder.

Re: [OpenJDK 2D-Dev] RFR: 8264923: PNGImageWriter.write_zTXt throws Exception with a typo

2021-04-08 Thread Alexey Ivanov
On Thu, 8 Apr 2021 13:00:49 GMT, Aleksey Shipilev wrote: > Noticed this when backporting JDK-8242557: there is a trivial copy-paste > error in exception message. See: > https://hg.openjdk.java.net/jdk/jdk/rev/645c71334acd#l1.58 Marked as reviewed by aivanov (Reviewer). - PR:

[OpenJDK 2D-Dev] Integrated: 8263984: Invalidate printServices when there are no printers

2021-04-07 Thread Alexey Ivanov
On Tue, 23 Mar 2021 13:45:33 GMT, Alexey Ivanov wrote: > When `getAllPrinterNames()` returns null, the list of `printServices` is > assigned a new empty array without invalidating old services which were in > the array before. > > The old print services should be invalida

Re: [OpenJDK 2D-Dev] RFR: 8264428: Cleanup usages of StringBuffer in java.desktop [v3]

2021-04-07 Thread Alexey Ivanov
On Wed, 7 Apr 2021 06:39:48 GMT, Andrey Turbanov wrote: >> There are few possible cleanups in java.desktop related to legacy >> StringBuffer usages: >> 1. In few places StringBuffer can be replaced with plain String >> concatenation. >> 2. StringBuffer can be replaced with StringBuilder.

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers [v3]

2021-04-07 Thread Alexey Ivanov
On Wed, 7 Apr 2021 04:12:55 GMT, Prasanta Sadhukhan wrote: >> [Code Conventions for >> Java](https://www.oracle.com/java/technologies/javase/codeconventions-indentation.html#248) >> say, “Line wrapping for `if` statements should generally use the 8-space >> rule, since conventional (4 space)

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers [v3]

2021-04-06 Thread Alexey Ivanov
On Tue, 6 Apr 2021 20:35:09 GMT, Alexey Ivanov wrote: >> BTW another solution is to move { to the next line if the previous statement >> was split across few lines. > > I added a blank line between the condition and the body. > Does it look good? @mrserb, @jayathirthr

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers [v3]

2021-04-06 Thread Alexey Ivanov
On Fri, 2 Apr 2021 01:56:37 GMT, Sergey Bylokhov wrote: >>> To make it clear, you're for keeping the indentation as it was in the >>> original PR to visually separate condition from the statement in the if >>> block. Do I get it right, @mrserb? >> >> I think it looks better. > > BTW another

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers [v3]

2021-04-06 Thread Alexey Ivanov
> When `getAllPrinterNames()` returns null, the list of `printServices` is > assigned a new empty array without invalidating old services which were in > the array before. > > The old print services should be invalidated. Alexey Ivanov has updated the pull request increme

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons

2021-04-02 Thread Alexey Ivanov
On Mon, 8 Mar 2021 13:22:07 GMT, Alexander Zuev wrote: > Fix updated after first round of review. src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java line 260: > 258: > 259:/** > 260: * Icon for a file, directory, or folder as it would be displayed in *Returns

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers [v2]

2021-04-01 Thread Alexey Ivanov
On Thu, 1 Apr 2021 17:29:08 GMT, Sergey Bylokhov wrote: >>> I would prefer if you revert this line or if we want to put emphasis on >>> readability moving '{' to new line also seems fine. >> >> Done. > > I do not suggest that the change should be moved forth and back, but I think > that the

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers [v2]

2021-04-01 Thread Alexey Ivanov
On Thu, 1 Apr 2021 13:19:07 GMT, Alexey Ivanov wrote: >> I would prefer if you revert this line or if we want to put emphasis on >> readability moving '{' to new line also seems fine. > >> By mapping i mean same indentation for all conditions in if statement… > > Oka

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers [v2]

2021-04-01 Thread Alexey Ivanov
> When `getAllPrinterNames()` returns null, the list of `printServices` is > assigned a new empty array without invalidating old services which were in > the array before. > > The old print services should be invalidated. Alexey Ivanov has updated the pull request increme

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers

2021-04-01 Thread Alexey Ivanov
On Thu, 1 Apr 2021 13:10:40 GMT, Jayathirth D V wrote: >> By mapping i mean same indentation for all conditions in if statement >> without adding additional indentation for each continuation line >> like(Basically line without your change of indentation) >> if ((condition1) && >>

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers

2021-04-01 Thread Alexey Ivanov
On Thu, 1 Apr 2021 06:04:32 GMT, Jayathirth D V wrote: >> When `getAllPrinterNames()` returns null, the list of `printServices` is >> assigned a new empty array without invalidating old services which were in >> the array before. >> >> The old print services should be invalidated. > >

[OpenJDK 2D-Dev] Withdrawn: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails

2021-03-31 Thread Alexey Ivanov
On Fri, 19 Mar 2021 20:36:57 GMT, Alexey Ivanov wrote: > If `JNU_NewStringPlatform` fails to allocate new Java String object for > printer name, `std::bad_alloc` is thrown. The handler for the exception does > not release the local reference to the `nameArray`, thus it will

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers

2021-03-24 Thread Alexey Ivanov
On Wed, 24 Mar 2021 13:07:21 GMT, Prasanta Sadhukhan wrote: > Since this is windows specific code, I am not sure if system will not have > any printers. I guess by default, Microsoft XPS Document Writer, Microsoft > Print-to-PDF, Fax are present in printers list. Yes, that's correct. But you

Re: [OpenJDK 2D-Dev] RFR: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails

2021-03-24 Thread Alexey Ivanov
On Fri, 19 Mar 2021 22:31:48 GMT, Sergey Bylokhov wrote: >> If `JNU_NewStringPlatform` fails to allocate new Java String object for >> printer name, `std::bad_alloc` is thrown. The handler for the exception does >> not release the local reference to the `nameArray`, thus it will be leaked. > >

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers

2021-03-24 Thread Alexey Ivanov
On Wed, 24 Mar 2021 09:16:33 GMT, Prasanta Sadhukhan wrote: >> When `getAllPrinterNames()` returns null, the list of `printServices` is >> assigned a new empty array without invalidating old services which were in >> the array before. >> >> The old print services should be invalidated. > >

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers

2021-03-23 Thread Alexey Ivanov
On Tue, 23 Mar 2021 13:45:33 GMT, Alexey Ivanov wrote: > When `getAllPrinterNames()` returns null, the list of `printServices` is > assigned a new empty array without invalidating old services which were in > the array before. > > The old print services should be in

Re: [OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers

2021-03-23 Thread Alexey Ivanov
On Tue, 23 Mar 2021 13:45:33 GMT, Alexey Ivanov wrote: > When `getAllPrinterNames()` returns null, the list of `printServices` is > assigned a new empty array without invalidating old services which were in > the array before. > > The old print services should be in

[OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers

2021-03-23 Thread Alexey Ivanov
When `getAllPrinterNames()` returns null, the list of `printServices` is assigned a new empty array without invalidating old services which were in the array before. The old print services should be invalidated. - Commit messages: - 8263984: Invalidate printServices when there

Re: [OpenJDK 2D-Dev] Clarification regarding PageFormat and Paper getImageable* functions orientation consideration

2021-03-23 Thread Alexey Ivanov
Hi Rajat, I agree with Phil. Both PageFormat [1] and Paper [2] have getImageable*() methods. The spec for each of these methods in PageFormat states, “This method takes into account the orientation of the page.” The implementation confirms this statement. Yet the spec for Paper does not

[OpenJDK 2D-Dev] Integrated: 8263894: Convert defaultPrinter and printers fields to local variables

2021-03-22 Thread Alexey Ivanov
On Fri, 19 Mar 2021 20:35:03 GMT, Alexey Ivanov wrote: > `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but > they are used only in `getDefaultPrintService()` and `refreshServices()` > correspondingly. Thus these two fields can be converted to local

Re: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables [v2]

2021-03-19 Thread Alexey Ivanov
On Fri, 19 Mar 2021 21:05:57 GMT, Phil Race wrote: > Why did you delete the comments ? The comments highlighted the difference between what is stored in `printers` and in `printServices`: _excludes_ vs. _includes_ the default printer. However, according to the code, `printers` _included_ the

Re: [OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables [v2]

2021-03-19 Thread Alexey Ivanov
> `PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but > they are used only in `getDefaultPrintService()` and `refreshServices()` > correspondingly. Thus these two fields can be converted to local variables in > the corresponding methods. Alexey Ivanov

[OpenJDK 2D-Dev] RFR: 8263893: getPrinterNames() leaks nameArray if Java String allocation fails

2021-03-19 Thread Alexey Ivanov
If `JNU_NewStringPlatform` fails to allocate new Java String object for printer name, `std::bad_alloc` is thrown. The handler for the exception does not release the local reference to the `nameArray`, thus it will be leaked. - Commit messages: - 8263893: getPrinterNames() leaks

[OpenJDK 2D-Dev] RFR: 8263894: Convert defaultPrinter and printers fields to local variables

2021-03-19 Thread Alexey Ivanov
`PrintServiceLookupProvider` has `defaultPrinter` and `printers` fields but they are used only in `getDefaultPrintService()` and `refreshServices()` correspondingly. Thus these two fields can be converted to local variables in the corresponding methods. - Commit messages: -

[OpenJDK 2D-Dev] Integrated: 8263311: Watch registry changes for remote printers update instead of polling

2021-03-18 Thread Alexey Ivanov
On Wed, 10 Mar 2021 15:38:27 GMT, Alexey Ivanov wrote: > [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented > polling for remote printers. > That bug description also mentions watching the registry for changes and > links to the article which describes th

Re: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling

2021-03-13 Thread Alexey Ivanov
On Sat, 13 Mar 2021 00:18:25 GMT, Sergey Bylokhov wrote: > Any idea why RegistryValueChange was rejected as a solution? I've no idea. I read that comment, it's exactly the comment that was in the code above `RemotePrinterChangeListener` class in `PrintServiceLookupProvider.java`. >

Re: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling

2021-03-12 Thread Alexey Ivanov
On Fri, 12 Mar 2021 11:38:08 GMT, Prasanta Sadhukhan wrote: >>> Is this only about addition/removal? What about printer name change? >> >> You cannot change the name of a remote printer. >> >> Opening *Printer Properties* dialog from the printer context menu on the >> local host and editing

Re: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling

2021-03-12 Thread Alexey Ivanov
On Fri, 12 Mar 2021 04:55:45 GMT, Prasanta Sadhukhan wrote: > Is this only about addition/removal? What about printer name change? You cannot change the name of a remote printer. Opening *Printer Properties* dialog from the printer context menu on the local host and editing its name changes

Re: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling

2021-03-11 Thread Alexey Ivanov
On Wed, 10 Mar 2021 15:38:27 GMT, Alexey Ivanov wrote: > [JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented > polling for remote printers. > That bug description also mentions watching the registry for changes and > links to the article which describes th

Re: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling

2021-03-11 Thread Alexey Ivanov
On Thu, 11 Mar 2021 11:30:52 GMT, Prasanta Sadhukhan wrote: >>> I guess having "FALSE" as fAsynchronous value mean the function does not >>> return until a change has occurred so do we still need this do-while >>> monitoring loop? >> >> You're right, `FALSE` for `fAsynchronous` means the

Re: [OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling

2021-03-11 Thread Alexey Ivanov
On Thu, 11 Mar 2021 10:39:56 GMT, Prasanta Sadhukhan wrote: > I guess having "FALSE" as fAsynchronous value mean the function does not > return until a change has occurred so do we still need this do-while > monitoring loop? You're right, `FALSE` for `fAsynchronous` means the function

Re: [OpenJDK 2D-Dev] RFR: 8182043: Access to Windows Large Icons

2021-03-10 Thread Alexey Ivanov
On Mon, 8 Mar 2021 13:22:07 GMT, Alexander Zuev wrote: > Fix updated after first round of review. src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1044: > 1042: new BufferedImage(iconSize, iconSize, > BufferedImage.TYPE_INT_ARGB); > 1043:

[OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling

2021-03-10 Thread Alexey Ivanov
[JDK-8153732](https://bugs.openjdk.java.net/browse/JDK-8153732) implemented polling for remote printers. That bug description also mentions watching the registry for changes and links to the article which describes the method yet it does so in terms of WMI. Using WMI is not necessary to watch

Re: [OpenJDK 2D-Dev] RFR: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe

2021-03-09 Thread Alexey Ivanov
On Sat, 27 Feb 2021 18:33:52 GMT, Andrey Turbanov wrote: > 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not > thread safe Marked as reviewed by aivanov (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/2762

[OpenJDK 2D-Dev] Integrated: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames()

2021-03-09 Thread Alexey Ivanov
On Thu, 4 Mar 2021 21:37:33 GMT, Alexey Ivanov wrote: > **Root cause:** > `getPrinterNames()` has two calls to > [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). > The first call is to get the required buffer size to contain the structure

Re: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v3]

2021-03-05 Thread Alexey Ivanov
On Fri, 5 Mar 2021 17:21:36 GMT, Dmitry Markov wrote: >> The IME functions and the DND operation must be executed on the toolkit >> thread. If the DND operation is in progress, the IME API is invoked via >> SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The >> flag

Re: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows [v2]

2021-03-05 Thread Alexey Ivanov
On Fri, 5 Mar 2021 16:06:04 GMT, Dmitry Markov wrote: >> The IME functions and the DND operation must be executed on the toolkit >> thread. If the DND operation is in progress, the IME API is invoked via >> SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The >> flag

Re: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames()

2021-03-05 Thread Alexey Ivanov
On Thu, 4 Mar 2021 22:09:55 GMT, Phil Race wrote: > I guess this is OK and yes we should have been checking this. > Not sure we really got to the bottom of the real world problem because I'd > expect the 2nd call just milliseconds after the first. But it could be that > this happens during

Re: [OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames()

2021-03-05 Thread Alexey Ivanov
On Fri, 5 Mar 2021 03:49:22 GMT, Prasanta Sadhukhan wrote: >> I guess since we are changing this method anyway, can we use >> PRINTER_ENUM_CONNECTIONS flag instead of hardcoded 4 so that it is more >> informative!! > > ok, it is for flags and not for level. please ignore > > > Don't we

[OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames()

2021-03-04 Thread Alexey Ivanov
**Root cause:** `getPrinterNames()` has two calls to [`::EnumPrinters`](https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters). The first call is to get the required buffer size to contain the structures and any strings. The second call is to get the list of printers. Yet the

Re: [OpenJDK 2D-Dev] RFR: 8262446: DragAndDrop hangs on Windows

2021-03-04 Thread Alexey Ivanov
On Thu, 4 Mar 2021 10:36:56 GMT, Dmitry Markov wrote: > The IME functions and the DND operation must be executed on the toolkit > thread. If the DND operation is in progress, the IME API is invoked via > SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The > flag

Re: [OpenJDK 2D-Dev] RFR: 8262915: java.awt.color.ColorSpace.getName() is not thread-safe

2021-03-03 Thread Alexey Ivanov
On Wed, 3 Mar 2021 03:46:59 GMT, Sergey Bylokhov wrote: > The java.awt.color.ColorSpace.getName() method does not use any kind of > synchronization to properly initialize and use the static cache for the color > components names. Marked as reviewed by aivanov (Reviewer). - PR:

Re: [OpenJDK 2D-Dev] RFR: 8257500: Drawing MultiResolutionImage with ImageObserver "leaks" memory

2021-02-26 Thread Alexey Ivanov
On Wed, 24 Feb 2021 18:57:25 GMT, Sergey Bylokhov wrote: > This bug was reported as a leak of the ImageObserver when the user draws a > multiresolution image. > > The multiresolution image is an image that contains a few images inside, when > the app uses the observer to get notifications

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v10]

2021-02-17 Thread Alexey Ivanov
On Wed, 17 Feb 2021 15:54:22 GMT, Prasanta Sadhukhan wrote: >> The API doc for Graphics2D.clip(shape s) claims that passing a null argument >> would actually clear the existing clipping area, which is incorrect. >> This statement is applicable only to G2D.setClip() and not for the clip() >>

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v9]

2021-02-17 Thread Alexey Ivanov
On Wed, 17 Feb 2021 15:48:12 GMT, Prasanta Sadhukhan wrote: >> The API doc for Graphics2D.clip(shape s) claims that passing a null argument >> would actually clear the existing clipping area, which is incorrect. >> This statement is applicable only to G2D.setClip() and not for the clip() >>

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v8]

2021-02-17 Thread Alexey Ivanov
On Wed, 17 Feb 2021 15:38:10 GMT, Prasanta Sadhukhan wrote: >> The API doc for Graphics2D.clip(shape s) claims that passing a null argument >> would actually clear the existing clipping area, which is incorrect. >> This statement is applicable only to G2D.setClip() and not for the clip() >>

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v7]

2021-02-17 Thread Alexey Ivanov
On Wed, 17 Feb 2021 15:08:58 GMT, Prasanta Sadhukhan wrote: >> The API doc for Graphics2D.clip(shape s) claims that passing a null argument >> would actually clear the existing clipping area, which is incorrect. >> This statement is applicable only to G2D.setClip() and not for the clip() >>

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v6]

2021-02-17 Thread Alexey Ivanov
On Mon, 15 Feb 2021 12:48:01 GMT, Prasanta Sadhukhan wrote: >> The API doc for Graphics2D.clip(shape s) claims that passing a null argument >> would actually clear the existing clipping area, which is incorrect. >> This statement is applicable only to G2D.setClip() and not for the clip() >>

Re: [OpenJDK 2D-Dev] RFR: 6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method [v5]

2021-02-12 Thread Alexey Ivanov
On Thu, 11 Feb 2021 15:44:57 GMT, Prasanta Sadhukhan wrote: >> The API doc for Graphics2D.clip(shape s) claims that passing a null argument >> would actually clear the existing clipping area, which is incorrect. >> This statement is applicable only to G2D.setClip() and not for the clip() >>

Re: [OpenJDK 2D-Dev] RFR: 8260695: The java.awt.color.ICC_Profile#getData/getData(int) are not thread safe [v3]

2021-02-12 Thread Alexey Ivanov
On Thu, 11 Feb 2021 20:00:01 GMT, Sergey Bylokhov wrote: >> Both methods are implemented in a similar way. >> 1. Requests the size of the profile/tag data >> 2. Creates an array of the correct size >> 3. Requests the data and copy it to the array >> >> If the data will be changed

Re: [OpenJDK 2D-Dev] RFR: 6211257: BasicStroke.createStrokedShape(Shape): NPE is not specified [v3]

2021-02-08 Thread Alexey Ivanov
On Sun, 7 Feb 2021 09:18:04 GMT, Prasanta Sadhukhan wrote: >> Method createStrokedShape(Shape) for java.awt.BasicStroke class throws >> NullPointerException when passed a null object reference for a input >> parameter but it's not specified in the spec. >> Updated spec to illustrate this. > >

Re: [OpenJDK 2D-Dev] RFR: 6211257: BasicStroke.createStrokedShape(Shape): NPE is not specified [v2]

2021-02-05 Thread Alexey Ivanov
On Thu, 4 Feb 2021 04:15:03 GMT, Prasanta Sadhukhan wrote: >> Method createStrokedShape(Shape) for java.awt.BasicStroke class throws >> NullPointerException when passed a null object reference for a input >> parameter but it's not specified in the spec. >> Updated spec to illustrate this. > >

Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermittent timeout with javax/swing JColorChooser Test [v4]

2021-01-30 Thread Alexey Ivanov
On Sat, 30 Jan 2021 05:10:07 GMT, Prasanta Sadhukhan wrote: >>> Does this volatile modifier resolve the now-removed infinite loop in `while >>> (!tk.IsDisposed())` in `WToolkit_shutdown`? >> >> The loop should not be removed. > > Unfortunately, volatile modifier has no effect if infinite loop

Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermittent timeout with javax/swing JColorChooser Test [v4]

2021-01-29 Thread Alexey Ivanov
On Fri, 29 Jan 2021 18:05:07 GMT, Prasanta Sadhukhan wrote: >> This test was failing in our nightly mach5 testing. Appropriate stability >> code in form of waitForIdle and delay is added. >> mach5 job running for several iterations on all platforms is ok. Link in JBS. > > Prasanta Sadhukhan

Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]

2021-01-29 Thread Alexey Ivanov
On Mon, 25 Jan 2021 15:09:35 GMT, Alexey Ivanov wrote: > Yet I suggest fixing the typo in the bug synopsis: Intermiitent → Intermittent I've edited the JBS synopsis. Please also update the PR subject. - PR: https://git.openjdk.java.net/jdk/pull/2220

Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]

2021-01-29 Thread Alexey Ivanov
On Fri, 29 Jan 2021 04:03:29 GMT, Prasanta Sadhukhan wrote: > It seems "m_breakMessageLoop" is never true for unsuccessful run even though > AwtToolkit::QuitMessageLoop finish execution (where m_breakMessageLoop is set > to true), > so AwtToolkit::MessageLoop never ends and shutdown hook gets

Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]

2021-01-28 Thread Alexey Ivanov
On Thu, 28 Jan 2021 11:57:06 GMT, Alexey Ivanov wrote: >> It seems in successful run, when the test finish >> - AwtToolkit::MessageLoop starts >> - DoQuitMessageLoop is called >> - AwtToolkit::QuitMessageLoop starts >> - AwtToolkit::QuitMessageLoop finishes >&

Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]

2021-01-28 Thread Alexey Ivanov
On Thu, 28 Jan 2021 09:59:22 GMT, Prasanta Sadhukhan wrote: >> Please take a look at the "AwtToolkit::Dispose()" method, on how much stuff >> should be done to properly shutdown the toolkit. This Dispose() method is >> executed immediately when we exit the message loop in the >>

Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v2]

2021-01-27 Thread Alexey Ivanov
On Wed, 27 Jan 2021 12:39:01 GMT, Prasanta Sadhukhan wrote: >> This test was failing in our nightly mach5 testing. Appropriate stability >> code in form of waitForIdle and delay is added. >> mach5 job running for several iterations on all platforms is ok. Link in JBS. > > Prasanta Sadhukhan

[OpenJDK 2D-Dev] Integrated: 8260314: Replace border="1" on tables with CSS

2021-01-27 Thread Alexey Ivanov
On Sat, 23 Jan 2021 19:06:05 GMT, Alexey Ivanov wrote: > Replace presentational attribute `border="1"` on `` element with CSS > styles: > table {border: outset 1px} > th, td {border: inset 1px} > > These declarations produce the same rendering as the defaul

Re: [OpenJDK 2D-Dev] RFR: 8260314: Replace border="1" on tables with CSS

2021-01-26 Thread Alexey Ivanov
On Tue, 26 Jan 2021 19:17:24 GMT, Jonathan Gibbons wrote: > In general, I recommend where possible using the styles provided in the > standard stylesheet, for overall visual consistency. I totally agree. I overlooked the standard styles for the tables. Thanks to @mrserb for pointing me in

Re: [OpenJDK 2D-Dev] RFR: 8260314: Replace border="1" on tables with CSS

2021-01-26 Thread Alexey Ivanov
On Tue, 26 Jan 2021 15:39:30 GMT, Alexey Ivanov wrote: >> Probably we can import the CSS used by the javadoc itself? > >> Probably we can import the CSS used by the javadoc itself? > > We do. For example, [AWT Modality in JDK > 15](https://docs.oracle.com/en

Re: [OpenJDK 2D-Dev] RFR: 8260314: Replace border="1" on tables with CSS [v3]

2021-01-26 Thread Alexey Ivanov
> Replace presentational attribute `border="1"` on `` element with CSS > styles: > table {border: outset 1px} > th, td {border: inset 1px} > > These declarations produce the same rendering as the default one in Firefox > and Edge. > > Another option is

Re: [OpenJDK 2D-Dev] RFR: 8260314: Replace border="1" on tables with CSS [v2]

2021-01-26 Thread Alexey Ivanov
> Replace presentational attribute `border="1"` on `` element with CSS > styles: > table {border: outset 1px} > th, td {border: inset 1px} > > These declarations produce the same rendering as the default one in Firefox > and Edge. > > Another option is

Re: [OpenJDK 2D-Dev] RFR: 8260314: Replace border="1" on tables with CSS

2021-01-26 Thread Alexey Ivanov
On Tue, 26 Jan 2021 01:54:10 GMT, Sergey Bylokhov wrote: > Probably we can import the CSS used by the javadoc itself? We do. For example, [AWT Modality in JDK 15](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/java/awt/doc-files/Modality.html) has borders because of

Re: [OpenJDK 2D-Dev] RFR: 8260314: Replace border="1" on tables with CSS

2021-01-25 Thread Alexey Ivanov
On Sat, 23 Jan 2021 19:06:05 GMT, Alexey Ivanov wrote: > Replace presentational attribute `border="1"` on `` element with CSS > styles: > table {border: outset 1px} > th, td {border: inset 1px} > > These declarations produce the same rendering as the defaul

[OpenJDK 2D-Dev] RFR: 8260314: Replace border="1" on tables with CSS

2021-01-23 Thread Alexey Ivanov
Replace presentational attribute `border="1"` on `` element with CSS styles: table {border: outset 1px} th, td {border: inset 1px} These declarations produce the same rendering as the default one in Firefox and Edge. Another option is to use `solid` in both cases. - Commit

[OpenJDK 2D-Dev] Integrated: 8240247: No longer need to wrap files with contentContainer

2021-01-23 Thread Alexey Ivanov
On Fri, 22 Jan 2021 19:50:17 GMT, Alexey Ivanov wrote: > [JDK-8231144](https://bugs.openjdk.java.net/browse/JDK-8231144) wrapped the > contents of plain HTML documents into `` to > apply the styles and add the margins around the content for a consistent look. > > This is no l

  1   2   3   >