Use cast instead of untyped for _getTarget().
Fixed compilation issue for Java target.
Merge pull request #4 from andyli/java-fix

Use cast instead of untyped for _getTarget().