Skip to content

Commit c005f63

Browse files
React to new info warnings from ecj (#802)
Add @deprecated to members of truly deprecated classes + most classes have a replacement for a long time already + still in use and no replacement specified: - JavaSourceLocationWorkbenchAdapterFactory
1 parent 909b9ad commit c005f63

File tree

14 files changed

+89
-0
lines changed

14 files changed

+89
-0
lines changed

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaSourceLookupDialog.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class JavaSourceLookupDialog extends Dialog {
7373
* @param configuration the launch configuration from which the source lookup
7474
* path is retrieved and (possibly) updated
7575
*/
76+
@Deprecated
7677
public JavaSourceLookupDialog(Shell shell, String message, ILaunchConfiguration configuration) {
7778
super(shell);
7879
fSourceLookupBlock= new SourceLookupBlock();
@@ -87,13 +88,15 @@ public JavaSourceLookupDialog(Shell shell, String message, ILaunchConfiguration
8788
*
8889
* @return whether the "do not ask again" check box is selected in the dialog
8990
*/
91+
@Deprecated
9092
public boolean isNotAskAgain() {
9193
return fNotAskAgain;
9294
}
9395

9496
/* (non-Javadoc)
9597
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
9698
*/
99+
@Deprecated
97100
@Override
98101
protected Control createDialogArea(Composite parent) {
99102
Font font = parent.getFont();
@@ -132,6 +135,7 @@ protected Control createDialogArea(Composite parent) {
132135
/* (non-Javadoc)
133136
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
134137
*/
138+
@Deprecated
135139
@Override
136140
protected void okPressed() {
137141
try {

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/JavaUISourceLocator.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class JavaUISourceLocator implements IPersistableSourceLocator {
7777
* Identifier for the 'Prompting Java Source Locator' extension
7878
* (value <code>"org.eclipse.jdt.debug.ui.javaSourceLocator"</code>).
7979
*/
80+
@Deprecated
8081
public static final String ID_PROMPTING_JAVA_SOURCE_LOCATOR = IJavaDebugUIConstants.PLUGIN_ID + ".javaSourceLocator"; //$NON-NLS-1$
8182

8283
/**
@@ -86,6 +87,7 @@ public class JavaUISourceLocator implements IPersistableSourceLocator {
8687
*
8788
* @since 2.1
8889
*/
90+
@Deprecated
8991
public static final String ATTR_FIND_ALL_SOURCE_ELEMENTS = IJavaDebugUIConstants.PLUGIN_ID + ".ATTR_FIND_ALL_SOURCE_ELEMENTS"; //$NON-NLS-1$
9092

9193
/**
@@ -120,6 +122,7 @@ public class JavaUISourceLocator implements IPersistableSourceLocator {
120122
/**
121123
* Constructs an empty source locator.
122124
*/
125+
@Deprecated
123126
public JavaUISourceLocator() {
124127
fSourceLocator = new JavaSourceLocator();
125128
fAllowedToAsk = true;
@@ -135,6 +138,7 @@ public JavaUISourceLocator() {
135138
* as well
136139
* @throws CoreException if the underlying {@link JavaSourceLocator} fails to be created
137140
*/
141+
@Deprecated
138142
public JavaUISourceLocator(IJavaProject[] projects, boolean includeRequired) throws CoreException {
139143
fSourceLocator = new JavaSourceLocator(projects, includeRequired);
140144
fAllowedToAsk = true;
@@ -150,6 +154,7 @@ public JavaUISourceLocator(IJavaProject[] projects, boolean includeRequired) thr
150154
* @exception CoreException if unable to read the project's
151155
* build path
152156
*/
157+
@Deprecated
153158
public JavaUISourceLocator(IJavaProject project) throws CoreException {
154159
fJavaProject = project;
155160
IJavaSourceLocation[] sls =
@@ -164,6 +169,7 @@ public JavaUISourceLocator(IJavaProject project) throws CoreException {
164169
/**
165170
* @see org.eclipse.debug.core.model.ISourceLocator#getSourceElement(IStackFrame)
166171
*/
172+
@Deprecated
167173
@Override
168174
public Object getSourceElement(IStackFrame stackFrame) {
169175
Object res = findSourceElement(stackFrame);
@@ -280,6 +286,7 @@ public void run() {
280286
/**
281287
* @see IPersistableSourceLocator#getMemento()
282288
*/
289+
@Deprecated
283290
@Override
284291
public String getMemento() throws CoreException {
285292
String memento = fSourceLocator.getMemento();
@@ -300,6 +307,7 @@ public String getMemento() throws CoreException {
300307
/**
301308
* @see IPersistableSourceLocator#initializeDefaults(ILaunchConfiguration)
302309
*/
310+
@Deprecated
303311
@Override
304312
public void initializeDefaults(ILaunchConfiguration configuration)
305313
throws CoreException {
@@ -312,6 +320,7 @@ public void initializeDefaults(ILaunchConfiguration configuration)
312320
/**
313321
* @see IPersistableSourceLocator#initializeFromMemento(String)
314322
*/
323+
@Deprecated
315324
@Override
316325
public void initializeFromMemento(String memento) throws CoreException {
317326
if (memento.startsWith("<project>")) { //$NON-NLS-1$
@@ -347,6 +356,7 @@ public void initializeFromMemento(String memento) throws CoreException {
347356
* @return the locations that this source locator is currently
348357
* searching, in the order that they are searched
349358
*/
359+
@Deprecated
350360
public IJavaSourceLocation[] getSourceLocations() {
351361
return fSourceLocator.getSourceLocations();
352362
}
@@ -359,6 +369,7 @@ public IJavaSourceLocation[] getSourceLocations() {
359369
* @param locations the locations that will be searched, in the order
360370
* to be searched
361371
*/
372+
@Deprecated
362373
public void setSourceLocations(IJavaSourceLocation[] locations) {
363374
fSourceLocator.setSourceLocations(locations);
364375
}
@@ -374,6 +385,7 @@ public void setSourceLocations(IJavaSourceLocation[] locations) {
374385
* source elements that correspond to a stack frame
375386
* @since 2.1
376387
*/
388+
@Deprecated
377389
public boolean isFindAllSourceElements() {
378390
return fIsFindAllSourceElements;
379391
}
@@ -386,6 +398,7 @@ public boolean isFindAllSourceElements() {
386398
* elements that correspond to a stack frame
387399
* @since 2.1
388400
*/
401+
@Deprecated
389402
public void setFindAllSourceElement(boolean findAll) {
390403
fIsFindAllSourceElements = findAll;
391404
}

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaSourceLookupTab.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@
5252
@Deprecated
5353
public class JavaSourceLookupTab extends JavaLaunchTab {
5454

55+
@Deprecated
5556
protected SourceLookupBlock fSourceLookupBlock;
5657

5758
/**
5859
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(Composite)
5960
*/
61+
@Deprecated
6062
@Override
6163
public void createControl(Composite parent) {
6264
Composite comp = new Composite(parent, SWT.NONE);
@@ -82,6 +84,7 @@ public void createControl(Composite parent) {
8284
/**
8385
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
8486
*/
87+
@Deprecated
8588
@Override
8689
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
8790
// be default, use a prompting source locator
@@ -93,6 +96,7 @@ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
9396
/**
9497
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
9598
*/
99+
@Deprecated
96100
@Override
97101
public void initializeFrom(ILaunchConfiguration configuration) {
98102
fSourceLookupBlock.initializeFrom(configuration);
@@ -101,6 +105,7 @@ public void initializeFrom(ILaunchConfiguration configuration) {
101105
/**
102106
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
103107
*/
108+
@Deprecated
104109
@Override
105110
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
106111
configuration.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, JavaUISourceLocator.ID_PROMPTING_JAVA_SOURCE_LOCATOR);
@@ -112,6 +117,7 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
112117
*
113118
* @since 3.3
114119
*/
120+
@Deprecated
115121
@Override
116122
public String getId() {
117123
return "org.eclipse.jdt.debug.ui.javaSourceLookupTab"; //$NON-NLS-1$
@@ -120,6 +126,7 @@ public String getId() {
120126
/**
121127
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
122128
*/
129+
@Deprecated
123130
@Override
124131
public String getName() {
125132
return LauncherMessages.JavaSourceLookupTab_Source_1;
@@ -128,6 +135,7 @@ public String getName() {
128135
/**
129136
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
130137
*/
138+
@Deprecated
131139
@Override
132140
public Image getImage() {
133141
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaSourceLocationWorkbenchAdapterFactory.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@
3737
@Deprecated
3838
/*package*/ class JavaSourceLocationWorkbenchAdapterFactory implements IAdapterFactory {
3939

40+
@Deprecated
4041
class SourceLocationPropertiesAdapter implements IWorkbenchAdapter {
4142

4243
private final JavaElementLabelProvider fJavaElementLabelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_BASICS);
4344

4445
/**
4546
* @see IWorkbenchAdapter#getChildren(Object)
4647
*/
48+
@Deprecated
4749
@Override
4850
public Object[] getChildren(Object o) {
4951
return new Object[0];
@@ -52,6 +54,7 @@ public Object[] getChildren(Object o) {
5254
/**
5355
* @see IWorkbenchAdapter#getImageDescriptor(Object)
5456
*/
57+
@Deprecated
5558
@Override
5659
public ImageDescriptor getImageDescriptor(Object o) {
5760
if (o instanceof JavaProjectSourceLocation) {
@@ -67,6 +70,7 @@ public ImageDescriptor getImageDescriptor(Object o) {
6770
/**
6871
* @see IWorkbenchAdapter#getLabel(Object)
6972
*/
73+
@Deprecated
7074
@Override
7175
public String getLabel(Object o) {
7276
if (o instanceof JavaProjectSourceLocation) {
@@ -87,6 +91,7 @@ public String getLabel(Object o) {
8791
/**
8892
* @see IWorkbenchAdapter#getParent(Object)
8993
*/
94+
@Deprecated
9095
@Override
9196
public Object getParent(Object o) {
9297
return null;
@@ -96,6 +101,7 @@ public Object getParent(Object o) {
96101
/**
97102
* @see IAdapterFactory#getAdapter(Object, Class)
98103
*/
104+
@Deprecated
99105
@Override
100106
@SuppressWarnings("unchecked")
101107
public <T> T getAdapter(Object obj, Class<T> adapterType) {
@@ -113,6 +119,7 @@ public <T> T getAdapter(Object obj, Class<T> adapterType) {
113119
/**
114120
* @see IAdapterFactory#getAdapterList()
115121
*/
122+
@Deprecated
116123
@Override
117124
public Class<?>[] getAdapterList() {
118125
return new Class[] {

org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaPatternBreakpoint.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public interface IJavaPatternBreakpoint extends IJavaLineBreakpoint {
3838
* if unable to access the property from this breakpoint's
3939
* underlying marker
4040
*/
41+
@Deprecated
4142
public String getPattern() throws CoreException;
4243

4344
/**
@@ -51,6 +52,7 @@ public interface IJavaPatternBreakpoint extends IJavaLineBreakpoint {
5152
* if unable to access the property from this breakpoint's
5253
* underlying marker
5354
*/
55+
@Deprecated
5456
public String getSourceName() throws CoreException;
5557

5658
}

org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/IRuntimeContainerComparator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public interface IRuntimeContainerComparator {
4242
* @return whether this container is a duplicate of the container
4343
* identified by the given path
4444
*/
45+
@Deprecated
4546
public boolean isDuplicate(IPath containerPath);
4647

4748
}

org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/ArchiveSourceLocation.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ private static ZipFile getZipFile(String name) throws IOException {
9595
* This method is only to be called by the launching
9696
* plug-in.
9797
*/
98+
@Deprecated
9899
public static void closeArchives() {
99100
synchronized (fZipFileCache) {
100101
Iterator<ZipFile> iter = fZipFileCache.values().iterator();
@@ -131,6 +132,7 @@ public static void closeArchives() {
131132
* Constructs a new empty source location to be initialized with
132133
* a memento.
133134
*/
135+
@Deprecated
134136
public ArchiveSourceLocation() {
135137
}
136138

@@ -143,6 +145,7 @@ public ArchiveSourceLocation() {
143145
* specified archive, or <code>null</code> if the root source folder
144146
* is the root of the archive
145147
*/
148+
@Deprecated
146149
public ArchiveSourceLocation(String archiveName, String sourceRoot) {
147150
super();
148151
setName(archiveName);
@@ -152,6 +155,7 @@ public ArchiveSourceLocation(String archiveName, String sourceRoot) {
152155
/* (non-Javadoc)
153156
* @see org.eclipse.jdt.launching.sourcelookup.IJavaSourceLocation#findSourceElement(java.lang.String)
154157
*/
158+
@Deprecated
155159
@Override
156160
public Object findSourceElement(String name) throws CoreException {
157161
try {
@@ -237,6 +241,7 @@ private void autoDetectRoot(IPath path) throws CoreException {
237241
* @throws IOException if unable to create the zip
238242
* file associated with this location
239243
*/
244+
@Deprecated
240245
protected ZipFile getArchive() throws IOException {
241246
return getZipFile(getName());
242247
}
@@ -268,6 +273,7 @@ private void setRootPath(String path) {
268273
* the archive, or <code>null</code> if the root source
269274
* folder is the root of the archive
270275
*/
276+
@Deprecated
271277
public IPath getRootPath() {
272278
return fRootPath;
273279
}
@@ -279,6 +285,7 @@ public IPath getRootPath() {
279285
* @return the name of the archive associated with this
280286
* source location
281287
*/
288+
@Deprecated
282289
public String getName() {
283290
return fName;
284291
}
@@ -297,6 +304,7 @@ private void setName(String name) {
297304
/* (non-Javadoc)
298305
* @see java.lang.Object#equals(java.lang.Object)
299306
*/
307+
@Deprecated
300308
@Override
301309
public boolean equals(Object object) {
302310
return object instanceof ArchiveSourceLocation archivceSource && getName().equals(archivceSource.getName());
@@ -305,6 +313,7 @@ public boolean equals(Object object) {
305313
/* (non-Javadoc)
306314
* @see java.lang.Object#hashCode()
307315
*/
316+
@Deprecated
308317
@Override
309318
public int hashCode() {
310319
return getName().hashCode();
@@ -313,6 +322,7 @@ public int hashCode() {
313322
/* (non-Javadoc)
314323
* @see org.eclipse.jdt.launching.sourcelookup.IJavaSourceLocation#getMemento()
315324
*/
325+
@Deprecated
316326
@Override
317327
public String getMemento() throws CoreException {
318328
Document doc = DebugPlugin.newDocument();
@@ -329,6 +339,7 @@ public String getMemento() throws CoreException {
329339
/* (non-Javadoc)
330340
* @see org.eclipse.jdt.launching.sourcelookup.IJavaSourceLocation#initializeFrom(java.lang.String)
331341
*/
342+
@Deprecated
332343
@Override
333344
public void initializeFrom(String memento) throws CoreException {
334345
Exception ex = null;

0 commit comments

Comments
 (0)