src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
changeset 49983 41069c4fad29
parent 48251 57148c79bd75
child 50473 bef0ed237504
equal deleted inserted replaced
49982:9042ffe5b7fe 49983:41069c4fad29
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  4260          * @param position start of text after the prefix
  4260          * @param position start of text after the prefix
  4261          * @param parser parser for the value after the prefix
  4261          * @param parser parser for the value after the prefix
  4262          * @return the position after the parse
  4262          * @return the position after the parse
  4263          */
  4263          */
  4264         private int parseOffsetBased(DateTimeParseContext context, CharSequence text, int prefixPos, int position, OffsetIdPrinterParser parser) {
  4264         private int parseOffsetBased(DateTimeParseContext context, CharSequence text, int prefixPos, int position, OffsetIdPrinterParser parser) {
  4265             String prefix = text.toString().substring(prefixPos, position).toUpperCase();
  4265             String prefix = text.subSequence(prefixPos, position).toString().toUpperCase();
  4266             if (position >= text.length()) {
  4266             if (position >= text.length()) {
  4267                 context.setParsed(ZoneId.of(prefix));
  4267                 context.setParsed(ZoneId.of(prefix));
  4268                 return position;
  4268                 return position;
  4269             }
  4269             }
  4270 
  4270