Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Move from deprecated to preferred API calls. #107

Merged
merged 1 commit into from
Jun 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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