Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5823E200D56 for ; Tue, 12 Dec 2017 15:34:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5635B160C31; Tue, 12 Dec 2017 14:34:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F3BE4160C27 for ; Tue, 12 Dec 2017 15:33:59 +0100 (CET) Received: (qmail 93090 invoked by uid 500); 12 Dec 2017 14:33:59 -0000 Mailing-List: contact notifications-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list notifications@commons.apache.org Received: (qmail 93044 invoked by uid 99); 12 Dec 2017 14:33:59 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Dec 2017 14:33:59 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 5060F3A049F for ; Tue, 12 Dec 2017 14:33:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1022144 [8/19] - in /websites/production/commons/content/proper/commons-text/javadocs/api-release: ./ org/apache/commons/text/ org/apache/commons/text/class-use/ org/apache/commons/text/diff/ org/apache/commons/text/diff/class-use/ org/apa... Date: Tue, 12 Dec 2017 14:33:52 -0000 To: notifications@commons.apache.org From: chtompki@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20171212143356.5060F3A049F@svn01-us-west.apache.org> archived-at: Tue, 12 Dec 2017 14:34:01 -0000 Modified: websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/ExtendedMessageFormat.html ============================================================================== --- websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/ExtendedMessageFormat.html (original) +++ websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/ExtendedMessageFormat.html Tue Dec 12 14:33:51 2017 @@ -318,125 +318,125 @@ 310 if (obj == null) { 311 return false; 312 } -313 if (!super.equals(obj)) { -314 return false; +313 if (!Objects.equals(getClass(), obj.getClass())) { +314 return false; 315 } -316 if (!Objects.equals(getClass(), obj.getClass())) { -317 return false; -318 } -319 final ExtendedMessageFormat rhs = (ExtendedMessageFormat) obj; -320 if (!Objects.equals(toPattern, rhs.toPattern)) { +316 final ExtendedMessageFormat rhs = (ExtendedMessageFormat) obj; +317 if (!Objects.equals(toPattern, rhs.toPattern)) { +318 return false; +319 } +320 if (!super.equals(obj)) { 321 return false; 322 } -323 if (!Objects.equals(registry, rhs.registry)) { -324 return false; -325 } -326 return true; -327 } -328 -329 /** -330 * {@inheritDoc} -331 */ -332 @Override -333 public int hashCode() { -334 int result = super.hashCode(); -335 result = HASH_SEED * result + Objects.hashCode(registry); -336 result = HASH_SEED * result + Objects.hashCode(toPattern); -337 return result; -338 } -339 -340 /** -341 * Get a custom format from a format description. -342 * -343 * @param desc String -344 * @return Format -345 */ -346 private Format getFormat(final String desc) { -347 if (registry != null) { -348 String name = desc; -349 String args = null; -350 final int i = desc.indexOf(START_FMT); -351 if (i > 0) { -352 name = desc.substring(0, i).trim(); -353 args = desc.substring(i + 1).trim(); -354 } -355 final FormatFactory factory = registry.get(name); -356 if (factory != null) { -357 return factory.getFormat(name, args, getLocale()); -358 } -359 } -360 return null; -361 } -362 -363 /** -364 * Read the argument index from the current format element. -365 * -366 * @param pattern pattern to parse -367 * @param pos current parse position -368 * @return argument index -369 */ -370 private int readArgumentIndex(final String pattern, final ParsePosition pos) { -371 final int start = pos.getIndex(); -372 seekNonWs(pattern, pos); -373 final StringBuilder result = new StringBuilder(); -374 boolean error = false; -375 for (; !error && pos.getIndex() < pattern.length(); next(pos)) { -376 char c = pattern.charAt(pos.getIndex()); -377 if (Character.isWhitespace(c)) { -378 seekNonWs(pattern, pos); -379 c = pattern.charAt(pos.getIndex()); -380 if (c != START_FMT && c != END_FE) { -381 error = true; -382 continue; -383 } -384 } -385 if ((c == START_FMT || c == END_FE) && result.length() > 0) { -386 try { -387 return Integer.parseInt(result.toString()); -388 } catch (final NumberFormatException e) { // NOPMD -389 // we've already ensured only digits, so unless something -390 // outlandishly large was specified we should be okay. -391 } -392 } -393 error = !Character.isDigit(c); -394 result.append(c); -395 } -396 if (error) { -397 throw new IllegalArgumentException( -398 "Invalid format argument index at position " + start + ": " -399 + pattern.substring(start, pos.getIndex())); -400 } -401 throw new IllegalArgumentException( -402 "Unterminated format element at position " + start); -403 } -404 -405 /** -406 * Parse the format component of a format element. -407 * -408 * @param pattern string to parse -409 * @param pos current parse position -410 * @return Format description String -411 */ -412 private String parseFormatDescription(final String pattern, final ParsePosition pos) { -413 final int start = pos.getIndex(); -414 seekNonWs(pattern, pos); -415 final int text = pos.getIndex(); -416 int depth = 1; -417 for (; pos.getIndex() < pattern.length(); next(pos)) { -418 switch (pattern.charAt(pos.getIndex())) { -419 case START_FE: -420 depth++; -421 break; -422 case END_FE: -423 depth--; -424 if (depth == 0) { -425 return pattern.substring(text, pos.getIndex()); -426 } -427 break; -428 case QUOTE: -429 getQuotedString(pattern, pos); -430 break; -431 default: +323 return Objects.equals(registry, rhs.registry); +324 } +325 +326 /** +327 * {@inheritDoc} +328 */ +329 @Override +330 public int hashCode() { +331 int result = super.hashCode(); +332 result = HASH_SEED * result + Objects.hashCode(registry); +333 result = HASH_SEED * result + Objects.hashCode(toPattern); +334 return result; +335 } +336 +337 /** +338 * Get a custom format from a format description. +339 * +340 * @param desc String +341 * @return Format +342 */ +343 private Format getFormat(final String desc) { +344 if (registry != null) { +345 String name = desc; +346 String args = null; +347 final int i = desc.indexOf(START_FMT); +348 if (i > 0) { +349 name = desc.substring(0, i).trim(); +350 args = desc.substring(i + 1).trim(); +351 } +352 final FormatFactory factory = registry.get(name); +353 if (factory != null) { +354 return factory.getFormat(name, args, getLocale()); +355 } +356 } +357 return null; +358 } +359 +360 /** +361 * Read the argument index from the current format element. +362 * +363 * @param pattern pattern to parse +364 * @param pos current parse position +365 * @return argument index +366 */ +367 private int readArgumentIndex(final String pattern, final ParsePosition pos) { +368 final int start = pos.getIndex(); +369 seekNonWs(pattern, pos); +370 final StringBuilder result = new StringBuilder(); +371 boolean error = false; +372 for (; !error && pos.getIndex() < pattern.length(); next(pos)) { +373 char c = pattern.charAt(pos.getIndex()); +374 if (Character.isWhitespace(c)) { +375 seekNonWs(pattern, pos); +376 c = pattern.charAt(pos.getIndex()); +377 if (c != START_FMT && c != END_FE) { +378 error = true; +379 continue; +380 } +381 } +382 if ((c == START_FMT || c == END_FE) && result.length() > 0) { +383 try { +384 return Integer.parseInt(result.toString()); +385 } catch (final NumberFormatException e) { // NOPMD +386 // we've already ensured only digits, so unless something +387 // outlandishly large was specified we should be okay. +388 } +389 } +390 error = !Character.isDigit(c); +391 result.append(c); +392 } +393 if (error) { +394 throw new IllegalArgumentException( +395 "Invalid format argument index at position " + start + ": " +396 + pattern.substring(start, pos.getIndex())); +397 } +398 throw new IllegalArgumentException( +399 "Unterminated format element at position " + start); +400 } +401 +402 /** +403 * Parse the format component of a format element. +404 * +405 * @param pattern string to parse +406 * @param pos current parse position +407 * @return Format description String +408 */ +409 private String parseFormatDescription(final String pattern, final ParsePosition pos) { +410 final int start = pos.getIndex(); +411 seekNonWs(pattern, pos); +412 final int text = pos.getIndex(); +413 int depth = 1; +414 while (pos.getIndex() < pattern.length()) { +415 switch (pattern.charAt(pos.getIndex())) { +416 case START_FE: +417 depth++; +418 next(pos); +419 break; +420 case END_FE: +421 depth--; +422 if (depth == 0) { +423 return pattern.substring(text, pos.getIndex()); +424 } +425 next(pos); +426 break; +427 case QUOTE: +428 getQuotedString(pattern, pos); +429 break; +430 default: +431 next(pos); 432 break; 433 } 434 } Modified: websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/FormattableUtils.html ============================================================================== --- websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/FormattableUtils.html (original) +++ websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/FormattableUtils.html Tue Dec 12 14:33:51 2017 @@ -139,9 +139,9 @@ 131 final int precision, final char padChar, final CharSequence ellipsis) { 132 if (!(ellipsis == null || precision < 0 || ellipsis.length() <= precision)) { 133 throw new IllegalArgumentException( -134 String.format("Specified ellipsis '%1$s' exceeds precision of %2$s", +134 String.format("Specified ellipsis '%s' exceeds precision of %s", 135 ellipsis, -136 Integer.valueOf(precision))); +136 precision)); 137 } 138 final StringBuilder buf = new StringBuilder(seq); 139 if (precision >= 0 && precision < seq.length()) {