[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[iam-dev] Question on the behavior of the builder

I have a few questions about the builder, especially in ResourceBuilderDelegate.

In investigating Bug 266034 - NPE in EMF when adding a new dependency to the pom, I found out that builder is being called once it detected changes in the POM.

In the method handlePomChange, there is some checking being done to see if Build Resources, Build Test Resources and Build Filters were modified.

If a dependency is added, runTest is set to true, by this snippet:

        if ( DiffUtils.isPathModified( diff.getOwnedElements(), new EStructuralFeature[] {
            PomPackage.Literals.MODEL__BUILD, PomPackage.Literals.BUILD__RESOURCES } ) )
            runResc = true;

This is because the feature ID for BUILD__RESOURCES happens to be the same as that of DEPENDENCY__EXCLUSIONS.


But when BUILD__FILTERS is being checked, that's when the NPE occurs since BUILD__FILTERS has a feature ID of 13 which is non-existent in a Dependency object.

My question on the builder is:  Is it supposed to compare a Dependency or some other modified POM object to a Build Resource or a Build Test Resource? Maybe it would be better if we add some checking first if the modified POM object is indeed a Build Resource/Build Test Resource/Build Filter before it gets to the checking being done in handlePomChange?