Kaynağa Gözat

Fix Quality flaws

tags/6.6-RC1
Simon Brandhof 6 yıl önce
ebeveyn
işleme
3a988bb88a

+ 2
- 1
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivatorContext.java Dosyayı Görüntüle

@@ -256,6 +256,7 @@ class RuleActivatorContext {
void verifyForActivation() {
checkRequest(RuleStatus.REMOVED != rule.getStatus(), "Rule was removed: %s", rule.getKey());
checkRequest(!rule.isTemplate(), "Rule template can't be activated on a Quality profile: %s", rule.getKey());
checkRequest(rulesProfile.getLanguage().equals(rule.getLanguage()), "Rule %s and profile %s have different languages", rule.getKey(), profile != null ? profile.getKee() : rulesProfile.getKee());
checkRequest(rulesProfile.getLanguage().equals(rule.getLanguage()),
"Rule %s and profile %s have different languages", rule.getKey(), profile != null ? profile.getKee() : rulesProfile.getKee());
}
}

+ 5
- 9
sonar-core/src/main/java/org/sonar/core/util/UtcDateUtils.java Dosyayı Görüntüle

@@ -30,15 +30,11 @@ import org.sonar.api.utils.DateUtils;
public class UtcDateUtils {

private static final ThreadLocal<DateFormat> format =
new ThreadLocal<DateFormat>() {
@Override
protected DateFormat initialValue() {
DateFormat f = new SimpleDateFormat(DateUtils.DATETIME_FORMAT);
f.setTimeZone(TimeZone.getTimeZone("UTC"));
return f;

}
};
ThreadLocal.withInitial(() -> {
DateFormat f = new SimpleDateFormat(DateUtils.DATETIME_FORMAT);
f.setTimeZone(TimeZone.getTimeZone("UTC"));
return f;
});

private UtcDateUtils() {
// only static stuff

+ 2
- 2
sonar-plugin-api/src/main/java/org/sonar/api/config/AesCipher.java Dosyayı Görüntüle

@@ -59,7 +59,7 @@ final class AesCipher implements Cipher {
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

@@ -73,7 +73,7 @@ final class AesCipher implements Cipher {
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}


+ 1
- 1
sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java Dosyayı Görüntüle

@@ -218,7 +218,7 @@ public class Version implements Comparable<Version> {
c = patch - other.patch;
if (c == 0) {
long diff = buildNumber - other.buildNumber;
c = diff > 0 ? 1 : (diff < 0 ? -1 : 0);
c = (diff > 0) ? 1 : ((diff < 0) ? -1 : 0);
}
}
}

+ 3
- 3
sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/pattern/LineRange.java Dosyayı Görüntüle

@@ -65,10 +65,10 @@ public class LineRange {

@Override
public int hashCode() {
final int prime = 31;
final int PRIME = 31;
int result = 1;
result = prime * result + from;
result = prime * result + to;
result = PRIME * result + from;
result = PRIME * result + to;
return result;
}


+ 2
- 2
sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/TrackedIssue.java Dosyayı Görüntüle

@@ -227,9 +227,9 @@ public class TrackedIssue implements Trackable, Serializable {

@Override
public int hashCode() {
final int prime = 31;
final int PRIME = 31;
int result = 1;
result = prime * result + ((key == null) ? 0 : key.hashCode());
result = PRIME * result + ((key == null) ? 0 : key.hashCode());
return result;
}


Loading…
İptal
Kaydet