From b65b705c391bb772bc41269bce5243c1cc88969d Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Fri, 22 Apr 2016 14:29:05 -0400 Subject: Formatting changes --- .../components/ComponentDescriptionFileParser.java | 13 ++++---- .../components/ComponentDescriptionState.java | 2 +- .../utils/components/FileComponentRepository.java | 36 +++++++++++----------- 3 files changed, 25 insertions(+), 26 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/components') diff --git a/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java b/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java index eec3fa8..52ab0b3 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java +++ b/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java @@ -50,8 +50,8 @@ public class ComponentDescriptionFileParser { try { state.setVersion(Integer.parseInt(token)); } catch (NumberFormatException nfex) { - PragmaFormatException pfex = - new PragmaFormatException("Argument " + token + PragmaFormatException pfex = new PragmaFormatException( + "Argument " + token + " to version pragma isn't a valid integer. " + "This pragma requires a integer argument"); @@ -62,9 +62,8 @@ public class ComponentDescriptionFileParser { }); } - private static - BiConsumer - buildStringCollapserPragma(String pragmaName) { + private static BiConsumer buildStringCollapserPragma( + String pragmaName) { return (tokenizer, state) -> { if (!tokenizer.hasMoreTokens()) { throw new PragmaFormatException("Pragma " + pragmaName @@ -83,8 +82,8 @@ public class ComponentDescriptionFileParser { * The stream to parse from * @return The description parsed from the stream */ - public static ComponentDescription - fromStream(InputStream inputSource) { + public static ComponentDescription fromStream( + InputStream inputSource) { ComponentDescriptionState readState = reader .fromStream(inputSource, new ComponentDescriptionState()); diff --git a/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionState.java b/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionState.java index 52a1999..7d91c84 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionState.java +++ b/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionState.java @@ -8,7 +8,7 @@ package bjc.utils.components; */ public class ComponentDescriptionState { private String name; - + private String description; private String author; diff --git a/BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java b/BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java index 53219fb..8b0d303 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java +++ b/BJC-Utils2/src/main/java/bjc/utils/components/FileComponentRepository.java @@ -7,9 +7,6 @@ import java.nio.file.attribute.BasicFileAttributes; import java.util.function.BiPredicate; import java.util.function.Function; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import bjc.utils.data.IHolder; import bjc.utils.data.Identity; import bjc.utils.funcdata.FunctionalList; @@ -18,6 +15,9 @@ import bjc.utils.funcdata.IFunctionalList; import bjc.utils.funcdata.IFunctionalMap; import bjc.utils.funcutils.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * A component repository that loads its components from files in a * directory @@ -30,8 +30,8 @@ import bjc.utils.funcutils.FileUtils; public class FileComponentRepository implements IComponentRepository { - private static final Logger CLASS_LOGGER = - LoggerFactory.getLogger(FileComponentRepository.class); + private static final Logger CLASS_LOGGER = LoggerFactory + .getLogger(FileComponentRepository.class); /** * The internal storage of components @@ -70,19 +70,19 @@ public class FileComponentRepository IHolder isFirstDir = new Identity<>(true); - BiPredicate firstLevelTraverser = - (pth, attr) -> { - if (attr.isDirectory() && !isFirstDir.getValue()) { - // Don't skip the first directory, that's the - // parent - isFirstDir.replace(false); - // Skip directories, they probably have - // component - return false; - } - - return true; - }; + BiPredicate firstLevelTraverser = (pth, + attr) -> { + if (attr.isDirectory() && !isFirstDir.getValue()) { + // Don't skip the first directory, that's the + // parent + isFirstDir.replace(false); + // Skip directories, they probably have + // component + return false; + } + + return true; + }; try { FileUtils.traverseDirectory(sourceDirectory, -- cgit v1.2.3