Changeset 8


Ignore:
Timestamp:
06/08/10 12:50:49 (14 years ago)
Author:
phdmakk
Message:

+ fix for class cast exception in t3d

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t3d/src/org/etsi/t3d/visitor/VisitorCommonFunctions.java

    r7 r8  
    11package org.etsi.t3d.visitor; 
    22 
    3 import java.util.ArrayList; 
    4 import java.util.Iterator; 
     3import java.util.Collection; 
    54import java.util.LinkedList; 
    65import java.util.List; 
     
    1716import de.ugoe.cs.swe.trex.core.analyzer.rfparser.LocationAST; 
    1817import de.ugoe.cs.swe.trex.core.analyzer.rfparser.TTCN3FormatterTreeParser; 
    19 import de.ugoe.cs.swe.trex.core.analyzer.rfparser.TTCN3Lexer; 
    2018import de.ugoe.cs.swe.trex.core.analyzer.rfparser.TTCN3ParserTokenTypes; 
    2119import de.ugoe.cs.swe.trex.core.analyzer.rfparser.symboltable.Scope; 
     
    149147                Map<String, List<ReferenceWithContext>> result = referenceFinder.findReferences(symb); 
    150148 
    151                 Iterator<List<ReferenceWithContext>> refIt = result.values().iterator(); 
    152                 if(refIt != null) 
    153                         while(refIt.hasNext()){ 
    154                                  
    155                                 ArrayList<ReferenceWithContext> refList = (ArrayList<ReferenceWithContext>)refIt.next(); 
    156                                 for(ReferenceWithContext ref : refList){ 
    157                                         linkedRefList.add(ref.getReferenceNode()); 
    158                                 } 
     149                Collection<List<ReferenceWithContext>> values = result.values(); 
     150                 
     151                for (List<ReferenceWithContext> referenceList : values) { 
     152                        for (ReferenceWithContext reference : referenceList) { 
     153                                linkedRefList.add(reference.getReferenceNode()); 
    159154                        } 
    160                 if(linkedRefList.isEmpty()) 
    161                         return null; 
     155                } 
     156                if (linkedRefList.isEmpty()) { 
     157                        return null; 
     158                } 
    162159                return linkedRefList; 
    163160        } 
    164          
    165          
     161                 
    166162        //returns the location of an html file that would represent node 
    167163        public static String getLocationFromIdentifier(LocationAST node){ 
Note: See TracChangeset for help on using the changeset viewer.