Support entitlement date check for customer assets I'm new to Java right now. Here is my following code snippet:

for(int i = (SelectedAssets.size()-1); -1 &lt; i; i--){

    Double supportTime = 0;
    //Date class must be used. Cannot replace with another class
    Date oDate=SelectedAssets[i].Entitlement_End_Date__c;
    Date dateDifference = oDate.daysBetween(date.today());
    /****************************************************************************
        If the number of days between Entitlement End Date and Todays 
        date is a positive number, then that means the support given to client is expired since 
        entitlement end date happened before todays date.         
    *****************************************************************************/
    if(dateDifference&gt;0){
        supportTime=((dateDifference/365.00));
        //If the number of days is greater than one year, I want 
        //to find out exactly the amount of days it's gone over in decimals. 
        if(supportTime&gt;1){
            supportTime=1;
            supportTime+=(date.today().daysBetween(TheEndDate)/365.00);
        }       
    }
    else{
        //if it hasn't gone over a year, find out how much time has elapsed in years. 
        supportTime=oDate.daysBetween(TheEndDate)/365.00;
    }
}


Is there any redundancies anywhere that I'm overlooking? Is there an easier way of doing this with fewer lines?
First thing would be to scan your code with Sonar. This will hit all the formatting complaints, magic numbers, etc.. Likewise, set up your IDE to auto format on save action to save lots of time fixing those Sonar findings.

The next thing to simplify would be to use Calendar instead of Date.