| Summary: | [code minning] On latest IBuild JDT code minings are not working. | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Gayan Perera <gayanper> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | azerr, Lars.Vogel, mistria, rgrunber |
| Version: | 4.16 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Gayan Perera
I'm using latest I-Build, and CodeMinings work fine for me. Can you please try with a fresh build? Did you make sure the JDT code minings are turned on? Found the issue. The recent testng codemining improvement i did actually returns null for provideCodeMinings on classes which are not test. This cause the whole code ming to fail with a NPE. I don’t see any warning either saying not to return null in that API. @Mickael should guard for this kind of return values. Checking at ICodeMiningProvider says can return null or empty. In testng provider retuns null result as supplyAsync. According doc i assume this is what is expects. And this worked like this for some time for some reason i guess. Downgrade to major since there is a workaround for this issue. Is this still reproducible ? Is there a stacktrace of the NPE ? Looking at https://github.com/eclipse/eclipse.platform.text/blob/master/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java#L190 , there seems to be a check for null. Its fixed in TestNG which cause the issue. But I still think there is a chance that a rouge mining can cause all the mining to disappear. @Gayan, is there any chance that the testng provideCodeMinings(..) implementation actually threw the NPE ? What happens if you just throw an NPE there ? In that case, I could see it breaking things because the CodeMiningManager.getCodeMinings(..) seems to expect clients to handle those. Otherwise I would probably close this as WORKSFORME until a better reproducer can be found. Marking as WORKSFORME for now. Feel free to re-open if you run into such an issue again. |