changeset 45391:60ea73fb4b4c

8181586: DateTimeTextProvider.getInstance() returns a new instance every time Reviewed-by: rriggs
author naoto
date Tue, 06 Jun 2017 10:34:21 -0700
parents c3f2c4b3d980
children fe2cb56e7fe9
files jdk/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java	Tue Jun 06 01:33:53 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java	Tue Jun 06 10:34:21 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, 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
@@ -112,6 +112,9 @@
         }
     };
 
+    // Singleton instance
+    private static final DateTimeTextProvider INSTANCE = new DateTimeTextProvider();
+
     DateTimeTextProvider() {}
 
     /**
@@ -120,7 +123,7 @@
      * @return the provider, not null
      */
     static DateTimeTextProvider getInstance() {
-        return new DateTimeTextProvider();
+        return INSTANCE;
     }
 
     /**