Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] IManagedOptionValueHandler.isEnumValueAppropriate parameter type

2009/12/5 Vladimir Prus <vladimir@xxxxxxxxxxxxxxxx>:
> At present, the signature of IManagedOptionValueHandler.isEnumValueAppropriate
> is as follows:
>        public boolean isEnumValueAppropriate(IBuildObject configuration,
>                        IHoldsOptions holder, IOption option, String extraArgument,
>                        String enumValue)
> It seems to be that the type and name of the first parameter are misleading.
> First, looking at the name one can assume that it's configuration that is passed
> in (and in fact, IConfiguration does extend IBuildObject). However,
> in practice IResourceInfo is always passed in -- after upcast to IBuildObject.
> Second, even assuming IBuildObject can be passed -- what is a poor method to do?
> There's a dozen interfaces that directly extend IBuildObject, and it's unlikely
> that any of that dozen can be passed.
> So:
> 1. Why is the parameter type so needlessly generic?

If you look at the CVS history that interface has been there since
2005 but IResourceInfo has only existed since 2007.  I think
historically it wasn't possible to override settings on a per resource

> 2. Could this be fixed?

Andrew's right, and this looks, to me, to already have pretty detailed
and clear JavaDoc:
	 * @param configuration
	 *            build configuration of option (may be IConfiguration or
	 *            IResourceConfiguration)


> Thanks,
> Volodya
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx

Back to the top