anchor.diff:        }
       }
       resolvers.add(new FileUriResolver());
  -    return new SourceFactory(resolvers, packages);
  +    return new SourceFactory(resolvers);
     }
   
     /// Convert the given [sourcePath] (which may be relative to the current
  
positive.code:       new DartUriResolver(sdk)
      ];
  
      Packages packages;
  
      if (options.packageConfigPath != null) {
        String packageConfigPath = options.packageConfigPath;
        Uri fileUri = new Uri.file(packageConfigPath);
        try {
          File configFile = new File.fromUri(fileUri);
          List<int> bytes = configFile.readAsBytesSync();
          Map<String, Uri> map = pkgfile.parse(bytes, fileUri);
          packages = new MapPackages(map);
        } catch (e) {
          printAndFail(
              'Unable to read package config data from $packageConfigPath: $e');
        }
      } else if (options.packageRootPath != null) {
        Map<String, List<fileSystem.Folder>> packageMap =
            _PackageRootPackageMapBuilder
                .buildPackageMap(options.packageRootPath);
        if (packageMap != null) {
          resolvers.add(new SdkExtUriResolver(packageMap));
        }
        JavaFile packageDirectory = new JavaFile(options.packageRootPath);
        resolvers.add(new PackageUriResolver([packageDirectory]));
      } else {
  
        //TODO(pquitslund): add .packages config discovery
  
        PubPackageMapProvider pubPackageMapProvider =
            new PubPackageMapProvider(PhysicalResourceProvider.INSTANCE, sdk);
        PackageMapInfo packageMapInfo = pubPackageMapProvider.computePackageMap(
  
negative.code:   /// Convert [sourcePath] into an absolute path.
    static String _normalizeSourcePath(String sourcePath) {
      return path.normalize(new File(sourcePath).absolute.path);
    }
  }
  
  /// [SdkExtUriResolver] needs a Map from package name to folder. In the case
  /// that the analyzer is invoked with a --package-root option, we need to
  /// manually create this mapping. Given [packageRootPath],
  /// [_PackageRootPackageMapBuilder] creates a simple mapping from package name
  /// to full path on disk (resolving any symbolic links).
  class _PackageRootPackageMapBuilder {
    static Map<String, List<fileSystem.Folder>> buildPackageMap(
        String packageRootPath) {
      var packageRoot = new Directory(packageRootPath);
      var packages = packageRoot.listSync(followLinks: false);
      var result = new Map<String, List<fileSystem.Folder>>();
      for (var package in packages) {
        var packageName = path.basename(package.path);
        var realPath = package.resolveSymbolicLinksSync();
        result[packageName] = [
          PhysicalResourceProvider.INSTANCE.getFolder(realPath)
        ];
      }
      return result;
    }
  }
  
  