File tree Expand file tree Collapse file tree
src/main/java/org/htmlunit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 * @author Daniel Gredler
4444 * @author Ahmed Ashour
4545 * @author Ronald Brill
46+ * @author Sven Strickroth
4647 */
4748public class WebResponseData implements Serializable {
4849 private static final Log LOG = LogFactory .getLog (WebResponseData .class );
@@ -124,7 +125,7 @@ private InputStream getStream(final ByteOrderMark... bomHeaders) throws IOExcept
124125 </html>""" , ISO_8859_1 );
125126 }
126127 if (stream != null && bomHeaders != null ) {
127- stream = new BOMInputStream ( stream , bomHeaders );
128+ stream = BOMInputStream . builder (). setInputStream ( stream ). setByteOrderMarks ( bomHeaders ). get ( );
128129 }
129130 return stream ;
130131 }
@@ -170,7 +171,7 @@ private InputStream getStream(final ByteOrderMark... bomHeaders) throws IOExcept
170171 }
171172
172173 if (stream != null && bomHeaders != null ) {
173- stream = new BOMInputStream ( stream , bomHeaders );
174+ stream = BOMInputStream . builder (). setInputStream ( stream ). setByteOrderMarks ( bomHeaders ). get ( );
174175 }
175176 return stream ;
176177 }
Original file line number Diff line number Diff line change 3838 *
3939 * @author Ahmed Ashour
4040 * @author Ronald Brill
41+ * @author Sven Strickroth
4142 */
4243@ JsxClass (value = {CHROME , EDGE }, className = "v8BreakIterator" )
4344public class V8BreakIterator extends HtmlUnitScriptable {
@@ -58,16 +59,16 @@ public class V8BreakIterator extends HtmlUnitScriptable {
5859 @ JsxConstructor
5960 public static Scriptable jsConstructor (final Context cx , final Scriptable scope ,
6061 final Object [] args , final Function ctorObj , final boolean inNewExpr ) {
61- Locale locale = new Locale ( "en" , "US" );
62+ Locale locale = new Locale . Builder (). setLanguage ( "en" ). setRegion ( "US" ). build ( );
6263 if (args .length != 0 ) {
6364 final Object locales = args [0 ];
6465 if (locales instanceof NativeArray array ) {
6566 if (array .getLength () != 0 ) {
66- locale = new Locale ( array .get (0 ).toString ());
67+ locale = new Locale . Builder (). setLanguage ( array .get (0 ).toString ()). build ( );
6768 }
6869 }
6970 else if (locales instanceof String ) {
70- locale = new Locale ( locales .toString ());
71+ locale = new Locale . Builder (). setLanguage ( locales .toString ()). build ( );
7172 }
7273 else if (!JavaScriptEngine .isUndefined (locales )) {
7374 throw JavaScriptEngine .throwAsScriptRuntimeEx (
You can’t perform that action at this time.
0 commit comments