コード例 #1
0
  private List<P2LineupValidationStatus> extractErrors(
      IStatus[] children,
      List<P2LineupUnresolvedInstallableUnit> units,
      List<P2LineupRepositoryError> repos) {
    List<P2LineupValidationStatus> extras = new ArrayList<P2LineupValidationStatus>();

    if (children != null) {
      for (IStatus s : children) {
        if (s instanceof P2LineupValidationStatus) {
          P2LineupValidationStatus status = (P2LineupValidationStatus) s;
          P2LineupError e = status.getError();
          if (e instanceof P2LineupUnresolvedInstallableUnit) {
            P2LineupUnresolvedInstallableUnit uie = (P2LineupUnresolvedInstallableUnit) e;
            units.add(uie);
          } else if (e instanceof P2LineupRepositoryError) {
            P2LineupRepositoryError ur = (P2LineupRepositoryError) e;
            repos.add(ur);
          } else {
            extras.add(status);
          }
          log.error(
              "error validating lineup: " + status.getMessage(),
              status.getException()); // $NON-NLS-1$
        } else {
          log.error(
              "Error validation lineup, unknown status:"
                  + s.getMessage()
                  + " "
                  + s.getClass()); // $NON-NLS-1$ //$NON-NLS-2$
        }
      }
    }
    return extras;
  }
コード例 #2
0
 private boolean hasOnlyWarnings(IStatus status) {
   if (status.isMultiStatus()) {
     for (IStatus s : status.getChildren()) {
       if (s instanceof P2LineupValidationStatus) {
         P2LineupValidationStatus validationStatus = (P2LineupValidationStatus) s;
         P2LineupError e = validationStatus.getError();
         if (!e.isWarning()) {
           return false;
         }
       }
     }
     return true;
   } else {
     return status.getSeverity() == IStatus.WARNING;
   }
 }