From 3f50c6e050ea922cb720ec88a9f38c991b1906cd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 5 Nov 2015 14:53:35 +0200 Subject: [PATCH] java: remove ((unnecessary)) parentheses Change-Id: I39fbe3a260c8dbfc203662c54eec4db064b88195 --- .../comp/beans/LocalOfficeConnection.java | 2 +- .../complex/connectivity/DBaseDriverTest.java | 8 +++---- .../qa/complex/dbaccess/DatabaseDocument.java | 2 +- .../qa/integration/forms/FormControlTest.java | 2 +- .../AcceleratorsConfigurationTest.java | 2 +- .../qa/complex/accelerators/KeyMapping.java | 2 +- .../ContextMenuInterceptor.java | 24 +++++++++---------- .../qa/complex/dispatches/Interceptor.java | 2 +- .../XInputStreamToInputStreamAdapter.java | 2 +- .../star/lib/uno/helper/PropertySetMixin.java | 14 +++++------ .../com/sun/star/lib/uno/helper/WeakBase.java | 2 +- .../star/lib/uno/helper/ProxyProvider.java | 4 ++-- .../linguistic/HangulHanjaConversion.java | 2 +- .../runner/complexlib/ComplexTestCase.java | 2 +- qadevOOo/runner/helper/BuildEnvTools.java | 2 +- qadevOOo/runner/util/InstCreator.java | 2 +- qadevOOo/runner/util/ValueChanger.java | 2 +- qadevOOo/runner/util/utils.java | 2 +- qadevOOo/tests/java/ifc/awt/_XControl.java | 2 +- .../tests/java/ifc/beans/_XIntrospection.java | 2 +- .../java/ifc/beans/_XMultiPropertyStates.java | 3 +-- .../tests/java/ifc/beans/_XPropertyState.java | 6 ++--- qadevOOo/tests/java/ifc/chart/_XDiagram.java | 2 +- .../tests/java/ifc/connection/_XAcceptor.java | 3 +-- qadevOOo/tests/java/ifc/i18n/_XCalendar.java | 2 +- .../tests/java/ifc/i18n/_XLocaleData.java | 10 ++++---- .../tests/java/ifc/io/_XPersistObject.java | 2 +- .../ifc/sdb/_XSingleSelectQueryAnalyzer.java | 13 +++++----- .../ifc/sdb/_XSingleSelectQueryComposer.java | 14 +++++------ .../java/ifc/sdbc/_XWarningsSupplier.java | 2 +- qadevOOo/tests/java/ifc/text/_XFootnote.java | 2 +- .../tests/java/ifc/text/_XPagePrintable.java | 2 +- .../mod/_dbaccess/ODatasourceBrowser.java | 2 +- .../java/mod/_forms/GenericModelTest.java | 4 ++-- .../java/mod/_forms/OCheckBoxControl.java | 2 +- .../java/mod/_forms/OComboBoxControl.java | 2 +- .../tests/java/mod/_forms/ODatabaseForm.java | 13 ++++------ .../tests/java/mod/_forms/ODateControl.java | 2 +- .../tests/java/mod/_forms/OEditControl.java | 2 +- .../java/mod/_forms/OFileControlModel.java | 2 +- .../java/mod/_forms/OFormattedControl.java | 2 +- .../java/mod/_forms/OFormsCollection.java | 2 +- .../java/mod/_forms/OGridControlModel.java | 2 +- .../java/mod/_forms/OGroupBoxControl.java | 2 +- .../tests/java/mod/_forms/OHiddenModel.java | 4 ++-- .../java/mod/_forms/OImageButtonControl.java | 2 +- .../java/mod/_forms/OImageControlControl.java | 2 +- .../java/mod/_forms/OListBoxControl.java | 2 +- .../java/mod/_forms/ONumericControl.java | 2 +- .../java/mod/_forms/OPatternControl.java | 2 +- .../java/mod/_forms/ORadioButtonControl.java | 2 +- .../java/mod/_forms/OScrollBarModel.java | 2 +- .../java/mod/_forms/OSpinButtonModel.java | 2 +- .../tests/java/mod/_forms/OTimeControl.java | 4 ++-- .../mod/_sd/SdXCustomPresentationAccess.java | 3 +-- qadevOOo/tests/java/mod/_sw/SwXMailMerge.java | 2 +- .../tests/java/mod/_sw/SwXTextPortion.java | 2 +- .../mod/_sw/SwXTextPortionEnumeration.java | 2 +- .../java/mod/_toolkit/TabController.java | 7 ++---- .../uno/typedesc/TypeDescription_Test.java | 6 ++--- ridljar/test/com/sun/star/uno/Type_Test.java | 21 +++++----------- .../writer/CheckIndexedPropertyValues.java | 11 ++++----- .../writer/CheckNamedPropertyValues.java | 9 +++---- .../writer/TextPortionEnumerationTest.java | 6 ++--- .../servicetests/RemoteServiceTest.java | 10 ++++---- toolkit/test/accessibility/CanvasShape.java | 2 +- .../test/accessibility/ov/ContextView.java | 2 +- toolkit/test/accessibility/ov/FocusView.java | 2 +- toolkit/test/accessibility/ov/TextView.java | 2 +- .../qa/complex/unoxml/RDFRepositoryTest.java | 3 +-- .../star/wizards/db/RelationController.java | 2 +- .../sun/star/wizards/document/Control.java | 4 ++-- .../star/wizards/report/ReportFinalizer.java | 2 +- .../star/wizards/table/PrimaryKeyHandler.java | 8 +++---- .../star/wizards/ui/AggregateComponent.java | 2 +- .../wizards/ui/CommandFieldSelection.java | 2 +- .../sun/star/wizards/ui/FilterComponent.java | 8 +++---- .../com/sun/star/wizards/ui/UnoDialog.java | 2 +- xmerge/source/bridge/java/XMergeBridge.java | 2 +- .../java/org/openoffice/xmerge/Convert.java | 2 +- .../xmerge/converter/xml/ParaStyle.java | 2 +- .../converter/xml/sxc/SheetSettings.java | 6 ++--- .../merge/CharacterBaseParagraphMerge.java | 2 +- .../org/openoffice/xmerge/util/XmlUtil.java | 2 +- .../xmerge/util/registry/ConverterInfo.java | 2 +- .../util/registry/ConverterInfoMgr.java | 2 +- .../util/registry/ConverterInfoReader.java | 2 +- 87 files changed, 159 insertions(+), 187 deletions(-) diff --git a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java index d58a30fe23f6..93ca72b7efec 100644 --- a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java +++ b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java @@ -704,7 +704,7 @@ public class LocalOfficeConnection if (unoPath == null) throw new java.io.IOException( "UNO_PATH environment variable is not set (required system path to the office program directory)" ); - cmdArray[0] = (new File(unoPath, OFFICE_APP_NAME)).getPath(); + cmdArray[0] = new File(unoPath, OFFICE_APP_NAME).getPath(); cmdArray[1] = "--nologo"; cmdArray[2] = "--nodefault"; if ( mConnType.equals( "pipe" ) ) diff --git a/connectivity/qa/complex/connectivity/DBaseDriverTest.java b/connectivity/qa/complex/connectivity/DBaseDriverTest.java index 7749fde8d97d..f1c89dc70188 100644 --- a/connectivity/qa/complex/connectivity/DBaseDriverTest.java +++ b/connectivity/qa/complex/connectivity/DBaseDriverTest.java @@ -55,16 +55,16 @@ public class DBaseDriverTest extends ComplexTestCase implements TestCase public void Functions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException { - DBaseStringFunctions aStringTest = new DBaseStringFunctions((param.getMSF()), this); + DBaseStringFunctions aStringTest = new DBaseStringFunctions(param.getMSF(), this); aStringTest.testFunctions(); - DBaseNumericFunctions aNumericTest = new DBaseNumericFunctions((param.getMSF()), this); + DBaseNumericFunctions aNumericTest = new DBaseNumericFunctions(param.getMSF(), this); aNumericTest.testFunctions(); - DBaseDateFunctions aDateTest = new DBaseDateFunctions((param.getMSF()), this); + DBaseDateFunctions aDateTest = new DBaseDateFunctions(param.getMSF(), this); aDateTest.testFunctions(); - DBaseSqlTests aSqlTest = new DBaseSqlTests((param.getMSF()), this); + DBaseSqlTests aSqlTest = new DBaseSqlTests(param.getMSF(), this); aSqlTest.testFunctions(); } } diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java index 7a3b09362af8..03db63289ef1 100644 --- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java +++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java @@ -573,7 +573,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. // obtain the DataSource associated with the document. Keeping this alive // ensures that the "impl data" of the document is kept alive, too, so when closing // and re-opening it, this "impl data" must be re-used. - XDocumentDataSource dataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, (UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, databaseDoc)).getDataSource()); + XDocumentDataSource dataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, databaseDoc).getDataSource()); // close and reload the doc impl_closeDocument(databaseDoc); diff --git a/forms/qa/integration/forms/FormControlTest.java b/forms/qa/integration/forms/FormControlTest.java index eac48209ca60..773a0197afdc 100644 --- a/forms/qa/integration/forms/FormControlTest.java +++ b/forms/qa/integration/forms/FormControlTest.java @@ -669,7 +669,7 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE { try { - if ( ( "f_time" ).equals(fieldName) ) + if ( "f_time".equals(fieldName) ) // http://bugs.mysql.com/bug.php?id=5681 return true; if (fieldName == null) { diff --git a/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java b/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java index a5226e0e4199..d8d1c06779fc 100644 --- a/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java +++ b/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java @@ -767,7 +767,7 @@ public class AcceleratorsConfigurationTest private XMultiServiceFactory getMSF() { - return(UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager())); + return UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); } // setup and close connections diff --git a/framework/qa/complex/accelerators/KeyMapping.java b/framework/qa/complex/accelerators/KeyMapping.java index 79e562a39a0b..fd3637ba2a13 100644 --- a/framework/qa/complex/accelerators/KeyMapping.java +++ b/framework/qa/complex/accelerators/KeyMapping.java @@ -133,7 +133,7 @@ public class KeyMapping public short mapIdentifier2Code(String sIdentifier) { - return (aIdentifierHashMap.get(sIdentifier)).shortValue(); + return aIdentifierHashMap.get(sIdentifier).shortValue(); } public String mapCode2Identifier(short nCode) diff --git a/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java b/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java index fa3a999ad25c..2a37129d8280 100644 --- a/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java +++ b/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java @@ -61,9 +61,9 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor UnoRuntime.queryInterface(com.sun.star.container.XIndexContainer.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerContainer")); // intialize root menu entry "Help" - xRootMenuEntry.setPropertyValue("Text", ("Help")); - xRootMenuEntry.setPropertyValue("CommandURL", ("slot:5410")); - xRootMenuEntry.setPropertyValue("HelpURL", ("5410")); + xRootMenuEntry.setPropertyValue("Text", "Help"); + xRootMenuEntry.setPropertyValue("CommandURL", "slot:5410"); + xRootMenuEntry.setPropertyValue("HelpURL", "5410"); xRootMenuEntry.setPropertyValue("SubContainer", xSubMenuContainer); xRootMenuEntry.setPropertyValue("Image", myBitmap); @@ -71,9 +71,9 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor // intialize help/content menu entry // entry "Content" XPropertySet xMenuEntry = UnoRuntime.queryInterface(XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger")); - xMenuEntry.setPropertyValue("Text", ("Content")); - xMenuEntry.setPropertyValue("CommandURL", ("slot:5401")); - xMenuEntry.setPropertyValue("HelpURL", ("5401")); + xMenuEntry.setPropertyValue("Text", "Content"); + xMenuEntry.setPropertyValue("CommandURL", "slot:5401"); + xMenuEntry.setPropertyValue("HelpURL", "5401"); // insert menu entry to sub menu xSubMenuContainer.insertByIndex(0, xMenuEntry); @@ -81,18 +81,18 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor // intialize help/help agent // entry "Help Agent" xMenuEntry = UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger")); - xMenuEntry.setPropertyValue("Text", ("Help Agent")); - xMenuEntry.setPropertyValue("CommandURL", ("slot:5962")); - xMenuEntry.setPropertyValue("HelpURL", ("5962")); + xMenuEntry.setPropertyValue("Text", "Help Agent"); + xMenuEntry.setPropertyValue("CommandURL", "slot:5962"); + xMenuEntry.setPropertyValue("HelpURL", "5962"); // insert menu entry to sub menu xSubMenuContainer.insertByIndex(1, xMenuEntry); // intialize help/tips // entry "Tips" xMenuEntry = UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger")); - xMenuEntry.setPropertyValue("Text", ("Tips")); - xMenuEntry.setPropertyValue("CommandURL", ("slot:5404")); - xMenuEntry.setPropertyValue("HelpURL", ("5404")); + xMenuEntry.setPropertyValue("Text", "Tips"); + xMenuEntry.setPropertyValue("CommandURL", "slot:5404"); + xMenuEntry.setPropertyValue("HelpURL", "5404"); // insert menu entry to sub menu xSubMenuContainer.insertByIndex(2, xMenuEntry); diff --git a/framework/qa/complex/dispatches/Interceptor.java b/framework/qa/complex/dispatches/Interceptor.java index 44ba2a2a9da0..40e8f2411727 100644 --- a/framework/qa/complex/dispatches/Interceptor.java +++ b/framework/qa/complex/dispatches/Interceptor.java @@ -304,6 +304,6 @@ public class Interceptor implements XDispatch, private boolean impl_match(String sVal1, String sVal2) { // TODO implement wildcard match - return (sVal1.equals(sVal2)); + return sVal1.equals(sVal2); } } diff --git a/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java b/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java index e3280c1bb91b..25f1798fbada 100644 --- a/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java +++ b/javaunohelper/com/sun/star/lib/uno/adapter/XInputStreamToInputStreamAdapter.java @@ -118,7 +118,7 @@ public final class XInputStreamToInputStreamAdapter extends InputStream { throw newEx; } - return (bytesRead); + return bytesRead; } @Override diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java index 26d94649174a..ab2a38143423 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java @@ -126,14 +126,14 @@ public final class PropertySetMixin { idlClass = getReflection(type.getTypeName()); XTypeDescription ifc; try { - ifc = UnoRuntime.queryInterface( - XTypeDescription.class, - (UnoRuntime.queryInterface( + XHierarchicalNameAccess xhna = UnoRuntime.queryInterface( XHierarchicalNameAccess.class, context.getValueByName( "/singletons/com.sun.star.reflection." - + "theTypeDescriptionManager")). - getByHierarchicalName(type.getTypeName()))); + + "theTypeDescriptionManager")); + ifc = UnoRuntime.queryInterface( + XTypeDescription.class, + xhna.getByHierarchicalName(type.getTypeName())); } catch (NoSuchElementException e) { throw new RuntimeException(e); } @@ -636,9 +636,7 @@ public final class PropertySetMixin { break; } attrAttribs |= n; - t = (UnoRuntime.queryInterface( - XStructTypeDescription.class, t)). - getTypeArguments()[0]; + t = UnoRuntime.queryInterface(XStructTypeDescription.class, t).getTypeArguments()[0]; } String name = members[i].getMemberName(); boolean present = true; diff --git a/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java b/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java index 24187ffb1290..ac175d3a6d5d 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java @@ -78,7 +78,7 @@ public class WeakBase implements XWeak, XTypeProvider for(int i = 0; i < interfaces.length; ++ i) { // Test if it is a UNO interface - if (com.sun.star.uno.XInterface.class.isAssignableFrom((interfaces[i]))) + if (com.sun.star.uno.XInterface.class.isAssignableFrom(interfaces[i])) vec.add(new Type(interfaces[i])); } // get the superclass the currentClass inherits from diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java b/javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java index 43decf30f388..a28794434e9f 100644 --- a/javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java +++ b/javaunohelper/test/com/sun/star/lib/uno/helper/ProxyProvider.java @@ -74,11 +74,11 @@ class Proxy implements IQueryInterface, XEventListener if (object instanceof IQueryInterface) { IQueryInterface iquery = (IQueryInterface) object; - return (iquery.getOid().equals(oid)); + return iquery.getOid().equals(oid); } String oidObj = UnoRuntime.generateOid(object); - return (oidObj.equals(oid)); + return oidObj.equals(oid); } public Object queryInterface(Type type) { diff --git a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java index b7e479d271b8..b407c464261b 100644 --- a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java +++ b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java @@ -119,7 +119,7 @@ XComponent xDoc = DesktopTools.loadDoc(xMSF, FileToLoad, while (!done) { String[] HangulHanja = getLeftAndRight(counter, xSheet); - done = (HangulHanja[0].equals("")); + done = HangulHanja[0].equals(""); counter++; if (!done) { diff --git a/qadevOOo/runner/complexlib/ComplexTestCase.java b/qadevOOo/runner/complexlib/ComplexTestCase.java index 56bc0b986198..4ece6ae2b610 100644 --- a/qadevOOo/runner/complexlib/ComplexTestCase.java +++ b/qadevOOo/runner/complexlib/ComplexTestCase.java @@ -119,7 +119,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest int posLeftParenthesis = entryName.indexOf('('); if (posLeftParenthesis != -1) { - String sParameter = (entryName.substring(posLeftParenthesis + 1, entryName.indexOf(')'))); + String sParameter = entryName.substring(posLeftParenthesis + 1, entryName.indexOf(')')); mTestMethodName = entryName; parameter = new String[] { sParameter }; entryName = entryName.substring(0, posLeftParenthesis); diff --git a/qadevOOo/runner/helper/BuildEnvTools.java b/qadevOOo/runner/helper/BuildEnvTools.java index 2c10aa70cad7..b967ee7f5872 100644 --- a/qadevOOo/runner/helper/BuildEnvTools.java +++ b/qadevOOo/runner/helper/BuildEnvTools.java @@ -83,7 +83,7 @@ public class BuildEnvTools { error = true; } - mCygwin = (param.getBool(PropertyName.CYGWIN)); + mCygwin = param.getBool(PropertyName.CYGWIN); if (error) { throw new ParameterNotFoundException(msg); diff --git a/qadevOOo/runner/util/InstCreator.java b/qadevOOo/runner/util/InstCreator.java index de40b07c03b1..d517f0cd1e8c 100644 --- a/qadevOOo/runner/util/InstCreator.java +++ b/qadevOOo/runner/util/InstCreator.java @@ -88,7 +88,7 @@ public class InstCreator implements XInstCreator { XFootnotesSupplier oTTS = UnoRuntime.queryInterface( XFootnotesSupplier.class, xParent ); - return( oTTS.getFootnotes() ); + return oTTS.getFootnotes(); } if ( iDsc instanceof TextSectionDsc ) { diff --git a/qadevOOo/runner/util/ValueChanger.java b/qadevOOo/runner/util/ValueChanger.java index 008b98295f8d..ec796aec5757 100644 --- a/qadevOOo/runner/util/ValueChanger.java +++ b/qadevOOo/runner/util/ValueChanger.java @@ -153,7 +153,7 @@ public class ValueChanger { com.sun.star.style.TabAlign TA1 = com.sun.star.style.TabAlign.CENTER; com.sun.star.style.TabAlign TA2 = com.sun.star.style.TabAlign.RIGHT; - if ((TSold.Alignment).equals(TA1)) + if (TSold.Alignment.equals(TA1)) TS.Alignment = TA2; else TS.Alignment = TA1; diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index dc019a4fcbfb..2ca7351db781 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -537,7 +537,7 @@ public class utils { public static boolean isVoid(Object aObject) { if (aObject instanceof com.sun.star.uno.Any) { com.sun.star.uno.Any oAny = (com.sun.star.uno.Any) aObject; - return (oAny.getType().getTypeName().equals("void")); + return oAny.getType().getTypeName().equals("void"); } else { return false; } diff --git a/qadevOOo/tests/java/ifc/awt/_XControl.java b/qadevOOo/tests/java/ifc/awt/_XControl.java index 1dd1da4361f2..0f3c06a25e71 100644 --- a/qadevOOo/tests/java/ifc/awt/_XControl.java +++ b/qadevOOo/tests/java/ifc/awt/_XControl.java @@ -158,7 +158,7 @@ public class _XControl extends MultiMethodTest { requiredMethod("setModel()"); XControlModel the_model = (XControlModel) tEnv.getObjRelation("MODEL"); XControlModel get = oObj.getModel(); - boolean res = (get.equals(the_model)); + boolean res = get.equals(the_model); if (!res) { log.println("getting: "+get.toString()); log.println("expected: "+the_model.toString()); diff --git a/qadevOOo/tests/java/ifc/beans/_XIntrospection.java b/qadevOOo/tests/java/ifc/beans/_XIntrospection.java index c8c96edbc8b6..79d7d1767dbd 100644 --- a/qadevOOo/tests/java/ifc/beans/_XIntrospection.java +++ b/qadevOOo/tests/java/ifc/beans/_XIntrospection.java @@ -44,7 +44,7 @@ public class _XIntrospection extends MultiMethodTest { public void _inspect() { boolean result = true; XIntrospectionAccess xIA = oObj.inspect(oObj); - result = (xIA.hasMethod("acquire",1)); + result = xIA.hasMethod("acquire",1); tRes.tested("inspect()",result); } diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java index 80b96398e0dc..c74f93d7fac8 100644 --- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java +++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java @@ -155,8 +155,7 @@ public class _XMultiPropertyStates extends MultiMethodTest { the_first[0] = propName; log.println("Setting " + propName + " to default"); oObj.setPropertiesToDefault(the_first); - result = (oObj.getPropertyStates(the_first)[0].equals - (PropertyState.DEFAULT_VALUE)); + result = oObj.getPropertyStates(the_first)[0].equals(PropertyState.DEFAULT_VALUE); } catch (com.sun.star.beans.UnknownPropertyException e) { log.println("some properties seem to be unknown: " + e.toString()); } diff --git a/qadevOOo/tests/java/ifc/beans/_XPropertyState.java b/qadevOOo/tests/java/ifc/beans/_XPropertyState.java index b7df9cc7c23a..ca7337a7417a 100644 --- a/qadevOOo/tests/java/ifc/beans/_XPropertyState.java +++ b/qadevOOo/tests/java/ifc/beans/_XPropertyState.java @@ -119,7 +119,7 @@ public class _XPropertyState extends MultiMethodTest { boolean result = true ; String localName = pName; if (localName == null) { - localName = (propertySetInfo.getProperties()[0]).Name; + localName = propertySetInfo.getProperties()[0].Name; } try { propDef = oObj.getPropertyDefault(localName); @@ -147,7 +147,7 @@ public class _XPropertyState extends MultiMethodTest { String localName = pName; if (localName == null) { - localName = (propertySetInfo.getProperties()[0]).Name; + localName = propertySetInfo.getProperties()[0].Name; } try { @@ -175,7 +175,7 @@ public class _XPropertyState extends MultiMethodTest { String localName = pName; if (localName == null) { - localName = (propertySetInfo.getProperties()[0]).Name; + localName = propertySetInfo.getProperties()[0].Name; } try { diff --git a/qadevOOo/tests/java/ifc/chart/_XDiagram.java b/qadevOOo/tests/java/ifc/chart/_XDiagram.java index 3d02e7399924..de51ea2e1082 100644 --- a/qadevOOo/tests/java/ifc/chart/_XDiagram.java +++ b/qadevOOo/tests/java/ifc/chart/_XDiagram.java @@ -73,7 +73,7 @@ public class _XDiagram extends MultiMethodTest { String stype = oObj.getDiagramType(); log.println("Current Diagram Type is " + stype); - result = (stype.startsWith("com.sun.star.chart.")); + result = stype.startsWith("com.sun.star.chart."); tRes.tested("getDiagramType()", result); } diff --git a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java index d8f7610654da..686f09a9ead4 100644 --- a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java +++ b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java @@ -125,8 +125,7 @@ public class _XAcceptor extends MultiMethodTest { // creating services required try { - Object oConnector = (tParam.getMSF()). - createInstance("com.sun.star.connection.Connector") ; + Object oConnector = tParam.getMSF().createInstance("com.sun.star.connection.Connector") ; xConnector = UnoRuntime.queryInterface (XConnector.class, oConnector) ; diff --git a/qadevOOo/tests/java/ifc/i18n/_XCalendar.java b/qadevOOo/tests/java/ifc/i18n/_XCalendar.java index 102bf7fc9b28..e04595adbb8c 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XCalendar.java +++ b/qadevOOo/tests/java/ifc/i18n/_XCalendar.java @@ -324,7 +324,7 @@ public class _XCalendar extends MultiMethodTest { log.println("*** " + lang + " ... FAILED ***"); log.println(error); } - res &= (error.equals("")); + res &= error.equals(""); } tRes.tested("setValue()", res); diff --git a/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java b/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java index d94daef71f99..e7060dcb2aae 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java +++ b/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java @@ -233,7 +233,7 @@ public class _XLocaleData extends MultiMethodTest { for (int i=0;i<7;i++) { Implementation[] impl = oObj.getCollatorImplementations(getLocale(i)); for (int j=0;j aReferencedTableVector = new ArrayList(); - XResultSet xResultSet = super.getCommandMetaData().xDBMetaData.getExportedKeys((getCatalogName(this)), getSchemaName(), getTableName()); + XResultSet xResultSet = super.getCommandMetaData().xDBMetaData.getExportedKeys(getCatalogName(this), getSchemaName(), getTableName()); XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet); while (xResultSet.next()) { diff --git a/wizards/com/sun/star/wizards/document/Control.java b/wizards/com/sun/star/wizards/document/Control.java index 1b6075577cd8..17d12f0a4b32 100644 --- a/wizards/com/sun/star/wizards/document/Control.java +++ b/wizards/com/sun/star/wizards/document/Control.java @@ -189,11 +189,11 @@ public class Control extends Shape // when we change the border from "3D" to "Flat" if (getControlType() == FormHandler.SOCHECKBOX) { - return ((aPeerSize.Width * oFormHandler.getXPixelFactor())); + return aPeerSize.Width * oFormHandler.getXPixelFactor(); } else { - return ((aPeerSize.Width * oFormHandler.getXPixelFactor()) + 200); + return (aPeerSize.Width * oFormHandler.getXPixelFactor()) + 200; } } } diff --git a/wizards/com/sun/star/wizards/report/ReportFinalizer.java b/wizards/com/sun/star/wizards/report/ReportFinalizer.java index 1c1b5ef06e7d..2ed8d286f10a 100644 --- a/wizards/com/sun/star/wizards/report/ReportFinalizer.java +++ b/wizards/com/sun/star/wizards/report/ReportFinalizer.java @@ -182,7 +182,7 @@ public class ReportFinalizer } public void initialize(RecordParser _CurDBMetaData) { - String FirstCommandName = (_CurDBMetaData.getIncludedCommandNames())[0]; + String FirstCommandName = _CurDBMetaData.getIncludedCommandNames()[0]; String DefaultName = Desktop.getUniqueName(_CurDBMetaData.getReportDocuments(), FirstCommandName); if (!DefaultName.equals(OldDefaultName)) { diff --git a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java index e45c3dab97c0..c9d776140fd6 100644 --- a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java +++ b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java @@ -420,17 +420,17 @@ public class PrimaryKeyHandler implements XFieldSelectionListener } else if (optUseExisting.getState()) { - return (new String[] + return new String[] { lstSinglePrimeKey.getSelectedItem() - }); + }; } else if (optAddAutomatically.getState()) { - return (new String[] + return new String[] { SAUTOMATICKEYFIELDNAME - }); + }; } return null; } diff --git a/wizards/com/sun/star/wizards/ui/AggregateComponent.java b/wizards/com/sun/star/wizards/ui/AggregateComponent.java index 759e2f4b3f79..584ab57846a7 100644 --- a/wizards/com/sun/star/wizards/ui/AggregateComponent.java +++ b/wizards/com/sun/star/wizards/ui/AggregateComponent.java @@ -241,7 +241,7 @@ public class AggregateComponent extends ControlScroller oControlRow = ControlRowVector.get(fieldcount); oControlRow.setVisible(false); } - super.setScrollValue(getScrollValue() - 1, (fieldcount)); + super.setScrollValue(getScrollValue() - 1, fieldcount); super.unregisterControlGroup(fieldcount); } diff --git a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java index 5638da4f5fbf..738b7145a9d6 100644 --- a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java @@ -331,7 +331,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator< { return sCommandname.substring(sTablePrefix.length()); } - else if ((sCommandname.startsWith(this.sQueryPrefix))) + else if (sCommandname.startsWith(this.sQueryPrefix)) { return sCommandname.substring(sQueryPrefix.length()); } diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java index 38af3bc0f802..fd7664011c5e 100644 --- a/wizards/com/sun/star/wizards/ui/FilterComponent.java +++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java @@ -334,7 +334,7 @@ public class FilterComponent { boolean bisany = true; int ifilterstate = SOI_MATCHALL; - bisany = (this.optMatchAny.getState()); + bisany = this.optMatchAny.getState(); if (bisany) { ifilterstate = SOI_MATCHANY; @@ -722,8 +722,8 @@ public class FilterComponent Object oValue = Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "EffectiveValue"); if (!AnyConverter.isVoid(oValue)) { - String sValue = (String.valueOf(oValue)); - return (!sValue.equals(PropertyNames.EMPTY_STRING)); + String sValue = String.valueOf(oValue); + return !sValue.equals(PropertyNames.EMPTY_STRING); } } } @@ -916,7 +916,7 @@ public class FilterComponent // TODO make a difference between Text and Numbers private Object getValue() { - return (Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "EffectiveValue")); + return Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "EffectiveValue"); } diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.java b/wizards/com/sun/star/wizards/ui/UnoDialog.java index 07560e0a12cd..7801169ca035 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog.java +++ b/wizards/com/sun/star/wizards/ui/UnoDialog.java @@ -194,7 +194,7 @@ public class UnoDialog XControl xControl2 = xDlgContainer.getControl(ControlName); XView xView = UnoRuntime.queryInterface(XView.class, xControl2); Size aSize = xView.getSize(); - double dblMAPWidth = (((Integer) Helper.getUnoPropertyValue(xControl2.getModel(), PropertyNames.PROPERTY_WIDTH)).intValue()); + double dblMAPWidth = ((Integer) Helper.getUnoPropertyValue(xControl2.getModel(), PropertyNames.PROPERTY_WIDTH)).intValue(); return ((aSize.Width) / dblMAPWidth); } diff --git a/xmerge/source/bridge/java/XMergeBridge.java b/xmerge/source/bridge/java/XMergeBridge.java index 5793f4fd78a6..391232c90207 100644 --- a/xmerge/source/bridge/java/XMergeBridge.java +++ b/xmerge/source/bridge/java/XMergeBridge.java @@ -121,7 +121,7 @@ public class XMergeBridge { origName=origName.substring(origName.lastIndexOf("/")+1,origName.length()); } if (origName.lastIndexOf(".")>=0){ - name = origName.substring(0,(origName.lastIndexOf("."))); + name = origName.substring(0, origName.lastIndexOf(".")); } else{ name=origName; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java index 8d0eb79b38ca..728aa05ae120 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java @@ -228,6 +228,6 @@ public class Convert implements Cloneable { */ public Document getOfficeDocument(String name, InputStream is) throws IOException { - return(ci.getPluginFactory().createOfficeDocument(name, is)); + return ci.getPluginFactory().createOfficeDocument(name, is); } } \ No newline at end of file diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java index 2163fc658b96..786e82b77cf9 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java @@ -322,7 +322,7 @@ public class ParaStyle extends Style implements Cloneable { private void setAttribute(int attr, String value) { isSet[attr] = true; try { - this.value[attr] = (((conversionAlgorithm)algor[attr].newInstance())).I(value); + this.value[attr] = ((conversionAlgorithm)algor[attr].newInstance()).I(value); } catch (Exception e) { Debug.log(Debug.ERROR, "Instantiation error", e); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java index 8f6603a458ac..28a63cb7d713 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java @@ -89,7 +89,7 @@ public class SheetSettings implements OfficeConstants { * @return The position as a {@code Point}. */ public Point getCursor() { - return (new Point(cursorX, cursorY)); + return new Point(cursorX, cursorY); } /** @@ -124,7 +124,7 @@ public class SheetSettings implements OfficeConstants { */ public Point getSplit() { - return (new Point(splitPointX, splitPointY)); + return new Point(splitPointX, splitPointY); } /** @@ -134,7 +134,7 @@ public class SheetSettings implements OfficeConstants { */ public Point getSplitType() { - return (new Point(splitTypeX, splitTypeY)); + return new Point(splitTypeX, splitTypeY); } /** diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/CharacterBaseParagraphMerge.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/CharacterBaseParagraphMerge.java index 98c0d8a420dc..6ce425d205c7 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/CharacterBaseParagraphMerge.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/CharacterBaseParagraphMerge.java @@ -76,7 +76,7 @@ public final class CharacterBaseParagraphMerge implements NodeMergeAlgorithm { int extraChar = 0; int orgDiffCount = diffCount; - TextNodeEntry orgTextNode = (orgNodeList.get(i)); + TextNodeEntry orgTextNode = orgNodeList.get(i); Debug.log(Debug.INFO, "checking node " + (i + 1) + " of " + numNode); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java index 9cf24bf42fdf..fd39536b3082 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java @@ -95,7 +95,7 @@ public final class XmlUtil { case Node.ELEMENT_NODE: Element oldElem = (Element)newNode; String tagName = newNode.getNodeName(); - Element newElem = (docNode.createElement(tagName)); + Element newElem = docNode.createElement(tagName); // copy the attributes NamedNodeMap attrs = oldElem.getAttributes(); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java index 192777bd50b1..b549743fe308 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java @@ -260,7 +260,7 @@ public class ConverterInfo { * device mime-type. */ public Iterator getDeviceMime() { - return(piDeviceMime.iterator()); + return piDeviceMime.iterator(); } /** diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java index 09fd70f41d7a..0fd2320271dc 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java @@ -114,7 +114,7 @@ public final class ConverterInfoMgr { * exist. */ private static Iterator getConverterInfoEnumeration() { - return (converterInfoList.iterator()); + return converterInfoList.iterator(); } /** diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java index 00eaf9d8abbd..acc4d8eabc6e 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java @@ -247,6 +247,6 @@ public class ConverterInfoReader { * @return An {@code Enumeration} of {@code ConverterInfo} objects. */ public Iterator getConverterInfoEnumeration() { - return (converterInfoList.iterator()); + return converterInfoList.iterator(); } } \ No newline at end of file