anchor.diff:      contextOptions.generateSdkErrors = options.showSdkWarnings;
       context.analysisOptions = contextOptions;
   
  +    librarySource = computeLibrarySource();
  +
       // Create and add a ChangeSet
       ChangeSet changeSet = new ChangeSet();
  -    changeSet.addedSource(source);
  +    changeSet.addedSource(librarySource);
       context.applyChanges(changeSet);
     }
   
  
positive.code:   }
  
    /**
     * Returns the [Uri] for the given input file.
     *
     * Usually it is a `file:` [Uri], but if [file] is located in the `lib`
     * directory of the [sdk], then returns a `dart:` [Uri].
     */
    static Uri getUri(JavaFile file) {
      // may be file in SDK
      {
        Source source = sdk.fromFileUri(file.toURI());
        if (source != null) {
          return source.uri;
        }
      }
      // some generic file
      return file.toURI();
    }
  
    /**
     * Convert [sourcePath] into an absolute path.
     */
    static String _normalizeSourcePath(String sourcePath) {
  
negative.code:     return _analyzeSync(printMode);
    }
  
    Source computeLibrarySource() {
      JavaFile sourceFile = new JavaFile(sourcePath);
      Source source = sdk.fromFileUri(sourceFile.toURI());
      if (source != null) {
        return source;
      }
      source = new FileBasedSource.con2(sourceFile.toURI(), sourceFile);
      Uri uri = context.sourceFactory.restoreUri(source);
      return new FileBasedSource.con2(uri, sourceFile);
    }
  
    /**
     * Create and return the source factory to be used by the analysis context.
     */
    SourceFactory createSourceFactory() {
      List<UriResolver> resolvers = [
        new CustomUriResolver(options.customUrlMappings),
        new DartUriResolver(sdk)
      ];
      if (options.packageRootPath != null) {
        JavaFile packageDirectory = new JavaFile(options.packageRootPath);
        resolvers.add(new PackageUriResolver([packageDirectory]));
      } else {
        PubPackageMapProvider pubPackageMapProvider =
            new PubPackageMapProvider(PhysicalResourceProvider.INSTANCE, sdk);
        PackageMapInfo packageMapInfo = pubPackageMapProvider.computePackageMap(
            PhysicalResourceProvider.INSTANCE.getResource('.'));
        Map<String, List<Folder>> packageMap = packageMapInfo.packageMap;
        if (packageMap != null) {
          resolvers.add(new PackageMapUriResolver(
              PhysicalResourceProvider.INSTANCE, packageMap));
        }
      }
      resolvers.add(new FileUriResolver());
      return new SourceFactory(resolvers);
    }
  
    void prepareAnalysisContext() {
      sourceFactory = createSourceFactory();
      context = AnalysisEngine.instance.createAnalysisContext();
      context.sourceFactory = sourceFactory;
      Map<String, String> definedVariables = options.definedVariables;
  