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.
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.
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