Renamed methods

This commit is contained in:
Valentin Kipyatkov
2015-07-09 20:49:17 +03:00
parent b33202d32d
commit a08fe96a8b
2 changed files with 7 additions and 7 deletions
@@ -124,7 +124,7 @@ class SyntheticExtensionsScope(storageManager: StorageManager) : JetScope by Jet
if (classifier is JavaClassDescriptor) {
for (descriptor in classifier.getMemberScope(type.getArguments()).getAllDescriptors()) {
if (descriptor is FunctionDescriptor) {
val propertyName = fromGetMethodName(descriptor.getName()) ?: continue
val propertyName = propertyNameByGetMethodName(descriptor.getName()) ?: continue
addIfNotNull(syntheticPropertyInClass(Triple(classifier, type, propertyName)))
}
}
@@ -152,11 +152,11 @@ class SyntheticExtensionsScope(storageManager: StorageManager) : JetScope by Jet
}
companion object {
public fun fromGetMethodName(methodName: Name): Name? = fromAccessorMethodName(methodName, "get")
public fun propertyNameByGetMethodName(methodName: Name): Name? = propertyNameFromAccessorMethodName(methodName, "get")
public fun fromSetMethodName(methodName: Name): Name? = fromAccessorMethodName(methodName, "set")
public fun propertyNameBySetMethodName(methodName: Name): Name? = propertyNameFromAccessorMethodName(methodName, "set")
private fun fromAccessorMethodName(methodName: Name, prefix: String): Name? {
private fun propertyNameFromAccessorMethodName(methodName: Name, prefix: String): Name? {
if (methodName.isSpecial()) return null
val identifier = methodName.getIdentifier()
if (!identifier.startsWith(prefix)) return null