From df94066e3af02ff02d5ab4d033a3d603f743234c Mon Sep 17 00:00:00 2001 From: bjculkin Date: Mon, 12 Feb 2018 22:45:04 -0500 Subject: Formatting pass --- .../main/java/bjc/utils/ioutils/SimpleProperties.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'base/src/main/java/bjc/utils/ioutils/SimpleProperties.java') diff --git a/base/src/main/java/bjc/utils/ioutils/SimpleProperties.java b/base/src/main/java/bjc/utils/ioutils/SimpleProperties.java index e6279c4..7043ed2 100644 --- a/base/src/main/java/bjc/utils/ioutils/SimpleProperties.java +++ b/base/src/main/java/bjc/utils/ioutils/SimpleProperties.java @@ -32,23 +32,23 @@ public class SimpleProperties implements Map { * All leading/trailing spaces from the name & body are removed. * * @param is - * The stream to read from. + * The stream to read from. * * @param allowDuplicates - * Whether or not duplicate keys should be allowed. + * Whether or not duplicate keys should be allowed. */ public void loadFrom(final InputStream is, final boolean allowDuplicates) { - try (Scanner scn = new Scanner(is)) { - while (scn.hasNextLine()) { + try(Scanner scn = new Scanner(is)) { + while(scn.hasNextLine()) { final String ln = scn.nextLine().trim(); /* * Skip blank lines/comments */ - if (ln.equals("")) { + if(ln.equals("")) { continue; } - if (ln.startsWith("#")) { + if(ln.startsWith("#")) { continue; } @@ -57,7 +57,7 @@ public class SimpleProperties implements Map { /* * Complain about improperly formatted lines. */ - if (sepIdx == -1) { + if(sepIdx == -1) { final String fmt = "Properties must be a name, a space, then the body.\n\tOffending line is '%s'"; final String msg = String.format(fmt, ln); @@ -70,7 +70,7 @@ public class SimpleProperties implements Map { /* * Complain about duplicates, if that is wanted. */ - if (!allowDuplicates && containsKey(name)) { + if(!allowDuplicates && containsKey(name)) { final String msg = String.format("Duplicate key '%s'", name); throw new IllegalStateException(msg); @@ -87,7 +87,7 @@ public class SimpleProperties implements Map { public void outputProperties() { System.out.println("Read properties:"); - for (final Entry entry : entrySet()) { + for(final Entry entry : entrySet()) { System.out.printf("\t'%s'\t'%s'\n", entry.getKey(), entry.getValue()); } -- cgit v1.2.3