diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-13 10:19:51 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-20 10:35:53 +0200 |
commit | 60f152caeee38579433a31dd3a98e91dc3d23ff6 (patch) | |
tree | 15ba69f938e09bb173ca7de2e1b21b62e740ea40 /scripting | |
parent | 2922a967a1da5f9c0a07b5390906307d0ae6fe48 (diff) |
java: avoid unnecessary comparisons in boolean expressions
i.e. stuff like "x == true"
Change-Id: Ib82a4a30e736df392405332fa197b588482cffcf
Diffstat (limited to 'scripting')
33 files changed, 74 insertions, 75 deletions
diff --git a/scripting/examples/java/Highlight/HighlightText.java b/scripting/examples/java/Highlight/HighlightText.java index 8da530161ae7..6ed77aec6821 100644 --- a/scripting/examples/java/Highlight/HighlightText.java +++ b/scripting/examples/java/Highlight/HighlightText.java @@ -80,8 +80,8 @@ public class HighlightText implements com.sun.star.awt.XActionListener { } if (findDialog == null) { - if (tryLoadingLibrary(xmcf, context, "Dialog") == false || - tryLoadingLibrary(xmcf, context, "Script") == false) + if (!tryLoadingLibrary(xmcf, context, "Dialog") || + !tryLoadingLibrary(xmcf, context, "Script")) { System.err.println("Error loading ScriptBindingLibrary"); return; diff --git a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java index b1bdfff645ad..a1088260f470 100644 --- a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java +++ b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java @@ -345,7 +345,7 @@ XInitialization { xNameCont.insertByName( _label4Name, label4Model ); xNameCont.insertByName( _checkBoxName, checkBoxModel ); - if ( extraPathLine == true ) + if ( extraPathLine ) { // create the label model and set the properties Object label5Model = xMultiServiceFactory.createInstance( diff --git a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java index c2f966cbd23f..3500ab0b1d16 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java @@ -184,7 +184,7 @@ public class ParcelBrowseNode extends PropertySet String newName; if (aParams == null || aParams.length < 1 || - AnyConverter.isString(aParams[0]) == false) + !AnyConverter.isString(aParams[0])) { String prompt = "Enter name for new Script"; String title = "Create Script"; @@ -269,7 +269,7 @@ public class ParcelBrowseNode extends PropertySet { if (aParams == null || aParams.length < 1 || - AnyConverter.isString(aParams[0]) == false) + !AnyConverter.isString(aParams[0])) { String prompt = "Enter new name for Library"; String title = "Rename Library"; diff --git a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java index 5bb65b861f29..7722ce45faad 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java @@ -183,7 +183,7 @@ public class ProviderBrowseNode extends PropertySet String name; if (aParams == null || aParams.length < 1 || - AnyConverter.isString(aParams[0]) == false) + !AnyConverter.isString(aParams[0])) { String prompt = "Enter name for new Parcel"; String title = "Create Parcel"; diff --git a/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java index 1e5df7130dec..5c744b1bdcd6 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java @@ -83,7 +83,7 @@ public class ScriptBrowseNode extends PropertySet LogUtils.DEBUG("** caught exception getting script data for " + name + " ->" + e.toString() ); } - if (provider.hasScriptEditor() == true) + if (provider.hasScriptEditor()) { this.editable = true; diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java index 5b0209a32c4d..09535b48880f 100644 --- a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java +++ b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java @@ -193,7 +193,7 @@ public abstract class ScriptProvider contextUrl = getDocUrlFromModel( m_xModel ); m_container = new ParcelContainer( m_xContext, contextUrl, language ); } - else if (AnyConverter.isString(aArguments[0]) == true) + else if (AnyConverter.isString(aArguments[0])) { String originalContextURL = AnyConverter.toString(aArguments[0]); LogUtils.DEBUG("creating Application, path: " + originalContextURL ); diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java index 7c216e494fbb..bd8f01c9193a 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/PlainSourceView.java @@ -55,7 +55,7 @@ public class PlainSourceView extends JScrollPane so we don't get a storm of DocumentEvents during loading */ ta.getDocument().removeDocumentListener(this); - if (isModified == false) + if (!isModified) { int pos = ta.getCaretPosition(); ta.setText(model.getText()); diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java index 34061c473847..b66171fd9a26 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java @@ -314,7 +314,7 @@ public class ScriptEditorForBeanShell else if (result == JOptionPane.YES_OPTION) { boolean saveSuccess = saveTextArea(); - if (saveSuccess == false) + if (!saveSuccess) { return; } diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java index 208ee4766d67..00d2ab679290 100644 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java @@ -224,7 +224,7 @@ class ScriptImpl implements XScript } - if (editor != null && editor.isModified() == true) + if (editor != null && editor.isModified()) { LogUtils.DEBUG("GOT A MODIFIED SOURCE"); source = editor.getText(); diff --git a/scripting/java/org/openoffice/idesupport/CommandLineTools.java b/scripting/java/org/openoffice/idesupport/CommandLineTools.java index 5cb8d5f51b55..0b4747d1ccf9 100644 --- a/scripting/java/org/openoffice/idesupport/CommandLineTools.java +++ b/scripting/java/org/openoffice/idesupport/CommandLineTools.java @@ -63,7 +63,7 @@ public class CommandLineTools { } File officeDir = new File(officePath); - if (officeDir.exists() == false || officeDir.isDirectory() == false) + if (!officeDir.exists() || !officeDir.isDirectory()) { driver.fatalUsage( "Error: Office Installation path not valid: " + officePath); @@ -249,20 +249,20 @@ public class CommandLineTools { public void execute() throws Exception { - if (basedir.isDirectory() != true) { + if (!basedir.isDirectory()) { throw new Exception(basedir.getName() + " is not a directory"); } - else if (contents.exists() != true) { + else if (!contents.exists()) { throw new Exception(basedir.getName() + " does not contain a Contents directory"); } - if (language == null && parcelxml.exists() == false) { + if (language == null && !parcelxml.exists()) { throw new Exception(parcelxml.getName() + " not found and language " + "not specified"); } - if (language != null && parcelxml.exists() == true) { + if (language != null && parcelxml.exists()) { ParcelDescriptor desc; String desclang = ""; @@ -308,7 +308,7 @@ public class CommandLineTools { desc.write(); } else { - if (parcelxml.exists() == false) + if (!parcelxml.exists()) throw new Exception("No valid scripts found"); } diff --git a/scripting/java/org/openoffice/idesupport/ExtensionFinder.java b/scripting/java/org/openoffice/idesupport/ExtensionFinder.java index bf39f2e519d1..0fa051c5af67 100644 --- a/scripting/java/org/openoffice/idesupport/ExtensionFinder.java +++ b/scripting/java/org/openoffice/idesupport/ExtensionFinder.java @@ -39,8 +39,8 @@ public class ExtensionFinder implements MethodFinder { ArrayList<ScriptEntry> files = new ArrayList<ScriptEntry>(10); ScriptEntry[] empty = new ScriptEntry[0]; - if (basedir == null || basedir.exists() == false || - basedir.isDirectory() == false) + if (basedir == null || !basedir.exists() || + !basedir.isDirectory()) return empty; parcelName = basedir.getName(); diff --git a/scripting/java/org/openoffice/idesupport/JavaFinder.java b/scripting/java/org/openoffice/idesupport/JavaFinder.java index 1594b9fd37c5..f21cf3b52338 100644 --- a/scripting/java/org/openoffice/idesupport/JavaFinder.java +++ b/scripting/java/org/openoffice/idesupport/JavaFinder.java @@ -60,8 +60,8 @@ public class JavaFinder implements MethodFinder { ArrayList<ScriptEntry> result = new ArrayList<ScriptEntry>(10); ScriptEntry[] empty = new ScriptEntry[0]; - if (basedir == null || basedir.exists() == false || - basedir.isDirectory() == false) + if (basedir == null || !basedir.exists() || + !basedir.isDirectory()) return empty; parcelName = basedir.getName(); @@ -213,7 +213,7 @@ public class JavaFinder implements MethodFinder { boolean finished = false; - for (int j = 0; j < javaFiles.size() && finished == false; j++) + for (int j = 0; j < javaFiles.size() && !finished; j++) { File javaFile = javaFiles.get(j); String javaName = javaFile.getName(); diff --git a/scripting/java/org/openoffice/idesupport/SVersionRCFile.java b/scripting/java/org/openoffice/idesupport/SVersionRCFile.java index 30ad0bb81aca..a6a841f3b7cb 100644 --- a/scripting/java/org/openoffice/idesupport/SVersionRCFile.java +++ b/scripting/java/org/openoffice/idesupport/SVersionRCFile.java @@ -31,14 +31,14 @@ import java.util.StringTokenizer; public class SVersionRCFile { private static final String DEFAULT_NAME = - System.getProperty("os.name").startsWith("Windows") == true ? + System.getProperty("os.name").startsWith("Windows") ? System.getProperty("user.home") + File.separator + "Application Data" + File.separator + "sversion.ini" : System.getProperty("user.home") + File.separator + ".sversionrc"; public static final String FILE_URL_PREFIX = - System.getProperty("os.name").startsWith("Windows") == true ? + System.getProperty("os.name").startsWith("Windows") ? "file:///" : "file://"; @@ -124,10 +124,10 @@ public class SVersionRCFile { String s; while ((s = br.readLine()) != null && - (s.equals(VERSIONS_LINE)) != true) {} + !(s.equals(VERSIONS_LINE))) {} while ((s = br.readLine()) != null && - (s.equals("")) != true) { + !(s.equals(""))) { StringTokenizer tokens = new StringTokenizer(s, "="); int count = tokens.countTokens(); diff --git a/scripting/java/org/openoffice/idesupport/xml/Manifest.java b/scripting/java/org/openoffice/idesupport/xml/Manifest.java index 581cadae51d6..263de3d97b29 100644 --- a/scripting/java/org/openoffice/idesupport/xml/Manifest.java +++ b/scripting/java/org/openoffice/idesupport/xml/Manifest.java @@ -66,7 +66,7 @@ public class Manifest { } private void ensureBaseElementsExist() { - if (baseElementsExist == false) { + if (!baseElementsExist) { baseElementsExist = true; add("Scripts/", "application/script-parcel"); } diff --git a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java index e1e12fa56d83..9fd7f5da00fd 100644 --- a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java +++ b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java @@ -95,7 +95,7 @@ public class ParcelZipper manifestStream.close(); } } - else if (inEntry.isDirectory() == false) { + else if (!inEntry.isDirectory()) { while ((len = documentStream.read(bytes)) != -1) outStream.write(bytes, 0, len); } @@ -115,7 +115,7 @@ public class ParcelZipper outStream.close(); } - if (document.delete() == false) { + if (!document.delete()) { tmpfile.delete(); throw new IOException("Could not overwrite " + document); } diff --git a/scripting/java/org/openoffice/netbeans/editor/NetBeansSourceView.java b/scripting/java/org/openoffice/netbeans/editor/NetBeansSourceView.java index 1abbafdb6329..b4b2bd8d4fa3 100644 --- a/scripting/java/org/openoffice/netbeans/editor/NetBeansSourceView.java +++ b/scripting/java/org/openoffice/netbeans/editor/NetBeansSourceView.java @@ -151,7 +151,7 @@ public class NetBeansSourceView extends JPanel so we don't get a storm of DocumentEvents during loading */ pane.getDocument().removeDocumentListener(this); - if (isModified == false) + if (!isModified) { pane.setText(model.getText()); } diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java index e7da54240c71..015c15cfb54b 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java @@ -85,7 +85,7 @@ public class DeployParcelAction extends CookieAction implements Presenter.Popup if (!langdir.exists()) { boolean response = askIfCreateDirectory(langdir); - if (response == false) { + if (!response) { return; } } @@ -141,7 +141,7 @@ public class DeployParcelAction extends CookieAction implements Presenter.Popup public void run() { boolean result = parcelCookie.deploy(target); - if (result == true && target.isDirectory()) { + if (result && target.isDirectory()) { showNagDialog(); } } @@ -167,7 +167,7 @@ public class DeployParcelAction extends CookieAction implements Presenter.Popup result = false; } - if (result == false) { + if (!result) { String tmp = "Error creating: " + directory.getAbsolutePath(); NotifyDescriptor d2 = new NotifyDescriptor.Message( tmp, NotifyDescriptor.ERROR_MESSAGE); @@ -190,13 +190,13 @@ public class DeployParcelAction extends CookieAction implements Presenter.Popup OfficeSettings settings = OfficeSettings.getDefault(); - if (settings.getWarnAfterDirDeploy() == true) { + if (settings.getWarnAfterDirDeploy()) { NagDialog warning = NagDialog.createInformationDialog( message, "Show this message in future", true); warning.show(); - if (warning.getState() == false) + if (!warning.getState()) settings.setWarnAfterDirDeploy(false); } } diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java index b8fe3e6226e4..bf310bc8b2c0 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelFolderSupport.java @@ -131,7 +131,7 @@ public class ParcelFolderSupport implements ParcelFolderCookie parcelBase.getName() + "." + ParcelZipper.PARCEL_EXTENSION); boolean proceed = configure(); - if (proceed == false) { + if (!proceed) { return; } diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelSupport.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelSupport.java index a019622dbe2c..2cfd316cddde 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelSupport.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/ParcelSupport.java @@ -96,16 +96,16 @@ public class ParcelSupport implements ParcelCookie "Office, please close it before continuing. Click OK to " + "continue deployment."; - if (settings.getWarnBeforeDocDeploy() == true) { + if (settings.getWarnBeforeDocDeploy()) { NagDialog warning = NagDialog.createConfirmationDialog( message, "Show this message in future", true); boolean result = warning.show(); - if (warning.getState() == false) + if (!warning.getState()) settings.setWarnBeforeDocDeploy(false); - if (result == false) + if (!result) return false; } } @@ -114,8 +114,8 @@ public class ParcelSupport implements ParcelCookie getOutputWindowWriter(fo.getName() + " (deploying)"); try { - if (zipper.isOverwriteNeeded(source, target) == true) - if (promptForOverwrite(source, target) == false) + if (!zipper.isOverwriteNeeded(source, target)) + if (!promptForOverwrite(source, target)) return false; } catch (IOException ioe) { diff --git a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystem.java b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystem.java index 1a73873cb243..4ec771869fb5 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystem.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystem.java @@ -166,7 +166,7 @@ public class OpenOfficeDocFileSystem throws java.beans.PropertyVetoException, java.io.IOException { System.out.println("OpenOfficeDocFileSystem.setDocument: file=\"" + file.toString() + "\""); - if((file.exists() == false) || (file.isFile() == false)) { + if(!file.exists() || !file.isFile()) { IOException ioe = new IOException( file.toString() + " does not exist"); ErrorManager.getDefault().annotate(ioe, NbBundle.getMessage( @@ -372,8 +372,7 @@ System.out.println(" exception: " + ioe.getMessage()); synchronized(cache) { ModifiedStrategy modifiedStrategy = new ModifiedStrategy(); scanDocument(modifiedStrategy); - if((isModified == true) || - (modifiedStrategy.isModified() == true)) + if(isModified || modifiedStrategy.isModified()) { File tmpFile = null; try { @@ -448,7 +447,7 @@ System.out.println(" exception: " + ioe.getMessage()); ZipEntry zEntry = new ZipEntry(name); zEntry.setTime(new Date().getTime()); cEntry = new Entry(zEntry); - if(editableStrategy.evaluate(cEntry) == false) { + if(!editableStrategy.evaluate(cEntry)) { throw new IOException( "cannot create/edit readonly file"); // I18N } @@ -478,7 +477,7 @@ System.out.println(" exception: " + ioe.getMessage()); zEntry.setCrc(crc.getValue()); zEntry.setTime(new Date().getTime()); cEntry = new Entry(zEntry); - if(editableStrategy.evaluate(cEntry) == false) { + if(!editableStrategy.evaluate(cEntry)) { throw new IOException( "cannot create folder"); // I18N } @@ -487,7 +486,7 @@ System.out.println(" exception: " + ioe.getMessage()); cache.put(cEntry.getName(), cEntry); isModified = true; } else { - if(cEntry.isFolder() == false) + if(!cEntry.isFolder()) cEntry = null; } } // synchronized @@ -669,12 +668,12 @@ System.out.println(" exception: " + ioe.getMessage()); throw new IOException( "there is no such a file/folder " + oldName); // I18N } - if(entry.isReadOnly() == true) { + if(entry.isReadOnly()) { throw new IOException( "file/folder " + oldName + " is readonly"); // I18N } entry.rename(nname); - if(editableStrategy.evaluate(entry) == false) { + if(!editableStrategy.evaluate(entry)) { entry.rename(oname); throw new IOException( "cannot create file/folder"); // I18N @@ -833,7 +832,7 @@ System.out.println(" exception: " + ioe.getMessage()); { // do not accept "children" of a file // ignore "read only" part of the filesystem - if(entry.isReadOnly() == false) { + if(!entry.isReadOnly()) { // identify a child if( (entry.getName().length() > 0) && (entry.getName().startsWith(parent))) @@ -972,7 +971,7 @@ System.out.println(" exception: " + ioe.getMessage()); size = entry.getSize(); time = entry.getTime(); // removes tail file separator from a folder name - if((folder == true) && (name.endsWith(SEPARATOR))) { + if(folder && name.endsWith(SEPARATOR)) { name = name.substring( 0, name.length() - SEPARATOR.length()); } @@ -1019,7 +1018,7 @@ System.out.println(" exception: " + ioe.getMessage()); public InputStream getInputStream() throws FileNotFoundException { - return (isFolder() == false)? new FileInputStream(getFile()): null; + return !isFolder() ? new FileInputStream(getFile()) : null; } public OutputStream getOutputStream() @@ -1053,7 +1052,7 @@ System.out.println(" exception: " + ioe.getMessage()); arch.putNextEntry(entry); } else { // file - if(isModified() == false) + if(!isModified()) entry.setTime(getTime()); else entry.setTime(node.lastModified()); @@ -1171,7 +1170,7 @@ System.out.println(" exception: " + ioe.getMessage()); throws IOException { modified = true; - return (isFolder() == false)? new FileOutputStream(getFile()): null; + return !isFolder() ? new FileOutputStream(getFile()) : null; } } } diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataLoader.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataLoader.java index 968173dcefc1..d47481ec39d5 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataLoader.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataLoader.java @@ -59,7 +59,7 @@ public class OfficeDocumentDataLoader extends UniFileLoader { protected FileObject findPrimaryFile(FileObject fo) { ExtensionList extensions = getExtensions(); - if (extensions.isRegistered(fo) == false) + if (!extensions.isRegistered(fo)) return null; File document = FileUtil.toFile(fo); diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelContentsFolderDataLoader.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelContentsFolderDataLoader.java index ced430b451ea..4406f3f903c8 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelContentsFolderDataLoader.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelContentsFolderDataLoader.java @@ -45,8 +45,8 @@ public class ParcelContentsFolderDataLoader extends UniFileLoader { } protected FileObject findPrimaryFile(FileObject fo) { - if (fo.isFolder() == false || - fo.getName().equals(ParcelZipper.CONTENTS_DIRNAME) == false || + if (!fo.isFolder() || + !fo.getName().equals(ParcelZipper.CONTENTS_DIRNAME) || fo.getFileObject(ParcelZipper.PARCEL_DESCRIPTOR_XML) == null) return null; diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDataNode.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDataNode.java index a6634a28a948..5865f32c2803 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDataNode.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDataNode.java @@ -66,7 +66,7 @@ public class ParcelDataNode extends DataNode { (ParcelCookie)sourceParcel.getCookie(ParcelCookie.class); parcelCookie.deploy(targetDocument); - if (isCut == true) { + if (isCut) { FileObject fo = sourceParcel.getDataObject().getPrimaryFile(); try { fo.delete(); diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDescriptorDataObject.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDescriptorDataObject.java index bf392a4ecd39..c344830b1c27 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDescriptorDataObject.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDescriptorDataObject.java @@ -46,7 +46,7 @@ public class ParcelDescriptorDataObject extends MultiDataObject { CookieSet cookies = getCookieSet(); cookies.add(new ParcelDescriptorEditorSupport(this)); - if (canParse == true) + if (canParse) cookies.add(new ParcelDescriptorParserSupport(getPrimaryFile())); } @@ -55,7 +55,7 @@ public class ParcelDescriptorDataObject extends MultiDataObject { } protected Node createNodeDelegate() { - if (canParse == true) + if (canParse) return new ParcelDescriptorDataNode(this); else return new ParcelDescriptorDataNode(this, Children.LEAF); diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolderDataLoader.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolderDataLoader.java index 3b435fe5b17d..df60b27561c1 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolderDataLoader.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolderDataLoader.java @@ -52,7 +52,7 @@ public class ParcelFolderDataLoader extends UniFileLoader { } protected FileObject findPrimaryFile(FileObject fo) { - if (fo.isFolder() == false) + if (!fo.isFolder()) return null; FileObject contents = fo.getFileObject(ParcelZipper.CONTENTS_DIRNAME); diff --git a/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java b/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java index c65a00f33f5d..e5b0e900162b 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java @@ -48,7 +48,7 @@ public class OfficeDocumentChildren extends Children.Keys } Enumeration parcels = document.getParcels(); - if (parcels.hasMoreElements() != true) { + if (!parcels.hasMoreElements()) { setKeys(Collections.EMPTY_SET); return; } @@ -119,16 +119,16 @@ public class OfficeDocumentChildren extends Children.Keys "Office, please close it before continuing. Click OK to " + "delete this parcel."; - if (settings.getWarnBeforeParcelDelete() == true) { + if (settings.getWarnBeforeParcelDelete()) { NagDialog warning = NagDialog.createConfirmationDialog( message, "Show this message in future", true); boolean result = warning.show(); - if (warning.getState() == false) + if (!warning.getState()) settings.setWarnBeforeParcelDelete(false); - if (result == false) + if (!result) return; } super.destroy(); diff --git a/scripting/java/org/openoffice/netbeans/modules/office/utils/FrameworkJarChecker.java b/scripting/java/org/openoffice/netbeans/modules/office/utils/FrameworkJarChecker.java index de74e8b181d3..b26b729455bf 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/utils/FrameworkJarChecker.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/utils/FrameworkJarChecker.java @@ -111,7 +111,7 @@ public class FrameworkJarChecker { private static void warnBeforeMount() { OfficeSettings settings = OfficeSettings.getDefault(); - if (settings.getWarnBeforeMount() == false) + if (!settings.getWarnBeforeMount()) return; String message = "The Office Scripting Framework support jar file " + @@ -123,7 +123,7 @@ public class FrameworkJarChecker { NagDialog warning = NagDialog.createInformationDialog( message, prompt, true); - if (warning.getState() == false) { + if (!warning.getState()) { settings.setWarnBeforeMount(false); } } diff --git a/scripting/java/org/openoffice/netbeans/modules/office/utils/PackageRemover.java b/scripting/java/org/openoffice/netbeans/modules/office/utils/PackageRemover.java index 260b83bac0fb..270b30fde9d9 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/utils/PackageRemover.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/utils/PackageRemover.java @@ -62,7 +62,7 @@ public class PackageRemover { } } - if (source.delete() == false) { + if (!source.delete()) { tmp.delete(); throw new IOException("Could not overwrite " + source); } diff --git a/scripting/workben/installer/IdeUpdater.java b/scripting/workben/installer/IdeUpdater.java index fe7b700d237d..b35b519abbe3 100644 --- a/scripting/workben/installer/IdeUpdater.java +++ b/scripting/workben/installer/IdeUpdater.java @@ -44,7 +44,7 @@ public class IdeUpdater extends Thread { public IdeUpdater(String installPath, JLabel statusLabel, JProgressBar pBar) { - if (installPath.endsWith(File.separator) == false) + if (!installPath.endsWith(File.separator)) installPath += File.separator; File netbeansLauncher = new File( installPath + "bin" ); diff --git a/scripting/workben/installer/IdeVersion.java b/scripting/workben/installer/IdeVersion.java index 65b18f61338f..b75d5b38a04e 100644 --- a/scripting/workben/installer/IdeVersion.java +++ b/scripting/workben/installer/IdeVersion.java @@ -155,7 +155,7 @@ public class IdeVersion extends javax.swing.JPanel implements ActionListener, Ta int len = tableModel.data.size(); for (int i = 0; i < len; i++) { ArrayList<?> list = tableModel.data.get(i); - if (((Boolean)list.get(0)).booleanValue() == true) + if (((Boolean)list.get(0)).booleanValue()) InstallWizard.storeLocation((String)list.get(2)); } } @@ -319,7 +319,7 @@ class MyTableModelIDE extends AbstractTableModel { Iterator iter = data.iterator(); while (iter.hasNext()) { ArrayList<?> row = (ArrayList<?>)iter.next(); - if (((Boolean)row.get(0)).booleanValue() == true) { + if (((Boolean)row.get(0)).booleanValue()) { return true; } } diff --git a/scripting/workben/installer/InstUtil.java b/scripting/workben/installer/InstUtil.java index 703871dd67c7..d9bab179344f 100644 --- a/scripting/workben/installer/InstUtil.java +++ b/scripting/workben/installer/InstUtil.java @@ -67,7 +67,7 @@ public class InstUtil { boolean result = false; result = checkForSupportedVersion( getNetbeansLocation(), versions ); - if (result == false) + if (!result) System.out.println("No supported version of NetBeans found."); return result; } diff --git a/scripting/workben/installer/Version.java b/scripting/workben/installer/Version.java index 37bc7dde043c..4d125dee8fe6 100644 --- a/scripting/workben/installer/Version.java +++ b/scripting/workben/installer/Version.java @@ -215,7 +215,7 @@ public class Version extends javax.swing.JPanel implements ActionListener, Table int len = tableModel.data.size(); for (int i = 0; i < len; i++) { ArrayList<?> list = tableModel.data.get(i); - if (((Boolean)list.get(0)).booleanValue() == true) + if (((Boolean)list.get(0)).booleanValue()) InstallWizard.storeLocation((String)list.get(2)); } } @@ -334,7 +334,7 @@ class MyTableModel extends AbstractTableModel { Iterator iter = data.iterator(); while (iter.hasNext()) { ArrayList<?> row = (ArrayList<?>)iter.next(); - if (((Boolean)row.get(0)).booleanValue() == true) { + if (((Boolean)row.get(0)).booleanValue()) { return true; } } diff --git a/scripting/workben/installer/ZipData.java b/scripting/workben/installer/ZipData.java index abdf8a6641c2..466f87a6e863 100644 --- a/scripting/workben/installer/ZipData.java +++ b/scripting/workben/installer/ZipData.java @@ -56,7 +56,7 @@ public class ZipData { System.out.println("Unzipping " + entry + " to " + destination); - if (entry.startsWith("/") == false) + if (!entry.startsWith("/")) entry = "/" + entry; in = this.getClass().getResourceAsStream(entry); |