Kaydet (Commit) eda52500 authored tarafından Noel Grandin's avatar Noel Grandin

java:avoid empty if statements

Change-Id: I9c66dd5331f422d8d6271157fece2b346d8b3756
üst ff3b3bed
......@@ -541,9 +541,6 @@ public class OOoBeanTest
break;
}
}
else
{
}
} finally {
bean.stopOOoConnection();
......
......@@ -33,8 +33,7 @@ public class _XHierarchicalPropertySet extends MultiMethodTest {
XHierarchicalPropertySetInfo hpsi = oObj.getHierarchicalPropertySetInfo();
boolean res = true;
if (hpsi != null) {
} else {
if (hpsi == null) {
log.println(
"The component doesn't provide HierarchicalPropertySetInfo");
tRes.tested("getHierarchicalPropertySetInfo()",
......
......@@ -33,8 +33,7 @@ public class _XMultiHierarchicalPropertySet extends MultiMethodTest {
XHierarchicalPropertySetInfo hpsi = oObj.getHierarchicalPropertySetInfo();
boolean res = true;
if (hpsi != null) {
} else {
if (hpsi == null) {
log.println(
"The component doesn't provide HierarchicalPropertySetInfo");
tRes.tested("getHierarchicalPropertySetInfo()",
......
......@@ -111,8 +111,7 @@ public class _XCalendar extends MultiMethodTest {
", Country: "+ installed_locales[i].Country +
", Variant: "+ installed_locales[i].Country;
oObj.loadDefaultCalendar(installed_locales[i]);
if (oObj.getLoadedCalendar().Default) {
} else {
if (!oObj.getLoadedCalendar().Default) {
log.println(lang + " ... FAILED");
}
res &= oObj.getLoadedCalendar().Default;
......@@ -135,8 +134,7 @@ public class _XCalendar extends MultiMethodTest {
", Variant: "+ installed_locales[i].Country;
calendars[i] = oObj.getAllCalendars(installed_locales[i]);
count[i] = calendars[i].length-1;
if (calendars[i].length > 0) {
} else {
if (calendars[i].length <= 0) {
log.println(lang + " ... FAILED");
}
res &= (calendars[i].length > 0);
......@@ -163,8 +161,7 @@ public class _XCalendar extends MultiMethodTest {
", Country: "+ installed_locales[i].Country +
", Variant: "+ installed_locales[i].Country;
oObj.loadCalendar(calendars[i][0], installed_locales[i]);
if (calendars[i][0].equals(oObj.getLoadedCalendar().Name)) {
} else {
if (!calendars[i][0].equals(oObj.getLoadedCalendar().Name)) {
log.println(lang + " ... FAILED");
}
res &= calendars[i][0].equals(oObj.getLoadedCalendar().Name);
......@@ -192,8 +189,7 @@ public class _XCalendar extends MultiMethodTest {
", Country: "+ installed_locales[i].Country +
", Variant: "+ installed_locales[i].Country;
oObj.loadCalendar(calendars[i][0], installed_locales[i]);
if (calendars[i][0].equals(oObj.getLoadedCalendar().Name)) {
} else {
if (!calendars[i][0].equals(oObj.getLoadedCalendar().Name)) {
log.println(lang + " ... FAILED");
}
res &= calendars[i][0].equals(oObj.getLoadedCalendar().Name);
......@@ -219,8 +215,7 @@ public class _XCalendar extends MultiMethodTest {
", Variant: "+ installed_locales[i].Country;
oObj.loadCalendar(calendars[i][0], installed_locales[i]);
String uID = oObj.getUniqueID();
if (uID.equals(calendars[i][0])) {
} else {
if (!uID.equals(calendars[i][0])) {
log.println(lang + " ... FAILED");
}
res &= uID.equals(calendars[i][0]);
......@@ -244,8 +239,7 @@ public class _XCalendar extends MultiMethodTest {
", Variant: "+ installed_locales[i].Country;
oObj.setDateTime(newDTime);
double aDTime = oObj.getDateTime();
if (aDTime == newDTime) {
} else {
if (aDTime != newDTime) {
log.println(lang + " ... FAILED");
}
res &= (aDTime == newDTime);
......@@ -269,8 +263,7 @@ public class _XCalendar extends MultiMethodTest {
", Variant: "+ installed_locales[i].Country;
oObj.setDateTime(newDTime);
double aDTime = oObj.getDateTime();
if (aDTime == newDTime) {
} else {
if (aDTime != newDTime) {
log.println(lang + " ... FAILED");
}
res &= (aDTime == newDTime);
......
......@@ -71,29 +71,27 @@ public class _XDataOutputStream extends MultiMethodTest {
if (dataElem instanceof Boolean) {
((Boolean)dataElem).booleanValue();
} else
if (dataElem instanceof Byte) {
}
else if (dataElem instanceof Byte) {
((Byte)dataElem).byteValue();
} else
if (dataElem instanceof Character) {
}
else if (dataElem instanceof Character) {
((Character)dataElem).charValue();
} else
if (dataElem instanceof Short) {
}
else if (dataElem instanceof Short) {
((Short)dataElem).shortValue();
} else
if (dataElem instanceof Integer) {
}
else if (dataElem instanceof Integer) {
((Integer)dataElem).intValue();
} else
if (dataElem instanceof Long) {
}
else if (dataElem instanceof Long) {
((Long)dataElem).longValue();
} else
if (dataElem instanceof Float) {
}
else if (dataElem instanceof Float) {
((Float)dataElem).floatValue();
} else
if (dataElem instanceof Double) {
}
else if (dataElem instanceof Double) {
((Double)dataElem).doubleValue();
} else
if (dataElem instanceof String) {
}
}
}
......
......@@ -119,9 +119,7 @@ public class _XCellRangeMovement extends MultiMethodTest {
oSheet.getCellByPosition(3,21).setValue(200);
// catch some sleight of hand threads
if (oSheet.getCellByPosition(1,21).getValue() == 200){
}
else{
if (oSheet.getCellByPosition(1,21).getValue() != 200){
log.println("Cells were already inserted. "+
"Delete old cells now");
XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, oSheet);
......
......@@ -148,9 +148,7 @@ public class _XDocumentHandler extends MultiMethodTest {
if (xmlData == null || checker == null) throw new StatusException
(Status.failed("Relation wasn't found")) ;
if (targetDocSet != null){
}else{
if (targetDocSet == null){
log.println("object relation 'XDocumentHandler.TargetDocumentSetter' not used.");
log.println("be sure that the test have a target to write throu");
}
......
......@@ -467,9 +467,6 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener
{
sMessage = m_oResource.getResText(UIConsts.RID_REPORT + 92);
}
else
{
}
// show a dialog with the error message
SystemDialog.showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, sMessage);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment