Skip to content

Commit

Permalink
codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshnsears committed Dec 19, 2018
1 parent 92ed959 commit 89c6803
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -42,5 +42,5 @@ script:

after_success:
- mvn jacoco:report coveralls:report
- java -jar codacy-coverage-reporter-4.0.5-assembly report -l Java -r jacoco.xml
- java -jar codacy-coverage-reporter-4.0.5-assembly.jar report -l Java -r jacoco.xml
- sonar-scanner
18 changes: 9 additions & 9 deletions src/main/java/xqa/ingest/Ingest.java
Expand Up @@ -25,7 +25,7 @@
import xqa.commons.qpid.jms.MessageMaker;

public class Ingest {
private static final Logger logger = LoggerFactory.getLogger(Ingest.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Ingest.class);
private final String serviceId;

private MessageBroker messageBroker;
Expand All @@ -43,7 +43,7 @@ public class Ingest {

private Ingest() {
serviceId = this.getClass().getSimpleName().toLowerCase() + "/" + UUID.randomUUID().toString().split("-")[0];
logger.info(serviceId);
LOGGER.info(serviceId);
}

public static void main(String[] args) throws Exception {
Expand All @@ -58,7 +58,7 @@ public static int executeIngest(String[] args) throws CommandLineException {
} catch (Ingest.CommandLineException cliException) {
throw cliException;
} catch (Exception exception) {
logger.error(exception.getMessage());
LOGGER.error(exception.getMessage());
return 0;
}
}
Expand All @@ -76,7 +76,7 @@ private int ingestFiles() throws Exception {
XmlFileFinder xmlFileFinder = new XmlFileFinder(pathToXmlCandidateFiles);

Collection<File> xmlFiles = xmlFileFinder.findFiles();
logger.info(
LOGGER.info(
MessageFormat.format("found {0} file(s) in {1}", xmlFiles.size(), pathToXmlCandidateFiles));

for (File xmlFile : xmlFiles) {
Expand All @@ -87,13 +87,13 @@ private int ingestFiles() throws Exception {
sendXmlFileToMessageBroker(sentCounter, xmlFileFinder, xmlFile);

} catch (XmlFileFinder.FinderException finderException) {
logger.debug(finderException.getMessage());
LOGGER.debug(finderException.getMessage());
}
}

messageBroker.close();

logger.info(MessageFormat.format("FINISHED - sent: {0}/{1}",
LOGGER.info(MessageFormat.format("FINISHED - sent: {0}/{1}",
sentCounter, Optional.of(xmlFileFinder.findFiles().size()).orElse(0)));

return sentCounter;
Expand All @@ -105,7 +105,7 @@ private void sendXmlFileToMessageBroker(int sentCounter, XmlFileFinder xmlFileFi
String digest = DigestUtils.sha256Hex(xml);
int size = xml.getBytes(StandardCharsets.UTF_8).length;

logger.info(MessageFormat.format("Y: {0}: correlationId={1}; digest={2}; size={3} - {4}",
LOGGER.info(MessageFormat.format("Y: {0}: correlationId={1}; digest={2}; size={3} - {4}",
String.format("%4d", sentCounter),
correlationId,
digest,
Expand Down Expand Up @@ -140,7 +140,7 @@ private void processCommandLine(String[] args) throws ParseException, CommandLin
private void setConfigurationValues(Options options, CommandLine commandLine) throws CommandLineException {
if (commandLine.hasOption("message_broker_host")) {
messageBrokerHost = commandLine.getOptionValue("message_broker_host");
logger.info("message_broker_host=" + messageBrokerHost);
LOGGER.info("message_broker_host=" + messageBrokerHost);
} else {
showUsage(options);
}
Expand All @@ -155,7 +155,7 @@ private void setConfigurationValues(Options options, CommandLine commandLine) th

if (commandLine.hasOption("path")) {
pathToXmlCandidateFiles = commandLine.getOptionValue("path");
logger.info("path=" + pathToXmlCandidateFiles);
LOGGER.info("path=" + pathToXmlCandidateFiles);
} else {
showUsage(options);
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/xqa/ingest/IngestEvent.java
Expand Up @@ -3,13 +3,13 @@
import java.util.Date;

class IngestEvent {
private final String serviceId;
private final long creationTime;
private final String correlationId;
private final String source;
private final String digest;
private final int size;
private final String state;
public final String serviceId;
public final long creationTime;
public final String correlationId;
public final String source;
public final String digest;
public final int size;
public final String state;

IngestEvent(final String serviceId,
final String correlationId,
Expand Down
Expand Up @@ -365,7 +365,7 @@ public enum JmsMsgType {
TEXT("jms/text-message"),
TEXT_NULL("jms/text-message-null");

public final String buffer = new String(this.name());
public final String buffer = this.name();
final String mime;

JmsMsgType(String mime) {
Expand Down

0 comments on commit 89c6803

Please sign in to comment.