File tree Expand file tree Collapse file tree 2 files changed +21
-19
lines changed
hibernate-core/src/main/java/org/hibernate/boot/jaxb Expand file tree Collapse file tree 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) {
5959
6060 @ Override
6161 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 );
6563 }
6664
6765 @ Override
Original file line number Diff line number Diff line change 1010 * @author Steve Ebersole
1111 */
1212public 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 ;
2822
2923 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+ };
3135 }
3236}
You can’t perform that action at this time.
0 commit comments