简体   繁体   English

Eclipse Indigo中的源代码导航和JavaDoc错误

[英]Source code navigation and JavaDoc bug in Eclipse Indigo

I have a problem with Eclipse Indigo regarding library source code. 我对Eclipse Indigo有关库源代码的问题。 When I open a library class (eg from the JDK, but also from some other included libraries, such as Guava), either using the Open Type dialogue or simply through Ctrl + click on the class name or some of its methods, once in a while (not always) something breaks. 当我打开一个库类(例如来自JDK,也来自其他一些包含的库,例如Guava)时,要么使用Open Type对话框,要么只需按Ctrl + click类名或其某些方法,虽然(并非总是)某些东西中断了。

Don't get me wrong, the source is always displayed without any problem (either JDK source shipped with the JDK itself or Guava source downloaded by Maven). 不要误解我的意思,源代码总是显示没有任何问题(JDK本身附带的JDK源代码或Maven下载的Guava源代码)。 What actually stops to work: 什么实际停止工作:

  • When I open the Quick Outline popup in that given class using Ctrl + O , the list of methods and fields displays normally, but when I click on any of them, Eclipse doesn't move the view on it as it should. 当我使用Ctrl + O打开该给定类中的“ 快速大纲”弹出窗口时,方法和字段列表会正常显示,但是当我单击其中任何一个时,Eclipse不会按原样移动视图。 Also Ctrl + clicking any of the methods or fields of that class in my code doesn't bring me directly to it, but simply at the top of the source file. 同样在我的代码中按住Ctrl键并单击该类的任何方法或字段不会直接将它带到我,而只是在源文件的顶部。
  • When I hover over that said class or its methods, no JavaDoc appears in the popup as you can see in the attached image. 当我将鼠标悬停在所述类或其方法上时,弹出窗口中不会出现JavaDoc,如您在附加图像中看到的那样。 I am in the HashSet class, the source is clearly there, but it isn't displayed in the popup. 我在HashSet类中,源显然存在,但它不会显示在弹出窗口中。

HashSet JavaDoc消失了

I found out that this can be fixed by opening the Outline View and briefly clicking through the class's methods and fields. 我发现可以通过打开Outline视图并简单地单击该类的方法和字段来解决这个问题。 After a few clicks, Eclipse catches on and starts to work correctly, but only for this one class, not for all which are broken in this way at the moment. 点击几下后,Eclipse就会捕获并开始正常工作,但仅适用于这一类,而不是所有目前以这种方式破坏的类。

Has anybody met this kind of bug? 有没有人遇到过这种虫子? Is it tracked at Eclipse Bugzilla? 是否在Eclipse Bugzilla上进行了跟踪? Thanks in advance for any advice. 提前感谢任何建议。

For completeness, this is my configuration: 为了完整性,这是我的配置:

Windows 7 Professional x64
Oracle JDK 1.7 Update 2 32b
Eclipse Indigo for Java EE Developers 32b

your issue #2 may be resolved by following these steps : 您的问题#2可以通过以下步骤解决:

  1. Go to http://java.sun.com/j2se/1.5.0/download.jsp and choose to download the JDK 5.0 Source Code. 转到http://java.sun.com/j2se/1.5.0/download.jsp并选择下载JDK 5.0源代码。
  2. For JDK 5.0, select Download(SCSL source). 对于JDK 5.0,请选择下载(SCSL源)。
  3. Download JDK (SCSL) 5.0 (1.5.0). 下载JDK(SCSL)5.0(1.5.0)。 This will give you a file jdk-1_5_0-src.scsl.zip. 这将为您提供一个文件jdk-1_5_0-src.scsl.zip。 You do not need to unzip this file; 您无需解压缩此文件; Eclipse likes it the way it is. Eclipse喜欢它的方式。
  4. In Eclipse, go to Projects -> Properties -> Java Build Path -> Libraries and expand JRE System Library [jre 1.5.0], then rt.jar. 在Eclipse中,转到Projects - > Properties - > Java Build Path - > Libraries并展开JRE System Library [jre 1.5.0],然后是rt.jar。 Select Source attachment and click Edit... 选择源附件,然后单击编辑...
  5. Select the above zip file. 选择上面的zip文件。 and Finish by exiting the dialog boxes. 并退出对话框完成。

source 资源

Hope this helps.. 希望这可以帮助..

为了回答我自己的问题,我没有找到如何解决Indigo中的问题,但更新到Juno修复了它。

Sounds like wrong sources are attached to the libs inside Eclipse. 听起来错误的源代码附加到Eclipse内部的库中。

I had similar symptoms in a project where a class exist in both: inside a lib and in the project's src folder. 我在两个类中都存在类的项目中有类似的症状:在lib内部和项目的src文件夹中。 Same canonical class name, but different implementations. 相同的规范类名称,但实现不同。

I would recommend to verify (or reinstall) your JDK-Installation and re-configurating it in Eclipse. 我建议验证(或重新安装)JDK-Installation并在Eclipse中重新配置它。

Hitting Ctrl+Shift+T and typing HashSet and taking a screenshot of that window may help here, too. 点击Ctrl+Shift+T并键入HashSet并截取该窗口的屏幕截图也可能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM