mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix default getter template for boolean fields with meaningful starting 'is' (IDEA-148006)
This commit is contained in:
@@ -4,11 +4,7 @@ static ##
|
||||
$field.type ##
|
||||
#set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project))))
|
||||
#if ($field.boolean && $field.primitive)
|
||||
#if ($StringUtil.startsWithIgnoreCase($name, 'is'))
|
||||
#set($name = $StringUtil.decapitalize($name))
|
||||
#else
|
||||
is##
|
||||
#end
|
||||
is##
|
||||
#else
|
||||
get##
|
||||
#end
|
||||
|
||||
@@ -57,6 +57,7 @@ class Foo {
|
||||
myFixture.configureByText 'a.java', '''
|
||||
class Foo {
|
||||
boolean isStateForceMailField;
|
||||
boolean isic;
|
||||
|
||||
<caret>
|
||||
}
|
||||
@@ -65,10 +66,15 @@ class Foo {
|
||||
myFixture.checkResult '''
|
||||
class Foo {
|
||||
boolean isStateForceMailField;
|
||||
boolean isic;
|
||||
|
||||
public boolean isStateForceMailField() {
|
||||
return isStateForceMailField;
|
||||
}
|
||||
|
||||
public boolean isIsic() {
|
||||
return isic;
|
||||
}
|
||||
}
|
||||
'''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user