aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/common
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2018-06-02 13:01:14 +0000
committerAndreas Beeker <kiwiwings@apache.org>2018-06-02 13:01:14 +0000
commit87f7eac9c56c5a1e33a5309e4af64da178db61e7 (patch)
tree039e33c31603e108b2f3f3073d86e7893a9a50d2 /src/java/org/apache/poi/common
parentd879a2d3c8fc79463ec6942b27a748775636ca1f (diff)
downloadpoi-87f7eac9c56c5a1e33a5309e4af64da178db61e7.tar.gz
poi-87f7eac9c56c5a1e33a5309e4af64da178db61e7.zip
sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832735 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/common')
-rw-r--r--src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java b/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java
index c8a1a1cc04..1cfdc3aeca 100644
--- a/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java
+++ b/src/java/org/apache/poi/common/usermodel/fonts/FontGroup.java
@@ -111,18 +111,18 @@ public enum FontGroup {
* @return the FontGroup
*/
public static List<FontGroupRange> getFontGroupRanges(final String runText) {
- List<FontGroupRange> ttrList = new ArrayList<>();
+ final List<FontGroupRange> ttrList = new ArrayList<>();
if (runText == null || runText.isEmpty()) {
return ttrList;
}
FontGroupRange ttrLast = null;
- final int rlen = (runText != null) ? runText.length() : 0;
+ final int rlen = runText.length();
for(int cp, i = 0, charCount; i < rlen; i += charCount) {
cp = runText.codePointAt(i);
charCount = Character.charCount(cp);
// don't switch the font group for a few default characters supposedly available in all fonts
- FontGroup tt;
+ final FontGroup tt;
if (ttrLast != null && " \n\r".indexOf(cp) > -1) {
tt = ttrLast.fontGroup;
} else {