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

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/Elements.java

Issue 10907215: Issue 3553. Stop treating static final variables as constants (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks for tests Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 843 }
844 return false; 844 return false;
845 } 845 }
846 846
847 /** 847 /**
848 * @return <code>true</code> if given {@link FieldElement} is explicitly decla red static, or is 848 * @return <code>true</code> if given {@link FieldElement} is explicitly decla red static, or is
849 * static implicitly. 849 * static implicitly.
850 */ 850 */
851 public static boolean isStaticField(FieldElement field) { 851 public static boolean isStaticField(FieldElement field) {
852 Modifiers modifiers = field.getModifiers(); 852 Modifiers modifiers = field.getModifiers();
853 return modifiers.isStatic() || modifiers.isConstant(); 853 return modifiers.isStatic();
854 } 854 }
855 855
856 /** 856 /**
857 * @return <code>true</code> if given {@link InterfaceType} overrides "noSuchM ethod". 857 * @return <code>true</code> if given {@link InterfaceType} overrides "noSuchM ethod".
858 */ 858 */
859 public static boolean handlesNoSuchMethod(InterfaceType type) { 859 public static boolean handlesNoSuchMethod(InterfaceType type) {
860 Member member = type.lookupMember("noSuchMethod"); 860 Member member = type.lookupMember("noSuchMethod");
861 if (member == null) { 861 if (member == null) {
862 return false; 862 return false;
863 } 863 }
864 Source source = member.getElement().getSourceInfo().getSource(); 864 Source source = member.getElement().getSourceInfo().getSource();
865 return !isCoreLibrarySource(source); 865 return !isCoreLibrarySource(source);
866 } 866 }
867 } 867 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698