This file contains 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
if (condition) | |
if (condition) | |
someAction(); | |
else | |
otherAction(); | |
// or | |
if (condition) | |
if (condition) |
This file contains 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
=>(target=ID '.' feature=ID '=') value=Expression |
This file contains 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 org.eclipse.emf.ecore.EObject; | |
import org.eclipse.xtext.xbase.XAbstractFeatureCall; | |
import org.eclipse.xtext.xbase.XFeatureCall; | |
import org.eclipse.xtext.xbase.XMemberFeatureCall; | |
import org.eclipse.xtext.xbase.XNullLiteral; | |
import org.eclipse.xtext.xbase.XUnaryOperation; | |
import org.eclipse.xtext.xbase.XbaseFactory; | |
import com.google.caliper.Param; | |
import com.google.caliper.Runner; |
This file contains 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 static extension Throwables.* | |
val uri = [| new URI(requestURI) ].onException [ | |
new IllegalArgumentException(it) | |
] |
This file contains 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
public class Doh { | |
public static void main(String[] args) throws Exception { | |
Person p = new Person("Name"); | |
setName(p, "New Name"); | |
setDefault("Bob"); | |
System.out.println(p.getName()); | |
System.out.println(Person.DEFAULT); | |
} | |
/** |
This file contains 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
@Visitable | |
abstract class CarElement { | |
// placeholder | |
def void accept(CarElementVisitor visitor) | |
} | |
@Data | |
class Wheel extends CarElement { | |
String name; | |
} | |
class Engine extends CarElement {} |
This file contains 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 annotations | |
import java.lang.annotation.Documented | |
import java.lang.annotation.ElementType | |
import java.lang.annotation.Target | |
import java.util.List | |
import java.util.Set | |
import org.eclipse.xtend.lib.macro.Active | |
import org.eclipse.xtend.lib.macro.RegisterGlobalsContext | |
import org.eclipse.xtend.lib.macro.RegisterGlobalsParticipant |
This file contains 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 com.google.caliper.Benchmark; | |
import com.google.caliper.Param; | |
import com.google.caliper.api.Macrobenchmark; | |
import com.google.caliper.runner.CaliperMain; | |
import java.util.AbstractList; | |
import java.util.Arrays; | |
import java.util.List; | |
public class IntArraySumBenchmark extends Benchmark { |
This file contains 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 java.util.Arrays; | |
import java.util.stream.IntStream; | |
public class C { | |
public int parallelSumJava8(int reps) { | |
int result = 0; | |
for (int i = 0; i < reps; i++) { | |
final int i_ = i; | |
result += Arrays.stream(array).parallel().map(e -> e * 5 * i_).sum(); |
This file contains 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
A: // not necessarily called anywhere | |
SomeA | AB | |
; | |
B: // not necessarily called anywhere | |
SomeB | AB | |
; | |
AB: | |
a='a' b='b' | |
; |
OlderNewer