Because company-yasnippet expands each snippet to produce a preview in a
temporary (and fundamental-mode) buffer, java-current-class and
java-current-package throws errors, so I've added a special case to
return a placeholder if expanded in a temporary buffer.