The Canada Elections Act provides that a general election is to be held on the third Monday in October in the fourth calendar year after each general election. Thus, the next general election will be held on October 19, 2015 (unless the Governor General dissolves Parliament earlier). This provision was introduced in 2007.
The Canadian Constitution states that no Parliament can last more than five years, except in the case of an emergency. Thus, the next general election must be called within five years of May 3, 2011 - i.e. by May 3, 2016. Since Parliament must meet at least once a year, the next Parliament must meet no later than May 3, 2017, and there must be enough time after voting day for the return of the writs, etc. These constitutional requirements continue to exist notwithstanding the provisions of the Canada Elections Act.
The two provisions are not contradictory, since the Governor General's discretion to dissolve Parliament, whether before or after the four years prescribed by the legislation is untouched.