Shorter fix for ignoring throw keyword as function in java