From 491bac8cae9bfded3c4d1fc76ea2f21c1f813e36 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 17 Jun 2015 22:13:55 +0200 Subject: [PATCH 1/4] Issue #19: Add java.time unsafe methods (first stab) --- .../forbiddenapis/signatures/jdk-unsafe-1.8.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt b/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt index 55f1833e..02e65d20 100644 --- a/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt +++ b/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt @@ -14,6 +14,15 @@ # These methods and classes should not be used by server classes (unsafe, no charset, no locale,...): -# We only include 1.7 for now. -# TODO: Scan Java 8 API for additional locale/charset/... violations! @includeBundled jdk-unsafe-1.7 + +@defaultMessage Uses default time zone +java.time.LocalDateTime#now() +java.time.LocalDate#now() +java.time.LocalTime#now() +java.time.OffsetDateTime#now() +java.time.OffsetTime#now() +java.time.Year#now() +java.time.YearMonth#now() +java.time.MonthDay#now() + From 4da74c7b332956f720fd47c9ce7c7ed28615e76f Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 17 Jun 2015 23:35:53 +0200 Subject: [PATCH 2/4] Issue #19: More unsafe stuff in java.time --- .../forbiddenapis/signatures/jdk-unsafe-1.8.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt b/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt index 02e65d20..246c19b6 100644 --- a/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt +++ b/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt @@ -25,4 +25,13 @@ java.time.OffsetTime#now() java.time.Year#now() java.time.YearMonth#now() java.time.MonthDay#now() - +java.time.chrono.Chronology#dateNow() +java.time.chrono.HijrahChronology#dateNow() +java.time.chrono.JapaneseChronology#dateNow() +java.time.chrono.MinguoChronology#dateNow() +java.time.chrono.ThaiBuddhistChronology#dateNow() +java.time.chrono.IsoChronology#dateNow() +java.time.chrono.HijrahDate#now() +java.time.chrono.JapaneseDate#now() +java.time.chrono.MinguoDate#now() +java.time.chrono.ThaiBuddhistDate#now() From a3ceb3e6987dbf05317e633b264f33cfa7c5961b Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 17 Jun 2015 23:47:44 +0200 Subject: [PATCH 3/4] Issue #19: java.time formatting using default Locale --- .../thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt b/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt index 246c19b6..7696aca0 100644 --- a/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt +++ b/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt @@ -35,3 +35,10 @@ java.time.chrono.HijrahDate#now() java.time.chrono.JapaneseDate#now() java.time.chrono.MinguoDate#now() java.time.chrono.ThaiBuddhistDate#now() + +@defaultMessage Uses default locale +java.time.format.DateTimeFormatterBuilder#toFormatter(java.time.format.ResolverStyle,java.time.chrono.Chronology) +java.time.format.DateTimeFormatter#ofLocalizedDate(java.time.format.FormatStyle) +java.time.format.DateTimeFormatter#ofLocalizedDateTime(java.time.format.FormatStyle,java.time.format.FormatStyle) +java.time.format.DateTimeFormatter#ofLocalizedDateTime(java.time.format.FormatStyle) +java.time.format.DateTimeFormatter#ofLocalizedTime(java.time.format.FormatStyle) From bec07cfaa7a6e317d9bf2fbaae423292679cb4c9 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 17 Jun 2015 23:55:27 +0200 Subject: [PATCH 4/4] Issue #19: java.time formatting using default Locale (next iteration) --- .../de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt b/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt index 7696aca0..7c1ec824 100644 --- a/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt +++ b/src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-unsafe-1.8.txt @@ -42,3 +42,4 @@ java.time.format.DateTimeFormatter#ofLocalizedDate(java.time.format.FormatStyle) java.time.format.DateTimeFormatter#ofLocalizedDateTime(java.time.format.FormatStyle,java.time.format.FormatStyle) java.time.format.DateTimeFormatter#ofLocalizedDateTime(java.time.format.FormatStyle) java.time.format.DateTimeFormatter#ofLocalizedTime(java.time.format.FormatStyle) +java.time.format.DateTimeFormatter#ofPattern(java.lang.String)