Re: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2]

2021-01-12 Thread Prasanta Sadhukhan
On Tue, 12 Jan 2021 20:42:18 GMT, Sergey Bylokhov wrote: >> Please review the application of @java.io.Serial annotation (JDK-8202385) to >> types in the desktop module to enable stricter compile-time checking of >> serialization-related declarations. >> >> This annotation can be applied to the

Re: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2]

2021-01-12 Thread Sergey Bylokhov
On Wed, 13 Jan 2021 06:10:53 GMT, Prasanta Sadhukhan wrote: > Why do we add serialVersionUID in some classes like > DefaultMutableTreeNode.java but not in other swing classes? Most Swing classes are marked by the specific "Warning" that "Same-version serialization only" is supported. (I think

Re: RFR: 8259651: [macOS] Replace JNF_COCOA_ENTER/EXIT macros

2021-01-12 Thread Sergey Bylokhov
On Wed, 13 Jan 2021 02:34:37 GMT, Phil Race wrote: > Since the next line throws NSException everything before this change and > after this change should cause control to reach the COCOA_EXIT macro. It does not, the JNI_COCOA_EXIT macro is executed on a different thread than JNI_COCOA_THROW_RUN

Re: RFR: 8256109: Create implementation for NSAccessibilityButton protocol [v2]

2021-01-12 Thread Sergey Bylokhov
On Wed, 13 Jan 2021 06:03:09 GMT, Alexander Zuev wrote: >> The headers in the obj-c usually do not have guards because they are >> included via "#import" > > I know. But in this case that was not enough - that still caused weird > compilation glitches like full compilation works but incremental

Re: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2]

2021-01-12 Thread Prasanta Sadhukhan
On Tue, 12 Jan 2021 20:42:18 GMT, Sergey Bylokhov wrote: >> Please review the application of @java.io.Serial annotation (JDK-8202385) to >> types in the desktop module to enable stricter compile-time checking of >> serialization-related declarations. >> >> This annotation can be applied to the

Re: RFR: 8256109: Create implementation for NSAccessibilityButton protocol [v2]

2021-01-12 Thread Alexander Zuev
On Wed, 13 Jan 2021 03:02:04 GMT, Sergey Bylokhov wrote: >> Yes, since the CommonComponentAccessibility being imported from the base >> class sometimes it causes compilation glitches - guess ObjC is not a big fan >> of forward-declaration. Adding header guard helps. And since i'm not >> planni

Re: RFR: 8256109: Create implementation for NSAccessibilityButton protocol [v2]

2021-01-12 Thread Sergey Bylokhov
On Tue, 12 Jan 2021 06:04:32 GMT, Alexander Zuev wrote: >> src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.h >> line 25: >> >>> 23: * questions. >>> 24: */ >>> 25: >> >> There are no header guard here. Is it left intentionally? > > Yes, since the CommonComponentAcce

Re: RFR: 8259651: [macOS] Replace JNF_COCOA_ENTER/EXIT macros

2021-01-12 Thread Phil Race
On Wed, 13 Jan 2021 02:15:22 GMT, Sergey Bylokhov wrote: >> Most of the changes here are simply >> JNF_COCOA_ENTER -> JNI_COCOA_ENTER >> JNF_COCOA_EXIT -> JNI_COCOA_EXIT >> >> These new macros are defined in JNIUtilities.h and handle the auto release >> and on exit catch any NSException. >> Unl

Integrated: 8259519: The java.awt.datatransfer.DataFlavor#ioInputStreamClass field is redundant

2021-01-12 Thread Sergey Bylokhov
On Sun, 10 Jan 2021 03:57:42 GMT, Sergey Bylokhov wrote: > A long time ago in the pre-1.0 era, this field was initialized via reflection > since the "InputStream" class was optional. This was changed since then and a > separate field to refer the "InputStream.class" is not needed. This pull re

Re: RFR: 8259651: [macOS] Replace JNF_COCOA_ENTER/EXIT macros

2021-01-12 Thread Sergey Bylokhov
On Tue, 12 Jan 2021 21:39:02 GMT, Phil Race wrote: > Most of the changes here are simply > JNF_COCOA_ENTER -> JNI_COCOA_ENTER > JNF_COCOA_EXIT -> JNI_COCOA_EXIT > > These new macros are defined in JNIUtilities.h and handle the auto release > and on exit catch any NSException. > Unlike the JNF c

RFR: 8259651: [macOS] Replace JNF_COCOA_ENTER/EXIT macros

2021-01-12 Thread Phil Race
Most of the changes here are simply JNF_COCOA_ENTER -> JNI_COCOA_ENTER JNF_COCOA_EXIT -> JNI_COCOA_EXIT These new macros are defined in JNIUtilities.h and handle the auto release and on exit catch any NSException. Unlike the JNF code, JNI exceptions don't have to be extracted from the NSExceptio

