Changeset 192


Ignore:
Timestamp:
11/02/2009 01:50:24 PM (10 years ago)
Author:
joao.dias
Message:

Removed more compile warnings, and in particular unchecked cast warnings. There are just 4 warnings remaining now.

Location:
AgentMind/branches/FAtiMA2/src/FAtiMA
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • AgentMind/branches/FAtiMA2/src/FAtiMA/Agent.java

    r191 r192  
    380380        } 
    381381         
     382        @SuppressWarnings("unchecked") 
    382383        public void LoadAgentState(String fileName)  
    383384                throws IOException, ClassNotFoundException{ 
     385                 
    384386                 
    385387                FileInputStream in = new FileInputStream(fileName); 
  • AgentMind/branches/FAtiMA2/src/FAtiMA/culture/Ritual.java

    r191 r192  
    428428                r._numberOfTries = this._numberOfTries; 
    429429                 
    430                 r._expectedEffects = (Hashtable<String,Float>) this._expectedEffects.clone(); 
     430                r._expectedEffects = new Hashtable<String,Float>(this._expectedEffects); 
    431431                 
    432432                if(this._preConditions != null) 
  • AgentMind/branches/FAtiMA2/src/FAtiMA/deliberativeLayer/goals/ActivePursuitGoal.java

    r191 r192  
    795795                g._numberOfTries = this._numberOfTries; 
    796796         
    797                 g._expectedEffects = (Hashtable<String,Float>) this._expectedEffects.clone(); 
     797                g._expectedEffects = new Hashtable<String,Float>(this._expectedEffects); 
    798798                 
    799799                if(this._preConditions != null) 
  • AgentMind/branches/FAtiMA2/src/FAtiMA/deliberativeLayer/plan/OrderRelation.java

    r191 r192  
    133133        OrderRelation order = new OrderRelation(); 
    134134        order._stepID = this._stepID; 
    135         order._after = (ArrayList<Integer>) this._after.clone(); 
    136         order._before = (ArrayList<Integer>) this._before.clone(); 
     135        order._after = new ArrayList<Integer>(this._after); 
     136        order._before = new ArrayList<Integer>(this._before);  
    137137 
    138138        return order; 
  • AgentMind/branches/FAtiMA2/src/FAtiMA/deliberativeLayer/plan/Plan.java

    r191 r192  
    796796 
    797797        //no need to clone the elements 
    798         p._bindingConstraints = (HashMap<String,Substitution>) _bindingConstraints.clone(); 
    799         p._openPreconditions = (ArrayList<OpenPrecondition>) _openPreconditions.clone(); 
    800         p._links = (ArrayList<CausalLink>) _links.clone(); 
    801         p._causalConflicts = (ArrayList<CausalConflictFlaw>) _causalConflicts.clone(); 
     798        p._bindingConstraints = new HashMap<String,Substitution>(_bindingConstraints); 
     799        p._openPreconditions = new ArrayList<OpenPrecondition>(_openPreconditions); 
     800        p._links = new ArrayList<CausalLink>(_links); 
     801        p._causalConflicts = new ArrayList<CausalConflictFlaw>(_causalConflicts); 
     802         
    802803 
    803804        //TODO think about these ones 
    804         p._protectedConditions = _protectedConditions; 
    805         p._protectionThreats = (ArrayList<GoalThreat>) _protectionThreats.clone(); 
    806         p._ignoredConflicts = (ArrayList<CausalConflictFlaw>) _ignoredConflicts.clone(); 
     805        p._protectedConditions = new ArrayList<ProtectedCondition>(_protectedConditions); 
     806         
     807        p._protectionThreats = new ArrayList<GoalThreat>(_protectionThreats);  
     808        p._ignoredConflicts = new ArrayList<CausalConflictFlaw>(_ignoredConflicts);  
    807809 
    808810        return p; 
  • AgentMind/branches/FAtiMA2/src/FAtiMA/memory/ActionDetail.java

    r191 r192  
    359359        }*/ 
    360360         
     361        @SuppressWarnings("unchecked") 
    361362        public boolean verifiesKey(SearchKey key) 
    362363        { 
  • AgentMind/branches/FAtiMA2/src/FAtiMA/memory/autobiographicalMemory/MemoryEpisode.java

    r191 r192  
    288288                 
    289289                // version with both internal and external events 
    290                 List<ActionDetail> auxList = (List<ActionDetail>) _details.clone(); 
     290                List<ActionDetail> auxList = new ArrayList<ActionDetail>(_details); 
    291291                // version with only internal events 
    292292                //List auxList = (List) FilterInternalEvents(_details); 
  • AgentMind/branches/FAtiMA2/src/FAtiMA/memory/shortTermMemory/WorkingMemory.java

    r191 r192  
    349349        { 
    350350                KnowledgeSlot ks; 
    351                 ArrayList<KnowledgeSlot> tempFactList = (ArrayList<KnowledgeSlot>) _factList.clone(); 
     351                ArrayList<KnowledgeSlot> tempFactList = new ArrayList<KnowledgeSlot>(_factList);  
    352352                ListIterator<KnowledgeSlot> li = tempFactList.listIterator(); 
    353353                synchronized (this) { 
Note: See TracChangeset for help on using the changeset viewer.