code: @Override
      protected boolean isReGenerationRequired() {
  
          //
          // Use the stale flag method to identify if we should re-generate the XSDs from the sources.
          // Basically, we should re-generate the XSDs if:
          //
          // a) The staleFile does not exist
          // b) The staleFile exists and is older than one of the sources (Java or XJB files).
          //    "Older" is determined by comparing the modification timestamp of the staleFile and the source files.
          //
          final File staleFile = getStaleFile();
          final String debugPrefix = "StaleFile [" + FileSystemUtilities.getCanonicalPath(staleFile) + "]";
  
          boolean stale = !staleFile.exists();
          if (stale) {
              getLog().debug(debugPrefix + " not found. XML Schema (re-)generation required.");
          } else {
  
              final List<URL> sources = getSources();
  
              if (getLog().isDebugEnabled()) {
                  getLog().debug(debugPrefix + " found. Checking timestamps on source Java "
                          + "files to determine if XML Schema (re-)generation is required.");
              }
  
              final long staleFileLastModified = staleFile.lastModified();
              for (URL current : sources) {
  
                  final URLConnection sourceFileConnection;
                  try {
                      sourceFileConnection = current.openConnection();
                      sourceFileConnection.connect();
                  } catch (Exception e) {
  
                      if (getLog().isDebugEnabled()) {
                          getLog().debug("Could not open a sourceFileConnection to [" + current + "]", e);
                      }
  
                      // Can't determine if the staleFile is younger than this source.
                      // Re-generate to be on the safe side.
                      stale = true;
                      break;
                  }
  
                  try {
                      if (sourceFileConnection.getLastModified() > staleFileLastModified) {
  
                          if (getLog().isDebugEnabled()) {
                              getLog().debug(current.toString() + " is newer than the stale flag file.");
                          }
                          stale = true;
                      }
                  } finally {
                      if (sourceFileConnection instanceof HttpURLConnection) {
                          ((HttpURLConnection) sourceFileConnection).disconnect();
                      }
                  }
              }
          }
  
          // All done.
          return stale;
      }
docs: {@inheritDoc}