Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: pkg/analyzer/lib/src/generated/source.dart

Issue 137863002: Issue 8742. Preserve leading line comments during java2dart translation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test for block-style comment translation. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/source.dart
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index 0b6eeb288401e3215b19c0539bcda45b9aab393e..fc9d672c59737f5dea800b8ebf7b1942e77a7576 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -196,6 +196,7 @@ class SourceFactory {
return null;
}
try {
+ // Force the creation of an escaped URI to deal with spaces, etc.
return resolveUri2(containingSource, parseUriWithException(containedUri));
} on URISyntaxException catch (exception) {
return null;
@@ -896,6 +897,8 @@ class ContentCache {
} else {
int newStamp = JavaSystem.currentTimeMillis();
int oldStamp = javaMapPut(_stampMap, source, newStamp);
+ // Occasionally, if this method is called in rapid succession, the timestamps are equal.
+ // Guard against this by artificially incrementing the new timestamp
if (newStamp == oldStamp) {
_stampMap[source] = newStamp + 1;
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698