Re: RFR: 8257414: Drag n Drop target area is wrong on high DPI systems

2021-01-12 Thread Olga Mikhaltsova
On Mon, 4 Jan 2021 08:39:10 GMT, Sergey Bylokhov wrote: >> Please, review this small fix for drag-n-drop on Linux with HiDPI turned on! >> >> This bug is due to the following reason: while scaling Java recalculates >> resolution (W x H) according to sun.java2d.uiScale (W/SCALE x H/SCALE) and >

Re: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2]

2021-01-12 Thread Alexey Ivanov
On Tue, 12 Jan 2021 20:36:21 GMT, Sergey Bylokhov wrote: >> src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java >> line 42: >> >>> 40: */ >>> 41: @Serial >>> 42: private static final long serialVersionUID = 1L; >> >> This is the standard wording, yet shoul

Re: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2]

2021-01-12 Thread Sergey Bylokhov
On Tue, 12 Jan 2021 11:29:24 GMT, Alexey Ivanov wrote: >> Sergey Bylokhov has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Update >> src/java.desktop/share/classes/java/awt/image/ImagingOpException.java >> >>Co-authored-by: Ale

Re: RFR: 8259522: Apply java.io.Serial annotations in java.desktop [v2]

2021-01-12 Thread Sergey Bylokhov
> Please review the application of @java.io.Serial annotation (JDK-8202385) to > types in the desktop module to enable stricter compile-time checking of > serialization-related declarations. > > This annotation can be applied to these methods in the module: > > private void writeObject(java

Re: RFR: 8259519: The java.awt.datatransfer.DataFlavor#ioInputStreamClass field is redundant

2021-01-12 Thread Alexey Ivanov
On Sun, 10 Jan 2021 03:57:42 GMT, Sergey Bylokhov wrote: > A long time ago in the pre-1.0 era, this field was initialized via reflection > since the "InputStream" class was optional. This was changed since then and a > separate field to refer the "InputStream.class" is not needed. Marked as re

Re: RFR: 8259522: Apply java.io.Serial annotations in java.desktop

2021-01-12 Thread Alexey Ivanov
On Mon, 11 Jan 2021 06:21:52 GMT, Sergey Bylokhov wrote: > Please review the application of @java.io.Serial annotation (JDK-8202385) to > types in the desktop module to enable stricter compile-time checking of > serialization-related declarations. > > This annotation can be applied to these me

Integrated: 8259343: [macOS] Update JNI error handling in Cocoa code.

2021-01-12 Thread Phil Race
On Wed, 6 Jan 2021 21:14:06 GMT, Phil Race wrote: > Proposed updates to JNI error handling. This pull request has now been integrated. Changeset: d6a2105b Author:Phil Race URL: https://git.openjdk.java.net/jdk/commit/d6a2105b Stats: 75 lines in 8 files changed: 60 ins; 1 del; 14

Re: RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3]

2021-01-12 Thread Sergey Bylokhov
On Mon, 11 Jan 2021 19:27:12 GMT, Phil Race wrote: >> Proposed updates to JNI error handling. > > Phil Race has updated the pull request incrementally with one additional > commit since the last revision: > > 8259343: [macOS] Update JNI error handling in Cocoa code. Marked as reviewed by ser

Re: RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3]

2021-01-12 Thread Sergey Bylokhov
On Tue, 12 Jan 2021 17:21:53 GMT, Phil Race wrote: >> src/java.desktop/macosx/native/libosxapp/JNIUtilities.h line 197: >> >>> 195: } \ >>> 196: if (getenv("JNU_NO_COCOA_EXCEPTION") == NULL) { \ >>> 197: [NSException raise:NSGenericException format:@"Java >>> Excep

Re: RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3]

2021-01-12 Thread Phil Race
On Tue, 12 Jan 2021 02:31:56 GMT, Sergey Bylokhov wrote: >> Phil Race has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8259343: [macOS] Update JNI error handling in Cocoa code. > > src/java.desktop/macosx/native/libosxapp/JNIUtilities.h l

Re: RFR: 8259343: [macOS] Update JNI error handling in Cocoa code. [v3]

2021-01-12 Thread Phil Race
On Tue, 12 Jan 2021 02:38:11 GMT, Sergey Bylokhov wrote: >>> Not sure that the check for ExceptionOccurred is needed, >> It may not be needed in practice but if the code path is never taken no harm >> ... >> >> in all other places where we check the ref to methods/field we only check >> the r

Integrated: 8252015: [macos11] java.awt.TrayIcon requires updates for template images

2021-01-12 Thread Peter Zhelezniakov
On Fri, 2 Oct 2020 11:08:23 GMT, Peter Zhelezniakov wrote: > [JDK-8252015: [macos11] java.awt.TrayIcon requires updates for template > images](https://bugs.openjdk.java.net/browse/JDK-8252015) > > ### Problem > According to Apple's human interface guidelines, developers should use > template i