File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
main/java/org/springframework/data/mapping/model
test/java/org/springframework/data/mapping Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ public boolean isSimpleType(Class<?> type) {
123
123
return true ;
124
124
}
125
125
126
+ if (type .getName ().startsWith ("java.lang" )) {
127
+ return true ;
128
+ }
129
+
126
130
for (Class <?> clazz : simpleTypes ) {
127
131
if (clazz .isAssignableFrom (type )) {
128
132
simpleTypes .add (type );
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2011 by the original author(s).
2
+ * Copyright 2011-2017 by the original author(s).
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
18
18
import static org .hamcrest .CoreMatchers .*;
19
19
import static org .junit .Assert .*;
20
20
21
+ import java .lang .reflect .Type ;
21
22
import java .util .Collections ;
22
23
import java .util .HashSet ;
24
+ import java .util .UUID ;
23
25
24
26
import org .junit .Test ;
25
27
import org .springframework .data .mapping .model .SimpleTypeHolder ;
@@ -60,7 +62,7 @@ public void doesNotAddDefaultConvertersIfConfigured() {
60
62
61
63
SimpleTypeHolder holder = new SimpleTypeHolder (new HashSet <Class <?>>(), false );
62
64
63
- assertThat (holder .isSimpleType (String .class ), is (false ));
65
+ assertThat (holder .isSimpleType (UUID .class ), is (false ));
64
66
}
65
67
66
68
@ Test
@@ -104,6 +106,14 @@ public void considersComplexEnumAsSimple() {
104
106
assertThat (holder .isSimpleType (ComplexEnum .FOO .getClass ()), is (true ));
105
107
}
106
108
109
+ @ Test // DATACMNS-1006
110
+ public void considersJavaLangTypesSimple () {
111
+
112
+ SimpleTypeHolder holder = new SimpleTypeHolder ();
113
+
114
+ assertThat (holder .isSimpleType (Type .class ), is (true ));
115
+ }
116
+
107
117
enum SimpleEnum {
108
118
109
119
FOO ;
You can’t perform that action at this time.
0 commit comments