code: private void deriveProjectCalendar()
     {
        //
        // Count the number of times each calendar is used
        //
        Map<ProjectCalendar, Integer> map = new HashMap<ProjectCalendar, Integer>();
        for (Task task : m_project.getTasks())
        {
           ProjectCalendar calendar = task.getCalendar();
           Integer count = map.get(calendar);
           if (count == null)
           {
              count = Integer.valueOf(1);
           }
           else
           {
              count = Integer.valueOf(count.intValue() + 1);
           }
           map.put(calendar, count);
        }
  
        //
        // Find the most frequently used calendar
        //
        int maxCount = 0;
        ProjectCalendar defaultCalendar = null;
  
        for (Entry<ProjectCalendar, Integer> entry : map.entrySet())
        {
           if (entry.getValue().intValue() > maxCount)
           {
              maxCount = entry.getValue().intValue();
              defaultCalendar = entry.getKey();
           }
        }
  
        //
        // Set the default calendar for the project
        // and remove it's use as a task-specific calendar.
        //
        if (defaultCalendar != null)
        {
           m_project.setDefaultCalendar(defaultCalendar);
           for (Task task : m_project.getTasks())
           {
              if (task.getCalendar() == defaultCalendar)
              {
                 task.setCalendar(null);
              }
           }
        }
     }
docs: Asta Powerproject assigns an explicit calendar for each task. This method
  is used to find the most common calendar and use this as the default project
  calendar. This allows the explicitly assigned task calendars to be removed.