From b44b35129ef89316ca49123de280e9dbce753150 Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Thu, 23 Jan 2014 17:01:48 +0000 Subject: [PATCH] More source code to format... git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1560751 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/lang3/StringUtils.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 715d0360e..690d327c5 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -7123,19 +7123,15 @@ private static int transpositions(CharSequence first, CharSequence second) { * @param second The second string. * @return A number between 0 and 4. */ - private static int commonPrefixLength(CharSequence first, CharSequence second) - { + private static int commonPrefixLength(CharSequence first, CharSequence second) { String shorter; String longer; // Determine which String is longer. - if (first.length() > second.length()) - { + if (first.length() > second.length()) { longer = first.toString().toLowerCase(); shorter = second.toString().toLowerCase(); - } - else - { + } else { longer = second.toString().toLowerCase(); shorter = first.toString().toLowerCase(); } @@ -7143,17 +7139,15 @@ private static int commonPrefixLength(CharSequence first, CharSequence second) int result = 0; // Iterate through the shorter string. - for (int i = 0; i < shorter.length(); i++) - { - if (shorter.charAt(i) != longer.charAt(i)) - { + for (int i = 0; i < shorter.length(); i++) { + if (shorter.charAt(i) != longer.charAt(i)) { break; } result++; } // Limit the result to 4. - return result > 4? 4: result; + return result > 4 ? 4 : result; } // startsWith