Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: SonarSource/sonarqube
...
head fork: SonarSource/sonarqube
Checking mergeability… Don't worry, you can still create the pull request.
  • 11 commits
  • 41 files changed
  • 0 commit comments
  • 3 contributors
Showing with 56 additions and 44 deletions.
  1. +1 −1  plugins/sonar-checkstyle-plugin/pom.xml
  2. +1 −1  plugins/sonar-cobertura-plugin/pom.xml
  3. +1 −1  plugins/sonar-core-gwt/pom.xml
  4. +1 −1  plugins/sonar-core-plugin/pom.xml
  5. +8 −0 ...s/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingBlocksRecognizer.java
  6. +2 −2 plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingDecorator.java
  7. +4 −1 ...s/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/tracking/HashedSequenceComparator.java
  8. +1 −1  plugins/sonar-cpd-plugin/pom.xml
  9. +1 −1  plugins/sonar-dbcleaner-plugin/pom.xml
  10. +1 −1  plugins/sonar-design-plugin/pom.xml
  11. +1 −1  plugins/sonar-email-notifications-plugin/pom.xml
  12. +1 −1  plugins/sonar-findbugs-plugin/pom.xml
  13. +1 −1  plugins/sonar-jacoco-plugin/pom.xml
  14. +1 −1  plugins/sonar-l10n-en-plugin/pom.xml
  15. +1 −1  plugins/sonar-pmd-plugin/pom.xml
  16. +1 −1  plugins/sonar-squid-java-plugin/pom.xml
  17. +1 −1  plugins/sonar-surefire-plugin/pom.xml
  18. +1 −1  pom.xml
  19. +1 −1  sonar-application/pom.xml
  20. +1 −1  sonar-batch-bootstrapper/pom.xml
  21. +1 −1  sonar-batch-maven-compat/pom.xml
  22. +1 −1  sonar-batch/pom.xml
  23. +1 −1  sonar-channel/pom.xml
  24. +1 −1  sonar-check-api/pom.xml
  25. +1 −1  sonar-colorizer/pom.xml
  26. +1 −1  sonar-core/pom.xml
  27. +1 −1  sonar-deprecated/pom.xml
  28. +1 −1  sonar-duplications/pom.xml
  29. +1 −1  sonar-graph/pom.xml
  30. +1 −1  sonar-gwt-api/pom.xml
  31. +1 −1  sonar-java-api/pom.xml
  32. +1 −1  sonar-markdown/pom.xml
  33. +1 −1  sonar-maven-plugin/pom.xml
  34. +1 −1  sonar-maven3-plugin/pom.xml
  35. +1 −1  sonar-plugin-api/pom.xml
  36. +1 −1  sonar-server/pom.xml
  37. +1 −2  sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java
  38. +5 −3 sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
  39. +1 −1  sonar-squid/pom.xml
  40. +1 −1  sonar-testing-harness/pom.xml
  41. +1 −1  sonar-ws-client/pom.xml
