This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.language.reflectiveCalls | |
// for the story behind this snippet of code see: | |
// http://stackoverflow.com/questions/13185405/structural-subtyping-reflection | |
// requires Scala 2.10.0-RC1 or higher | |
// you also need to have scala-reflect.jar and scala-compiler.jar on your classpath | |
import scala.reflect.runtime.universe._ | |
object Test extends App { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VirtualExtensionMethod { | |
public static void main(String[] args) { | |
F fa = new FA(); | |
fa.f1("fa"); | |
F fb = new FB(); | |
fb.f2("fb"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package trampoline | |
import java.text.SimpleDateFormat | |
import java.util.Date | |
/** | |
* Simple Unit test DSL. | |
*/ | |
class UnitTestContext(val limit: Date) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.LinkedBlockingQueue; | |
import org.fluentd.logger.FluentLogger; |
NewerOlder