Cleanup code smells reported by Sonar

This is a first pass are removing some of the code smells.
Many reported code smells were ignored in this effort
This commit is contained in:
Glenn Renfro
2018-11-15 12:57:58 -05:00
committed by Mark Pollack
parent fa3e4e55c6
commit 8e1d38a76a
23 changed files with 50 additions and 46 deletions

View File

@@ -65,13 +65,13 @@ import org.springframework.messaging.MessageChannel;
@AutoConfigureAfter(SimpleTaskAutoConfiguration.class)
public class BatchEventAutoConfiguration {
public final static String JOB_EXECUTION_EVENTS_LISTENER = "jobExecutionEventsListener";
public final static String CHUNK_EVENTS_LISTENER = "chunkEventsListener";
public final static String STEP_EXECUTION_EVENTS_LISTENER = "stepExecutionEventsListener";
public final static String ITEM_READ_EVENTS_LISTENER = "itemReadEventsListener";
public final static String ITEM_WRITE_EVENTS_LISTENER = "itemWriteEventsListener";
public final static String ITEM_PROCESS_EVENTS_LISTENER = "itemProcessEventsListener";
public final static String SKIP_EVENTS_LISTENER = "skipEventsListener";
public static final String JOB_EXECUTION_EVENTS_LISTENER = "jobExecutionEventsListener";
public static final String CHUNK_EVENTS_LISTENER = "chunkEventsListener";
public static final String STEP_EXECUTION_EVENTS_LISTENER = "stepExecutionEventsListener";
public static final String ITEM_READ_EVENTS_LISTENER = "itemReadEventsListener";
public static final String ITEM_WRITE_EVENTS_LISTENER = "itemWriteEventsListener";
public static final String ITEM_PROCESS_EVENTS_LISTENER = "itemProcessEventsListener";
public static final String SKIP_EVENTS_LISTENER = "skipEventsListener";
@Bean
@ConditionalOnMissingBean

View File

@@ -87,7 +87,9 @@ public class JobParameterEvent {
@Override
public int hashCode() {
return 7 + 21 * (parameter == null ? parameterType.hashCode() : parameter.hashCode());
final int BASE_HASH = 7;
final int MULTIPLIER_HASH = 21;
return BASE_HASH + MULTIPLIER_HASH * (parameter == null ? parameterType.hashCode() : parameter.hashCode());
}
/**

View File

@@ -208,7 +208,9 @@ public class JobParametersEvent {
@Override
public int hashCode() {
return 17 + 23 * parameters.hashCode();
final int BASE_HASH = 17;
final int MULTIPLIER_HASH = 23;
return BASE_HASH + MULTIPLIER_HASH * parameters.hashCode();
}
@Override

View File

@@ -43,7 +43,7 @@ public class MessagePublisher<P>{
}
}
private final void publishMessage(Message<?> message) {
private void publishMessage(Message<?> message) {
this.listenerEventsChannel.send(message);
}

View File

@@ -163,10 +163,11 @@ public class TaskLaunchRequest implements Serializable{
@Override
public int hashCode() {
final int HASH_DEFAULT = 31;
int result = uri.hashCode();
result = 31 * result + commandlineArguments.hashCode();
result = 31 * result + environmentProperties.hashCode();
result = 31 * result + deploymentProperties.hashCode();
result = HASH_DEFAULT * result + commandlineArguments.hashCode();
result = HASH_DEFAULT * result + environmentProperties.hashCode();
result = HASH_DEFAULT * result + deploymentProperties.hashCode();
return result;
}
}