@@ -31,7 +31,6 @@ public final class Utils {
3131 private static final Pattern MAC_ADDRESS_PATTERN = Pattern .compile ("[0-9A-F]{2}([-:][0-9A-F]{2}){5}" , Pattern .CASE_INSENSITIVE );
3232
3333 private static JAXBContext jaxbContext = null ;
34- private static Unmarshaller unmarshaller = null ;
3534
3635 /**
3736 * Private Constructor, should not be instanced
@@ -149,7 +148,7 @@ public static String xpathAttributeFilter(String name, Collection<String> value)
149148 * @param s1 first string
150149 * @param s2 seconde string
151150 * @return true if strings are equals or both blank, false otherwise
152- * @see org.apache.commons.lang3. StringUtils#isBlank(CharSequence)
151+ * @see StringUtils#isBlank(CharSequence)
153152 */
154153 public static boolean equalsOrBothBlank (String s1 , String s2 ) {
155154 return Objects .equals (s1 , s2 )
@@ -167,9 +166,9 @@ public static boolean equalsOrBothBlank(String s1, String s2) {
167166 * @param s2 second String to compare
168167 * @return when s1 and s2 are not blank, same result as {@link String#compare(CharSequence, CharSequence)},
169168 * zero when s1 and s2 are both blanks, negative integer when s1 is blank and s2 is not, positive integer when s1 is not blank but s2 is.
170- * @see java.util. Comparator#compare(Object, Object)
171- * @see org.apache.commons.lang3. StringUtils#isBlank(CharSequence)
172- * @see java.util. Comparator#nullsFirst(Comparator)
169+ * @see Comparator#compare(Object, Object)
170+ * @see StringUtils#isBlank(CharSequence)
171+ * @see Comparator#nullsFirst(Comparator)
173172 */
174173 public static int blanksFirstComparator (String s1 , String s2 ) {
175174 if (StringUtils .isBlank (s1 )){
@@ -314,11 +313,12 @@ public static String toHex(long number, int length) {
314313 * @return copy of the object
315314 */
316315 public static <T > T copySclElement (T object , Class <T > clazz ) {
316+ Unmarshaller unmarshaller ;
317317 try {
318318 if (jaxbContext == null ) {
319319 jaxbContext = JAXBContext .newInstance ("org.lfenergy.compas.scl2007b4.model" );
320- unmarshaller = jaxbContext .createUnmarshaller ();
321320 }
321+ unmarshaller = jaxbContext .createUnmarshaller ();
322322 JAXBElement <T > contentObject = new JAXBElement <>(new QName (clazz .getSimpleName ()), clazz , object );
323323 JAXBSource source = new JAXBSource (jaxbContext , contentObject );
324324 return unmarshaller .unmarshal (source , clazz ).getValue ();
0 commit comments