Shakyamuni said he was willing to engage in debate if Upali was truly serious. Upali said that he was. Shakyamuni then proceeded to prove by means of many actual examples that good or bad mental motivation is more important than actual actions and words. Moreover, he proved this from the Jainist standpoint, calling upon examples taken from Jainist teachings.
In one instance, Shakyamuni countered Upali’s insistence that the physical act takes precedence in importance over the mental motivation in the following way. He asked what would happen to a Jainist who, out of respect for the minute living creatures in cool water, refused to drink it, even when suffering from a high fever, and consequently died. Upali said that attachment to the mind at the time of death would result in the man’s being born again in a heaven for those who remain attached to mind. In other words, mental attachment and not the actual act of drinking or not drinking cool water produced the effect.
Jainism strictly forbids the taking of life, even that of the small creatures living in water. But, should a person unwittingly step in a puddle of water on the road and kill some of these creatures, according to Jainism his sin is not grave, since he was unaware of what he was doing. In adopting this standpoint, Jainism tacitly puts greater emphasis on mental motivation than on physical result and thus contradicts itself.
Upali found it impossible to reply to these demonstrations of Jainist inconsistencies and at once became a believer in Buddhism. (Page 125-126)
The Beginnings of Buddhism