Update BeanPathAdapter.java

prevent creation of some unnecessary empty objects