An Indonesian man was sentenced to be caned for consuming alcohol by the same the judge who drew flak for handing a similar sentence to a woman.