Changeset 1160


Ignore:
Timestamp:
12/01/11 00:22:23 (13 years ago)
Author:
masberg
Message:

Fix bug in constructor: setPredicates() was called with an empty array and not our list of rules. Use generics. Remove unneeded code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/text/ModelicaPartitionScanner.java

    r491 r1160  
    2929 *  - Modelica code
    3030 */
    31 @SuppressWarnings("unchecked")
    3231public class ModelicaPartitionScanner extends RuleBasedPartitionScanner implements IModelicaPartitions {
    3332
     
    9089     */
    9190    public ModelicaPartitionScanner() {
    92         super();
    93 
    9491        IToken modelicaString = new Token(MODELICA_STRING);     
    9592        IToken modelicaMultiLineComment= new Token(MODELICA_MULTI_LINE_COMMENT);
    9693        IToken modelicaSingleLineComment= new Token(MODELICA_SINGLE_LINE_COMMENT);     
    9794
    98         List rules= new ArrayList();
     95        List<IPredicateRule> rules= new ArrayList<IPredicateRule>();
    9996
    10097        // Add rule for single line comments.
     
    110107        rules.add(new MultiLineRule("/*", "*/", modelicaMultiLineComment, (char)0, true));
    111108       
    112         IPredicateRule[] result= new IPredicateRule[rules.size()];
    113         rules.toArray(result);
     109        IPredicateRule[] result = rules.toArray(new IPredicateRule[0]);
     110
    114111        setPredicateRules(result);
    115112    }
Note: See TracChangeset for help on using the changeset viewer.