From 5483e9592066769d769b5b587a092d1ccef6be87 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 18 Sep 2019 08:58:51 +0200 Subject: [PATCH] LazyStringBuilder: Wrap NPE in RuntimeException instead of using a Logger. --- .../org/jivesoftware/smack/util/LazyStringBuilder.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/LazyStringBuilder.java b/smack-core/src/main/java/org/jivesoftware/smack/util/LazyStringBuilder.java index 2ca66515a..752fda1cf 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/LazyStringBuilder.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/LazyStringBuilder.java @@ -1,6 +1,6 @@ /** * - * Copyright 2014-2017 Florian Schmaus + * Copyright 2014-2019 Florian Schmaus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,9 @@ package org.jivesoftware.smack.util; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; public class LazyStringBuilder implements Appendable, CharSequence { - private static final Logger LOGGER = Logger.getLogger(LazyStringBuilder.class.getName()); - private final List list; private String cache; @@ -80,8 +76,7 @@ public class LazyStringBuilder implements Appendable, CharSequence { } catch (NullPointerException npe) { StringBuilder sb = safeToStringBuilder(); - LOGGER.log(Level.SEVERE, "The following LazyStringBuilder threw a NullPointerException: " + sb, npe); - throw npe; + throw new RuntimeException("The following LazyStringBuilder threw a NullPointerException: " + sb, npe); } return length; }