Changeset 16258

Show
Ignore:
Timestamp:
18/07/08 15:02:51 (1 month ago)
Author:
kmr
Message:

Fixed Eclipse warnings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/intermine/web/main/src/org/intermine/web/logic/config/WebConfig.java

    r15876 r16258  
    4040public class WebConfig 
    4141{ 
    42     private Map<String, Type> types = new HashMap(); 
    43     private Map tableExportConfigs = new HashMap(); 
    44     private Map<String, WidgetConfig> widgets = new HashMap(); 
    45      
     42    private Map<String, Type> types = new HashMap<String, Type>(); 
     43    private Map<String, TableExportConfig> tableExportConfigs = 
     44        new HashMap<String, TableExportConfig>(); 
     45    private Map<String, WidgetConfig> widgets = new HashMap<String, WidgetConfig>(); 
     46 
    4647    /** 
    4748     * Parse a WebConfig XML file 
     
    128129 
    129130        webConfig.validate(model); 
    130          
     131 
    131132        webConfig.setSubClassConfig(model); 
    132          
     133 
    133134        return webConfig; 
    134135    } 
    135136 
    136137    /** 
    137      * Validate web config according to the model. Test that configured classes exist in  
     138     * Validate web config according to the model. Test that configured classes exist in 
    138139     * model and configured fields in web config exist in model. 
    139140     * @param model model used for validation 
     
    143144            if (!model.getClassNames().contains(typeName)) { 
    144145                throw new RuntimeException("Invalid web config. Class specified in web config " 
    145                 + "doesn't exist in model. Web config class: " + typeName + "."); 
     146                                   + "doesn't exist in model. Web config class: " + typeName + "."); 
    146147            } 
    147148            Type type = types.get(typeName); 
     
    150151                String pathString; 
    151152                try { 
    152                     pathString = Class.forName(typeName).getSimpleName()  
     153                    pathString = Class.forName(typeName).getSimpleName() 
    153154                        + "." + fieldConfig.getFieldExpr(); 
    154155                } catch (ClassNotFoundException e) { 
     
    158159                } 
    159160                try { 
    160                     Path path = new Path(model, pathString); 
     161                    new Path(model, pathString); 
    161162                } catch (PathError e) { 
    162                     throw new RuntimeException("Invalid web config. Field expression '"  
    163                             + fieldConfig.getFieldExpr() + "' for class "  
     163                    throw new RuntimeException("Invalid web config. Field expression '" 
     164                            + fieldConfig.getFieldExpr() + "' for class " 
    164165                            + typeName + " is not valid according to the model. " 
    165166                            + "Corresponding path " + pathString + " doesn't exist."); 
    166167                } 
    167168            } 
    168         }          
     169        } 
    169170    } 
    170171 
     
    259260    void setSubClassConfig(Model model) throws ClassNotFoundException { 
    260261        TreeSet<String> classes = new TreeSet<String>(model.getClassNames()); 
    261         for (Iterator modelIter = classes.iterator(); modelIter.hasNext();) { 
    262  
    263             String className = (String) modelIter.next(); 
    264             Type thisClassType = (Type) types.get(className); 
     262        for (Iterator<String> modelIter = classes.iterator(); modelIter.hasNext();) { 
     263 
     264            String className = modelIter.next(); 
     265            Type thisClassType = types.get(className); 
    265266 
    266267            if (thisClassType == null) { 
     
    270271            } 
    271272 
    272             Set cds = model.getClassDescriptorsForClass(Class.forName(className)); 
    273             List cdList = new ArrayList(cds); 
    274  
    275             for (Iterator cdIter = cdList.iterator(); cdIter.hasNext(); ) { 
    276                 ClassDescriptor cd = (ClassDescriptor) cdIter.next(); 
     273            Set<ClassDescriptor> cds = model.getClassDescriptorsForClass(Class.forName(className)); 
     274            List<ClassDescriptor> cdList = new ArrayList<ClassDescriptor>(cds); 
     275 
     276            for (Iterator<ClassDescriptor> cdIter = cdList.iterator(); cdIter.hasNext(); ) { 
     277                ClassDescriptor cd = cdIter.next(); 
    277278 
    278279                if (className.equals(cd.getName())) { 
     
    280281                } 
    281282 
    282                 Type superClassType = (Type) types.get(cd.getName()); 
     283                Type superClassType = types.get(cd.getName()); 
    283284 
    284285                if (superClassType != null) { 
     
    310311                                    && superClassType.getWidgets() != null 
    311312                                    && superClassType.getWidgets().size() > 0) { 
    312                         Iterator widgetIter 
    313                         = superClassType.getWidgets().iterator(); 
     313                        Iterator widgetIter = superClassType.getWidgets().iterator(); 
    314314 
    315315                        while (widgetIter.hasNext()) { 
     
    331331        StringBuffer sb = new StringBuffer(); 
    332332        sb.append("<webconfig>"); 
    333         Iterator typesIter = types.values().iterator(); 
     333        Iterator<Type> typesIter = types.values().iterator(); 
    334334        while (typesIter.hasNext()) { 
    335335            sb.append(typesIter.next().toString()); 
    336336        } 
    337         Iterator tableExportConfigIter = tableExportConfigs.values().iterator(); 
     337        Iterator<TableExportConfig> tableExportConfigIter = tableExportConfigs.values().iterator(); 
    338338        while (tableExportConfigIter.hasNext()) { 
    339339            sb.append(tableExportConfigIter.next().toString());