Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-11-26 22:21:49 +0000
committerKarsten Thoms2019-12-12 11:23:34 +0000
commit8ec8c931c0ff5ee2c495a72f8d025a42cf53b003 (patch)
treef88d7e841feda0fe850f8276f5dadf3a7aaf17e5
parent6afb3af14227fd1b3b5b2bd584d931d5dc2b9a61 (diff)
downloadeclipse.platform.ua-8ec8c931c0ff5ee2c495a72f8d025a42cf53b003.tar.gz
eclipse.platform.ua-8ec8c931c0ff5ee2c495a72f8d025a42cf53b003.tar.xz
eclipse.platform.ua-8ec8c931c0ff5ee2c495a72f8d025a42cf53b003.zip
Use .isEmpty() instead of .size()==0 or .equals("")
Change-Id: I795082af563324917ba37929eb8a4dbc74ed7ce8 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/PreferenceFileHandler.java2
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/base/scope/ScopeRegistry.java6
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/search/IndexingOperation.java9
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/search/PrebuiltIndexes.java2
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java2
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java2
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java2
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/SearchData.java2
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/TopicFinder.java6
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/WorkingSetManagerData.java2
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/parser/AboutParser.java2
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java2
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java2
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java2
-rw-r--r--org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/CheckTocAction.java2
-rw-r--r--org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/LoadTocAction.java2
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java2
-rw-r--r--org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java2
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java2
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java2
-rw-r--r--org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java2
-rw-r--r--org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java4
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java2
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java2
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartLocationListener.java2
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java2
29 files changed, 40 insertions, 41 deletions
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/PreferenceFileHandler.java b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/PreferenceFileHandler.java
index 589d741b4..3434182da 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/PreferenceFileHandler.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/PreferenceFileHandler.java
@@ -95,7 +95,7 @@ public class PreferenceFileHandler {
String [] currEntries;
String [] updatedArray=null;
- if(!preferenceEntry.equals("")) //$NON-NLS-1$
+ if(!preferenceEntry.isEmpty())
currEntries=preferenceEntry.split(PREFERENCE_ENTRY_DELIMITER);
else
currEntries = new String[0];
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/base/scope/ScopeRegistry.java b/org.eclipse.help.base/src/org/eclipse/help/internal/base/scope/ScopeRegistry.java
index cc143d45a..35bf98fc1 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/base/scope/ScopeRegistry.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/base/scope/ScopeRegistry.java
@@ -121,7 +121,7 @@ public class ScopeRegistry {
scopes.add(scope);
}
- if (scopes.size()==0)
+ if (scopes.isEmpty())
return null;
if (scopes.size()==1)
return scopes.get(0);
@@ -219,14 +219,14 @@ public class ScopeRegistry {
return format(next,current);
next+=current;
}
- if (next.equals("")) //$NON-NLS-1$
+ if (next.isEmpty())
return null;
return next;
}
private String format(String next,char current)
{
- if (next.equals("")) //$NON-NLS-1$
+ if (next.isEmpty())
{
cursor++;
return current+""; //$NON-NLS-1$
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/IndexingOperation.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/IndexingOperation.java
index e2d18dbcb..0f27a0a42 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/IndexingOperation.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/IndexingOperation.java
@@ -104,8 +104,7 @@ class IndexingOperation {
removeStaleDocuments(subMonitor.split(numRemoved), staleDocs);
checkCancelled(pm);
// 2. merge prebult plugin indexes and addjust
- addNewDocuments(subMonitor.split(10 * numAdded), newDocs,
- staleDocs.size() == 0);
+ addNewDocuments(subMonitor.split(10 * numAdded), newDocs, staleDocs.isEmpty());
pm.done();
BaseHelpSystem.getLocalSearchManager().clearSearchParticipants();
@@ -156,7 +155,7 @@ class IndexingOperation {
Map<String, String[]> docsToDelete = calculateNewToRemove(newDocs, prebuiltDocs);
SubMonitor subMonitor = SubMonitor.convert(pm, 10 * docsToIndex.size() + docsToDelete.size());
checkCancelled(pm);
- addDocuments(subMonitor.split(10 * docsToIndex.size()), docsToIndex, docsToDelete.size() == 0);
+ addDocuments(subMonitor.split(10 * docsToIndex.size()), docsToIndex, docsToDelete.isEmpty());
checkCancelled(pm);
removeNewDocuments(subMonitor.split(docsToDelete.size()), docsToDelete);
pm.done();
@@ -195,7 +194,7 @@ class IndexingOperation {
*/
private void removeNewDocuments(IProgressMonitor pm, Map<String, String[]> docsToDelete)
throws IndexingException {
- if (docsToDelete.size() == 0) {
+ if (docsToDelete.isEmpty()) {
return;
}
pm = new LazyProgressMonitor(pm);
@@ -463,7 +462,7 @@ class IndexingOperation {
private void add(String href, Set<String> hrefs) {
if (href != null
- && !href.equals("") && !href.startsWith("http://") && !href.startsWith("https://")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ && !href.isEmpty() && !href.startsWith("http://") && !href.startsWith("https://")) //$NON-NLS-1$ //$NON-NLS-2$
hrefs.add(href);
}
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/PrebuiltIndexes.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/PrebuiltIndexes.java
index cc2e973f5..8ab74ed9e 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/PrebuiltIndexes.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/PrebuiltIndexes.java
@@ -46,7 +46,7 @@ public class PrebuiltIndexes {
List<PluginIndex> indexes = new ArrayList<>(set);
for (int i = 0; i < indexes.size();) {
PluginIndex index = indexes.get(i);
- if (index.getPaths().size() == 0) {
+ if (index.getPaths().isEmpty()) {
set.remove(index);
}
i++;
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java
index f8627ea40..1b676a2d5 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java
@@ -260,7 +260,7 @@ public class QueryBuilder {
// Get queries for parts separated by OR
List<Query> requiredQueries = getRequiredQueries(searchTokens, fieldNames,
boosts);
- if (requiredQueries.size() == 0)
+ if (requiredQueries.isEmpty())
return null;
else if (requiredQueries.size() <= 1)
return requiredQueries.get(0);
diff --git a/org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java b/org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java
index 73846edda..6e29ee7c5 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java
@@ -536,7 +536,7 @@ public class HelpIndexBuilder {
href = getAttribute(topic, "topic"); //$NON-NLS-1$
}
if (href != null
- && !href.equals("") && !href.startsWith("http://") && !href.startsWith("https://")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ && !href.isEmpty() && !href.startsWith("http://") && !href.startsWith("https://")) { //$NON-NLS-1$ //$NON-NLS-2$
href = SearchIndex.getIndexableHref(href);
if (href != null)
hrefs.add(href);
@@ -545,7 +545,7 @@ public class HelpIndexBuilder {
for (int i = 0; i < subtopics.getLength(); i++) {
Element subtopic = (Element) subtopics.item(i);
href = getAttribute(subtopic, "href"); //$NON-NLS-1$
- if (href != null && !href.equals("") && !href.startsWith("http://") && !href.startsWith("https://")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (href != null && !href.isEmpty() && !href.startsWith("http://") && !href.startsWith("https://")) { //$NON-NLS-1$ //$NON-NLS-2$
href = SearchIndex.getIndexableHref(href);
if (href != null)
hrefs.add(href);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java
index a646d604e..e8873ca57 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java
@@ -102,7 +102,7 @@ public class StyledLineWrapper implements StyledTextContent {
@Override
public int getLineCount() {
- if (lines.size() == 0)
+ if (lines.isEmpty())
return 1;
return lines.size();
}
@@ -114,7 +114,7 @@ public class StyledLineWrapper implements StyledTextContent {
@Override
public int getOffsetAtLine(int line) {
- if (lines.size() == 0)
+ if (lines.isEmpty())
return 0;
int offset = 0;
for (int i = 0; i < line; i++)
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java
index 287e20e3c..c2492604b 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java
@@ -84,7 +84,7 @@ public class ICPreferences {
for (int i=0;i<names.length;i++)
{
- if (!names[i].equals("")) //$NON-NLS-1$
+ if (!names[i].isEmpty())
{
try {
IC ic = new IC(
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java
index 0886cd534..c7cc5c6a3 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java
@@ -244,12 +244,12 @@ public class EngineResultSection {
}
public synchronized void completed() {
- if (hits.size() == 0 && !searchResults.isDisposed())
+ if (hits.isEmpty() && !searchResults.isDisposed())
asyncUpdateResults(false, false);
}
public synchronized void canceling() {
- if (hits.size() == 0 && !searchResults.isDisposed()) {
+ if (hits.isEmpty() && !searchResults.isDisposed()) {
StringBuilder buff = new StringBuilder();
buff.append("<form>"); //$NON-NLS-1$
buff.append("<p><span color=\"summary\">");//$NON-NLS-1$
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java
index ba9bdc580..0058a341a 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java
@@ -640,7 +640,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
eds.add(ed);
}
}
- if (entries.size() == 0)
+ if (entries.isEmpty())
return;
FederatedSearchEntry[] array = entries.toArray(new FederatedSearchEntry[entries.size()]);
if (scopeSection.isExpanded()) {
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/SearchData.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/SearchData.java
index 7e3cbd385..05acfd718 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/SearchData.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/SearchData.java
@@ -517,7 +517,7 @@ public class SearchData extends ActivitiesData {
workingSetCol.add(ws);
}
}
- if (workingSetCol.size() == 0) {
+ if (workingSetCol.isEmpty()) {
return null;
}
return workingSetCol
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/TopicFinder.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/TopicFinder.java
index cc01fa593..3c2e533d9 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/TopicFinder.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/TopicFinder.java
@@ -215,7 +215,7 @@ public class TopicFinder {
* @return -1 if the toc is not found
*/
private int findTocContainingTopic(String topic) {
- if (topic == null || topic.equals("")) //$NON-NLS-1$
+ if (topic == null || topic.isEmpty())
return -1;
int index = topic.indexOf("/topic/"); //$NON-NLS-1$
@@ -246,7 +246,7 @@ public class TopicFinder {
if (index != -1)
topic = topic.substring(0, index);
- if (topic == null || topic.equals("")) //$NON-NLS-1$
+ if (topic == null || topic.isEmpty())
return -1;
// try to find in enabled tocs first
@@ -303,7 +303,7 @@ public class TopicFinder {
if (index != -1)
topic = topic.substring(0, index);
- if (topic == null || topic.equals("")) //$NON-NLS-1$
+ if (topic == null || topic.isEmpty())
return null;
if (selectedToc < 0)
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/WorkingSetManagerData.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/WorkingSetManagerData.java
index a8da99b81..8a9b1efba 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/WorkingSetManagerData.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/WorkingSetManagerData.java
@@ -221,7 +221,7 @@ public class WorkingSetManagerData extends RequestData {
for (String criterion : criteria) {
if(category.contains(criterion)){
List<String> allValuesInCategory = Arrays.asList(getCriterionValueIds(criterion));
- if(0 == allValuesInCategory.size()){
+ if(allValuesInCategory.isEmpty()){
continue;
}
Set<String> elements = selectedElements.get(criterion);
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/parser/AboutParser.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/parser/AboutParser.java
index 165bfc8f7..33425d18a 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/parser/AboutParser.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/parser/AboutParser.java
@@ -69,7 +69,7 @@ public class AboutParser extends ResultParser {
|| service == Utils.ABOUT_PLUGIN)
return;
- if (element != null && !currentTag.equals("")) { //$NON-NLS-1$
+ if (element != null && !currentTag.isEmpty()) {
Properties properties = element.getProps();
if (properties != null) {
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java
index 5a0934079..88889377a 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java
@@ -46,7 +46,7 @@ public class HighlightFilter implements IFilter {
}
Collection<String> keywords = getWords(req);
- if (keywords.size() == 0) {
+ if (keywords.isEmpty()) {
return out;
}
keywords = removeWildCards(keywords);
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java
index e9f4e53fd..cecddc83e 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java
@@ -93,7 +93,7 @@ public class InjectionFilter implements IFilter {
needsLiveHelp = !enabled && HelpBasePlugin.getActivitySupport().getDocumentMessageUsesLiveHelp(addNarrow);
- if (cssIncludes.size() == 0 && !addDisabled)
+ if (cssIncludes.isEmpty() && !addDisabled)
return out;
IPath path = new Path(pathInfo);
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java b/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java
index 3062c59b4..fbcb57dd4 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java
@@ -67,7 +67,7 @@ public class ProductPreferences {
List<String> primaryOrdering = getPrimaryTocOrdering();
@SuppressWarnings("unchecked")
List<String>[] secondaryOrdering = new List[0];
- if (primaryOrdering == null || primaryOrdering.size() == 0) {
+ if (primaryOrdering == null || primaryOrdering.isEmpty()) {
secondaryOrdering = getSecondaryTocOrderings();
}
return getOrderedList(itemsToOrder, primaryOrdering, secondaryOrdering, nameIdMap);
diff --git a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/CheckTocAction.java b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/CheckTocAction.java
index 62cc9b4f7..f53c5d85b 100644
--- a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/CheckTocAction.java
+++ b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/CheckTocAction.java
@@ -33,7 +33,7 @@ public class CheckTocAction implements IWorkbenchWindowActionDelegate {
public static List<BrokenLink> errors = new ArrayList<>();
public static void showErrors() {
- if (errors.size() == 0) {
+ if (errors.isEmpty()) {
reportStatus("No errors detected in load");
}
for (int i = 0; i < errors.size(); i++) {
diff --git a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/LoadTocAction.java b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/LoadTocAction.java
index f75f4ca4c..7496f5ef0 100644
--- a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/LoadTocAction.java
+++ b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/actions/LoadTocAction.java
@@ -79,7 +79,7 @@ public class LoadTocAction implements IWorkbenchWindowActionDelegate {
public static void showErrors() {
if (errors == null) return;
- if (errors.size() == 0) {
+ if (errors.isEmpty()) {
reportStatus("Testing complete, no errors found");
} else {
reportStatus("Testing complete, errors found");
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
index 86495e7a6..8b783851d 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/InfocenterWorkingSetManagerTest.java
@@ -460,7 +460,7 @@ public class InfocenterWorkingSetManagerTest {
private void checkCookies(MockServletResponse resp) {
String illegalChars = resp.getIllegalCharatersFound();
- if (illegalChars.equals("") || illegalChars.equals("<")) {
+ if (illegalChars.isEmpty() || illegalChars.equals("<")) {
return;
}
fail("Cookie contains these illegal characters " + illegalChars + '"');
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java
index a638ec969..eb074af48 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/contentdetect/ContentDetectorTest.java
@@ -93,7 +93,7 @@ public class ContentDetectorTest {
ContentDetector detector = new ContentDetector();
assertFalse(detector.isNewContentAvailable());
Set<?> newContent = ContentDetector.getNewContributors();
- assertTrue(newContent == null || newContent.size() == 0);
+ assertTrue(newContent == null || newContent.isEmpty());
String firstContribution = helper.getContributors().iterator().next();
assertFalse(ContentDetector.isNew(firstContribution));
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java
index 80a48f308..cfcff1e15 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java
@@ -887,7 +887,7 @@ public class CheatSheetParser implements IStatusContainer {
}
}
- if(al.size() == 0) {
+ if(al.isEmpty()) {
String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {item.getNodeName(), node.getNodeName()}));
addStatus(IStatus.WARNING, message, null);
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java
index 4c9804fbe..6cfdfd0df 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java
@@ -162,7 +162,7 @@ public class CheatSheetCollectionElement extends WorkbenchAdapter implements IPl
* Returns true if this element has no children and no cheatsheets.
*/
public boolean isEmpty() {
- return childCollections.size() == 0 && cheatsheets.size() == 0;
+ return childCollections.isEmpty() && cheatsheets.size() == 0;
}
/**
diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
index ddc830aa1..5508b54bf 100644
--- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
+++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
@@ -782,7 +782,7 @@ public class CustomizationContentsArea {
return;
String pid = product.getId();
StringBuilder sbuf = new StringBuilder();
- if (introRootPages.size() == 0) {
+ if (introRootPages.isEmpty()) {
// An empty string means no preference so special value needed
// to indicate no root pages.
sbuf.append(NO_ROOT_PAGES);
diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java
index 0ad098b1f..39da4f876 100644
--- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java
+++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java
@@ -127,7 +127,7 @@ public class PageData {
return;
}
GroupData gd = findDefaultGroup();
- if (gd==null && groups.size()==0) {
+ if (gd==null && groups.isEmpty()) {
// add bottoms as the default group
gd = new GroupData(P_BOTTOM_LEFT, true);
groups.add(gd);
@@ -188,7 +188,7 @@ public class PageData {
if (hidden!=null && hidden.contains(extensionId))
return null;
// create the default: pick the last group
- if (groups.size()==0) return null;
+ if (groups.isEmpty()) return null;
GroupData last = groups.get(groups.size()-1);
return id + "/" + last.getPath() + "/" + IUniversalIntroConstants.DEFAULT_ANCHOR; //$NON-NLS-1$//$NON-NLS-2$
}
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java
index f02839a9d..d66c7e987 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java
@@ -240,7 +240,7 @@ public class History {
}
public boolean currentLocationIsUrl() {
- if (history.size() == 0) {
+ if (history.isEmpty()) {
return false;
}
return getCurrentLocation().isURL();
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java
index 07091885c..d6baacb9a 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java
@@ -599,7 +599,7 @@ public class BrowserIntroPartImplementation extends
public void propertyChanged(Object source, int propId) {
if (propId == IntroModelRoot.CURRENT_PAGE_PROPERTY_ID) {
String pageId = getModel().getCurrentPageId();
- if (pageId == null || pageId.equals("")) //$NON-NLS-1$
+ if (pageId == null || pageId.isEmpty())
// page ID was not set properly. exit.
return;
// update the presentation's content based on the model changes
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartLocationListener.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartLocationListener.java
index 0afa75b9f..5b2dcb14d 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartLocationListener.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartLocationListener.java
@@ -52,7 +52,7 @@ public class BrowserIntroPartLocationListener implements LocationListener {
IntroModelRoot model = implementation.getModel();
IntroURLParser parser = new IntroURLParser(url);
if (!parser.hasProtocol() || parser.getHost() == null
- || parser.getHost().equals("")) //$NON-NLS-1$
+ || parser.getHost().isEmpty())
// This will filter out two navigation events fired by the browser
// on a setText. (about:blank and
// res://C:\WINDOWS\System32\shdoclc.dll/navcancl.htm on windows,
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java
index 3bd213d4f..67c162c2c 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java
@@ -241,7 +241,7 @@ public class FormIntroPartImplementation extends
public void propertyChanged(Object source, int propId) {
if (propId == IntroModelRoot.CURRENT_PAGE_PROPERTY_ID) {
String pageId = getModel().getCurrentPageId();
- if (pageId == null || pageId.equals("")) //$NON-NLS-1$
+ if (pageId == null || pageId.isEmpty())
// If page ID was not set properly. exit.
return;

Back to the top