| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
| 6 | 6 |
| 7 import com.google.common.annotations.VisibleForTesting; | 7 import com.google.common.annotations.VisibleForTesting; |
| 8 import com.google.common.base.Objects; | 8 import com.google.common.base.Objects; |
| 9 import com.google.common.collect.ImmutableSet; | 9 import com.google.common.collect.ImmutableSet; |
| 10 import com.google.common.collect.Lists; | 10 import com.google.common.collect.Lists; |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 public static boolean isArtificialAssertMethod(Element element) { | 740 public static boolean isArtificialAssertMethod(Element element) { |
| 741 if (element instanceof MethodElement) { | 741 if (element instanceof MethodElement) { |
| 742 MethodElement methodElement = (MethodElement) element; | 742 MethodElement methodElement = (MethodElement) element; |
| 743 return Objects.equal(methodElement.getName(), "assert") | 743 return Objects.equal(methodElement.getName(), "assert") |
| 744 && methodElement.getEnclosingElement() instanceof LibraryElement | 744 && methodElement.getEnclosingElement() instanceof LibraryElement |
| 745 && methodElement.getEnclosingElement().getName().equals("dart://core/c
ore_runtime.dart"); | 745 && methodElement.getEnclosingElement().getName().equals("dart://core/c
ore_runtime.dart"); |
| 746 } | 746 } |
| 747 return false; | 747 return false; |
| 748 } | 748 } |
| 749 | 749 |
| 750 /** |
| 751 * @return <code>true</code> if normal field or abstract field with getter. |
| 752 */ |
| 753 public static boolean isFieldWithGetter(FieldElement fieldElement) { |
| 754 if (fieldElement.getModifiers().isAbstractField()) { |
| 755 return fieldElement.getGetter() != null; |
| 756 } |
| 757 return true; |
| 758 } |
| 759 |
| 760 public static boolean isAbstractFieldWithoutGetter(Element element) { |
| 761 if (element instanceof FieldElement) { |
| 762 FieldElement fieldElement = (FieldElement) element; |
| 763 return fieldElement.getModifiers().isAbstractField() && fieldElement.getGe
tter() == null; |
| 764 } |
| 765 return false; |
| 766 } |
| 767 |
| 750 } | 768 } |
| OLD | NEW |