@@ -103,7 +103,6 @@ public BaseReferenceManifest(final byte[] rimBytes) throws UnmarshalException {
103
103
* @param rimBytes byte array representation of the RIM
104
104
* @throws IOException if unable to unmarshal the string
105
105
*/
106
- @ SuppressWarnings ("checkstyle:AvoidInlineConditionals" )
107
106
public BaseReferenceManifest (final String fileName , final byte [] rimBytes )
108
107
throws UnmarshalException {
109
108
super (rimBytes );
@@ -127,9 +126,11 @@ public BaseReferenceManifest(final String fileName, final byte[] rimBytes)
127
126
SwidTagConstants .SWIDTAG_NAMESPACE , SwidTagConstants .META ).item (0 );
128
127
setTagId (softwareIdentity .getAttribute (SwidTagConstants .TAGID ));
129
128
this .swidName = softwareIdentity .getAttribute (SwidTagConstants .NAME );
130
- this .swidCorpus = Boolean .parseBoolean (softwareIdentity .getAttribute (SwidTagConstants .CORPUS )) ? 1 : 0 ;
129
+ this .swidCorpus =
130
+ Boolean .parseBoolean (softwareIdentity .getAttribute (SwidTagConstants .CORPUS )) ? 1 : 0 ;
131
131
this .setSwidPatch (Boolean .parseBoolean (softwareIdentity .getAttribute (SwidTagConstants .PATCH )));
132
- this .setSwidSupplemental (Boolean .parseBoolean (softwareIdentity .getAttribute (SwidTagConstants .SUPPLEMENTAL )));
132
+ this .setSwidSupplemental (
133
+ Boolean .parseBoolean (softwareIdentity .getAttribute (SwidTagConstants .SUPPLEMENTAL )));
133
134
this .setSwidVersion (softwareIdentity .getAttribute (SwidTagConstants .VERSION ));
134
135
this .setSwidTagVersion (softwareIdentity .getAttribute (SwidTagConstants .TAGVERSION ));
135
136
@@ -147,20 +148,22 @@ public BaseReferenceManifest(final String fileName, final byte[] rimBytes)
147
148
*/
148
149
private void parseSoftwareMeta (final Element softwareMeta ) {
149
150
if (softwareMeta != null ) {
150
- this .colloquialVersion = softwareMeta .getAttribute (SwidTagConstants ._COLLOQUIAL_VERSION_STR );
151
- this .product = softwareMeta .getAttribute (SwidTagConstants ._PRODUCT_STR );
152
- this .revision = softwareMeta .getAttribute (SwidTagConstants ._REVISION_STR );
153
- this .edition = softwareMeta .getAttribute (SwidTagConstants ._EDITION_STR );
154
- this .rimLinkHash = softwareMeta .getAttribute (SwidTagConstants ._RIM_LINK_HASH_STR );
155
- this .bindingSpec = softwareMeta .getAttribute (SwidTagConstants ._BINDING_SPEC_STR );
156
- this .bindingSpecVersion = softwareMeta .getAttribute (SwidTagConstants ._BINDING_SPEC_VERSION_STR );
157
- this .setPlatformManufacturerId (softwareMeta .getAttribute (SwidTagConstants ._PLATFORM_MANUFACTURER_ID_STR ));
158
- this .setPlatformManufacturer (softwareMeta .getAttribute (SwidTagConstants ._PLATFORM_MANUFACTURER_STR ));
159
- this .setPlatformModel (softwareMeta .getAttribute (SwidTagConstants ._PLATFORM_MODEL_STR ));
160
- this .platformVersion = softwareMeta .getAttribute (SwidTagConstants ._PLATFORM_VERSION_STR );
161
- this .payloadType = softwareMeta .getAttribute (SwidTagConstants ._PAYLOAD_TYPE_STR );
162
- this .pcURIGlobal = softwareMeta .getAttribute (SwidTagConstants ._PC_URI_GLOBAL_STR );
163
- this .pcURILocal = softwareMeta .getAttribute (SwidTagConstants ._PC_URI_LOCAL_STR );
151
+ this .colloquialVersion = softwareMeta .getAttribute (SwidTagConstants .COLLOQUIAL_VERSION_STR );
152
+ this .product = softwareMeta .getAttribute (SwidTagConstants .PRODUCT_STR );
153
+ this .revision = softwareMeta .getAttribute (SwidTagConstants .REVISION_STR );
154
+ this .edition = softwareMeta .getAttribute (SwidTagConstants .EDITION_STR );
155
+ this .rimLinkHash = softwareMeta .getAttribute (SwidTagConstants .RIM_LINK_HASH_STR );
156
+ this .bindingSpec = softwareMeta .getAttribute (SwidTagConstants .BINDING_SPEC_STR );
157
+ this .bindingSpecVersion = softwareMeta .getAttribute (SwidTagConstants .BINDING_SPEC_VERSION_STR );
158
+ this .setPlatformManufacturerId (
159
+ softwareMeta .getAttribute (SwidTagConstants .PLATFORM_MANUFACTURER_ID_STR ));
160
+ this .setPlatformManufacturer (
161
+ softwareMeta .getAttribute (SwidTagConstants .PLATFORM_MANUFACTURER_FULL_STR ));
162
+ this .setPlatformModel (softwareMeta .getAttribute (SwidTagConstants .PLATFORM_MODEL_STR ));
163
+ this .platformVersion = softwareMeta .getAttribute (SwidTagConstants .PLATFORM_VERSION_STR );
164
+ this .payloadType = softwareMeta .getAttribute (SwidTagConstants .PAYLOAD_TYPE_STR );
165
+ this .pcURIGlobal = softwareMeta .getAttribute (SwidTagConstants .PC_URI_GLOBAL_STR );
166
+ this .pcURILocal = softwareMeta .getAttribute (SwidTagConstants .PC_URI_LOCAL_STR );
164
167
} else {
165
168
log .warn ("SoftwareMeta Tag not found." );
166
169
}
@@ -202,7 +205,6 @@ private void parseLink(final Element link) {
202
205
* This method validates the .swidtag file at the given filepath against the
203
206
* schema. A successful validation results in the output of the tag's name
204
207
* and tagId attributes, otherwise a generic error message is printed.
205
- *
206
208
*/
207
209
private Element getDirectoryTag (final byte [] rimBytes ) {
208
210
if (rimBytes == null || rimBytes .length == 0 ) {
@@ -254,7 +256,6 @@ public List<SwidResource> getFileResources() {
254
256
* This method iterates over the list of File elements under the directory.
255
257
*
256
258
* @param rimBytes the bytes to find the files
257
- *
258
259
*/
259
260
public List <SwidResource > getFileResources (final byte [] rimBytes ) {
260
261
Element directoryTag = getDirectoryTag (rimBytes );
@@ -267,8 +268,8 @@ public List<SwidResource> getFileResources(final byte[] rimBytes) {
267
268
swidResource = new SwidResource ();
268
269
swidResource .setName (file .getAttribute (SwidTagConstants .NAME ));
269
270
swidResource .setSize (file .getAttribute (SwidTagConstants .SIZE ));
270
- swidResource .setHashValue (file .getAttribute (SwidTagConstants ._SHA256_HASH .getPrefix () + ":"
271
- + SwidTagConstants ._SHA256_HASH .getLocalPart ()));
271
+ swidResource .setHashValue (file .getAttribute (SwidTagConstants .SHA_256_HASH .getPrefix () + ":"
272
+ + SwidTagConstants .SHA_256_HASH .getLocalPart ()));
272
273
validHashes .add (swidResource );
273
274
}
274
275
@@ -353,9 +354,15 @@ private Document removeXMLWhitespace(final ByteArrayInputStream byteArrayInputSt
353
354
354
355
@ Override
355
356
public boolean equals (Object o ) {
356
- if (this == o ) return true ;
357
- if (o == null || getClass () != o .getClass ()) return false ;
358
- if (!super .equals (o )) return false ;
357
+ if (this == o ) {
358
+ return true ;
359
+ }
360
+ if (o == null || getClass () != o .getClass ()) {
361
+ return false ;
362
+ }
363
+ if (!super .equals (o )) {
364
+ return false ;
365
+ }
359
366
BaseReferenceManifest that = (BaseReferenceManifest ) o ;
360
367
return swidCorpus == that .swidCorpus && Objects .equals (swidName , that .swidName )
361
368
&& Objects .equals (colloquialVersion , that .colloquialVersion )
0 commit comments