508 : sonar qube critical issue fixes (#852)
* 508 : sonar qube critical issue fixes * 508 : Sunar Qube Fixes Define a constant instead of duplicating this literal "user_accounts" 4 times. Define a constant instead of duplicating this literal "userID" 5 times Define a constant instead of duplicating this literal "additionalInfo" 4 times. Define a constant instead of duplicating this literal "userName" 4 times. * 508 : Sunar Qube Fixes Define a constant instead of duplicating this literal "user_accounts" 4 times. * 508 : Sonar Qube Fixes Define a constant instead of duplicating this literal "eEvans" 4 times Define a constant instead of duplicating this literal "jBloch" 6 times Define a constant instead of duplicating this literal "mFowler" 3 times * 508 : Sonar Qube FIxes Define a constant instead of duplicating this literal "username" 3 times. * 508: sonar qube issue fixes Define a constant instead of duplicating this literal "customerDao.getAllCustomers(): " 4 times. * 508 : sonar qube issue fixes Define a constant instead of duplicating this literal "App.main(), student : " 4 times. * 508 : sonar Qube issue fixes Define a constant instead of duplicating this literal "{} hits {}. {} is damaged!" 3 times. Define a constant instead of duplicating this literal "{} hits {}." 4 times. * 508 : Define a constant instead of duplicating this literal "{} hits {}." 4 times. * 508 : checkstyle fixes * 508: checkstyle fixes * 508: checkstyle fixes * 508: checkstyle fixes * 508: checkstyle fixes * 508: checkstyle fixes * 508: cqrs checkstyle fixes
This commit is contained in:
committed by
Ilkka Seppälä
parent
17bfc91f45
commit
c6ecf58687
@ -25,6 +25,8 @@ package com.iluwatar.doubledispatch;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.iluwatar.doubledispatch.constants.AppConstants;
|
||||
|
||||
/**
|
||||
*
|
||||
* Meteoroid game object
|
||||
@ -45,21 +47,21 @@ public class Meteoroid extends GameObject {
|
||||
|
||||
@Override
|
||||
public void collisionResolve(FlamingAsteroid asteroid) {
|
||||
LOGGER.info("{} hits {}.", asteroid.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
LOGGER.info(AppConstants.HITS, asteroid.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(Meteoroid meteoroid) {
|
||||
LOGGER.info("{} hits {}.", meteoroid.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
LOGGER.info(AppConstants.HITS, meteoroid.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(SpaceStationMir mir) {
|
||||
LOGGER.info("{} hits {}.", mir.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
LOGGER.info(AppConstants.HITS, mir.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(SpaceStationIss iss) {
|
||||
LOGGER.info("{} hits {}.", iss.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
LOGGER.info(AppConstants.HITS, iss.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ package com.iluwatar.doubledispatch;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.iluwatar.doubledispatch.constants.AppConstants;
|
||||
|
||||
/**
|
||||
*
|
||||
* Space station Mir game object
|
||||
@ -45,7 +47,7 @@ public class SpaceStationMir extends GameObject {
|
||||
|
||||
@Override
|
||||
public void collisionResolve(FlamingAsteroid asteroid) {
|
||||
LOGGER.info("{} hits {}. {} is damaged! {} is set on fire!", asteroid.getClass().getSimpleName(),
|
||||
LOGGER.info(AppConstants.HITS," {} is damaged! {} is set on fire!", asteroid.getClass().getSimpleName(),
|
||||
this.getClass().getSimpleName(), this.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
setDamaged(true);
|
||||
setOnFire(true);
|
||||
@ -53,21 +55,21 @@ public class SpaceStationMir extends GameObject {
|
||||
|
||||
@Override
|
||||
public void collisionResolve(Meteoroid meteoroid) {
|
||||
LOGGER.info("{} hits {}. {} is damaged!", meteoroid.getClass().getSimpleName(),
|
||||
LOGGER.info(AppConstants.HITS," {} is damaged!", meteoroid.getClass().getSimpleName(),
|
||||
this.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
setDamaged(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(SpaceStationMir mir) {
|
||||
LOGGER.info("{} hits {}. {} is damaged!", mir.getClass().getSimpleName(),
|
||||
LOGGER.info(AppConstants.HITS," {} is damaged!", mir.getClass().getSimpleName(),
|
||||
this.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
setDamaged(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collisionResolve(SpaceStationIss iss) {
|
||||
LOGGER.info("{} hits {}. {} is damaged!", iss.getClass().getSimpleName(),
|
||||
LOGGER.info(AppConstants.HITS," {} is damaged!", iss.getClass().getSimpleName(),
|
||||
this.getClass().getSimpleName(), this.getClass().getSimpleName());
|
||||
setDamaged(true);
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
package com.iluwatar.doubledispatch.constants;
|
||||
|
||||
/**
|
||||
*
|
||||
* Constants class to define all constants
|
||||
*
|
||||
*/
|
||||
public class AppConstants {
|
||||
|
||||
public static final String HITS = "{} hits {}.";
|
||||
}
|
Reference in New Issue
Block a user