Add the right constructor to Java annotations

Review by @olhotak please.