IDE-1527 Add empty java package check

Inside the { } block we can just modify the javaPackage variable and only do the "NodeUtil..." line just one time.