remove deprecated method toResource(Object,boolean) and toResource(Object)