Skip to content

Commit 160fa72

Browse files
author
smisger
committed
Fixing squid:S1854- Dead stores should be removed
1 parent 492a8e7 commit 160fa72

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/main/java/org/audit4j/core/Configurations.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ static Configuration loadConfig(ConfigurationStream stream) throws Configuration
9292
* @throws ConfigurationException the configuration exception
9393
*/
9494
static ConfigurationStream resolveConfigFileAsStream(String configFilePath) throws ConfigurationException {
95-
InputStream fileStream = null;
96-
String fileExtention = null;
95+
InputStream fileStream;
96+
String fileExtention;
9797

9898
if (configFilePath != null) {
9999
if (new File(configFilePath).isDirectory()) {
@@ -142,7 +142,7 @@ static String scanConfigFile(String dirPath) throws ConfigurationException {
142142

143143
String filePath = dirPath + File.separator + CONFIG_FILE_NAME + ".";
144144

145-
String fullFilePath = null;
145+
String fullFilePath;
146146
// Scan for Yaml file
147147
if (AuditUtil.isFileExists(filePath + YML_EXTENTION)) {
148148
fullFilePath = filePath + YML_EXTENTION;
@@ -182,7 +182,7 @@ static void generateConfigFile(String configFilePath) throws ConfigurationExcept
182182
* @throws ConfigurationException
183183
*/
184184
private static ConfigProvider<Configuration> getProviderByFileExtention(String extention) throws ConfigurationException {
185-
ConfigProvider<Configuration> provider = null;
185+
ConfigProvider<Configuration> provider;
186186
if (XML_EXTENTION.equals(extention)) {
187187
provider = new XMLConfigProvider<>(Configuration.class);
188188
} else if (YML_EXTENTION.equals(extention) || YAML_EXTENTION.equals(extention)) {

src/main/java/org/audit4j/core/annotation/AuditFieldAnnotationAttribute.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public List<Field> getAllFields(final Method method, final Object[] arg1) {
5252
int i = 0;
5353
String paramName = null;
5454
String paramValue = null;
55-
Class<?> paramType = null;
55+
Class<?> paramType;
5656
for (final Annotation[] annotations : parameterAnnotations) {
5757
final Object object = arg1[i++];
5858
//paramValue = ObjectToStringSerializer.(object);
@@ -99,7 +99,7 @@ public List<Field> getMarkedFields(final Method method, final Object[] arg1) {
9999
int i = 0;
100100
String paramName = null;
101101
String paramValue = null;
102-
Class<?> paramType = null;
102+
Class<?> paramType;
103103
for (final Annotation[] annotations : parameterAnnotations) {
104104
final Object object = arg1[i++];
105105
//paramValue = ObjectToStringSerializer.toStringIfNotImplemented(object);

src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class DeIdentifyUtil {
3939
* @since 2.0.0
4040
*/
4141
public static String deidentifyLeft(String str, int size) {
42-
int repeat = 0;
42+
int repeat;
4343
if (size > str.length()) {
4444
repeat = str.length();
4545
} else {
@@ -59,7 +59,7 @@ public static String deidentifyLeft(String str, int size) {
5959
*/
6060
public static String deidentifyRight(String str, int size) {
6161
int end = str.length();
62-
int repeat = 0;
62+
int repeat;
6363
if (size > str.length()) {
6464
repeat = str.length();
6565
} else {
@@ -79,7 +79,7 @@ public static String deidentifyRight(String str, int size) {
7979
*/
8080
public static String deidentifyFromLeft(String str, int size) {
8181
int end = str.length();
82-
int repeat = 0;
82+
int repeat;
8383
if (size > str.length()) {
8484
repeat = 0;
8585
} else {
@@ -99,7 +99,7 @@ public static String deidentifyFromLeft(String str, int size) {
9999
*/
100100
public static String deidentifyFromRight(String str, int size) {
101101
int end = str.length();
102-
int repeat = 0;
102+
int repeat;
103103
if (size > str.length()) {
104104
repeat = str.length();
105105
} else {
@@ -120,7 +120,7 @@ public static String deidentifyFromRight(String str, int size) {
120120
*/
121121
public static String deidentifyMiddle(String str, int start, int end) {
122122

123-
int repeat = 0;
123+
int repeat;
124124
if (end - start > str.length()) {
125125
repeat = str.length();
126126
} else {

0 commit comments

Comments
 (0)