Whether the goodness of the will, as regards the means, depends on the intention of the end?

Objections

Objection 1 : It would seem that the goodness of the will does not depend on the intention of the end. For it has been stated above (Article [2]) that the goodness of the will depends on the object alone. But as regards the means, the object of the will is one thing, and the end intended is another. Therefore in such matters the goodness of the will does not depend on the intention of the end.
Objection 2 : Further, to wish to keep God's commandment, belongs to a good will. But this can be referred to an evil end, for instance, to vainglory or covetousness, by willing to obey God for the sake of temporal gain. Therefore the goodness of the will does not depend on the intention of the end.
Objection 3 : Further, just as good and evil diversify the will, so do they diversify the end. But malice of the will does not depend on the malice of the end intended; since a man who wills to steal in order to give alms, has an evil will, although he intends a good end. Therefore neither does the goodness of the will depend on the goodness of the end intended.