Skip to content

Commit

Permalink
Refactoring: Tune isPropertyFinal()
Browse files Browse the repository at this point in the history
  • Loading branch information
goodwinnk committed Oct 3, 2012
1 parent dc54bd6 commit 93baf78
Showing 1 changed file with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,24 +326,20 @@ private static boolean isPropertyVar(GroupingValue members) {
return members.setter != null;
}

private static boolean isPropertyFinal(ResolverScopeData scopeData, GroupingValue propertyGrouping) {
boolean isFinal;
private static boolean isPropertyFinal(ResolverScopeData scopeData, GroupingValue members) {
if (!scopeData.kotlin) {
isFinal = true;
return true;
}
else if (propertyGrouping.setter == null && propertyGrouping.getter == null) {
isFinal = false;
}
else if (propertyGrouping.getter != null) {
isFinal = propertyGrouping.getter.getMember().isFinal();
}
else if (propertyGrouping.setter != null) {
isFinal = propertyGrouping.setter.getMember().isFinal();

if (members.getter != null) {
return members.getter.getMember().isFinal();
}
else {
isFinal = false;

if (members.setter != null) {
return members.setter.getMember().isFinal();
}
return isFinal;

return false;
}

private static Set<PropertyDescriptor> getPropertiesFromSupertypes(ResolverScopeData scopeData, Name propertyName) {
Expand Down

0 comments on commit 93baf78

Please sign in to comment.