From ca4f38f1305667758c2c2e90b45cd19bdb532721 Mon Sep 17 00:00:00 2001
From: Roberto Sánchez <roberto.sanchez@curisit.net>
Date: Thu, 18 Sep 2014 14:07:32 +0000
Subject: [PATCH] #0 feature - Fixed some SonarQube issues
---
src/main/java/net/curisit/securis/LicenseValidator.java | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/main/java/net/curisit/securis/LicenseValidator.java b/src/main/java/net/curisit/securis/LicenseValidator.java
index a9fa2ad..2b95123 100644
--- a/src/main/java/net/curisit/securis/LicenseValidator.java
+++ b/src/main/java/net/curisit/securis/LicenseValidator.java
@@ -16,15 +16,18 @@
private static final Logger log = LogManager.getLogger(LicenseValidator.class);
- public static LicenseValidator singleton = new LicenseValidator();
- public static byte[] LOGO_SECRET;
+ private static LicenseValidator singleton = new LicenseValidator();
+ protected static byte[] LOGO_SECRET;
- private LicenseValidator() {
+ static {
try {
LOGO_SECRET = "Logo ipsum s3cr3t test áíóú".getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
log.error("Unexpected error getting LOGO secret", e);
}
+ }
+
+ private LicenseValidator() {
}
public static LicenseValidator getInstance() {
@@ -57,8 +60,9 @@
public void validateHW(RequestBean reqBean, String appCode, String customerCode) throws SeCurisException {
RequestBean currentHW = ReqGenerator.getInstance().createRequest(appCode, customerCode);
- if (!currentHW.match(reqBean))
+ if (!currentHW.match(reqBean)) {
throw new SeCurisException("Current System info mismatch the License System info:\n Licensed: " + JsonUtils.toJSON(reqBean, true) + "\n Expected: " + JsonUtils.toJSON(currentHW, true));
+ }
}
}
--
Gitblit v1.3.2