Skip to content

Commit

Permalink
Merge pull request #107 from dart-lang/depre_fixes
Browse files Browse the repository at this point in the history
Move from deprecated to preferred API calls.
  • Loading branch information
pq committed Jun 16, 2015
2 parents 0cd2bc6 + db6b184 commit edf7d3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/src/analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import 'package:linter/src/rules.dart';


Source createSource(Uri sourceUri) =>
new FileBasedSource.con1(new JavaFile(sourceUri.toFilePath()));
new FileBasedSource(new JavaFile(sourceUri.toFilePath()));

AnalysisOptions _buildAnalyzerOptions(DriverOptions options) {
AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl();
Expand Down Expand Up @@ -95,12 +95,12 @@ class AnalysisDriver {
ChangeSet changeSet = new ChangeSet();
for (File file in files) {
JavaFile sourceFile = new JavaFile(p.normalize(file.absolute.path));
Source source = new FileBasedSource.con2(sourceFile.toURI(), sourceFile);
Source source = new FileBasedSource(sourceFile, sourceFile.toURI());
Uri uri = context.sourceFactory.restoreUri(source);
if (uri != null) {
// Ensure that we analyze the file using its canonical URI (e.g. if
// it's in "/lib", analyze it using a "package:" URI).
source = new FileBasedSource.con2(uri, sourceFile);
source = new FileBasedSource(sourceFile, uri);
}
sources.add(source);
changeSet.addedSource(source);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/linter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ abstract class LintRule extends Linter implements Comparable<LintRule> {

// Cache error and location info for creating AnalysisErrorInfos
// Note that error columns are 1-based
var error = new AnalysisError.con2(source, node.span.start.column + 1,
var error = new AnalysisError(source, node.span.start.column + 1,
node.span.length, new _LintCode(name, description));

_locationInfo.add(new AnalysisErrorInfoImpl([error], new _LineInfo(node)));
Expand Down
3 changes: 1 addition & 2 deletions test/linter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void defineLinterEngineTests() {
expect(visited, isTrue);
});
test('error collecting', () {
var error = new AnalysisError.con1(new StringSource('foo', ''),
var error = new AnalysisError(new StringSource('foo', ''), 0, 0,
new LintCode('MockLint', 'This is a test...'));
var linter = new SourceLinter(new LinterOptions([]));
linter.onError(error);
Expand Down Expand Up @@ -255,7 +255,6 @@ void defineLinterEngineTests() {
});
}


/// Rule tests
defineRuleTests() {

Expand Down

0 comments on commit edf7d3c

Please sign in to comment.