Fork me on GitHub
#java
<
2023-06-15
>
Eric Scott15:06:26

So I'm doing some interop with a java project that seems to have a bug in it, and I'm using emacs lsp-java to see if I can gain some visibility to the program. I don't do a lot of Java programming, so apologies for the newbie question. One of the lines of code goes like this:

InputStream s = RuleExample.class.getResourceAsStream("sh/tests/rules/triple/rectangle.test.ttl");
Which would probably work fine in compiled code, but returns null when I step through in the debugger. I can fix the problem by adding this:
if (s == null)
            {
                s = new FileInputStream("src/test/resources/sh/tests/rules/triple/rectangle.test.ttl");
            }
When I step through the emacs lisp, it appears to be putting <root>/target/test-classes" on the classpath (which where I'd expect to find it), but stepping through the code, it appears to be looking in the class loader and not finding it for some reason. Is there something I need to do to my LSP configuration to make this resource file visible in the debugger?

emccue21:06:48

instead of sh/tests do /sh/tests

emccue21:06:53

sorry this is super late

Eric Scott12:06:07

Thanks! I'll give that a shot.