File tree 2 files changed +21
-19
lines changed
hibernate-core/src/main/java/org/hibernate/boot/jaxb
2 files changed +21
-19
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,7 @@ public boolean equals(Object o) {
59
59
60
60
@ Override
61
61
public int hashCode () {
62
- int result = type != null ? type .hashCode () : 0 ;
63
- result = 31 * result + ( name != null ? name .hashCode () : 0 );
64
- return result ;
62
+ return Objects .hash ( type , name );
65
63
}
66
64
67
65
@ Override
Original file line number Diff line number Diff line change 10
10
* @author Steve Ebersole
11
11
*/
12
12
public enum SourceType {
13
- RESOURCE ( "resource" ),
14
- FILE ( "file" ),
15
- INPUT_STREAM ( "input stream" ),
16
- URL ( "URL" ),
17
- STRING ( "string" ),
18
- DOM ( "xml" ),
19
- JAR ( "jar" ),
20
- ANNOTATION ( "annotation" ),
21
- OTHER ( "other" );
22
-
23
- private final String legacyTypeText ;
24
-
25
- SourceType (String legacyTypeText ) {
26
- this .legacyTypeText = legacyTypeText ;
27
- }
13
+ RESOURCE ,
14
+ FILE ,
15
+ INPUT_STREAM ,
16
+ URL ,
17
+ STRING ,
18
+ DOM ,
19
+ JAR ,
20
+ ANNOTATION ,
21
+ OTHER ;
28
22
29
23
public String getLegacyTypeText () {
30
- return legacyTypeText ;
24
+ return switch ( this ) {
25
+ case RESOURCE -> "resource" ;
26
+ case FILE -> "file" ;
27
+ case INPUT_STREAM -> "input stream" ;
28
+ case URL -> "URL" ;
29
+ case STRING -> "string" ;
30
+ case DOM -> "xml" ;
31
+ case JAR -> "jar" ;
32
+ case ANNOTATION -> "annotation" ;
33
+ case OTHER -> "other" ;
34
+ };
31
35
}
32
36
}
You can’t perform that action at this time.
0 commit comments