Cleanup (formatting)

This commit is contained in:
Roman Shevchenko
2017-09-19 09:21:39 +03:00
parent a536b8db58
commit defb0e089a
@@ -277,13 +277,13 @@ public class UrlClassLoader extends ClassLoader {
}
@Override
public URL findResource(final String name) {
Resource res = _getResource(name);
public URL findResource(String name) {
Resource res = findResourceImpl(name);
return res != null ? res.getURL() : null;
}
@Nullable
private Resource _getResource(final String name) {
private Resource findResourceImpl(String name) {
String n = FileUtil.toCanonicalUriPath(name);
Resource resource = getClassPath().getResource(n, true);
if (resource == null && n.startsWith("/")) { // compatibility with existing code, non-standard classloader behavior
@@ -294,12 +294,13 @@ public class UrlClassLoader extends ClassLoader {
@Nullable
@Override
public InputStream getResourceAsStream(final String name) {
if (myAllowBootstrapResources) return super.getResourceAsStream(name);
public InputStream getResourceAsStream(String name) {
if (myAllowBootstrapResources) {
return super.getResourceAsStream(name);
}
try {
Resource res = _getResource(name);
if (res == null) return null;
return res.getInputStream();
Resource res = findResourceImpl(name);
return res != null ? res.getInputStream() : null;
}
catch (IOException e) {
return null;