@@ -135,52 +135,42 @@ public ExtendedMessageFormat(final String pattern, final Locale locale) {
135135 * Constructs a new ExtendedMessageFormat.
136136 *
137137 * @param pattern the pattern to use, not null
138- * @param locale the locale to use, not null
139- * @param registry the registry of format factories, may be null
138+ * @param locale the locale to use, not null
139+ * @param registry the registry of format factories, may be null
140140 * @throws IllegalArgumentException in case of a bad pattern.
141141 */
142- public ExtendedMessageFormat (final String pattern ,
143- final Locale locale ,
144- final Map <String , ? extends FormatFactory > registry ) {
142+ public ExtendedMessageFormat (final String pattern , final Locale locale , final Map <String , ? extends FormatFactory > registry ) {
145143 super (EMPTY_PATTERN );
146144 setLocale (locale );
147- this .registry = registry != null
148- ? Collections .unmodifiableMap (new HashMap <>(registry ))
149- : null ;
145+ this .registry = registry != null ? Collections .unmodifiableMap (new HashMap <>(registry )) : null ;
150146 applyPattern (pattern );
151147 }
152148
153149 /**
154150 * Constructs a new ExtendedMessageFormat for the default locale.
155151 *
156152 * @param pattern the pattern to use, not null
157- * @param registry the registry of format factories, may be null
153+ * @param registry the registry of format factories, may be null
158154 * @throws IllegalArgumentException in case of a bad pattern.
159155 */
160- public ExtendedMessageFormat (final String pattern ,
161- final Map <String , ? extends FormatFactory > registry ) {
156+ public ExtendedMessageFormat (final String pattern , final Map <String , ? extends FormatFactory > registry ) {
162157 this (pattern , Locale .getDefault (Category .FORMAT ), registry );
163158 }
164159
165160 /**
166- * Consumes a quoted string, adding it to {@code appendTo} if
167- * specified.
161+ * Consumes a quoted string, adding it to {@code appendTo} if specified.
168162 *
169- * @param pattern pattern to parse
170- * @param pos current parse position
163+ * @param pattern pattern to parse
164+ * @param pos current parse position
171165 * @param appendTo optional StringBuilder to append
172166 */
173- private void appendQuotedString (final String pattern , final ParsePosition pos ,
174- final StringBuilder appendTo ) {
175- assert pattern .toCharArray ()[pos .getIndex ()] == QUOTE
176- : "Quoted string must start with quote character" ;
177-
167+ private void appendQuotedString (final String pattern , final ParsePosition pos , final StringBuilder appendTo ) {
168+ assert pattern .toCharArray ()[pos .getIndex ()] == QUOTE : "Quoted string must start with quote character" ;
178169 // handle quote character at the beginning of the string
179170 if (appendTo != null ) {
180171 appendTo .append (QUOTE );
181172 }
182173 next (pos );
183-
184174 final int start = pos .getIndex ();
185175 final char [] c = pattern .toCharArray ();
186176 for (int i = pos .getIndex (); i < pattern .length (); i ++) {
@@ -195,8 +185,7 @@ private void appendQuotedString(final String pattern, final ParsePosition pos,
195185 next (pos );
196186 }
197187 }
198- throw new IllegalArgumentException (
199- "Unterminated quoted string at position " + start );
188+ throw new IllegalArgumentException ("Unterminated quoted string at position " + start );
200189 }
201190
202191 /**
@@ -214,7 +203,6 @@ public final void applyPattern(final String pattern) {
214203 final ArrayList <Format > foundFormats = new ArrayList <>();
215204 final ArrayList <String > foundDescriptions = new ArrayList <>();
216205 final StringBuilder stripCustom = new StringBuilder (pattern .length ());
217-
218206 final ParsePosition pos = new ParsePosition (0 );
219207 final char [] c = pattern .toCharArray ();
220208 int fmtCount = 0 ;
@@ -233,8 +221,7 @@ public final void applyPattern(final String pattern) {
233221 Format format = null ;
234222 String formatDescription = null ;
235223 if (c [pos .getIndex ()] == START_FMT ) {
236- formatDescription = parseFormatDescription (pattern ,
237- next (pos ));
224+ formatDescription = parseFormatDescription (pattern , next (pos ));
238225 format = getFormat (formatDescription );
239226 if (format == null ) {
240227 stripCustom .append (START_FMT ).append (formatDescription );
@@ -249,8 +236,7 @@ public final void applyPattern(final String pattern) {
249236 throw new IllegalArgumentException ("The validated expression is false" );
250237 }
251238 if (c [pos .getIndex ()] != END_FE ) {
252- throw new IllegalArgumentException (
253- "Unreadable format element at position " + start );
239+ throw new IllegalArgumentException ("Unreadable format element at position " + start );
254240 }
255241 //$FALL-THROUGH$
256242 default :
0 commit comments