Skip to content

Commit 83d07f8

Browse files
lint fix
1 parent 13d4f2c commit 83d07f8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/generators/java/JavaDefaultRendererUtil.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,18 @@ export class JavaDefaultRendererUtil {
3030
if (property.property.type === 'BigDecimal') {
3131
return `private ${property.property.type} ${property.propertyName} = new BigDecimal(${property.property.originalInput.default});`;
3232
}
33-
if (property.property instanceof ConstrainedReferenceModel && property.property.ref instanceof ConstrainedEnumModel) {
34-
const defaultEnumValue = property.property.ref.values.find(valueModel => valueModel.originalInput === property.property.originalInput.default);
33+
if (
34+
property.property instanceof ConstrainedReferenceModel &&
35+
property.property.ref instanceof ConstrainedEnumModel
36+
) {
37+
const defaultEnumValue = property.property.ref.values.find(
38+
(valueModel) =>
39+
valueModel.originalInput === property.property.originalInput.default
40+
);
3541
if (defaultEnumValue === undefined) {
3642
return `private ${property.property.type} ${property.propertyName};`;
37-
} else {
38-
return `private ${property.property.type} ${property.propertyName} = ${property.property.type}.${defaultEnumValue.key};`;
3943
}
44+
return `private ${property.property.type} ${property.propertyName} = ${property.property.type}.${defaultEnumValue.key};`;
4045
}
4146
return `private ${property.property.type} ${property.propertyName} = ${property.property.originalInput.default};`;
4247
}

0 commit comments

Comments
 (0)