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

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

Issue 185403018: Unroll 'synchronized {}' in java2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Include fix from Java Created 6 years, 10 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/index.dart ('k') | pkg/analyzer/lib/src/generated/sdk_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/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index e23260b234b2e0281ddcd78d0cf3bdca7c3619ce..10466cb3eb0b9cc0a9cd73489ee1cf39bf01d0b5 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -8008,7 +8008,7 @@ class InheritanceManager {
//
// Include the members from the superclass in the resultMap.
//
- recordMapWithClassMembers(resultMap, supertype);
+ recordMapWithClassMembers(resultMap, supertype, false);
} finally {
visitedClasses.remove(superclassElt);
}
@@ -8037,7 +8037,7 @@ class InheritanceManager {
//
// Include the members from the superclass in the resultMap.
//
- recordMapWithClassMembersFromMixin(map, mixins[i]);
+ recordMapWithClassMembers(map, mixins[i], false);
//
// Add the members from map into result map.
//
@@ -8168,7 +8168,7 @@ class InheritanceManager {
//
// Add any members from the super type into the map as well.
//
- recordMapWithClassMembers(map, supertype);
+ recordMapWithClassMembers(map, supertype, true);
lookupMaps.add(map);
} finally {
visitedInterfaces.remove(superclassElement);
@@ -8205,7 +8205,7 @@ class InheritanceManager {
//
// Add any members from the mixin type into the map as well.
//
- recordMapWithClassMembers(map, mixinType);
+ recordMapWithClassMembers(map, mixinType, true);
lookupMaps.add(map);
} finally {
visitedInterfaces.remove(mixinElement);
@@ -8242,7 +8242,7 @@ class InheritanceManager {
//
// And add any members from the interface into the map as well.
//
- recordMapWithClassMembers(map, interfaceType);
+ recordMapWithClassMembers(map, interfaceType, true);
lookupMaps.add(map);
} finally {
visitedInterfaces.remove(interfaceElement);
@@ -8455,55 +8455,24 @@ class InheritanceManager {
* @param map some non-`null` map to put the methods and accessors from the passed
* [ClassElement] into
* @param type the type that will be recorded into the passed map
+ * @param doIncludeAbstract `true` if abstract members will be put into the map
*/
- void recordMapWithClassMembers(MemberMap map, InterfaceType type) {
+ void recordMapWithClassMembers(MemberMap map, InterfaceType type, bool doIncludeAbstract) {
List<MethodElement> methods = type.methods;
for (MethodElement method in methods) {
- if (method.isAccessibleIn(_library) && !method.isStatic) {
+ if (method.isAccessibleIn(_library) && !method.isStatic && (doIncludeAbstract || !method.isAbstract)) {
map.put(method.name, method);
}
}
List<PropertyAccessorElement> accessors = type.accessors;
for (PropertyAccessorElement accessor in accessors) {
- if (accessor.isAccessibleIn(_library) && !accessor.isStatic) {
+ if (accessor.isAccessibleIn(_library) && !accessor.isStatic && (doIncludeAbstract || !accessor.isAbstract)) {
map.put(accessor.name, accessor);
}
}
}
/**
- * Similar to [recordMapWithClassMembers], but only puts values
- * into the map if the additional executable doesn't replace a concrete member with an abstract
- * member, ex: NonErrorResolverTest.test_nonAbstractClassInheritsAbstractMemberOne_mixin_*()
- *
- * @param map some non-`null` map to put the methods and accessors from the passed
- * [ClassElement] into
- * @param type the type that will be recorded into the passed map
- */
- void recordMapWithClassMembersFromMixin(MemberMap map, InterfaceType type) {
- List<MethodElement> methods = type.methods;
- for (MethodElement method in methods) {
- if (method.isAccessibleIn(_library) && !method.isStatic) {
- String methodName = method.name;
- ExecutableElement elementInMap = map.get(methodName);
- if (elementInMap == null || (elementInMap != null && !method.isAbstract)) {
- map.put(methodName, method);
- }
- }
- }
- List<PropertyAccessorElement> accessors = type.accessors;
- for (PropertyAccessorElement accessor in accessors) {
- if (accessor.isAccessibleIn(_library) && !accessor.isStatic) {
- String accessorName = accessor.name;
- ExecutableElement elementInMap = map.get(accessorName);
- if (elementInMap == null || (elementInMap != null && !accessor.isAbstract)) {
- map.put(accessorName, accessor);
- }
- }
- }
- }
-
- /**
* This method is used to report errors on when they are found computing inheritance information.
* See [ErrorVerifier#checkForInconsistentMethodInheritance] to see where these generated
* error codes are reported back into the analysis engine.
« no previous file with comments | « pkg/analyzer/lib/src/generated/index.dart ('k') | pkg/analyzer/lib/src/generated/sdk_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698