Skip to content

Commit

Permalink
Allow 'logger' constant to be lowercase and fix idToFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmudd committed Apr 19, 2019
1 parent cb2706d commit 82d9db0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion jhdf/config/checkstyle/checkstyle.xml
Expand Up @@ -26,7 +26,9 @@
<!-- http://checkstyle.sourceforge.net/config_imports.html#AvoidStarImport -->
<module name="AvoidStarImport"/>
<!-- http://checkstyle.sourceforge.net/config_naming.html#ConstantName -->
<module name="ConstantName"/>
<module name="ConstantName">
<property name="format" value="^logger?$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
</module>
<!-- http://checkstyle.sourceforge.net/config_blocks.html#EmptyBlock -->
<module name="EmptyBlock"/>
<!-- http://checkstyle.sourceforge.net/config_metrics.html#BooleanExpressionComplexity -->
Expand Down
6 changes: 3 additions & 3 deletions jhdf/src/main/java/io/jhdf/filter/FilterManager.java
Expand Up @@ -32,7 +32,7 @@ public enum FilterManager {

private static final Logger logger = LoggerFactory.getLogger(FilterManager.class);

private static final Map<Integer, Filter> idToFilter = new HashMap<>();
private static final Map<Integer, Filter> ID_TO_FILTER = new HashMap<>();

static {
logger.info("Initalising HDF5 filters...");
Expand Down Expand Up @@ -60,7 +60,7 @@ public enum FilterManager {
*/
public static void addFilter(Filter filter) {
// Add the filter
idToFilter.put(filter.getId(), filter);
ID_TO_FILTER.put(filter.getId(), filter);

logger.info("Added HDF5 filter '{}' with ID '{}'", filter.getName(), filter.getId());
}
Expand All @@ -82,7 +82,7 @@ public static FilterPipeline getPipeline(FilterPipelineMessage filterPipelineMes
// Make the new pipeline
FilterPipeline pipeline = new FilterPipeline();
// Add each filter
filters.forEach(filter -> pipeline.addFilter(idToFilter.get(filter.getId()), filter.getData()));
filters.forEach(filter -> pipeline.addFilter(ID_TO_FILTER.get(filter.getId()), filter.getData()));

return pipeline;
}
Expand Down

0 comments on commit 82d9db0

Please sign in to comment.