This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 206598 - SourceUtils.getFile should handle Groovy & other languages
Summary: SourceUtils.getFile should handle Groovy & other languages
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.2
Hardware: PC Linux
: P4 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks: 196414
  Show dependency tree
 
Reported: 2011-12-20 20:20 UTC by Jesse Glick
Modified: 2016-07-07 07:16 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-12-20 20:20:32 UTC
ClassDataObject.OpenSourceCookie.open relies on SourceUtils.getFile to decide which source file to open. This is apparently limited to *.java (acc. to Match.isJava), so it will not work in case X.class was compiled from X.groovy (or X.scala, etc.). There is also a clause that uses findSource but this seems to rely on there being an index, which might not hold for e.g. Maven repository JARs.

This all seems unnecessary; you need only

sourcePath.findResource(pkgName + new ClassFile(file, false).getSourceFileName())

in the normal case that the *.class specifies the matching source file.
Comment 1 Martin Balin 2016-07-07 07:16:51 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss