From: Stefan Bund Date: Tue, 21 Sep 2010 12:29:40 +0000 (+0200) Subject: further formatting changes X-Git-Url: http://g0dil.de/git?p=jpim.git;a=commitdiff_plain;h=2d606559488890b9aea1ae9e84376b2c64dab77b further formatting changes --- diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 5cf10e2..d594d77 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Tue Sep 21 12:13:50 CEST 2010 +#Tue Sep 21 14:26:16 CEST 2010 eclipse.preferences.version=1 org.eclipse.jdt.core.codeComplete.argumentPrefixes= org.eclipse.jdt.core.codeComplete.argumentSuffixes= @@ -274,7 +274,7 @@ org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false org.eclipse.jdt.core.formatter.tabulation.char=space org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_on_off_tags=true org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/src/de/j32/pimstuff/conduit/FritzAddressbookImporter.java b/src/de/j32/pimstuff/conduit/FritzAddressbookImporter.java index a67d975..82c61d7 100644 --- a/src/de/j32/pimstuff/conduit/FritzAddressbookImporter.java +++ b/src/de/j32/pimstuff/conduit/FritzAddressbookImporter.java @@ -24,17 +24,13 @@ public class FritzAddressbookImporter implements Importer * @throws SAXException * @throws IOException */ - public FritzAddressbookImporter(InputStream is) throws SAXException, - IOException + public FritzAddressbookImporter(InputStream is) throws SAXException, IOException { // It does not make sens to try / finally here, at least conceptually: - // Since - // the base-class constructor might throw we would never get a chance to - // properly close is. Thus I deem it safer to only take responsibility - // for is - // when the constructor does NOT throw and place the try / finally into - // the - // callers code. + // Since the base-class constructor might throw we would never get a + // chance to // properly close is. Thus I deem it safer to only take + // responsibility for is when the constructor does NOT throw and place + // the try finally into the callers code. xml_ = XmlUtil.parse(is); is.close(); } @@ -42,29 +38,24 @@ public class FritzAddressbookImporter implements Importer @Override public void sendTo(EntryConsumer consumer) { - for (Element node : XmlUtil.iterate( - xml_.getElementsByTagName("contact"), Element.class)) { - /* - * subnodes: category (unused, always 0) person/realName - * person/imageURL telephony/number (@prio, @type, @vanity) - * services/email mod_time - */ + for (Element node : XmlUtil.iterate(xml_.getElementsByTagName("contact"), Element.class)) { + + // subnodes: category (unused, always 0) person/realName + // person/imageURL telephony/number (@prio, @type, @vanity) + // services/email mod_time Entry entry = new Entry(); try { - entry.name(node.getElementsByTagName("realName").item(0) - .getTextContent()); + entry.name(node.getElementsByTagName("realName").item(0).getTextContent()); - for (Element phone : XmlUtil.iterate( - node.getElementsByTagName("number"), Element.class)) { - entry.attribute("phone", phone.getAttribute("type"), - phone.getTextContent()); + for (Element phone : XmlUtil.iterate(node.getElementsByTagName("number"), + Element.class)) { + entry.attribute("phone", phone.getAttribute("type"), phone.getTextContent()); } try { - entry.attribute("email", "", - node.getElementsByTagName("email").item(0) - .getTextContent()); + entry.attribute("email", "", node.getElementsByTagName("email").item(0) + .getTextContent()); } catch (NullPointerException e) {} // ignore missing optional // email