Skip to content

Commit c77ffae

Browse files
Perform clean code of runtime/bundles/org.eclipse.core.runtime
1 parent 879c3bd commit c77ffae

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/preferences/legacy/PreferenceForwarder.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ public class PreferenceForwarder extends Preferences implements IEclipsePreferen
4747
/*
4848
* Used for test suites only.
4949
*/
50+
@Deprecated
5051
public PreferenceForwarder(String pluginID) {
5152
this(null, pluginID);
5253
}
5354

55+
@Deprecated
5456
public PreferenceForwarder(Object plugin, String pluginID) {
5557
super();
5658
this.plugin = plugin;
@@ -60,6 +62,7 @@ public PreferenceForwarder(Object plugin, String pluginID) {
6062
/*
6163
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener#added(org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent)
6264
*/
65+
@Deprecated
6366
@Override
6467
public synchronized void added(IEclipsePreferences.NodeChangeEvent event) {
6568
if (listeners.size() > 0 && pluginID.equals(event.getChild().name())) {
@@ -75,6 +78,7 @@ public synchronized void added(IEclipsePreferences.NodeChangeEvent event) {
7578
/*
7679
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener#removed(org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent)
7780
*/
81+
@Deprecated
7882
@Override
7983
public synchronized void removed(IEclipsePreferences.NodeChangeEvent event) {
8084
// Do nothing. We can't remove ourselves from the node's list of preference change
@@ -87,6 +91,7 @@ public synchronized void removed(IEclipsePreferences.NodeChangeEvent event) {
8791
*
8892
* @param listener a property change listener
8993
*/
94+
@Deprecated
9095
@Override
9196
public synchronized void addPropertyChangeListener(IPropertyChangeListener listener) {
9297
if (listeners.size() == 0) {
@@ -103,6 +108,7 @@ public synchronized void addPropertyChangeListener(IPropertyChangeListener liste
103108
/*
104109
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
105110
*/
111+
@Deprecated
106112
@Override
107113
public void preferenceChange(IEclipsePreferences.PreferenceChangeEvent event) {
108114
// if we are the ones making this change, then don't broadcast
@@ -145,6 +151,7 @@ private IEclipsePreferences getDefaultPreferences() {
145151
*
146152
* @param listener a property change listener
147153
*/
154+
@Deprecated
148155
@Override
149156
public synchronized void removePropertyChangeListener(IPropertyChangeListener listener) {
150157
listeners.remove(listener);
@@ -194,6 +201,7 @@ private Object getDefault(String key, Object obj) {
194201
* @return <code>true</code> if either a current value or a default
195202
* value is known for the named property, and <code>false</code>otherwise
196203
*/
204+
@Deprecated
197205
@Override
198206
public boolean contains(String name) {
199207
if (name == null) {
@@ -216,6 +224,7 @@ public boolean contains(String name) {
216224
* @param name the name of the property
217225
* @return the boolean-valued property
218226
*/
227+
@Deprecated
219228
@Override
220229
public boolean getBoolean(String name) {
221230
return getPluginPreferences(true).getBoolean(name, getDefaultPreferences().getBoolean(name, BOOLEAN_DEFAULT_DEFAULT));
@@ -240,6 +249,7 @@ public boolean getBoolean(String name) {
240249
* @param name the name of the property
241250
* @param value the new current value of the property
242251
*/
252+
@Deprecated
243253
@Override
244254
public void setValue(String name, boolean value) {
245255
Boolean oldValue = getBoolean(name) ? Boolean.TRUE : Boolean.FALSE;
@@ -270,6 +280,7 @@ public void setValue(String name, boolean value) {
270280
* @param name the name of the property
271281
* @return the default value of the named property
272282
*/
283+
@Deprecated
273284
@Override
274285
public boolean getDefaultBoolean(String name) {
275286
return getDefaultPreferences().getBoolean(name, BOOLEAN_DEFAULT_DEFAULT);
@@ -290,6 +301,7 @@ public boolean getDefaultBoolean(String name) {
290301
* @param name the name of the property
291302
* @param value the new default value for the property
292303
*/
304+
@Deprecated
293305
@Override
294306
public void setDefault(String name, boolean value) {
295307
getDefaultPreferences().putBoolean(name, value);
@@ -305,6 +317,7 @@ public void setDefault(String name, boolean value) {
305317
* @param name the name of the property
306318
* @return the double-valued property
307319
*/
320+
@Deprecated
308321
@Override
309322
public double getDouble(String name) {
310323
return getPluginPreferences(true).getDouble(name, getDefaultPreferences().getDouble(name, DOUBLE_DEFAULT_DEFAULT));
@@ -330,6 +343,7 @@ public double getDouble(String name) {
330343
* @param value the new current value of the property; must be
331344
* a number (not a NaN)
332345
*/
346+
@Deprecated
333347
@Override
334348
public void setValue(String name, double value) {
335349
if (Double.isNaN(value)) {
@@ -364,6 +378,7 @@ public void setValue(String name, double value) {
364378
* @param name the name of the property
365379
* @return the default value of the named property
366380
*/
381+
@Deprecated
367382
@Override
368383
public double getDefaultDouble(String name) {
369384
return getDefaultPreferences().getDouble(name, DOUBLE_DEFAULT_DEFAULT);
@@ -385,6 +400,7 @@ public double getDefaultDouble(String name) {
385400
* @param value the new default value for the property; must be
386401
* a number (not a NaN)
387402
*/
403+
@Deprecated
388404
@Override
389405
public void setDefault(String name, double value) {
390406
if (Double.isNaN(value)) {
@@ -403,6 +419,7 @@ public void setDefault(String name, double value) {
403419
* @param name the name of the property
404420
* @return the float-valued property
405421
*/
422+
@Deprecated
406423
@Override
407424
public float getFloat(String name) {
408425
return getPluginPreferences(true).getFloat(name, getDefaultPreferences().getFloat(name, FLOAT_DEFAULT_DEFAULT));
@@ -428,6 +445,7 @@ public float getFloat(String name) {
428445
* @param value the new current value of the property; must be
429446
* a number (not a NaN)
430447
*/
448+
@Deprecated
431449
@Override
432450
public void setValue(String name, float value) {
433451
if (Float.isNaN(value)) {
@@ -462,6 +480,7 @@ public void setValue(String name, float value) {
462480
* @param name the name of the property
463481
* @return the default value of the named property
464482
*/
483+
@Deprecated
465484
@Override
466485
public float getDefaultFloat(String name) {
467486
return getDefaultPreferences().getFloat(name, FLOAT_DEFAULT_DEFAULT);
@@ -483,6 +502,7 @@ public float getDefaultFloat(String name) {
483502
* @param value the new default value for the property; must be
484503
* a number (not a NaN)
485504
*/
505+
@Deprecated
486506
@Override
487507
public void setDefault(String name, float value) {
488508
if (Float.isNaN(value)) {
@@ -501,6 +521,7 @@ public void setDefault(String name, float value) {
501521
* @param name the name of the property
502522
* @return the int-valued property
503523
*/
524+
@Deprecated
504525
@Override
505526
public int getInt(String name) {
506527
return getPluginPreferences(true).getInt(name, getDefaultPreferences().getInt(name, INT_DEFAULT_DEFAULT));
@@ -525,6 +546,7 @@ public int getInt(String name) {
525546
* @param name the name of the property
526547
* @param value the new current value of the property
527548
*/
549+
@Deprecated
528550
@Override
529551
public void setValue(String name, int value) {
530552
final int intValue = getInt(name);
@@ -556,6 +578,7 @@ public void setValue(String name, int value) {
556578
* @param name the name of the property
557579
* @return the default value of the named property
558580
*/
581+
@Deprecated
559582
@Override
560583
public int getDefaultInt(String name) {
561584
return getDefaultPreferences().getInt(name, INT_DEFAULT_DEFAULT);
@@ -576,6 +599,7 @@ public int getDefaultInt(String name) {
576599
* @param name the name of the property
577600
* @param value the new default value for the property
578601
*/
602+
@Deprecated
579603
@Override
580604
public void setDefault(String name, int value) {
581605
getDefaultPreferences().putInt(name, value);
@@ -591,6 +615,7 @@ public void setDefault(String name, int value) {
591615
* @param name the name of the property
592616
* @return the long-valued property
593617
*/
618+
@Deprecated
594619
@Override
595620
public long getLong(String name) {
596621
return getPluginPreferences(true).getLong(name, getDefaultPreferences().getLong(name, LONG_DEFAULT_DEFAULT));
@@ -615,6 +640,7 @@ public long getLong(String name) {
615640
* @param name the name of the property
616641
* @param value the new current value of the property
617642
*/
643+
@Deprecated
618644
@Override
619645
public void setValue(String name, long value) {
620646
final long longValue = getLong(name);
@@ -646,6 +672,7 @@ public void setValue(String name, long value) {
646672
* @param name the name of the property
647673
* @return the default value of the named property
648674
*/
675+
@Deprecated
649676
@Override
650677
public long getDefaultLong(String name) {
651678
return getDefaultPreferences().getLong(name, LONG_DEFAULT_DEFAULT);
@@ -666,6 +693,7 @@ public long getDefaultLong(String name) {
666693
* @param name the name of the property
667694
* @param value the new default value for the property
668695
*/
696+
@Deprecated
669697
@Override
670698
public void setDefault(String name, long value) {
671699
getDefaultPreferences().putLong(name, value);
@@ -680,6 +708,7 @@ public void setDefault(String name, long value) {
680708
* @param name the name of the property
681709
* @return the string-valued property
682710
*/
711+
@Deprecated
683712
@Override
684713
public String getString(String name) {
685714
return getPluginPreferences(true).get(name, getDefaultPreferences().get(name, STRING_DEFAULT_DEFAULT));
@@ -704,6 +733,7 @@ public String getString(String name) {
704733
* @param name the name of the property
705734
* @param value the new current value of the property
706735
*/
736+
@Deprecated
707737
@Override
708738
public void setValue(String name, String value) {
709739
if (value == null) {
@@ -736,6 +766,7 @@ public void setValue(String name, String value) {
736766
* @param name the name of the property
737767
* @return the default value of the named property
738768
*/
769+
@Deprecated
739770
@Override
740771
public String getDefaultString(String name) {
741772
return getDefaultPreferences().get(name, STRING_DEFAULT_DEFAULT);
@@ -756,6 +787,7 @@ public String getDefaultString(String name) {
756787
* @param name the name of the property
757788
* @param value the new default value for the property
758789
*/
790+
@Deprecated
759791
@Override
760792
public void setDefault(String name, String value) {
761793
if (value == null) {
@@ -773,6 +805,7 @@ public void setDefault(String name, String value) {
773805
* and <code>false</code> otherwise (including the case where the property
774806
* is unknown to this object)
775807
*/
808+
@Deprecated
776809
@Override
777810
public boolean isDefault(String name) {
778811
if (name == null) {
@@ -800,6 +833,7 @@ public boolean isDefault(String name) {
800833
*
801834
* @param name the name of the property
802835
*/
836+
@Deprecated
803837
@Override
804838
public void setToDefault(String name) {
805839
IEclipsePreferences preferences = getPluginPreferences(true);
@@ -815,6 +849,7 @@ public void setToDefault(String name) {
815849
*
816850
* @return an array of property names
817851
*/
852+
@Deprecated
818853
@Override
819854
public String[] propertyNames() {
820855
return getPluginPreferences(true).keys();
@@ -826,6 +861,7 @@ public String[] propertyNames() {
826861
*
827862
* @return an array of property names
828863
*/
864+
@Deprecated
829865
@Override
830866
public String[] defaultPropertyNames() {
831867
try {
@@ -844,6 +880,7 @@ public String[] defaultPropertyNames() {
844880
* known to this preference object has a current value different from its
845881
* default value, and <code>false</code> otherwise
846882
*/
883+
@Deprecated
847884
@Override
848885
public boolean needsSaving() {
849886
return getPluginPreferences(true).isDirty();
@@ -852,6 +889,7 @@ public boolean needsSaving() {
852889
/**
853890
* Flush the values of these plug-in preferences to disk.
854891
*/
892+
@Deprecated
855893
public void flush() throws BackingStoreException {
856894
IEclipsePreferences node = getPluginPreferences(false);
857895
if (node != null) {
@@ -870,6 +908,7 @@ private void logError(String message, Exception e) {
870908
/*
871909
* @see org.eclipse.core.runtime.Preferences#load(java.io.InputStream)
872910
*/
911+
@Deprecated
873912
@Override
874913
public void load(InputStream in) throws IOException {
875914
Properties result = new Properties();
@@ -888,6 +927,7 @@ public void load(InputStream in) throws IOException {
888927
/*
889928
* @see org.eclipse.core.runtime.Preferences#store(java.io.OutputStream, java.lang.String)
890929
*/
930+
@Deprecated
891931
@Override
892932
public void store(OutputStream out, String header) throws IOException {
893933
Properties result = convertToProperties();
@@ -913,6 +953,7 @@ private void convertFromProperties(Properties props) {
913953
}
914954
}
915955

956+
@Deprecated
916957
@Override
917958
public String toString() {
918959
return "PreferenceForwarder(" + pluginID + ")"; //$NON-NLS-1$ //$NON-NLS-2$

0 commit comments

Comments
 (0)