fix java order generation in case of flat and structure fields.