Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-03-09 07:05:14 -0500
committerMichael Keppler2019-03-12 13:33:01 -0400
commite7db487413056711702fa26cc0b6424496bdf978 (patch)
tree9c9a055b8fb901e6b0a0d8b3bfdaa076b9a18ee9
parenta05ad984aa3bb6df1d2bcd417ba2c3ed7bf3b351 (diff)
downloadegit-github-e7db487413056711702fa26cc0b6424496bdf978.tar.gz
egit-github-e7db487413056711702fa26cc0b6424496bdf978.tar.xz
egit-github-e7db487413056711702fa26cc0b6424496bdf978.zip
Remove unnecessary null check
Change-Id: Iad7636699be5b4969e6cffe7435d2cf95b998270 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/CredentialsWizardPage.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/CredentialsWizardPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/CredentialsWizardPage.java
index 306d6aef..8167c579 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/CredentialsWizardPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/CredentialsWizardPage.java
@@ -24,7 +24,7 @@ import org.eclipse.swt.widgets.Text;
/**
* Credentials wizard page class.
- *
+ *
* @author Kevin Sawicki (kevin@github.com)
*/
public class CredentialsWizardPage extends WizardPage {
@@ -44,6 +44,7 @@ public class CredentialsWizardPage extends WizardPage {
/**
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite displayArea = new Composite(parent, SWT.NONE);
GridLayoutFactory.swtDefaults().numColumns(2).equalWidth(false)
@@ -54,6 +55,7 @@ public class CredentialsWizardPage extends WizardPage {
userText = new Text(displayArea, SWT.BORDER | SWT.SINGLE);
userText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validatePage();
}
@@ -65,6 +67,7 @@ public class CredentialsWizardPage extends WizardPage {
| SWT.PASSWORD);
passwordText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validatePage();
}
@@ -77,11 +80,11 @@ public class CredentialsWizardPage extends WizardPage {
private void validatePage() {
String message = null;
- if (message == null && userText.getText().trim().length() == 0)
+ if (userText.getText().trim().isEmpty()) {
message = Messages.CredentialsWizardPage_ErrorUser;
-
- if (message == null && passwordText.getText().trim().length() == 0)
+ } else if (passwordText.getText().trim().isEmpty()) {
message = Messages.CredentialsWizardPage_ErrorPassword;
+ }
setErrorMessage(message);
setPageComplete(message == null);
@@ -90,7 +93,7 @@ public class CredentialsWizardPage extends WizardPage {
/**
* Get user name
- *
+ *
* @return user name
*/
public String getUserName() {
@@ -99,7 +102,7 @@ public class CredentialsWizardPage extends WizardPage {
/**
* Get password
- *
+ *
* @return password
*/
public String getPassword() {

Back to the top