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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParserCommentsHelper.java

Issue 10695166: Optimize comments to nodes binding (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/parser/DartParserCommentsHelper.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParserCommentsHelper.java b/compiler/java/com/google/dart/compiler/parser/DartParserCommentsHelper.java
index 6633dc506207eb6ef82ebfcdd89955c33013006f..00cfe9f10c70195c32f24242c014605984ffe1e7 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParserCommentsHelper.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParserCommentsHelper.java
@@ -174,19 +174,20 @@ public class DartParserCommentsHelper {
}
/**
- * DartC creates both a DartField and a DartMethodDefinition for getters and setters. They have
- * the same source location; we want to assign the DartDoc to the method definition and not the
- * field.
+ * DartC creates both a {@link DartField} and a {@link DartMethodDefinition} for getters and
+ * setters. They have the same source location; we want to assign the DartDoc to the method
+ * definition and not the field.
*/
private static boolean commentContainedBySibling(DartComment comment, DartDeclaration<?> node) {
- for (DartNode child : getChildren(node.getParent())) {
- if (child != node && !(child instanceof DartComment)) {
- if (isContainedBy(comment, child)) {
- return true;
+ if (node instanceof DartField) {
+ for (DartNode child : getChildren(node.getParent())) {
+ if (child != node && !(child instanceof DartComment)) {
+ if (isContainedBy(comment, child)) {
+ return true;
+ }
}
}
}
-
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698