File tree Expand file tree Collapse file tree 7 files changed +12
-18
lines changed
main/java/org/apache/ibatis
test/java/org/apache/ibatis
submitted/optional_on_mapper_method Expand file tree Collapse file tree 7 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 29
29
30
30
<groupId >org.mybatis</groupId >
31
31
<artifactId >mybatis</artifactId >
32
- <version >3.5.19 -SNAPSHOT</version >
32
+ <version >3.6.0 -SNAPSHOT</version >
33
33
34
34
<name >mybatis</name >
35
35
<description >The MyBatis SQL mapper framework makes it easier to use a relational database with object-oriented
64
64
65
65
<properties >
66
66
<!-- Java Usage -->
67
- <java .version>8 </java .version>
68
- <java .release.version>8 </java .release.version>
67
+ <java .version>11 </java .version>
68
+ <java .release.version>11 </java .release.version>
69
69
70
70
<!-- Override impsort comliance to 17 (remove after parent 49 release) -->
71
71
<impsort .compliance>17</impsort .compliance>
99
99
<argLine >-Xmx2048m -javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar</argLine >
100
100
101
101
<!-- Reproducible Builds -->
102
- <project .build.outputTimestamp>1735702000 </project .build.outputTimestamp>
102
+ <project .build.outputTimestamp>1735704225 </project .build.outputTimestamp>
103
103
</properties >
104
104
105
105
<dependencies >
Original file line number Diff line number Diff line change 21
21
import java .io .IOException ;
22
22
import java .io .InputStream ;
23
23
import java .io .InputStreamReader ;
24
- import java .io .UnsupportedEncodingException ;
25
24
import java .net .MalformedURLException ;
26
25
import java .net .URL ;
27
26
import java .net .URLEncoder ;
@@ -278,11 +277,7 @@ protected URL findJarForResource(URL url) throws MalformedURLException {
278
277
279
278
// File name might be URL-encoded
280
279
if (!file .exists ()) {
281
- try {
282
- file = new File (URLEncoder .encode (jarUrl .toString (), StandardCharsets .UTF_8 .name ()));
283
- } catch (UnsupportedEncodingException e ) {
284
- throw new RuntimeException ("Unsupported encoding? UTF-8? That's impossible." );
285
- }
280
+ file = new File (URLEncoder .encode (jarUrl .toString (), StandardCharsets .UTF_8 ));
286
281
}
287
282
288
283
if (file .exists ()) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2009-2023 the original author or authors.
2
+ * Copyright 2009-2025 the original author or authors.
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.
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2009-2022 the original author or authors.
2
+ * Copyright 2009-2025 the original author or authors.
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.
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2009-2024 the original author or authors.
2
+ * Copyright 2009-2025 the original author or authors.
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.
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2009-2024 the original author or authors.
2
+ * Copyright 2009-2025 the original author or authors.
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.
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
-
17
16
package org .apache .ibatis .scripting .xmltags ;
18
17
19
- import static org .assertj .core .api .Assertions .* ;
18
+ import static org .assertj .core .api .Assertions .assertThat ;
20
19
import static org .junit .Assert .assertEquals ;
21
20
22
21
import java .lang .reflect .Field ;
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ void returnNotNullOnAnnotation() {
64
64
Mapper mapper = sqlSession .getMapper (Mapper .class );
65
65
Optional <User > user = mapper .getUserUsingAnnotation (1 );
66
66
assertTrue (user .isPresent ());
67
- assertEquals ("User1" , user .get ().getName ());
67
+ assertEquals ("User1" , user .orElseThrow ().getName ());
68
68
}
69
69
}
70
70
@@ -83,7 +83,7 @@ void returnNotNullOnXml() {
83
83
Mapper mapper = sqlSession .getMapper (Mapper .class );
84
84
Optional <User > user = mapper .getUserUsingXml (2 );
85
85
assertTrue (user .isPresent ());
86
- assertEquals ("User2" , user .get ().getName ());
86
+ assertEquals ("User2" , user .orElseThrow ().getName ());
87
87
}
88
88
}
89
89
You can’t perform that action at this time.
0 commit comments