Please see the developer guide.
This got a bit messy, so in the interest of clarifying things and tidying this up:
All patches must be submitted under the Apache 2.0 License. Ownership of copyright of patches is retained by their licensors. When you are submitting a patch for a file with an existing copyright assertion other than to 'The Contributors' or to a file with no copyright assertion at all, you may add an additional copyright assertion on behalf of 'The Contributors' (with an Apache 2.0 license statement). Any other copyright assertion should not be added other than in exceptional circumstances.
And add yourself (and any other contributors) to the AUTHORS file when you first make a contribution.