Intellij IDEA未检测到更改 [英] Intellij IDEA doesn't detect changes

查看:598
本文介绍了Intellij IDEA未检测到更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我重构了我的项目并更改了我的包的布局(我将一些包移到了另一个包中,创建了新的包等)。但现在,当我尝试运行JUnit测试时,我会在重构后更改名称的方法上获得 NoSuchMethodError 。此外,当我更改方法中的其他代码时,IDEA仍然运行旧代码..我试图在文件菜单中运行无效缓存,我也尝试重新启动计算机 - 没有结果。哪里可能有问题?

Yesterday I refactored my project and I changed layout of my packages (I moved some packages into another packages, created new packages etc). But now, when I try to run JUnit test I get NoSuchMethodError on methods which name is changed after refactoring. Also, when I change other code in methods, IDEA still running old code.. I tried to run "Invalidate caches" in File menu, also I tried to reboot computer - no result. Where can be problem?

编辑:昨天移动包后IDEA没有正确更改 .java中的包声明文件,所以我手动更改了它们

Yesterday after moving packages IDEA doesn't correctly change package declarations in .java files, so I changed them by hand

推荐答案

我有两个建议可以在这里试试

I have two suggestions you could try here


  • 编辑测试配置并确保它们指向您期望的测试配置。我有时看到重构没有在运行配置中被选中,我不得不手动更改它

  • 不太可能工作,但尝试同步你的项目:文件 - >同步。在项目的最高级别执行此操作

关于您的编辑 - 我自己也没有看到过。每当我重命名或移动文件(包括包)时,这些更改都已正确应用于所有适用的文件。您是否使用Refactor> Move / Refactor-> Copy进行重构?

With regards to your edit - I've not seen this myself. Whenever I've renamed or moved files (including packages) these changes have been correctly applied to all applicable files. Are you refactoring with Refactor>Move / Refactor->Copy ?

这篇关于Intellij IDEA未检测到更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