ValidationInfo () { if (myCreateBranch.isSelected()) { String branchName = myBranchName.getText().trim(); if (branchName.isEmpty()) { return new ValidationInfo(TaskBundle.message("dialog.message.branch.name.should.not.be.empty"), myBranchName); } else if (myVcsTaskHandler != null) { return myVcsTaskHandler.isBranchNameValid(branchName) ? null : new ValidationInfo(TaskBundle.message("dialog.message.branch.name.not.valid.check.your.vcs.branch.name.restrictions"), myBranchName); } else if (branchName.contains(" ")) { return new ValidationInfo(TaskBundle.message("dialog.message.branch.name.should.not.contain.spaces"), myBranchName); } else { return null; } } if (myCreateChangelist.isSelected()) { if (myChangelistName.getText().trim().isEmpty()) { return new ValidationInfo(TaskBundle.message("dialog.message.changelist.name.should.not.be.empty"), myChangelistName); } } return null; }