22 * The CIP4 Software License, Version 1.0
33 *
44 *
5- * Copyright (c) 2001-2022 The International Cooperation for the Integration of Processes in Prepress, Press and Postpress (CIP4). All rights reserved.
5+ * Copyright (c) 2001-2025 The International Cooperation for the Integration of Processes in Prepress, Press and Postpress (CIP4). All rights reserved.
66 *
77 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
88 *
5555import java .util .List ;
5656import java .util .Set ;
5757
58- import org .apache .commons .lang .StringUtils ;
58+ import org .apache .commons .lang3 .StringUtils ;
5959import org .apache .commons .logging .Log ;
6060import org .apache .commons .logging .LogFactory ;
6161import org .cip4 .jdflib .core .JDFConstants ;
@@ -154,7 +154,9 @@ public boolean isEmpty()
154154 public List <String > getKeys ()
155155 {
156156 if (obj == null )
157+ {
157158 return null ;
159+ }
158160 final StringArray sa = new StringArray ();
159161 for (final Object o : obj .keySet ())
160162 {
@@ -255,7 +257,6 @@ public JSONObjHelper(final File f)
255257 }
256258
257259 /**
258- *
259260 * @param toConvert
260261 * @return
261262 * @deprecated use StringUtil.underToCamel
@@ -669,7 +670,9 @@ List<Object> getInheritedObjects(final String path, final boolean checkParent)
669670 {
670671 final String parent = StringUtil .removeToken (path , -1 , JDFConstants .SLASH );
671672 if (getPathObject (parent ) == null )
673+ {
672674 return c ;
675+ }
673676 }
674677 final String removeToken = StringUtil .removeToken (path , -2 , JDFConstants .SLASH );
675678 if (!path .equals (removeToken ))
@@ -803,7 +806,9 @@ public InputStream getInputStream()
803806 public String getRootName ()
804807 {
805808 if (obj == null )
809+ {
806810 return null ;
811+ }
807812 final Set keySet = obj .keySet ();
808813 return ContainerUtil .isEmpty (keySet ) ? null : (String ) keySet .iterator ().next ();
809814 }
@@ -914,14 +919,15 @@ public JSONObjHelper getCreateObject(final String path)
914919 {
915920 final JSONObjHelper ret = getHelper (path );
916921 if (ret != null )
922+ {
917923 return ret ;
924+ }
918925 final JSONObject o = new JSONObject ();
919926 setObj (path , o );
920927 return new JSONObjHelper (o );
921928 }
922929
923930 /**
924- *
925931 * @param path
926932 * @return
927933 */
@@ -933,11 +939,17 @@ public Object remove(final String path)
933939 {
934940 final Object remove = parent .remove (StringUtil .token (path , -1 , JDFConstants .SLASH ));
935941 if (remove instanceof JSONObject )
942+ {
936943 return new JSONObjHelper ((JSONObject ) remove );
944+ }
937945 if (remove instanceof JSONArray )
946+ {
938947 return new JSONArrayHelper ((JSONArray ) remove );
948+ }
939949 else
950+ {
940951 return remove ;
952+ }
941953 }
942954 return null ;
943955 }
@@ -965,14 +977,18 @@ public void retainAll(final Collection<String> allowedPartitions)
965977 public Object put (final Object key , final Object value )
966978 {
967979 if (obj == null )
980+ {
968981 obj = new JSONObject ();
982+ }
969983 return obj .put (key , value );
970984 }
971985
972986 public void clear ()
973987 {
974988 if (obj != null )
989+ {
975990 obj .clear ();
991+ }
976992 }
977993
978994 public Set <String > keySet ()
0 commit comments