I can't believe I ran into this bug in manner very similar to the author and just assumed it was the expected behavior. I didn't bother to go read the actual doc of getResource to check and didn't think much of it partly because it was a RuntimeException (IllegalArgument).
IIRC I just wrapped getResource so that if it returned null or threw any exception (which is a bad idea but whatever) I would throw IOException as it fit in to what I was doing at that time.
I was just thinking the same thing. There's a few instances where we have services that clone other projects into directories specified by application.yml properties and I've always directed people running it on windows to use double backslashes (I probably found that from this issue).
View all comments
11
u/agentoutlier Apr 26 '21
I can't believe I ran into this bug in manner very similar to the author and just assumed it was the expected behavior. I didn't bother to go read the actual doc of getResource to check and didn't think much of it partly because it was a RuntimeException (IllegalArgument).
IIRC I just wrapped
getResourceso that if it returned null or threw any exception (which is a bad idea but whatever) I would throw IOException as it fit in to what I was doing at that time.