Skip to content

Instantly share code, notes, and snippets.

View filiphr's full-sized avatar

Filip Hrisafov filiphr

View GitHub Profile
@filiphr
filiphr / Animal.java
Last active October 13, 2018 21:50
Differences between javac and tycho-compiler-jdt (1.2.0)
public interface Animal<ID extends KeyOfAllBeings> extends Identifiable<KeyOfAllBeings> {
@Override
ID getKey();
void setKey(ID item);
}
@filiphr
filiphr / Main.java
Created May 11, 2018 06:07
Confusing compiler warning
import java.util.List;
public class Main {
public static void main(String[] args) {
Foo foo = new Foo();
// Why does the compiler complain about an unchecked assignment, because foo is raw?
List<Integer> numbers = foo.getNumbers();
}
import java.util.ArrayList;
import java.util.List;
public class VehicleMapperImpl implements VehicleMapper {
@Override
public VehicleDto map(Vehicle in) {
if ( in == null ) {
return null;
}
@filiphr
filiphr / TypeResolverTest.java
Last active July 5, 2017 21:20 — forked from cykl/TypeResolverTest.java
Code sample to figure out how to check whether the return type of two methods are equals (including generics). See https://github.com/joel-costigliola/assertj-core/issues/1005
package cma.sandox;
import com.google.common.reflect.TypeResolver;
import org.assertj.core.api.WithAssertions;
import org.junit.Test;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
@filiphr
filiphr / Address.java
Created December 20, 2016 19:05
Mapstruct #1003
public class Address {
private String street;
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;