From 984eb9ba48bd57ba6ca54ee870980946076b7f0b Mon Sep 17 00:00:00 2001 From: Sanddust Date: Mon, 4 Jul 2022 12:13:24 -0500 Subject: [PATCH] Sonarqube updates https://github.com/x-stream/xstream/issues/298 Use Charsequence and StringBuilder rather than StringBuffer Also-by: Stephen Davidson Signed-off-by: Sanddust --- .../thoughtworks/xstream/tools/benchmark/model/Five.java | 6 +++--- .../xstream/tools/benchmark/model/SerializableFive.java | 6 +++--- .../xstream/tools/benchmark/targets/JavaBeanTarget.java | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/model/Five.java b/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/model/Five.java index 9ecbfdd67..e8174f6c5 100644 --- a/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/model/Five.java +++ b/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/model/Five.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009, 2011, 2015 XStream Committers. + * Copyright (C) 2008, 2009, 2011, 2015, 2022 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -23,9 +23,9 @@ public class Five extends One { private int two; private boolean three; private char four; - private StringBuffer five; + private CharSequence five; - public Five(String one, int two, boolean three, char four, StringBuffer five) { + public Five(String one, int two, boolean three, char four, CharSequence five) { super(one); this.two = two; this.three = three; diff --git a/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/model/SerializableFive.java b/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/model/SerializableFive.java index cefc10d0b..d52e50437 100644 --- a/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/model/SerializableFive.java +++ b/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/model/SerializableFive.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009, 2011, 2015 XStream Committers. + * Copyright (C) 2008, 2009, 2011, 2015, 2022 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -27,9 +27,9 @@ public class SerializableFive extends SerializableOne { private int two; private boolean three; private char four; - private StringBuffer five; + private CharSequence five; - public SerializableFive(String one, int two, boolean three, char four, StringBuffer five) { + public SerializableFive(String one, int two, boolean three, char four, CharSequence five) { super(one); this.two = two; this.three = three; diff --git a/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/targets/JavaBeanTarget.java b/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/targets/JavaBeanTarget.java index 39a870f26..814506e0a 100644 --- a/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/targets/JavaBeanTarget.java +++ b/xstream-benchmark/src/java/com/thoughtworks/xstream/tools/benchmark/targets/JavaBeanTarget.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, 2011, 2015 XStream Committers. + * Copyright (C) 2009, 2011, 2015, 2022 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -41,7 +41,7 @@ public JavaBeanTarget() { five.setTwo(2); five.setThree(true); five.setFour('4'); - five.setFive(new StringBuffer("5")); + five.setFive(new StringBuilder("5")); list.add(five); }