Fix warnings about unnecessary else clauses.
Change-Id: I134bed156300c49d128f17dd1a0a5bef61d48029
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/ElementTreeSerializationTest.java b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/ElementTreeSerializationTest.java
index 1c27f9c..f4ba5e0 100644
--- a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/ElementTreeSerializationTest.java
+++ b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/ElementTreeSerializationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -250,9 +250,8 @@
String data = input.readUTF();
if ("null".equals(data)) {
return null;
- } else {
- return data;
}
+ return data;
}
};
}
diff --git a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/PhantomComparator.java b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/PhantomComparator.java
index 35255f9..3026f3f 100644
--- a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/PhantomComparator.java
+++ b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/watson/PhantomComparator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -56,29 +56,25 @@
if (newInfo.isPhantom) {
/* ignore changes to phantoms */
return K_NO_CHANGE;
- } else {
- /* phantom -> real is an addition */
- return ADDED;
}
- } else {
- if (newInfo.isPhantom) {
- /* real -> phantom == deletion */
- return REMOVED;
- } else {
- /* not a phantom */
- if (oldInfo.name == null && newInfo.name == null) {
- return K_NO_CHANGE;
- }
- if (oldInfo.name == null || newInfo.name == null) {
- return CHANGED;
- }
- if (oldInfo.name.equals(newInfo.name)) {
- return K_NO_CHANGE;
- } else {
- return CHANGED;
- }
- }
+ /* phantom -> real is an addition */
+ return ADDED;
}
+ if (newInfo.isPhantom) {
+ /* real -> phantom == deletion */
+ return REMOVED;
+ }
+ /* not a phantom */
+ if (oldInfo.name == null && newInfo.name == null) {
+ return K_NO_CHANGE;
+ }
+ if (oldInfo.name == null || newInfo.name == null) {
+ return CHANGED;
+ }
+ if (oldInfo.name.equals(newInfo.name)) {
+ return K_NO_CHANGE;
+ }
+ return CHANGED;
}
/**
diff --git a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java
index 0b500a2..58da531 100644
--- a/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java
+++ b/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java
@@ -129,9 +129,8 @@
if (resource.getType() == IResource.ROOT) {
assertNull("1.0." + resource.getFullPath(), actual);
return true;
- } else {
- assertNotNull("1.1." + resource.getFullPath(), actual);
}
+ assertNotNull("1.1." + resource.getFullPath(), actual);
byte[] expected = table.get(resource.getFullPath());
assertEquals("1.2." + resource.getFullPath(), expected, actual);
} catch (CoreException e) {
@@ -168,9 +167,8 @@
if (resource.getType() == IResource.ROOT) {
assertNull("3.0", actual);
return true;
- } else {
- assertNotNull("3.1." + resource.getFullPath(), actual);
}
+ assertNotNull("3.1." + resource.getFullPath(), actual);
byte[] expected = table.get(resource.getFullPath());
assertEquals("3.2." + resource.getFullPath(), expected, actual);
} catch (CoreException e) {
@@ -241,9 +239,8 @@
if (resource.getType() == IResource.ROOT) {
assertNull("1.0." + resource.getFullPath(), actual);
return true;
- } else {
- assertNotNull("1.1." + resource.getFullPath(), actual);
}
+ assertNotNull("1.1." + resource.getFullPath(), actual);
byte[] expected = table.get(resource.getFullPath());
assertEquals("1.2." + resource.getFullPath(), expected, actual);
} catch (CoreException e) {
@@ -282,9 +279,8 @@
if (resource.getType() == IResource.ROOT) {
assertNull("3.0", actual);
return true;
- } else {
- assertNotNull("3.1." + resource.getFullPath(), actual);
}
+ assertNotNull("3.1." + resource.getFullPath(), actual);
byte[] expected = table.get(resource.getFullPath());
assertEquals("3.2." + resource.getFullPath(), expected, actual);
} catch (CoreException e) {
@@ -603,9 +599,8 @@
if (resource.getType() == IResource.ROOT) {
assertNull("4.0", actual);
return true;
- } else {
- assertNotNull("4.1." + resource.getFullPath(), actual);
}
+ assertNotNull("4.1." + resource.getFullPath(), actual);
byte[] expected = table.get(resource.getFullPath());
assertEquals("4.2." + resource.getFullPath(), expected, actual);
return true;
@@ -840,9 +835,8 @@
if (resource.getType() == IResource.ROOT) {
assertNull("5.0", actual);
return true;
- } else {
- assertNotNull("5.1." + resource.getFullPath(), actual);
}
+ assertNotNull("5.1." + resource.getFullPath(), actual);
byte[] expected = table.get(resource.getFullPath());
assertEquals("5.2." + resource.getFullPath(), expected, actual);
} catch (CoreException e) {
@@ -883,9 +877,8 @@
if (resource.getType() == IResource.ROOT) {
assertNull("7.0", actual);
return true;
- } else {
- assertNotNull("7.1." + resource.getFullPath(), actual);
}
+ assertNotNull("7.1." + resource.getFullPath(), actual);
byte[] expected = table.get(resource.getFullPath());
assertEquals("7.2." + resource.getFullPath(), expected, actual);
} catch (CoreException e) {