Class is never used, although it is used
Answered
Hi there, I'm trying to create a controller directory under my project but when I right click and chose "new", there is no option "directory" there. I have to go all the way up to the "main" directory in order to get this option. Why is it not possible to create a new directory? For plugins I use Maven and GIT.
cheers!
Please sign in to leave a comment.
Hi. For Java projects, you need to create a package instead.
Thanks Petr! :-)
I made a package instead and now I get a message saying that class "UploadController" is never used. After running the code, I know that the method "upload" in this class is run. What could be wrong?
Cheers!
It is hard to tell without looking at the code, could you please provide a project source?
Sure, the source code is here:
https://github.com/bjornart/spring-boot-file-upload/
The method inside the UploadController class runs when starting mvp spring-boot:run but IntelliJ says that the class is never used.
Does it help if you remove .idea folder and reimport the project?
Hi again Petr - sorry for the late reply. Thanks for your suggestion. I tried to remove the .idea folder and reimported the project but it still says that the class is never used although when I run the code I know that the methods inside the class is run.
Is this a bug with IntelliJ itself?
also, I tried the "invalidate caches and restart" option:
https://www.jetbrains.com/help/idea/2016.1/cleaning-system-cache.html
Hi, unfortunately, I was not able to reproduce the problem, could you please provide idea.log (Help | Show log...), after restarting the IDE.