generics
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/text/AbstractScriptScanner.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/text/AbstractScriptScanner.java
index d82b87c..94093f8 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/text/AbstractScriptScanner.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/text/AbstractScriptScanner.java
@@ -60,7 +60,7 @@
 	private IColorManager fColorManager;
 	private IPreferenceStore fPreferenceStore;
 
-	private Map fTokenMap = new HashMap();
+	private Map<String, Token> fTokenMap = new HashMap<String, Token>();
 	private String[] fPropertyNamesColor;
 	/**
 	 * Preference keys for boolean preferences which are <code>true</code>, iff
@@ -120,7 +120,7 @@
 	/**
 	 * Creates the list of rules controlling this scanner.
 	 */
-	abstract protected List createRules();
+	abstract protected List<IRule> createRules();
 
 	/**
 	 * Creates an abstract script scanner.
@@ -222,7 +222,7 @@
 			fTokenMap.put(colorKey, new Token(createTextAttribute(colorKey,
 					boldKey, italicKey, strikethroughKey, underlineKey)));
 		else {
-			Token token = ((Token) fTokenMap.get(colorKey));
+			Token token = fTokenMap.get(colorKey);
 			if (token != null)
 				token.setData(createTextAttribute(colorKey, boldKey, italicKey,
 						strikethroughKey, underlineKey));
@@ -269,15 +269,13 @@
 	protected Token getToken(String key) {
 		if (fNeedsLazyColorLoading)
 			resolveProxyAttributes();
-		return (Token) fTokenMap.get(key);
+		return fTokenMap.get(key);
 	}
 
 	private void initializeRules() {
-		List rules = createRules();
+		List<IRule> rules = createRules();
 		if (rules != null) {
-			IRule[] result = new IRule[rules.size()];
-			rules.toArray(result);
-			setRules(result);
+			setRules(rules.toArray(new IRule[rules.size()]));
 		}
 	}