Skip to content
Permalink
Browse files
8272616: Strange code in java.text.DecimalFormat#applyPattern
Reviewed-by: bpb, naoto, iris
  • Loading branch information
turbanoff authored and Brian Burkhalter committed Aug 19, 2021
1 parent 03b5e99 commit 51c1b9a6870bd9644e92227e47082a53e2d1c066
Showing with 8 additions and 10 deletions.
  1. +8 −10 src/java.base/share/classes/java/text/DecimalFormat.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -3406,16 +3406,14 @@ private void applyPattern(String pattern, boolean localized) {
// opening quote or two quotes, which is a quote
// literal. That is, we have the first quote in 'do'
// or o''clock.
if (ch == QUOTE) {
if ((pos+1) < pattern.length() &&
pattern.charAt(pos+1) == QUOTE) {
++pos;
affix.append("''"); // o''clock
} else {
inQuote = true; // 'do'
}
continue;
if ((pos+1) < pattern.length() &&
pattern.charAt(pos+1) == QUOTE) {
++pos;
affix.append("''"); // o''clock
} else {
inQuote = true; // 'do'
}
continue;
} else if (ch == separator) {
// Don't allow separators before we see digit
// characters of phase 1, and don't allow separators

1 comment on commit 51c1b9a

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 51c1b9a Aug 19, 2021

Please sign in to comment.