Skip to content

Instantly share code, notes, and snippets.

View paulk-asert's full-sized avatar

Paul King paulk-asert

  • Brisbane, Australia
  • 00:49 (UTC +10:00)
View GitHub Profile
import org.codehaus.groovy.ast.expr.*
incompatibleAssignment { lhsType, rhsType, expr ->
if (!(expr instanceof DeclarationExpression)) return
Expression orig = expr.rightExpression
def ce = new CastExpression(lhsType, orig)
ce.coerce = true
expr.setRightExpression(ce)
storeType(expr, lhsType)
handled = true
@Grab('org.scala-stm:scala-stm_2.10:0.7')
import scala.concurrent.stm.TxnUnknown$
import static scala.concurrent.stm.japi.STM.*
import static scala.concurrent.stm.Txn.*
void retry() {
def txn = findCurrent(TxnUnknown$.MODULE$).get()
retry(txn)
}