Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2009-10-03 04:45:15 +0000
committerAndrew Gvozdev2009-10-03 04:45:15 +0000
commit6348536f9f916061fefacf3de220bc7559fc1bfd (patch)
tree6451b38305e1cd7c990fce78a81b0b4ce28d7742
parentdb7a537b361ed67831fcf98a4e11e0977715858f (diff)
downloadorg.eclipse.cdt-6348536f9f916061fefacf3de220bc7559fc1bfd.tar.gz
org.eclipse.cdt-6348536f9f916061fefacf3de220bc7559fc1bfd.tar.xz
org.eclipse.cdt-6348536f9f916061fefacf3de220bc7559fc1bfd.zip
cleanup: java generics - parameterized this class
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java
index ad79dfa51b1..fa8e73bf264 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java
@@ -27,7 +27,7 @@ import org.eclipse.cdt.core.settings.model.ICSettingEntry;
* @see ICSettingEntry#SOURCE_PATH
*
*/
-public class KindBasedStore implements Cloneable {
+public class KindBasedStore<TypeStored> implements Cloneable {
private static final int INDEX_INCLUDE_PATH = 0;
private static final int INDEX_INCLUDE_FILE = 1;
private static final int INDEX_MACRO = 2;
@@ -148,13 +148,15 @@ public class KindBasedStore implements Cloneable {
}
throw new IllegalArgumentException(UtilMessages.getString("KindBasedStore.1")); //$NON-NLS-1$
}
- public Object get(int kind){
- return fEntryStorage[kindToIndex(kind)];
+ @SuppressWarnings("unchecked")
+ public TypeStored get(int kind){
+ return (TypeStored) fEntryStorage[kindToIndex(kind)];
}
- public Object put(int kind, Object object){
+ @SuppressWarnings("unchecked")
+ public TypeStored put(int kind, TypeStored object){
int index = kindToIndex(kind);
- Object old = fEntryStorage[index];
+ TypeStored old = (TypeStored) fEntryStorage[index];
fEntryStorage[index] = object;
return old;
}
@@ -210,7 +212,8 @@ public class KindBasedStore implements Cloneable {
@Override
public Object clone() {
try {
- KindBasedStore clone = (KindBasedStore)super.clone();
+ @SuppressWarnings("unchecked")
+ KindBasedStore<TypeStored> clone = (KindBasedStore<TypeStored>)super.clone();
clone.fEntryStorage = fEntryStorage.clone();
return clone;
} catch (CloneNotSupportedException e) {

Back to the top