Just checked: your code from picture 2 runs fine when passing an entity to the Java action (as Type parameter), ending up with Strings that are empty. I inspected this in the Mendix debugger.
Not sure what you want to achieve in the line above // BEGIN USER CODE, but please notice that everything outside of //BEGIN… and //END.. and // BEGIN EXTRA CODE, //END EXTRA CODE will be removed when triggering a “Deploy to Eclipse” from Studio Pro next time.