lkishalmi commented on pull request #2553: URL: https://github.com/apache/netbeans/pull/2553#issuecomment-752660231
> Do I get it right that the problem is in the implementation of @ProjectServiceProvider? I could get 291eac5 and let the test fail and then try to find out what to change in the project modules to make the test pass. I may take a look, but I haven't written that code, so I am not going to have much advantage. Yes, that's the case. If you get that commit the ```org.netbeans.modules.gradle.java.classpath.GradleSourcesImplTest,testSourceProviderChange()``` testcase will fail. Well, it is either the ProjectServiceProvider's Lazy Lookup is wrong or the ProxyLookup does. The LazyLookup might wrongly assume that the beforeLookup() would be called in every case when it's content being queried, or the ProxyLookup does not fullfill that contract in every case. It worked so far well in NetBeans as the dynamic nature of ProxyLookup was rarely used. So if plugins register ProjectServiceProvider on the main project type. then it works as initially the LazyLookups on some code path got initialized. Maven Plugin has a dynamic nature based on the packaging type, so services can be registered on war, osgi, and jar packaging type explicitly. There are only a few, maybe less than 5, such registration occurs in the codebase. They are not used by mergers, and eventually get initialized on some other code paths (I haven't explored them deeply though.) Gradle Support is a bit different, as planned to allow plugin based ProjectServiceProvider registration. So simple aggregator root project of a multi-project build would not have all the Java bells and whistles in its lookup. But the most common use case is when the user opens a project in NetBeans, that time it is only some heuristics used in order to avoid the immediate turn to Gradle. Heuristic can go wrong in some cases, failing to assume some plugins. After a priming build the project lookup needs to be updated... ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
