Lines 408-419
Link Here
|
408 |
assert name.length() > 0; |
408 |
assert name.length() > 0; |
409 |
TypeMirror type = copy.getTypes().asMemberOf((DeclaredType)clazz.asType(), field); |
409 |
TypeMirror type = copy.getTypes().asMemberOf((DeclaredType)clazz.asType(), field); |
410 |
StringBuilder sb = getCapitalizedName(name); |
410 |
StringBuilder sb = getCapitalizedName(name); |
411 |
boolean isBooleanType = false; |
411 |
boolean isBooleanType = type.getKind() == TypeKind.BOOLEAN; |
412 |
if (type instanceof DeclaredType) { |
|
|
413 |
isBooleanType = copy.getElements().getTypeElement("java.lang.Boolean").equals(((DeclaredType) type).asElement()); // NOI18N |
414 |
} else { |
415 |
isBooleanType = type.getKind() == TypeKind.BOOLEAN; |
416 |
} |
417 |
sb.insert(0, isBooleanType ? "is" : "get"); //NOI18N |
412 |
sb.insert(0, isBooleanType ? "is" : "get"); //NOI18N |
418 |
BlockTree body = make.Block(Collections.singletonList(make.Return(make.Identifier(name))), false); |
413 |
BlockTree body = make.Block(Collections.singletonList(make.Return(make.Identifier(name))), false); |
419 |
return make.Method(make.Modifiers(mods), sb, make.Type(type), Collections.<TypeParameterTree>emptyList(), Collections.<VariableTree>emptyList(), Collections.<ExpressionTree>emptyList(), body, null); |
414 |
return make.Method(make.Modifiers(mods), sb, make.Type(type), Collections.<TypeParameterTree>emptyList(), Collections.<VariableTree>emptyList(), Collections.<ExpressionTree>emptyList(), body, null); |