#0 feature - Fixed some SonarQube issues
| .. | .. |
|---|
| 76 | 76 | <uniqueVersion>true</uniqueVersion> |
|---|
| 77 | 77 | <id>curistecSnapshot</id> |
|---|
| 78 | 78 | <name>CurisTec Snapshots</name> |
|---|
| 79 | | - <url>http://92.54.10.233:48080/archiva/repository/snapshots/</url> |
|---|
| 79 | + <url>http://10.0.0.12:8080/archiva/repository/snapshots/</url> |
|---|
| 80 | 80 | <layout>default</layout> |
|---|
| 81 | 81 | </snapshotRepository> |
|---|
| 82 | 82 | </distributionManagement> |
|---|
| .. | .. |
|---|
| 17 | 17 | private static final Logger log = LogManager.getLogger(LicenseValidator.class); |
|---|
| 18 | 18 | |
|---|
| 19 | 19 | public static LicenseValidator singleton = new LicenseValidator(); |
|---|
| 20 | | - private byte[] LOGO_SECRET; |
|---|
| 20 | + public static byte[] LOGO_SECRET; |
|---|
| 21 | 21 | |
|---|
| 22 | 22 | private LicenseValidator() { |
|---|
| 23 | 23 | try { |
|---|
| 24 | 24 | LOGO_SECRET = "Logo ipsum s3cr3t test áíóú".getBytes("utf-8"); |
|---|
| 25 | 25 | } catch (UnsupportedEncodingException e) { |
|---|
| 26 | | - e.printStackTrace(); |
|---|
| 26 | + log.error("Unexpected error getting LOGO secret", e); |
|---|
| 27 | 27 | } |
|---|
| 28 | 28 | } |
|---|
| 29 | 29 | |
|---|
| .. | .. |
|---|
| 23 | 23 | |
|---|
| 24 | 24 | private static ReqGenerator singleton = new ReqGenerator(); |
|---|
| 25 | 25 | |
|---|
| 26 | | - private byte[] LOGO_SECRET; |
|---|
| 27 | | - |
|---|
| 28 | 26 | private ReqGenerator() { |
|---|
| 29 | | - try { |
|---|
| 30 | | - LOGO_SECRET = "Logo ipsum s3cr3t test áíóú".getBytes("utf-8"); |
|---|
| 31 | | - } catch (UnsupportedEncodingException e) { |
|---|
| 32 | | - e.printStackTrace(); |
|---|
| 33 | | - } |
|---|
| 34 | 27 | } |
|---|
| 35 | 28 | |
|---|
| 36 | 29 | public static ReqGenerator getInstance() { |
|---|
| .. | .. |
|---|
| 91 | 84 | if (is == null) |
|---|
| 92 | 85 | return null; |
|---|
| 93 | 86 | try { |
|---|
| 94 | | - String shaLogo = LicUtils.sha256(IOUtils.toByteArray(is), LOGO_SECRET); |
|---|
| 87 | + String shaLogo = LicUtils.sha256(IOUtils.toByteArray(is), LicenseValidator.LOGO_SECRET); |
|---|
| 95 | 88 | return shaLogo; |
|---|
| 96 | 89 | } catch (IOException e) { |
|---|
| 97 | 90 | log.error("Customer logo was not found in classpath in " + logResource, e); |
|---|
| .. | .. |
|---|
| 62 | 62 | } |
|---|
| 63 | 63 | |
|---|
| 64 | 64 | @Override |
|---|
| 65 | + public int hashCode() { |
|---|
| 66 | + int code = 0; |
|---|
| 67 | + code += expirationDate != null ? expirationDate.hashCode() : 0; |
|---|
| 68 | + code += signature != null ? signature.hashCode() : 0; |
|---|
| 69 | + code += metadata != null ? metadata.hashCode() : 0; |
|---|
| 70 | + |
|---|
| 71 | + return code; |
|---|
| 72 | + }; |
|---|
| 73 | + |
|---|
| 74 | + @Override |
|---|
| 65 | 75 | public boolean equals(Object obj) { |
|---|
| 66 | 76 | if (!(obj instanceof LicenseBean)) |
|---|
| 67 | 77 | return false; |
|---|
| .. | .. |
|---|
| 84 | 84 | return false; |
|---|
| 85 | 85 | } |
|---|
| 86 | 86 | |
|---|
| 87 | + |
|---|
| 88 | + @Override |
|---|
| 89 | + public int hashCode() { |
|---|
| 90 | + int code = 0; |
|---|
| 91 | + code += appCode != null ? appCode.hashCode() : 0; |
|---|
| 92 | + code += arch != null ? arch.hashCode() : 0; |
|---|
| 93 | + code += crcLogo != null ? crcLogo.hashCode() : 0; |
|---|
| 94 | + code += customerCode != null ? customerCode.hashCode() : 0; |
|---|
| 95 | + code += osName != null ? osName.hashCode() : 0; |
|---|
| 96 | + code += macAddresses != null ? macAddresses.hashCode() : 0; |
|---|
| 97 | + |
|---|
| 98 | + return code; |
|---|
| 99 | + }; |
|---|
| 100 | + |
|---|
| 87 | 101 | @Override |
|---|
| 88 | 102 | public boolean equals(Object obj) { |
|---|
| 89 | 103 | if (!(obj instanceof RequestBean)) |
|---|
| .. | .. |
|---|
| 197 | 197 | } catch (JsonParseException e) { |
|---|
| 198 | 198 | throw new SeCurisException("Error converting JSON to object", e); |
|---|
| 199 | 199 | } catch (IOException e) { |
|---|
| 200 | | - e.printStackTrace(); |
|---|
| 200 | + log.error("Error converting JSON to object", e); |
|---|
| 201 | 201 | throw new SeCurisException("Error converting JSON to object", e); |
|---|
| 202 | 202 | } |
|---|
| 203 | 203 | } |
|---|