View
2  plugins/sonar-checkstyle-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
2  plugins/sonar-cobertura-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
2  plugins/sonar-core-gwt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>sonar-core-gwt</artifactId>
View
2  plugins/sonar-core-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
8 ...onar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingBlocksRecognizer.java
@@ -40,6 +40,14 @@ private ViolationTrackingBlocksRecognizer(StringText a, StringText b, StringText
this.cmp = new HashedSequenceComparator<StringText>(cmp);
}
+ public boolean isValidLineInReference(int line) {
+ return (0 <= line) && (line < a.length());
+ }
+
+ public boolean isValidLineInSource(int line) {
+ return (0 <= line) && (line < b.length());
+ }
+
/**
* @param startA number of line from first version of text (numbering starts from 0)
* @param startB number of line from second version of text (numbering starts from 0)
View
4 plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingDecorator.java
@@ -124,9 +124,9 @@ public RuleFailureModel getReferenceViolation(Violation violation) {
List<ViolationPair> possiblePairs = Lists.newArrayList();
for (Violation newViolation : newViolations) {
- if (newViolation.getLineId() != null) {
+ if (newViolation.getLineId() != null && rec.isValidLineInSource(newViolation.getLineId() - 1)) {
for (RuleFailureModel pastViolation : pastViolationsByRule.get(newViolation.getRule().getId())) {
- if (pastViolation.getLine() != null) {
+ if (pastViolation.getLine() != null && rec.isValidLineInReference(pastViolation.getLine() - 1)) {
int weight = rec.computeLengthOfMaximalBlock(pastViolation.getLine() - 1, newViolation.getLineId() - 1);
possiblePairs.add(new ViolationPair(pastViolation, newViolation, weight));
}
View
5 ...onar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/tracking/HashedSequenceComparator.java
@@ -31,7 +31,10 @@ public HashedSequenceComparator(SequenceComparator<? super S> cmp) {
}
public boolean equals(HashedSequence<S> a, int ai, HashedSequence<S> b, int bi) {
- return a.hashes[ai] == b.hashes[bi] && cmp.equals(a.base, ai, b.base, bi);
+ if (a.hashes[ai] == b.hashes[bi]) {
+ return cmp.equals(a.base, ai, b.base, bi);
+ }
+ return false;
}
public int hash(HashedSequence<S> seq, int i) {
View
2  plugins/sonar-cpd-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
2  plugins/sonar-dbcleaner-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
2  plugins/sonar-design-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
2  plugins/sonar-email-notifications-plugin/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
View
2  plugins/sonar-findbugs-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
2  plugins/sonar-jacoco-plugin/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
View
2  plugins/sonar-l10n-en-plugin/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
View
2  plugins/sonar-pmd-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
2  plugins/sonar-squid-java-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<groupId>org.codehaus.sonar.plugins</groupId>
View
2  plugins/sonar-surefire-plugin/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
View
2  pom.xml
@@ -5,7 +5,7 @@
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
<packaging>pom</packaging>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<name>Sonar</name>
<url>http://www.sonarsource.org</url>
<description>Put technical debt under control</description>
View
2  sonar-application/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-application</artifactId>
<packaging>jar</packaging>
View
2  sonar-batch-bootstrapper/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-batch-bootstrapper</artifactId>
View
2  sonar-batch-maven-compat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-batch-maven-compat</artifactId>
View
2  sonar-batch/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<groupId>org.codehaus.sonar</groupId>
View
2  sonar-channel/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>sonar-channel</artifactId>
View
2  sonar-check-api/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>sonar-check-api</artifactId>
View
2  sonar-colorizer/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>sonar-colorizer</artifactId>
View
2  sonar-core/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-core</artifactId>
<name>Sonar :: Core</name>
View
2  sonar-deprecated/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-deprecated</artifactId>
<name>Sonar :: Deprecated</name>
View
2  sonar-duplications/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-duplications</artifactId>
View
2  sonar-graph/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.codehaus.sonar</groupId>
View
2  sonar-gwt-api/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-gwt-api</artifactId>
<packaging>jar</packaging>
View
2  sonar-java-api/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-java-api</artifactId>
<name>Sonar :: Java API</name>
View
2  sonar-markdown/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>sonar-markdown</artifactId>
View
2  sonar-maven-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
View
2  sonar-maven3-plugin/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-maven3-plugin</artifactId>
<packaging>maven-plugin</packaging>
View
2  sonar-plugin-api/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-plugin-api</artifactId>
<packaging>jar</packaging>
View
2  sonar-server/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-server</artifactId>
<packaging>war</packaging>
View
3  sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java
@@ -20,7 +20,6 @@
package org.sonar.server.ui;
import com.google.common.collect.Lists;
-import org.apache.commons.configuration.Configuration;
import org.slf4j.LoggerFactory;
import org.sonar.api.CoreProperties;
import org.sonar.api.config.License;
@@ -337,7 +336,7 @@ public Settings getSettings() {
}
public String getConfigurationValue(String key) {
- return getContainer().getComponentByType(Configuration.class).getString(key, null);
+ return getContainer().getComponentByType(Settings.class).getString(key);
}
public List<InetAddress> getValidInetAddressesForServerId() {
View
8 sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
@@ -33,9 +33,11 @@ def index
def update
@project=nil
+ resource_id=nil
if params[:resource_id]
@project=Project.by_key(params[:resource_id])
access_denied unless (@project && is_admin?(@project))
+ resource_id=@project.id
else
access_denied unless is_admin?
end
@@ -47,12 +49,12 @@ def update
if @category && @definitions_per_category[@category]
@definitions_per_category[@category].each do |property|
value=params[property.getKey()]
- persisted_property = Property.find(:first, :conditions => {:prop_key=> property.key(), :resource_id => params[:resource_id], :user_id => nil})
+ persisted_property = Property.find(:first, :conditions => {:prop_key=> property.key(), :resource_id => resource_id, :user_id => nil})
# update the property
if persisted_property
if value.empty?
- Property.delete_all('prop_key' => property.key(), 'resource_id' => params[:resource_id], 'user_id' => nil)
+ Property.delete_all('prop_key' => property.key(), 'resource_id' => resource_id, 'user_id' => nil)
java_facade.setGlobalProperty(property.getKey(), nil) if is_global
elsif persisted_property.text_value != value.to_s
persisted_property.text_value = value.to_s
@@ -64,7 +66,7 @@ def update
# create the property
elsif value.present?
- persisted_property=Property.new(:prop_key => property.key(), :text_value => value.to_s, :resource_id => params[:resource_id])
+ persisted_property=Property.new(:prop_key => property.key(), :text_value => value.to_s, :resource_id => resource_id)
if persisted_property.save && is_global
java_facade.setGlobalProperty(property.getKey(), value.to_s)
end
View
2  sonar-squid/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.codehaus.sonar</groupId>
View
2  sonar-testing-harness/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-testing-harness</artifactId>
<packaging>jar</packaging>
View
2  sonar-ws-client/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>sonar-ws-client</artifactId>
<packaging>jar</packaging>

No commit comments for this range

Something went wrong with that request. Please try again.