-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accolades sur le "if liste null". Plus respectueux des bonnes pratiqu…
…es (voir issue Sonar java:S121)
- Loading branch information
kevin.buntrock
committed
Oct 1, 2024
1 parent
a263ddf
commit 65e02f9
Showing
1 changed file
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,9 +125,10 @@ public void WriteGetter(JavaWriter fw, Class classe, string tag, IProperty prope | |
var type = _config.GetType(ap, _classes, useClassForAssociation: useClassForAssociation).Split('<').First(); | ||
if (_newableTypes.TryGetValue(type, out var newableType)) | ||
{ | ||
fw.WriteLine(indentLevel + 1, $"if(this.{propertyName} == null)"); | ||
fw.WriteLine(indentLevel + 1, $"if(this.{propertyName} == null) {{"); | ||
fw.AddImport($"java.util.{newableType}"); | ||
fw.WriteLine(indentLevel + 2, $"this.{propertyName} = new {newableType}<>();"); | ||
fw.WriteLine(indentLevel + 1, $"}}"); | ||
Check warning on line 131 in TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs GitHub Actions / build
Check warning on line 131 in TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs GitHub Actions / build
Check warning on line 131 in TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs GitHub Actions / build
Check warning on line 131 in TopModel.Generator.Jpa/JpaModelPropertyGenerator.cs GitHub Actions / build
|
||
} | ||
} | ||
|
||
|