Skip to content

Commit b1597d5

Browse files
committedSep 4, 2023
#36 Make the default name a constant
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
1 parent 7a20e13 commit b1597d5

File tree

1 file changed

+12
-6
lines changed
  • src/main/java/io/securecodebox/persistence/defectdojo/model

1 file changed

+12
-6
lines changed
 

‎src/main/java/io/securecodebox/persistence/defectdojo/model/ScanFile.java

+12-6
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,24 @@
88

99
@Data
1010
public class ScanFile {
11+
/**
12+
* A default name must be set
13+
* <p>
14+
* It does not matter however unless the parser pays attention to file endings like json or xml.
15+
* </p>
16+
*/
17+
static final String DEFAULT_NAME = "default-name.txt";
1118

1219
String content;
1320

14-
// a default name must be set, it does not matter however
15-
// unless the parser pays attention to file endings like json or xml
16-
String name = "default-name.txt";
21+
String name;
1722

18-
public ScanFile(String content){
19-
this.content = content;
23+
public ScanFile(String content) {
24+
this(content, DEFAULT_NAME);
2025
}
2126

22-
public ScanFile(String content, String name){
27+
public ScanFile(String content, String name) {
28+
super();
2329
this.content = content;
2430
this.name = name;
2531
}

0 commit comments

Comments
 (0)