Skip to content

Commit 5789a8a

Browse files
committed
Suppress discouraged access and missingJavadocComments warnings
The affected classes access internal methods intentionally.
1 parent 15816d8 commit 5789a8a

11 files changed

Lines changed: 42 additions & 29 deletions

File tree

bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/.settings/org.eclipse.jdt.core.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
7171
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
7272
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
7373
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
74-
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
74+
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
7575
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
7676
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
7777
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning

bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/AbstractWindowHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011 IBM Corporation and others.
2+
* Copyright (c) 2011, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -27,8 +27,8 @@
2727
*/
2828
public abstract class AbstractWindowHandler {
2929
@CanExecute
30-
public boolean canExecute(
31-
@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
30+
@SuppressWarnings("restriction")
31+
public boolean canExecute(@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
3232
if (shell == null || shell.view == null) {
3333
return false;
3434
}

bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/ArrangeWindowHandler.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011 IBM Corporation and others.
2+
* Copyright (c) 2011, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -37,13 +37,16 @@ public boolean canExecute(@Optional Display display) {
3737

3838
// not all windows should be in minimized state
3939
for (int i = 0; i < shells.length; i++) {
40-
if (shells[i].view.window().isKeyWindow()) {
40+
@SuppressWarnings("restriction")
41+
boolean isKeyWindow = shells[i].view.window().isKeyWindow();
42+
if (isKeyWindow) {
4143
isEnabled = true;
4244
break;
4345
}
4446
}
4547
return isEnabled;
4648
}
49+
4750
/**
4851
* Utilizes the {@code NSApplication} to access the application instance and
4952
* invokes {@code arrangeInFront} to prioritize its window on the desktop <br>
@@ -52,6 +55,7 @@ public boolean canExecute(@Optional Display display) {
5255
* API's
5356
*/
5457
@Execute
58+
@SuppressWarnings("restriction")
5559
public void execute() {
5660
NSApplication app = NSApplication.sharedApplication();
5761
app.arrangeInFront(app);

bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/CocoaUIHandler.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2008, 2018 Adobe Systems, Inc. and others.
2+
* Copyright (c) 2008, 2026 Adobe Systems, Inc. and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -87,6 +87,7 @@ public class CocoaUIHandler {
8787
@Inject
8888
protected MApplication app;
8989
@Inject
90+
@SuppressWarnings("restriction")
9091
protected Provider<StatusReporter> statusReporter;
9192
@Inject
9293
protected ECommandService commandService;
@@ -142,10 +143,9 @@ private void processMenuContribution(MMenuContribution contribution) {
142143
}
143144
}
144145

145-
void log(Exception e) {
146-
// StatusUtil.handleStatus(e, StatusManager.LOG);
147-
statusReporter.get().report(new Status(IStatus.WARNING, CocoaUIProcessor.FRAGMENT_ID,
148-
"Exception occurred during CocoaUI processing", e), StatusReporter.LOG); //$NON-NLS-1$
146+
@SuppressWarnings("restriction")
147+
private void log(IStatus status) {
148+
statusReporter.get().report(status, StatusReporter.LOG);
149149
}
150150

151151
/*
@@ -353,7 +353,7 @@ private boolean runAction(String actionId) {
353353
// theoretically, one of
354354
// SecurityException,Illegal*Exception,InvocationTargetException,NoSuch*Exception
355355
// not expected to happen at all.
356-
log(e);
356+
log(Status.warning("Exception occurred during CocoaUI processing", e)); //$NON-NLS-1$
357357
// return false?
358358
}
359359
return true;
@@ -381,10 +381,7 @@ private void simulateMenuSelection(MMenuItem item) {
381381
service.executeHandler(cmd);
382382
lclContext.remove(MItem.class.getName());
383383
} else {
384-
statusReporter.get()
385-
.report(new Status(IStatus.WARNING, CocoaUIProcessor.FRAGMENT_ID,
386-
"Unhandled menu type: " + item.getClass() + ": " + item), //$NON-NLS-1$ //$NON-NLS-2$
387-
StatusReporter.LOG);
384+
log(Status.warning("Unhandled menu type: " + item.getClass() + ": " + item)); //$NON-NLS-1$ //$NON-NLS-2$
388385
}
389386
}
390387

bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/CocoaUIProcessor.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2010, 2015 Brian de Alwis, and others.
2+
* Copyright (c) 2010, 2026 Brian de Alwis, and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -45,9 +45,9 @@ public class CocoaUIProcessor {
4545
/**
4646
* Useful constants for referencing classes defined within this host/fragment
4747
*/
48-
static final String FRAGMENT_ID = "org.eclipse.e4.ui.workbench.renderers.swt.cocoa"; //$NON-NLS-1$
48+
private static final String FRAGMENT_ID = "org.eclipse.e4.ui.workbench.renderers.swt.cocoa"; //$NON-NLS-1$
4949
protected static final String CONTRIBUTOR_URI = "platform:/fragment/" + FRAGMENT_ID; //$NON-NLS-1$
50-
static final String HOST_ID = "org.eclipse.e4.ui.workbench.renderers.swt"; //$NON-NLS-1$
50+
private static final String HOST_ID = "org.eclipse.e4.ui.workbench.renderers.swt"; //$NON-NLS-1$
5151
protected static final String CONTRIBUTION_URI_PREFIX = "bundleclass://" + HOST_ID; //$NON-NLS-1$
5252

5353
// constants for close dialog
@@ -58,6 +58,7 @@ public class CocoaUIProcessor {
5858
protected MApplication app;
5959

6060
@Inject
61+
@SuppressWarnings("restriction")
6162
protected Provider<StatusReporter> statusReporter;
6263

6364
/**
@@ -149,10 +150,7 @@ private void installKeybinding(String bindingContextId, String keysequence, MCom
149150
if (bindingTable == null) {
150151
MBindingContext bindingContext = findBindingContext(app.getBindingContexts(), bindingContextId);
151152
if (bindingContext == null) {
152-
statusReporter.get()
153-
.report(new Status(IStatus.WARNING, CocoaUIProcessor.FRAGMENT_ID,
154-
"No binding context exists for " + bindingContextId), //$NON-NLS-1$
155-
StatusReporter.LOG);
153+
log(Status.warning("No binding context exists for " + bindingContextId)); //$NON-NLS-1$
156154
return;
157155
}
158156
bindingTable = MCommandsFactory.INSTANCE.createBindingTable();
@@ -167,6 +165,11 @@ private void installKeybinding(String bindingContextId, String keysequence, MCom
167165
bindingTable.getBindings().add(binding);
168166
}
169167

168+
@SuppressWarnings("restriction")
169+
private void log(IStatus status) {
170+
statusReporter.get().report(status, StatusReporter.LOG);
171+
}
172+
170173
/**
171174
* @param bindingContexts
172175
* @param bindingContextId

bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/MinimizeWindowHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011 IBM Corporation and others.
2+
* Copyright (c) 2011, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -26,6 +26,7 @@
2626
*/
2727
public class MinimizeWindowHandler extends AbstractWindowHandler {
2828
@Execute
29+
@SuppressWarnings("restriction")
2930
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
3031
if (shell == null) {
3132
return;

bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/SWTCocoaEnhancerDelegate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2008, 2014 Adobe Systems, Inc. and others.
2+
* Copyright (c) 2008, 2026 Adobe Systems, Inc. and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,6 +16,7 @@
1616

1717
import org.eclipse.swt.internal.cocoa.NSObject;
1818

19+
@SuppressWarnings("restriction")
1920
public class SWTCocoaEnhancerDelegate extends NSObject {
2021

2122
public SWTCocoaEnhancerDelegate() {

bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/ZoomWindowHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011 IBM Corporation and others.
2+
* Copyright (c) 2011, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -26,6 +26,7 @@
2626
*/
2727
public class ZoomWindowHandler extends AbstractWindowHandler {
2828
@Execute
29+
@SuppressWarnings("restriction")
2930
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
3031
if (shell == null) {
3132
return;

bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/CocoaTitlePathUpdater.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2010, 2015 IBM Corporation and others.
2+
* Copyright (c) 2010, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -23,6 +23,7 @@
2323
* @since 3.7
2424
*
2525
*/
26+
@SuppressWarnings("restriction")
2627
public class CocoaTitlePathUpdater extends TitlePathUpdater {
2728

2829
@Override

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2019 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -3243,6 +3243,7 @@ public IWorkbenchActivitySupport getActivitySupport() {
32433243
}
32443244

32453245
@Override
3246+
@SuppressWarnings("deprecation")
32463247
public IWorkbenchContextSupport getContextSupport() {
32473248
return workbenchContextSupport;
32483249
}
@@ -3670,14 +3671,17 @@ private static class AutoscaleAdaptation {
36703671

36713672
private final String initialAutoScaleValue;
36723673

3674+
@SuppressWarnings("restriction")
36733675
public AutoscaleAdaptation() {
36743676
initialAutoScaleValue = DPIUtil.getEffectiveAutoScaleValue();
36753677
}
36763678

3679+
@SuppressWarnings("restriction")
36773680
public void runWithInitialAutoScaleValue(Runnable runnable) {
36783681
DPIUtil.runWithAutoScaleValue(initialAutoScaleValue, runnable);
36793682
}
36803683

3684+
@SuppressWarnings("restriction")
36813685
public void setRescaleAtRuntimePropertyFromPreference() {
36823686
if (System.getProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY) != null) {
36833687
WorkbenchPlugin.log(Status.warning(SWT_RESCALE_AT_RUNTIME_PROPERTY

0 commit comments

Comments
 (0)