Cannot find symbol

i tried to test my first few test to check if i do it correct. apperntly i did something wrong because buildbot send me this

--> test compile-for-public-daily-parser
Result: failure
Additional info:
Error while compiling with exit status 1
Trace:
src/uri/tests/SimpleTests.java:75: error: cannot find symbol
                Uri uri =UriParserFactory.create("scheme://").parse();
                ^
  symbol:   class Uri
  location: class SimpleTests
1 error

How do i handle this?
Second i get the warning "SimpleTests.java is a non-project file, only syntax errors are reported Java (16)

is this related?

If you want to use a class, you have to import the file (like you did with header files in C).
For Uri this is uri.Uri.

Also note that you are currently importing java.net.URI.
But you are not allowed to use any class from java.net.

I did not notice that since i thought i could just keep writing in SimpleTests.java and everything was provided there the correct way.

should i delete the provided “import java.net.URI,” and replace it with “import uri.Uri,” or copy my simple tests in a new file where i do this and revert SimpleTests.java to its original state?

VSCode probably wanted to be helpful and added that import automatically for you.
You should remove it and add import uri.Uri; at the Position where you want to user Uri.

That would be the cleanest solution.
Depending on how you structure your code, it might also be a good idea to extract some common code you need for many tests into functions or a new class.

This might be true. But this suggests, that one of your provided tests should have run into the same error since you used
“Host host =UriParserFactory.create(uri:“scheme://1.2.3.4”.parse().getHost();”
but .getHost() is defined in Uri.java. Even if this is not relevant for now it might be later and at least it might be interesting to know.

This is probably not related. But it might be the same issue as here:

If Uri is not included, the symbols from Uri.java like the type Uri are not available.
But Java knows UriParserFactory which knows Uri. Therefore, Java knows the Uri methods and allows you to use them.
The reason why it does not load the symbols is to avoid namespace cluttering where all symbols are loaded and maybe similar names or equivalent names shadow each other / get confused.