diff options
author | Carsten Hammer | 2019-11-26 22:25:04 +0000 |
---|---|---|
committer | Lars Vogel | 2020-03-19 11:42:51 +0000 |
commit | 993bc1eed15ef5502ff3e005e2f76f7334b80b14 (patch) | |
tree | 70fde7cb368755f8756587d9a1f7a7c3abad93a7 /examples | |
parent | ce4ee64f0c0ddf4733ab946f2171587cc35d4fcd (diff) | |
download | eclipse.platform.team-993bc1eed15ef5502ff3e005e2f76f7334b80b14.tar.gz eclipse.platform.team-993bc1eed15ef5502ff3e005e2f76f7334b80b14.tar.xz eclipse.platform.team-993bc1eed15ef5502ff3e005e2f76f7334b80b14.zip |
Use .isEmpty() instead of .size()==0 or .equals("")I20200402-2250I20200402-1800I20200402-0850I20200402-0410I20200401-1800I20200331-1800I20200330-1800I20200329-1800I20200328-1800I20200327-1800I20200326-1800I20200325-1800I20200324-1800I20200323-1800I20200322-1800I20200322-1150
Change-Id: If2db9cef6eddb2d79e3fd1c312b2c8248dd288d6
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Diffstat (limited to 'examples')
4 files changed, 9 insertions, 9 deletions
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java index 4ecaf135a..ffb22b164 100644 --- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java +++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/CreateNewIdMapAction.java @@ -58,7 +58,7 @@ public class CreateNewIdMapAction extends Action { if (dialog.open() == Window.OK) { if (!fIdMaps.containsKey(idmap.getName())) { fIdMaps.put(idmap.getName(),new HashMap()); - if (!idmap.getExtension().equals("")) //$NON-NLS-1$ + if (!idmap.getExtension().isEmpty()) fIdExtensionToName.put(idmap.getExtension(),idmap.getName()); XMLPlugin.getDefault().setIdMaps(fIdMaps,fIdExtensionToName,null,false); } diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java index f4eb8115d..584804472 100644 --- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java +++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLComparePreferencePage.java @@ -405,7 +405,7 @@ public class XMLComparePreferencePage extends PreferencePage implements IWorkben if (dialog.open() == Window.OK) { if (!fIdMaps.containsKey(idmap.getName())) { fIdMaps.put(idmap.getName(),new HashMap()); - if (!idmap.getExtension().equals("")) //$NON-NLS-1$ + if (!idmap.getExtension().isEmpty()) fIdExtensionToName.put(idmap.getExtension(),idmap.getName()); newIdMapsTableItem(idmap,true); } @@ -424,7 +424,7 @@ public class XMLComparePreferencePage extends PreferencePage implements IWorkben fIdMaps.remove(old_name); fIdExtensionToName.remove(old_extension); fIdMaps.put(idmap.getName(),idmapHS); - if (!idmap.getExtension().equals("")) //$NON-NLS-1$ + if (!idmap.getExtension().isEmpty()) fIdExtensionToName.put(idmap.getExtension(),idmap.getName()); fIdMapsTable.remove(fIdMapsTable.indexOf(itemsIdMaps[0])); newIdMapsTableItem(idmap,true); diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java index 3a40b5c43..fb5b808e0 100644 --- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java +++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLPlugin.java @@ -157,7 +157,7 @@ public final class XMLPlugin extends AbstractUIPlugin { IdMapAttribute = CurrentIdMap.substring(end_of_signature+1,end_of_attribute); String IdMapExtension= CurrentIdMap.substring(end_of_attribute+1,CurrentIdMap.length()); //if extension already associated, do not associate with this idmap - if (!IdMapExtension.equals("") && !fIdExtensionToName.containsKey(IdMapExtension)) { //$NON-NLS-1$ + if (!IdMapExtension.isEmpty() && !fIdExtensionToName.containsKey(IdMapExtension)) { fIdExtensionToName.put(IdMapExtension,IdMapName); CompareUI.addStructureViewerAlias(DEFAULT_PREFIX, IdMapExtension); } @@ -307,8 +307,8 @@ public final class XMLPlugin extends AbstractUIPlugin { String attribute= mapping.getAttribute(MAPPING_ID_ATTRIBUTE); String idsource= mapping.getAttribute(MAPPING_ID_SOURCE); String bodyid= ""; //$NON-NLS-1$ - if (signature != null && !signature.equals("") //$NON-NLS-1$ - && attribute != null && !attribute.equals("")) { //$NON-NLS-1$ + if (signature != null && !signature.isEmpty() + && attribute != null && !attribute.isEmpty()) { if (idsource != null && idsource.equals(MAPPING_ID_SOURCE_BODY)) bodyid= (Character.valueOf(XMLStructureCreator.ID_TYPE_BODY)).toString(); idmapHM.put(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR @@ -323,7 +323,7 @@ public final class XMLPlugin extends AbstractUIPlugin { //add SIGN_SEPARATOR at the end because not contained in signatures of plugin.xml //also add prefix at beginning String signature= ordered.getAttribute(ORDERED_SIGNATURE_ATTRIBUTE); - if (signature != null && !signature.equals("")) //$NON-NLS-1$ + if (signature != null && !signature.isEmpty()) orderedAL.add(XMLStructureCreator.ROOT_ID + XMLStructureCreator.SIGN_SEPARATOR + signature + XMLStructureCreator.SIGN_SEPARATOR); } if (orderedAL.size() > 0) diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java index f78e35de7..3d7531925 100644 --- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java +++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureCreator.java @@ -249,7 +249,7 @@ public class XMLStructureCreator implements IStructureCreator { } catch (Exception e) { value= ""; //$NON-NLS-1$ } - if (value.equals("")) //$NON-NLS-1$ + if (value.isEmpty()) found= true; else if (value.equals(attr_value)) { id_index= element_string.lastIndexOf(attr_name, first_quotes - 1); @@ -328,7 +328,7 @@ public class XMLStructureCreator implements IStructureCreator { System.out.println("Body Location: line " + locator.getLineNumber() + " column " + locator.getColumnNumber()); //$NON-NLS-2$ //$NON-NLS-1$ //if text contains only white space, it will be ignored. - if (!trimWhiteSpace(chars).equals("")) { //$NON-NLS-1$ + if (!trimWhiteSpace(chars).isEmpty()) { if (XMLStructureCreator.DEBUG_MODE) System.out.println("Adding body"); //$NON-NLS-1$ try { |