docs: public boolean addClasspathEntry(final String pathElement, final ClassLoader classLoader,
              final ScanSpec scanSpec, final LogNode log) {
          if (pathElement == null || pathElement.isEmpty()) {
              return false;
          }
          // Check for wildcard path element (allowable for local classpaths as of JDK 6)
          if (pathElement.endsWith("*")) {
              if (pathElement.length() == 1 || //
                      (pathElement.length() > 2 && pathElement.charAt(pathElement.length() - 1) == '*'
                              && (pathElement.charAt(pathElement.length() - 2) == File.separatorChar
                                      || (File.separatorChar != '/'
                                              && pathElement.charAt(pathElement.length() - 2) == '/')))) {
                  // Apply classpath element filters, if any 
                  final String baseDirPath = pathElement.length() == 1 ? ""
                          : pathElement.substring(0, pathElement.length() - 2);
                  final String baseDirPathResolved = FastPathResolver.resolve(FileUtils.CURR_DIR_PATH, baseDirPath);
                  if (!filter(baseDirPath)
                          || (!baseDirPathResolved.equals(baseDirPath) && !filter(baseDirPathResolved))) {
                      if (log != null) {
                          log.log("Classpath element did not match filter criterion, skipping: " + pathElement);
                      }
                      return false;
                  }
  
                  // Check the path before the "/*" suffix is a directory 
                  final File baseDir = new File(baseDirPathResolved);
                  if (!baseDir.exists()) {
                      if (log != null) {
                          log.log("Directory does not exist for wildcard classpath element: " + pathElement);
                      }
                      return false;
                  }
                  if (!FileUtils.canRead(baseDir)) {
                      if (log != null) {
                          log.log("Cannot read directory for wildcard classpath element: " + pathElement);
                      }
                      return false;
                  }
                  if (!baseDir.isDirectory()) {
                      if (log != null) {
                          log.log("Wildcard is appended to something other than a directory: " + pathElement);
                      }
                      return false;
                  }
  
                  // Add all elements in the requested directory to the classpath
                  final LogNode dirLog = log == null ? null
                          : log.log("Adding classpath elements from wildcarded directory: " + pathElement);
                  final File[] baseDirFiles = baseDir.listFiles();
                  if (baseDirFiles != null) {
                      for (final File fileInDir : baseDirFiles) {
                          final String name = fileInDir.getName();
                          if (!name.equals(".") && !name.equals("..")) {
                              // Add each directory entry as a classpath element
                              final String fileInDirPath = fileInDir.getPath();
                              final String fileInDirPathResolved = FastPathResolver.resolve(FileUtils.CURR_DIR_PATH,
                                      fileInDirPath);
                              if (addClasspathEntry(fileInDirPathResolved, classLoader, scanSpec)) {
                                  if (dirLog != null) {
                                      dirLog.log("Found classpath element: " + fileInDirPath
                                              + (fileInDirPath.equals(fileInDirPathResolved) ? ""
                                                      : " -> " + fileInDirPathResolved));
                                  }
                              } else {
                                  if (dirLog != null) {
                                      dirLog.log("Ignoring duplicate classpath element: " + fileInDirPath
                                              + (fileInDirPath.equals(fileInDirPathResolved) ? ""
                                                      : " -> " + fileInDirPathResolved));
                                  }
                              }
                          }
                      }
                      return true;
                  } else {
                      return false;
                  }
              } else {
                  if (log != null) {
                      log.log("Wildcard classpath elements can only end with a leaf of \"*\", "
                              + "can't have a partial name and then a wildcard: " + pathElement);
                  }
                  return false;
              }
          } else {
              // Non-wildcarded (standard) classpath element
              final String pathElementResolved = FastPathResolver.resolve(FileUtils.CURR_DIR_PATH, pathElement);
              if (!filter(pathElement)
                      || (!pathElementResolved.equals(pathElement) && !filter(pathElementResolved))) {
                  if (log != null) {
                      log.log("Classpath element did not match filter criterion, skipping: " + pathElement
                              + (pathElement.equals(pathElementResolved) ? "" : " -> " + pathElementResolved));
                  }
                  return false;
              }
              if (addClasspathEntry(pathElementResolved, classLoader, scanSpec)) {
                  if (log != null) {
                      log.log("Found classpath element: " + pathElement
                              + (pathElement.equals(pathElementResolved) ? "" : " -> " + pathElementResolved));
                  }
                  return true;
              } else {
                  if (log != null) {
                      log.log("Ignoring duplicate classpath element: " + pathElement
                              + (pathElement.equals(pathElementResolved) ? "" : " -> " + pathElementResolved));
                  }
                  return false;
              }
          }
      }