From 5367a1c8a691048bcf76fab3ad0bbc2f2718b2ca Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Mon, 23 Apr 2018 09:59:38 +0100 Subject: [PATCH] HHH-12515 LocalXsdResolver should attempt local resource loading before attempting it via URL --- .../org/hibernate/boot/xsd/LocalXsdResolver.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/xsd/LocalXsdResolver.java b/hibernate-core/src/main/java/org/hibernate/boot/xsd/LocalXsdResolver.java index 31ac6a838e..ea1acefe3e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/xsd/LocalXsdResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/xsd/LocalXsdResolver.java @@ -45,13 +45,6 @@ public class LocalXsdResolver { } public static URL resolveLocalXsdUrl(String resourceName) { - // first we try name as a URL - try { - return new URL( resourceName ); - } - catch (Exception ignore) { - } - try { final URL url = LocalXsdResolver.class.getClassLoader().getResource( resourceName ); if ( url != null ) { @@ -74,6 +67,13 @@ public class LocalXsdResolver { } } + // Last: we try name as a URL + try { + return new URL( resourceName ); + } + catch (Exception ignore) { + } + return null; }