Commit aee83ec authored and committed Mar 25, 2022
1 parent d8cbabb commit aee83ec Copy full SHA for aee83ec
File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -81,11 +81,16 @@ public String spdxId() {
81
81
return spdxFile .getId ();
82
82
}
83
83
84
+ public List <String > fileInfoErrorWithRetrievalList (String errorMessage ) {
85
+ List <String > retval = Lists .newArrayList ();
86
+ retval .add (errorMessage );
87
+ return retval ;
88
+ }
89
+
84
90
public List <String > checksums () {
91
+
85
92
if (spdxFile == null ) {
86
- List <String > retval = Lists .newArrayList ();
87
- retval .add ("Error getting SPDX file information: " + (error != null ? error .getMessage () : "null" ));
88
- return retval ;
93
+ return fileInfoErrorWithRetrievalList ("Error getting SPDX file information: " + (error != null ? error .getMessage () : "null" ));
89
94
}
90
95
Checksum [] fileChecksums = this .spdxFile .getChecksums ();
91
96
if (fileChecksums == null || fileChecksums .length ==0 ) {
@@ -102,9 +107,7 @@ public List<String> checksums() {
102
107
103
108
public List <String > fileType () {
104
109
if (spdxFile == null && error != null ) {
105
- List <String > retval = Lists .newArrayList ();
106
- retval .add ("Error getting SPDX file information: " +error .getMessage ());
107
- return retval ;
110
+ return fileInfoErrorWithRetrievalList ("Error getting SPDX file information: " +error .getMessage ());
108
111
} else {
109
112
if (spdxFile != null && spdxFile .getFileTypes () != null &&
110
113
spdxFile .getFileTypes ().length > 0 ) {
You can’t perform that action at this time.
0 commit comments