开发者

Running JUnit test in NetBeans gives NoSuchMethodError error on a method whose return type was changed

开发者 https://www.devze.com 2022-12-12 06:05 出处:网络
I have a project in NetBeans with JUnit tests. I made a change to a method return type in a dependent project, and the app runs fine. But when I run the JUnit test from inside NetBeans I get a NoSuchM

I have a project in NetBeans with JUnit tests. I made a change to a method return type in a dependent project, and the app runs fine. But when I run the JUnit test from inside NetBeans I get a NoSuchMethodError. 开发者_如何学GoI made sure to clean and build.


The solution was to make a change (any change) to the class which was making the call to the changed method. I then saved the class, then undid the change and saved the class. Then running the JUnit test inside NetBeans worked. It seems like a bug with NetBeans caching. I've had strange issues like this before and I've had to close NetBeans, delete the NetBeans cache folder, and restart NetBeans. But it seems like making a change to that class (and then undoing it) was enough to fix the NetBeans cache.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号