Program: 91661
Project: 91661
Buggy source:
/** 
 * Sets <code>module</code flag to <code>true</code> to classpath dependencies declared in module-info.java
 * @param facade a Maven facade project
 * @param classpath a classpath descriptor
 * @param monitor a progress monitor
 */
public static void configureClasspath(IMavenProjectFacade facade,IClasspathDescriptor classpath,IProgressMonitor monitor) throws CoreException {
  IJavaProject javaProject=JavaCore.create(facade.getProject());
  if (javaProject == null || !javaProject.exists()) {
    return;
  }
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  Set<String> requiredModules=getRequiredModules(javaProject,monitor);
  if (requiredModules.isEmpty() || classpath.getEntryDescriptors().isEmpty() || monitor.isCanceled()) {
    return;
  }
  List<IClasspathEntryDescriptor> entryDescriptors=classpath.getEntryDescriptors();
  Map<String,IClasspathEntryDescriptor> moduleMap=new HashMap<>(entryDescriptors.size());
  Map<IClasspathEntryDescriptor,String> descriptorsMap=new HashMap<>(entryDescriptors.size());
  for (  IClasspathEntryDescriptor entry : entryDescriptors) {
    if (monitor.isCanceled()) {
      return;
    }
    String moduleName=getModuleName(entry.getEntryKind(),entry.getPath(),monitor);
    moduleMap.put(moduleName,entry);
    descriptorsMap.put(entry,moduleName);
  }
  Set<String> visitedModules=new HashSet<>(entryDescriptors.size());
  collectTransitiveRequiredModules(requiredModules,visitedModules,moduleMap,monitor);
  if (monitor.isCanceled()) {
    return;
  }
  descriptorsMap.forEach((entry,module) -> {
    if (requiredModules.contains(module)) {
      entry.setClasspathAttribute(IClasspathAttribute.MODULE,Boolean.TRUE.toString());
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Sets <code>module</code flag to <code>true</code> to classpath dependencies declared in module-info.java
 * @param facade    a Maven facade project
 * @param classpath a classpath descriptor
 * @param monitor   a progress monitor
 */
public static void configureClasspath(IMavenProjectFacade facade,IClasspathDescriptor classpath,IProgressMonitor monitor) throws CoreException {
  IJavaProject javaProject=JavaCore.create(facade.getProject());
  if (javaProject == null || !javaProject.exists()) {
    return;
  }
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  Set<String> requiredModules=new LinkedHashSet<>(getRequiredModules(javaProject,monitor));
  if (requiredModules.isEmpty() || classpath.getEntryDescriptors().isEmpty() || monitor.isCanceled()) {
    return;
  }
  List<IClasspathEntryDescriptor> entryDescriptors=classpath.getEntryDescriptors();
  Map<String,IClasspathEntryDescriptor> moduleMap=new HashMap<>(entryDescriptors.size());
  Map<IClasspathEntryDescriptor,String> descriptorsMap=new HashMap<>(entryDescriptors.size());
  for (  IClasspathEntryDescriptor entry : entryDescriptors) {
    if (monitor.isCanceled()) {
      return;
    }
    String moduleName=getModuleName(entry.getEntryKind(),entry.getPath(),monitor);
    moduleMap.put(moduleName,entry);
    descriptorsMap.put(entry,moduleName);
  }
  Set<String> visitedModules=new HashSet<>(entryDescriptors.size());
  collectTransitiveRequiredModules(requiredModules,visitedModules,moduleMap,monitor);
  if (monitor.isCanceled()) {
    return;
  }
  descriptorsMap.forEach((entry,module) -> {
    if (requiredModules.contains(module)) {
      entry.setClasspathAttribute(IClasspathAttribute.MODULE,Boolean.TRUE.toString());
    }
  }
);
}