[1016578] Refactor s to newSource and used setAttributes