Name name();
- public enum Name {
+ enum Name {
PRE, DEFAULT, POST
}
}
}
ProjectDefinition that = (ProjectDefinition) o;
String key = getKey();
- if (key != null ? !key.equals(that.getKey()) : that.getKey() != null) {
- return false;
- }
+ return !(key != null ? !key.equals(that.getKey()) : that.getKey() != null);
- return true;
}
@Override
*/
public class DebtRemediationFunction {
- public static enum Type {
+ public enum Type {
LINEAR, LINEAR_OFFSET, CONSTANT_ISSUE
}
/**
* Interface of the underlying file index.
*/
- public static interface Index {
+ interface Index {
Iterable<InputFile> inputFiles();
@CheckForNull
public Iterable<InputFile> get(Index index) {
String relative = PathUtils.sanitize(new PathResolver().relativePath(baseDir.toFile(), new File(path)));
if (relative == null) {
- return Collections.<InputFile>emptyList();
+ return Collections.emptyList();
}
InputFile f = index.inputFile(relative);
return f != null ? Arrays.asList(f) : Collections.<InputFile>emptyList();
}
}
- public static interface LineHashConsumer {
+ public interface LineHashConsumer {
void consume(int lineIdx, @Nullable byte[] hash);
public boolean match(InputFile inputFile, boolean caseSensitiveFileExtension) {
String path = inputFile.absolutePath();
if (!caseSensitiveFileExtension) {
- String extension = super.sanitizeExtension(FilenameUtils.getExtension(inputFile.file().getName()));
+ String extension = sanitizeExtension(FilenameUtils.getExtension(inputFile.file().getName()));
if (StringUtils.isNotBlank(extension)) {
path = StringUtils.removeEndIgnoreCase(path, extension);
path = path + extension;
public boolean match(InputFile inputFile, boolean caseSensitiveFileExtension) {
String path = inputFile.relativePath();
if (!caseSensitiveFileExtension) {
- String extension = super.sanitizeExtension(FilenameUtils.getExtension(inputFile.file().getName()));
+ String extension = sanitizeExtension(FilenameUtils.getExtension(inputFile.file().getName()));
if (StringUtils.isNotBlank(extension)) {
path = StringUtils.removeEndIgnoreCase(path, extension);
path = path + extension;
/**
* Callback for the provider to report results of blame per file.
*/
- public static interface BlameInput {
+ public interface BlameInput {
/**
* Filesystem of the current (sub )project.
/**
* Callback for the provider to report results of blame per file.
*/
- public static interface BlameOutput {
+ public interface BlameOutput {
/**
* Add result of the blame command for a single file. Number of lines should
Preconditions.checkState(!this.fromKey.equals(this.toKey), "From and To can't be the same inputFile");
Preconditions.checkNotNull(this.fromKey, "From inputFile can't be null");
Preconditions.checkNotNull(this.toKey, "To inputFile can't be null");
- storage.store((Dependency) this);
+ storage.store(this);
}
@Override
@Beta
public interface Duplication {
- public static class Block {
+ class Block {
private final String resourceKey;
private final int startLine;
private final int length;
@Beta
public interface Issue {
- public enum Severity {
+ enum Severity {
INFO,
MINOR,
MAJOR,
CRITICAL,
- BLOCKER;
+ BLOCKER
}
/**
return false;
}
Action that = (Action) o;
- if (!key.equals(that.key)) {
- return false;
- }
- return true;
+ return key.equals(that.key);
}
@Override
return false;
}
DefaultIssue that = (DefaultIssue) o;
- if (key != null ? !key.equals(that.key) : that.key != null) {
- return false;
- }
- return true;
+ return !(key != null ? !key.equals(that.key) : that.key != null);
}
@Override
if (characteristic != null ? !characteristic.equals(measure.characteristic) : measure.characteristic != null) {
return false;
}
- if (personId != null ? !personId.equals(measure.personId) : measure.personId != null) {
- return false;
- }
- return true;
+ return !(personId != null ? !personId.equals(measure.personId) : measure.personId != null);
}
@Override
return false;
}
ProfileExporter that = (ProfileExporter) o;
- if (key != null ? !key.equals(that.key) : that.key != null) {
- return false;
- }
- return true;
+ return !(key != null ? !key.equals(that.key) : that.key != null);
}
@Override
return false;
}
ProfileImporter that = (ProfileImporter) o;
- if (importerKey != null ? !importerKey.equals(that.importerKey) : that.importerKey != null) {
- return false;
- }
- return true;
+ return !(importerKey != null ? !importerKey.equals(that.importerKey) : that.importerKey != null);
}
@Override
if (!repository.equals(ruleKey.repository)) {
return false;
}
- if (!rule.equals(ruleKey.rule)) {
- return false;
- }
- return true;
+ return rule.equals(ruleKey.rule);
}
@Override
if (!rule.equals(that.rule)) {
return false;
}
- if (rulesProfile != null ? !rulesProfile.equals(that.rulesProfile) : that.rulesProfile != null) {
- return false;
- }
+ return !(rulesProfile != null ? !rulesProfile.equals(that.rulesProfile) : that.rulesProfile != null);
- return true;
}
@Override
/**
* Plugins must not implement this interface. It is provided at runtime.
*/
- public interface Context {
+ interface Context {
ModuleFileSystem fileSystem();
FileType type();
/**
* Only used when a characteristic is disabled (id is -1 in dto) by the user. see {@link org.sonar.server.rule.index.RuleNormalizer}
*/
- static String NONE = "NONE";
+ String NONE = "NONE";
String key();
*/
public interface DebtRemediationFunction {
- static enum Type {
+ enum Type {
LINEAR, LINEAR_OFFSET, CONSTANT_ISSUE
}
}
TaskDefinition that = (TaskDefinition) o;
- if (!key.equals(that.key)) {
- return false;
- }
- return true;
+ return key.equals(that.key);
}
@Override
if (!characteristic.equals(that.characteristic)) {
return false;
}
- if (!ruleKey.equals(that.ruleKey)) {
- return false;
- }
+ return ruleKey.equals(that.ruleKey);
- return true;
}
@Override
if (key != null ? !key.equals(that.key) : that.key != null) {
return false;
}
- if (ruleKey != null ? !ruleKey.equals(that.ruleKey) : that.ruleKey != null) {
- return false;
- }
+ return !(ruleKey != null ? !ruleKey.equals(that.ruleKey) : that.ruleKey != null);
- return true;
}
@Override
}
Duration that = (Duration) o;
- if (durationInMinutes != that.durationInMinutes) {
- return false;
- }
+ return durationInMinutes == that.durationInMinutes;
- return true;
}
@Override
if (Double.compare(workUnit.value, value) != 0) {
return false;
}
- if (!unit.equals(workUnit.unit)) {
- return false;
- }
+ return unit.equals(workUnit.unit);
- return true;
}
@Override
static final int HOUR_POSITION_IN_LONG = 100;
static final int MINUTE_POSITION_IN_LONG = 1;
- public static enum UNIT {
+ public enum UNIT {
DAYS, HOURS, MINUTES
}
}
WorkDuration that = (WorkDuration) o;
- if (durationInMinutes != that.durationInMinutes) {
- return false;
- }
+ return durationInMinutes == that.durationInMinutes;
- return true;
}
@Override
@Deprecated
public final class ViolationQuery {
- public static enum SwitchMode {
+ public enum SwitchMode {
OFF, ON, BOTH
}