Skip to main content
summaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorAlex Blewitt2016-04-19 06:35:21 -0400
committerGerrit Code Review @ Eclipse.org2016-04-19 13:35:54 -0400
commit2114f6b108763ff027fe0936e1f7b4d7e9cc655c (patch)
treeafd55872d8d3dae5de15300ef63cc6acffdc6e92 /codan
parent10ba077124e266fb7cfa661241d044a3ee91e0d3 (diff)
downloadorg.eclipse.cdt-2114f6b108763ff027fe0936e1f7b4d7e9cc655c.tar.gz
org.eclipse.cdt-2114f6b108763ff027fe0936e1f7b4d7e9cc655c.tar.xz
org.eclipse.cdt-2114f6b108763ff027fe0936e1f7b4d7e9cc655c.zip
Bug 491984 - Replace .equals("") with .isEmpty()
In many cases a String's empty status is tested with `.equals("")`. However, Java 1.6 added `.isEmpty()` which can be more efficient since it compares the internal length parameter only for testing. Replace code using the `.isEmpty()` variant instead. Some tests for `"".equals(expr)` can be replaced with `expr.isEmpty()` where it is already known that the `expr` is not null; however, these have to be reviewed on a case-by-case basis. Change-Id: I3c6af4d8b7638e757435914ac76cb3a67899a5fd Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java b/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java
index eb6f492f0c..11d393da2c 100644
--- a/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java
+++ b/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 QNX Software Systems and others.
+ * Copyright (c) 2010, 2016 QNX Software Systems 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
@@ -355,7 +355,7 @@ public class ControlFlowGraphView extends ViewPart {
}
protected boolean open(String filename) throws PartInitException, CModelException {
- if (filename.equals(""))
+ if (filename.isEmpty())
return false;
IResource r = ParserUtil.getResourceForFilename(filename);
if (r != null) {

Back to the top