Community
Participate
Working Groups
IPackageFragmentRoot::getModuleDescription returns null for AutoModules There is an API on IModuleDescription isAutoModule which specifies if it is an auto module or not. So, IPackageFragmentRoot should return a non-null IModuleDescription. This breaks the module related QuickAssists for Auto Modules.
Kalyan, are you on latest master? Do you see the fix for bug 539698 (I20181030-1800)? How one can reproduce the issue?
(In reply to Andrey Loskutov from comment #1) > Kalyan, are you on latest master? Do you see the fix for bug 539698 > (I20181030-1800)? > > How one can reproduce the issue? Andrey, I have been following that bug. But it's not clear to me whether it will return non-null for automatic modules, which is what Kalyan is interested in.
(In reply to Jay Arthanareeswaran from comment #2) > (In reply to Andrey Loskutov from comment #1) > > Kalyan, are you on latest master? Do you see the fix for bug 539698 > > (I20181030-1800)? > > > > How one can reproduce the issue? > > Andrey, I have been following that bug. But it's not clear to me whether it > will return non-null for automatic modules, which is what Kalyan is > interested in. This is not clear for me too, because AutoModule is not implementing IPackageFragmentRoot and I do not see where is the relationship between AutoModule and IPackageFragmentRoot::getModuleDescription.
(In reply to Andrey Loskutov from comment #3) > (In reply to Jay Arthanareeswaran from comment #2) > > (In reply to Andrey Loskutov from comment #1) > > > Kalyan, are you on latest master? Do you see the fix for bug 539698 > > > (I20181030-1800)? > > > > > > How one can reproduce the issue? > > > > Andrey, I have been following that bug. But it's not clear to me whether it > > will return non-null for automatic modules, which is what Kalyan is > > interested in. > > This is not clear for me too, because AutoModule is not implementing > IPackageFragmentRoot and I do not see where is the relationship between > AutoModule and IPackageFragmentRoot::getModuleDescription. The use case for this issue is the bug 239782. While providing a quickfix for missing import on a type, if the type belongs to an Auto Module we will need to add "requires" statement in the module-info.java file. The current procedure to get the module information for a type is to get the IPackageFragmentRoot in which the type is defined and get its IModuleDescription. Currently this returns null for AutoModules.
(In reply to Kalyan Prasad Tatavarthi from comment #4) > (In reply to Andrey Loskutov from comment #3) > > (In reply to Jay Arthanareeswaran from comment #2) > > > (In reply to Andrey Loskutov from comment #1) > > > > Kalyan, are you on latest master? Do you see the fix for bug 539698 > > > > (I20181030-1800)? > > > > > > > > How one can reproduce the issue? > > > > > > Andrey, I have been following that bug. But it's not clear to me whether it > > > will return non-null for automatic modules, which is what Kalyan is > > > interested in. > > > > This is not clear for me too, because AutoModule is not implementing > > IPackageFragmentRoot and I do not see where is the relationship between > > AutoModule and IPackageFragmentRoot::getModuleDescription. > > The use case for this issue is the bug 239782. > > While providing a quickfix for missing import on a type, if the type belongs > to an Auto Module we will need to add "requires" statement in the > module-info.java file. > > The current procedure to get the module information for a type is to get the > IPackageFragmentRoot in which the type is defined and get its > IModuleDescription. > > Currently this returns null for AutoModules. Its the bug 539782
Kalayan, van you please point me to the related code where you ask for the module description?
Kalyan, I believe you need to call org.eclipse.jdt.core.provisional.JavaModelAccess.getAutomaticModuleDescription(IJavaElement) (see bug 525208). IPackageFragmentRoot.getModuleDescription() has no provision to synthesize a module description for an auto module. When you start using the method in JavaModelAccess please file a follow-up bug for migrating the provisional API to some permanent place.
(In reply to Stephan Herrmann from comment #7) > Kalyan, I believe you need to call > org.eclipse.jdt.core.provisional.JavaModelAccess. > getAutomaticModuleDescription(IJavaElement) (see bug 525208). > > IPackageFragmentRoot.getModuleDescription() has no provision to synthesize a > module description for an auto module. > > When you start using the method in JavaModelAccess please file a follow-up > bug for migrating the provisional API to some permanent place. Thanks Stephan, This API is helpful. Once The changes go into JDT UI, I will create a bug requesting the migration of the provisonal API to some permanent place.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.