Skip to content

Instantly share code, notes, and snippets.

View PiotrCL's full-sized avatar

PiotrCL

View GitHub Profile
/**
* Methods showing how to transform for/yield based expression into pure map/flatMap/withFilter expression.
* The idea is - this transformations is possible using simple substitutions.
*
* Exapmples based on the coursera "Functional Program Design in Scala"
* Lecture 1.2 "Translation of For"
* https://www.coursera.org/learn/progfun2/lecture/zJcCG/lecture-1-2-translation-of-for
*
* @author Piotr Reszke
*/
@PiotrCL
PiotrCL / StrictfpReflectionTest.java
Created September 20, 2016 10:38
Test class that detects how the strictfp modifier is propagated in different scenarios. The test is based on Java Reflection API
import java.lang.reflect.Modifier;
strictfp interface StrictInterface {
void someInterfaceMethod();
default void someInterfaceDefaultMethod() {}
class InnerTest {
public static void innerMethod() {}