Skip to content

Drop the unused className parameter of SWT_AWT.initFrame - #3719

Open
GreenFuze wants to merge 3 commits into
eclipse-platform:masterfrom
GreenFuze:drop-initframe-classname
Open

GreenFuze wants to merge 3 commits into
eclipse-platform:masterfrom
GreenFuze:drop-initframe-classname

Conversation

@GreenFuze

@GreenFuze GreenFuze commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3665.

As you suggested, initFrame no longer takes className. None of the natives ever read it (each one always creates the platform's default embedded frame class), and the GTK native didn't even declare it.

SWT_AWT.embeddedFrameClass is now deprecated for removal (since 2026-12), following the API removal process. I kept its Class.forName check, so nothing changes for code that still sets it. On Cocoa, JDK17_FRAME was only used as that default, so it's gone too.

Like in #3526, I didn't touch Library.java or the binaries -- the C change needs the natives rebuilt. Happy to adjust anything!

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 1 026 files  ±0   1 026 suites  ±0   1h 32m 26s ⏱️ + 6m 24s
 5 067 tests ±0   5 039 ✅ ±0     28 💤 ±0  0 ❌ ±0 
29 761 runs  ±0  27 225 ✅ ±0  2 536 💤 ±0  0 ❌ ±0 

Results for commit f6c9d17. ± Comparison against base commit 0182d2a.

♻️ This comment has been updated with latest results.

@GreenFuze

Copy link
Copy Markdown
Contributor Author

Heads up: API tools treats adding @noreference to an existing public field as an API break (it reports the field as "no longer an API" and wants a major version bump), which is why the builds failed. So I dropped @noreference and kept the @Deprecated(forRemoval = true, since = "2026-12") deprecation. If you'd rather keep @noreference, I can add API filters to the binary fragments instead, just say.

@GreenFuze

Copy link
Copy Markdown
Contributor Author

All GitHub builds pass now. The Jenkins job timed out twice at ~2h, I think in the native-build stage (this PR touches the cocoa and win32 natives). Could someone re-run it when the native build agents are free?

Comment thread bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/org/eclipse/swt/awt/SWT_AWT.java Outdated
@akurtakov

Copy link
Copy Markdown
Member

Please change the natives too. The C part will be auto rebuilt by the CI.

@akurtakov
akurtakov force-pushed the drop-initframe-classname branch 4 times, most recently from 073fc7b to 5165be9 Compare October 16, 2026 11:34
@GreenFuze

Copy link
Copy Markdown
Contributor Author

@akurtakov both points are in:

  • @noreference is back on embeddedFrameClass, with an API tools filter (id 338940029) in each binary fragment's .api_filters (5165be9). My inline reply said cc2c5a7; that commit became 5165be9 when I rebased.
  • The natives are changed: the cocoa and win32 swt_awt.c no longer take className (813566f), and the GTK native never declared it. I left Library.java and the binaries for the CI rebuild, as you said.

All GitHub builds are green. The Jenkins run on the current head was aborted again after about 2 hours, like the earlier ones. Could someone re-run it, or let me know if there's anything else on my side?

GreenFuze and others added 3 commits October 23, 2026 18:31
None of the natives reads it: each one always creates the platform's
default embedded frame class (XEmbeddedFrame, CViewEmbeddedFrame,
WEmbeddedFrame), and the GTK native did not declare it at all.

SWT_AWT.embeddedFrameClass, whose value was passed as className, is
deprecated for removal accordingly. Its Class.forName check is kept, so
nothing changes for code that still sets it.

Fixes eclipse-platform#3665

Signed-off-by: TCs <green.fuzer@gmail.com>
API tools reports adding @noreference to an existing public field as an
API break ("no longer an API", asking for a major version increment), so
drop the tag and keep the @deprecated(forRemoval = true, since = "2026-12")
deprecation alone.

Signed-off-by: TCs <green.fuzer@gmail.com>
Restore @noreference on SWT_AWT.embeddedFrameClass, as requested in
review, and filter the resulting "field is no longer an API" problem
(id 338940029) in each binary fragment's .api_filters.

Signed-off-by: TCs <green.fuzer@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akurtakov
akurtakov force-pushed the drop-initframe-classname branch from 5165be9 to f6c9d17 Compare October 23, 2026 15:31
@akurtakov

Copy link
Copy Markdown
Member

Rebasing on top of master does all you have asked for, I did it now. I would appreciate if you squash all the comments into single commit.

@akurtakov

Copy link
Copy Markdown
Member

Sorry for the delay! There are so many things ongoing and so less times that PRs easily get lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SWT_AWT.initFrame takes (long, String) in Java; the GTK native declares no className and the Cocoa native types it const char *

2 participants