Skip to content

Commit a954d11

Browse files
committed
Remove support for Joda Time and ThreeTenBackport.
Closes #2276
1 parent 81bf927 commit a954d11

17 files changed

+20
-755
lines changed

pom.xml

-14
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,6 @@
9999
<optional>true</optional>
100100
</dependency>
101101

102-
<dependency>
103-
<groupId>joda-time</groupId>
104-
<artifactId>joda-time</artifactId>
105-
<version>${jodatime}</version>
106-
<optional>true</optional>
107-
</dependency>
108-
109-
<dependency>
110-
<groupId>org.threeten</groupId>
111-
<artifactId>threetenbp</artifactId>
112-
<version>${threetenbp}</version>
113-
<optional>true</optional>
114-
</dependency>
115-
116102
<!-- Project Reactor -->
117103

118104
<dependency>

src/main/asciidoc/auditing.adoc

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[[auditing.basics]]
55
== Basics
6-
Spring Data provides sophisticated support to transparently keep track of who created or changed an entity and when the change happened. To benefit from that functionality, you have to equip your entity classes with auditing metadata that can be defined either using annotations or by implementing an interface.
6+
Spring Data provides sophisticated support to transparently keep track of who created or changed an entity and when the change happened.To benefit from that functionality, you have to equip your entity classes with auditing metadata that can be defined either using annotations or by implementing an interface.
77
Additionally, auditing has to be enabled either through Annotation configuration or XML configuration to register the required infrastructure components.
88
Please refer to the store-specific section for configuration samples.
99

@@ -18,7 +18,7 @@ We provide `@CreatedBy` and `@LastModifiedBy` to capture the user who created or
1818

1919
.An audited entity
2020
====
21-
[source, java]
21+
[source,java]
2222
----
2323
class Customer {
2424
@@ -33,13 +33,14 @@ class Customer {
3333
----
3434
====
3535

36-
As you can see, the annotations can be applied selectively, depending on which information you want to capture. The annotations capturing when changes were made can be used on properties of type Joda-Time, `DateTime`, legacy Java `Date` and `Calendar`, JDK8 date and time types, and `long` or `Long`.
36+
As you can see, the annotations can be applied selectively, depending on which information you want to capture.
37+
The annotations, indicating to capture when changes are made, can be used on properties of type JDK8 date and time types, `long`, `Long`, and legacy Java `Date` and `Calendar`.
3738

38-
Auditing metadata does not necessarily need to live in the root level entity but can be added to an embedded one (depending on the actual store in use), as shown in the snipped below.
39+
Auditing metadata does not necessarily need to live in the root level entity but can be added to an embedded one (depending on the actual store in use), as shown in the snippet below.
3940

4041
.Audit metadata in embedded entity
4142
====
42-
[source, java]
43+
[source,java]
4344
----
4445
class Customer {
4546

src/main/asciidoc/custom-conversions.adoc

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ Converters are subject to explicit registration as instances are not picked up f
2121
`CustomConversions` ships with a pre-defined set of converter registrations:
2222

2323
* JSR-310 Converters for conversion between `java.time`, `java.util.Date` and `String` types.
24-
* Deprecated: Joda Time Converters for conversion between `org.joda.time`, JSR-310, and `java.util.Date`.
25-
* Deprecated: ThreeTenBackport Converters for conversion between `org.joda.time`, JSR-310, and `java.util.Date`.
2624
2725
NOTE: Default converters for local temporal types (e.g. `LocalDateTime` to `java.util.Date`) rely on system-default timezone settings to convert between those types. You can override the default converter, by registering your own converter.
2826

src/main/java/org/springframework/data/auditing/AnnotationAuditingMetadata.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.springframework.data.annotation.LastModifiedBy;
3030
import org.springframework.data.annotation.LastModifiedDate;
3131
import org.springframework.data.convert.Jsr310Converters;
32-
import org.springframework.data.convert.ThreeTenBackPortConverters;
3332
import org.springframework.data.util.Optionals;
3433
import org.springframework.data.util.ReflectionUtils;
3534
import org.springframework.data.util.ReflectionUtils.AnnotationFieldFilter;
@@ -54,16 +53,11 @@ final class AnnotationAuditingMetadata {
5453

5554
private static final Map<Class<?>, AnnotationAuditingMetadata> metadataCache = new ConcurrentHashMap<>();
5655

57-
public static final boolean IS_JDK_8 = org.springframework.util.ClassUtils.isPresent("java.time.Clock",
58-
AnnotationAuditingMetadata.class.getClassLoader());
59-
6056
static final List<String> SUPPORTED_DATE_TYPES;
6157

6258
static {
6359

6460
List<String> types = new ArrayList<>(5);
65-
types.add("org.joda.time.DateTime");
66-
types.add("org.joda.time.LocalDateTime");
6761
types.add(Date.class.getName());
6862
types.add(Long.class.getName());
6963
types.add(long.class.getName());
@@ -109,7 +103,7 @@ private void assertValidDateFieldType(Optional<Field> field) {
109103

110104
Class<?> type = it.getType();
111105

112-
if (Jsr310Converters.supports(type) || ThreeTenBackPortConverters.supports(type)) {
106+
if (Jsr310Converters.supports(type)) {
113107
return;
114108
}
115109

src/main/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactory.java

-4
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424

2525
import org.springframework.core.ResolvableType;
2626
import org.springframework.core.convert.ConversionService;
27-
import org.springframework.data.convert.JodaTimeConverters;
2827
import org.springframework.data.convert.Jsr310Converters;
29-
import org.springframework.data.convert.ThreeTenBackPortConverters;
3028
import org.springframework.data.domain.Auditable;
3129
import org.springframework.data.util.ReflectionUtils;
3230
import org.springframework.format.support.DefaultFormattingConversionService;
@@ -50,9 +48,7 @@ public DefaultAuditableBeanWrapperFactory() {
5048

5149
DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService();
5250

53-
JodaTimeConverters.getConvertersToRegister().forEach(conversionService::addConverter);
5451
Jsr310Converters.getConvertersToRegister().forEach(conversionService::addConverter);
55-
ThreeTenBackPortConverters.getConvertersToRegister().forEach(conversionService::addConverter);
5652

5753
this.conversionService = conversionService;
5854
}

src/main/java/org/springframework/data/convert/CustomConversions.java

-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ public class CustomConversions {
7979

8080
List<Object> defaults = new ArrayList<>();
8181

82-
defaults.addAll(JodaTimeConverters.getConvertersToRegister());
8382
defaults.addAll(Jsr310Converters.getConvertersToRegister());
84-
defaults.addAll(ThreeTenBackPortConverters.getConvertersToRegister());
8583
defaults.addAll(JMoleculesConverters.getConvertersToRegister());
8684

8785
DEFAULT_CONVERTERS = Collections.unmodifiableList(defaults);

src/main/java/org/springframework/data/convert/JodaTimeConverters.java

-212
This file was deleted.

0 commit comments

Comments
 (0)