@@ -228,7 +228,7 @@ private synchronized TypedValue deserializeCoreObject(JsonNode node, String defa
228228 PropertyDescriptor property ;
229229 try {
230230 Optional <PropertyDescriptor > optDesc = jsonFieldNameToProperty (field .getKey (), tv .getSpecVersion ());
231- if (! optDesc .isPresent ()) {
231+ if (optDesc .isEmpty ()) {
232232 throw new InvalidSPDXAnalysisException ("No property descriptor for field " +field .getKey ());
233233 }
234234 property = optDesc .get ();
@@ -286,7 +286,7 @@ private TypedValue getOrCreateCoreObject(JsonNode node,
286286 id = jsonNodeId ;
287287 }
288288 type = typeNodeToType (node .get ("type" ));
289- if (! type .isPresent ()) {
289+ if (type .isEmpty ()) {
290290 logger .error ("Missing type for core object {}" , node );
291291 throw new InvalidSPDXAnalysisException ("Missing type for core object " + node );
292292 }
@@ -315,7 +315,7 @@ private Object toStoredObject(String propertyName, JsonNode value, String specVe
315315 case ARRAY :
316316 throw new InvalidSPDXAnalysisException ("Can not convert a JSON array to a stored object" );
317317 case BOOLEAN : {
318- if (! propertyType .isPresent () || JsonLDSchema .BOOLEAN_TYPES .contains (propertyType .get ())) {
318+ if (propertyType .isEmpty () || JsonLDSchema .BOOLEAN_TYPES .contains (propertyType .get ())) {
319319 return value .asBoolean ();
320320 } else if (JsonLDSchema .STRING_TYPES .contains (propertyType .get ())) {
321321 return value .asText ();
@@ -325,7 +325,7 @@ private Object toStoredObject(String propertyName, JsonNode value, String specVe
325325 }
326326 case NULL : throw new InvalidSPDXAnalysisException ("Can not convert a JSON NULL to a stored object" );
327327 case NUMBER : {
328- if (! propertyType .isPresent () || JsonLDSchema .INTEGER_TYPES .contains (propertyType .get ())) {
328+ if (propertyType .isEmpty () || JsonLDSchema .INTEGER_TYPES .contains (propertyType .get ())) {
329329 return value .asInt ();
330330 } else if (JsonLDSchema .DOUBLE_TYPES .contains (propertyType .get ())) {
331331 return value .asDouble ();
@@ -363,13 +363,13 @@ private Object jsonStringToStoredValue(String propertyName, JsonNode jsonValue,
363363 } else if (schema .isEnum (propertyName )) {
364364 // we can assume that the @vocab points to the prefix for the enumerations
365365 Optional <String > vocab = schema .getVocab (propertyName );
366- if (! vocab .isPresent ()) {
366+ if (vocab .isEmpty ()) {
367367 throw new InvalidSPDXAnalysisException ("Missing vocabulary for enum property " +propertyName );
368368 }
369369 return new SimpleUriValue (vocab .get () + jsonValue .asText ());
370370 } else {
371371 Optional <String > propertyType = schema .getPropertyType (propertyName );
372- if (! propertyType .isPresent ()) {
372+ if (propertyType .isEmpty ()) {
373373 logger .warn ("Missing property type for value {}. Defaulting to a string type" , jsonValue );
374374 return jsonValue .asText ();
375375 } else if (JsonLDSchema .STRING_TYPES .contains (propertyType .get ())) {
@@ -503,7 +503,7 @@ public TypedValue deserializeElement(JsonNode elementNode) throws GenerationExce
503503 throw new InvalidSPDXAnalysisException ("Can not serialize an anonymous (blank) element" );
504504 }
505505 Optional <String > type = typeNodeToType (elementNode .get ("type" ));
506- if (! type .isPresent ()) {
506+ if (type .isEmpty ()) {
507507 throw new InvalidSPDXAnalysisException ("Missing type for element " +id );
508508 }
509509 String specVersion = getSpecVersionFromNode (elementNode , creationInfoIdToSpecVersion ,
0 commit comments