It has been branded the "Bali Bonking Ban". The revised criminal code which has been approved this week by the Indonesian parliament is getting the kind of publicity rarely given to arcane changes in another country's legal system.
Headlines around the world are warning tourists visiting Indonesia that they face up to a year in jail if caught having sex or cohabiting with someone they are not married to. Suddenly a country usually lauded as a pluralistic Muslim democracy finds itself being accused of mediaeval moral meddling.
It is actually a much more complicated story, and the "sex ban" is not the most worrying change for many Indonesians, who see other areas of the code threatening human rights and freedom of speech.
Indonesia inherited its legal system from Dutch colonial rule, and successive governments have wanted to reform it, and make it more relevant to the country today.
A draft was presented to the parliament three years ago, but it provoked widespread protests and was shelved on the advice of President Joko Widodo.
The committee charged with preparing it again this year has said the revised code has been altered to take into account some of the public concerns.
It should also be stressed that the new laws will not take effect for three years, and that they can be challenged in the constitutional court.
But the code still alarms many Indonesians.
First, about those warnings to tourists. Foreigners are bound by the law as much as Indonesians, but the stipulation that you cannot be prosecuted for extramarital sex or cohabitation unless a complaint is filed by a child, parent or spouse of the accused makes it very unlikely that tourists will be affected.
It is far more worrying for Indonesia's LGBTQ community, who cannot marry, and fear the law will be used against them.
Others have pointed out the risk of this provision being abused in personal vendettas against estranged family members, or by people with ultra-conservative or religious beliefs who cannot accept the lifestyle preferences of their children.
But it is the other provisions of the new code which really alarm Indonesians who are concerned about civil liberties.
"We have made great strides towards democracy since the downfall of Suharto's dictatorship, and the new criminal code threatens to reverse that progress," said Eva Sundari, a former member of parliament and board member for Asean Parliamentarians for Human Rights.
"The government and House [of Representatives] claim to have opened room for input from civil society, but that was evidently just for the sake of appearances, as they have largely ignored objections from academics, experts and human rights defenders."
The new code makes it a crime to insult the president or vice-president, punishable by up to three years in prison, although this can only happen if either of the two top office-holders file a complaint. It criminalises holding protests without permission. Human rights groups have identified 17 articles which they believe threaten the freedoms won since the return to democratic rule in the 1990s.
Evi Mariani, at the public journalism group Project Multatuli, has posted her concern on Twitter about the threat to journalists from article 263, which stipulates a four-year prison sentence for anyone found guilty of spreading news which is suspected of being false and causing public disturbances. She described the code as "a siege against freedom of expression", and says that now "every avenue of dissent has criminal charges lurking".
For Andreas Harsono, the Indonesia researcher for Human Rights Watch, the inclusion of what is called "living law" is what worries him most. This originated in the idea that customary law, known in Indonesia as adat, which still governs some aspects of life in parts of the country, should be incorporated to prevent conflicts between it and the official criminal code.
"This is one of the most dangerous part of the new criminal code. It did not exist in the old code. The living law could be used to implement narrow religious or customary practices such as female genital mutilation, child marriage, mandatory hijab rules or polygamy. It could also be used for land grabbing. Indonesia's largest indigenous people coalition is protesting against this article because they see it as taking away their own traditional dispute mechanisms."
The influence of conservative Islamic groups is evident in the widening of the blasphemy provisions in the code from one to six, and for the first time, outlawing apostasy, or persuading someone to abandon their faith.
Some Indonesians have voiced their frustration over the Western media's obsession with the restrictions on sex, and the supposed threat to tourists. It is not about your sex life, they have been writing, but our civil rights.