As part of a sweeping national trend, New Jersey could soon begin losing tens of thousands of affordable housing units built decades ago with either federal housing subsidies or financial incentives offered by state judges.

Private developers, who agreed to keep the units affordable for between 10 and 30 years in exchange for the breaks, are being tempted to sell or convert the buildings by soaring condo prices and a hot rental market.