Index: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/PropertySemanticProcessor.java |
diff --git a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/PropertySemanticProcessor.java b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/PropertySemanticProcessor.java |
index 332c98681ddb238fdb5e14f4a65b63d8d78f9841..643c7c122a554cea40971cc66270011afdd9a32d 100644 |
--- a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/PropertySemanticProcessor.java |
+++ b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/PropertySemanticProcessor.java |
@@ -275,11 +275,18 @@ public class PropertySemanticProcessor extends SemanticProcessor { |
String name = context.getIdentifierOriginalName(nameNode); |
List<FormalParameter> parameters = node.getParameters().getParameters(); |
// getter |
- if (parameters.isEmpty() && (hasPrefix(name, "get") || hasPrefix(name, "is"))) { |
+ if (parameters.isEmpty() |
+ && (hasPrefix(name, "get") || hasPrefix(name, "is") || hasPrefix(name, "has"))) { |
if (!context.canMakeProperty(nameNode)) { |
return null; |
} |
- String propertyName = StringUtils.uncapitalize(StringUtils.removeStart(name, "get")); |
+ String propertyName = name; |
+ if (hasPrefix(name, "get")) { |
+ propertyName = StringUtils.removeStart(name, "get"); |
+ } else if (hasPrefix(name, "is")) { |
Brian Wilkerson
2014/03/06 21:31:55
Not sure why we're testing for it if we're not doi
|
+ // don't remove "is" prefix, for example because we want to keep "isSynthetic" name |
+ } |
+ propertyName = StringUtils.uncapitalize(propertyName); |
// rename references |
context.renameIdentifier(nameNode, propertyName); |
// replace MethodInvocation with PropertyAccess |