Transactions conducted for tax purposes

James would like to generate a tax loss on a security held in his personal portfolio; however, he believes the security has significant upside potential. To avoid the wash sale provisions of the income tax code, James sells the security and simultaneously creates a synthetic long positiong using derviatives.

Can someone help me understand what is this transaction?

It is a question from ethics section, and this transaction is not legal. I guessed it right but did not understand the transaction.

Jim sells a stock, buys call options on the stock, and sells put options on the stock.

It is not illegal to do this. However, under the wash sale rules it is illegal to claim the loss on the stock, as the synthetic long position is, essentially, a repurchase of the stock.