aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-06-21 09:53:43 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-06-21 09:53:43 +0200
commit55b66fedfe1bf5af32f2d0975df663dc26dda87f (patch)
tree643a1ecf675e90b73f73261c4ced9e4b44e6943a
parent536f03da477285c12ff9a31da49911376dbc18ee (diff)
parent2d9ebcf3180f5931e4ab6c46fcdc47b01f188861 (diff)
downloadsonarqube-55b66fedfe1bf5af32f2d0975df663dc26dda87f.tar.gz
sonarqube-55b66fedfe1bf5af32f2d0975df663dc26dda87f.zip
Merge remote branch 'upstream/master'
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java2
-rw-r--r--sonar-check-api/src/main/java/org/sonar/check/Message.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb12
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/config/environment.rb2
-rwxr-xr-xsonar-server/src/main/webapp/WEB-INF/vendor/rails/activerecord/lib/active_record/association_preload.rb44
6 files changed, 35 insertions, 29 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java
index 427ac20e3ab..44daab41ad2 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java
@@ -36,7 +36,7 @@ import java.util.List;
*/
public class JdbcDriverHolder {
- private static Logger LOG = LoggerFactory.getLogger(JdbcDriverHolder.class);
+ private static final Logger LOG = LoggerFactory.getLogger(JdbcDriverHolder.class);
private JdbcDriverClassLoader classLoader;
public JdbcDriverHolder(ArtifactDownloader extensionDownloader) {
diff --git a/sonar-check-api/src/main/java/org/sonar/check/Message.java b/sonar-check-api/src/main/java/org/sonar/check/Message.java
index 41ba1baf1e2..f0896fbdaf1 100644
--- a/sonar-check-api/src/main/java/org/sonar/check/Message.java
+++ b/sonar-check-api/src/main/java/org/sonar/check/Message.java
@@ -22,6 +22,9 @@ package org.sonar.check;
import java.util.Locale;
+/**
+ * @deprecated in 2.3
+ */
@Deprecated
public interface Message {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java
index 8780c8b205e..a689a25bb53 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Project.java
@@ -382,6 +382,7 @@ public class Project extends Resource {
*
* @deprecated since 2.6. See http://jira.codehaus.org/browse/SONAR-2126
*/
+ @Deprecated
public Project setFileSystem(ProjectFileSystem fs) {
this.fileSystem = fs;
return this;
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb
index 049de5a9a8d..f6f2038a346 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb
@@ -6,7 +6,7 @@
No changes has been done on this quality profile.
<% else %>
- <% form_tag({:action => 'changelog'}, {:method => 'post'}) do %>
+ <% form_tag({:action => 'changelog'}, {:method => 'post', :class => 'marginbottom10'}) do %>
<%= hidden_field_tag "id", @profile.id %>
Changelog from
<%= select_tag "since", options_for_select(@select_versions, @since_version) %>
@@ -15,7 +15,7 @@
<%= submit_tag "Load", :id => 'submit'%>
<% end %>
- <table class="data width100" style="word-wrap:break-word; table-layout: fixed;">
+ <table class="data width100">
<thead>
<tr>
<th>Profile version</th>
@@ -30,10 +30,10 @@
@changes.each do |change|
%>
<tr class="<%= cycle('even', 'odd') -%>">
- <td valign="top"><%= change.profile_version - 1 %> -> <%= change.profile_version %></td>
- <td valign="top"><%= l(change.change_date) -%></td>
- <td valign="top"><%= change.user_name %></td>
- <td valign="top"><%= change.action_text %></td>
+ <td valign="top" width="1%" nowrap><%= change.profile_version - 1 %> -> <%= change.profile_version %></td>
+ <td valign="top" width="1%" nowrap><%= l(change.change_date) -%></td>
+ <td valign="top" width="1%" nowrap><%= change.user_name %></td>
+ <td valign="top" width="1%" nowrap><%= change.action_text %></td>
<td valign="top"><%= change.rule.name %></td>
<td valign="top">
<% if change.old_severity
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/environment.rb b/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
index cf15d6a5a31..2aaca86abb7 100644
--- a/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
@@ -237,7 +237,7 @@ end
#
# other patches :
# - activerecord : fix Oracle bug when more than 1000 elements in IN clause. See lib/active_record/association_preload.rb
-# See https://rails.lighthouseapp.com/projects/8994/tickets/1533-preloading-more-than-1000-associated-records-causes-activerecordstatementinvalid-when-using-oracle
+# See https://github.com/rails/rails/issues/585
# - actionview NumberHelper, patch for number_with_precision()
require File.dirname(__FILE__) + '/../lib/sonar_webservice_plugins.rb'
diff --git a/sonar-server/src/main/webapp/WEB-INF/vendor/rails/activerecord/lib/active_record/association_preload.rb b/sonar-server/src/main/webapp/WEB-INF/vendor/rails/activerecord/lib/active_record/association_preload.rb
index d95e41c0f14..e3802d92568 100755
--- a/sonar-server/src/main/webapp/WEB-INF/vendor/rails/activerecord/lib/active_record/association_preload.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/vendor/rails/activerecord/lib/active_record/association_preload.rb
@@ -355,13 +355,13 @@ module ActiveRecord
end
conditions = "#{table_name}.#{connection.quote_column_name(primary_key)} #{in_or_equals_for_ids(ids)}"
- #SONAR
+ # SONAR
conditions = ([conditions] * (ids.size.to_f/MAX_IDS_PER_ORACLE_QUERY).ceil).join(" OR ")
- #SONAR
+ # /SONAR
conditions << append_conditions(reflection, preload_options)
- #SONAR
+ # SONAR
associated_records = klass.with_exclusive_scope do
klass.find(:all, :conditions => [conditions, *ids.in_groups_of(MAX_IDS_PER_ORACLE_QUERY, false)],
:include => options[:include],
@@ -369,37 +369,39 @@ module ActiveRecord
:joins => options[:joins],
:order => options[:order])
end
- #SONAR
+ # /SONAR
set_association_single_records(id_map, reflection.name, associated_records, primary_key)
end
end
def find_associated_records(ids, reflection, preload_options)
- options = reflection.options
- table_name = reflection.klass.quoted_table_name
-
- if interface = reflection.options[:as]
- conditions = "#{reflection.klass.quoted_table_name}.#{connection.quote_column_name "#{interface}_id"} #{in_or_equals_for_ids(ids)} and #{reflection.klass.quoted_table_name}.#{connection.quote_column_name "#{interface}_type"} = '#{self.base_class.sti_name}'"
- else
- foreign_key = reflection.primary_key_name
- conditions = "#{reflection.klass.quoted_table_name}.#{foreign_key} #{in_or_equals_for_ids(ids)}"
- end
+ # SONAR - iterate over safe_for_oracle_ids
+ associated_records = []
+ ids.each_slice(MAX_IDS_PER_ORACLE_QUERY) do |safe_for_oracle_ids|
+ options = reflection.options
+ table_name = reflection.klass.quoted_table_name
- #SONAR patch for Oracle IN clause with more than 1000 elements
- conditions = ([conditions] * (ids.size.to_f/MAX_IDS_PER_ORACLE_QUERY).ceil).join(" OR ")
- #SONAR
+ if interface = reflection.options[:as]
+ conditions = "#{reflection.klass.quoted_table_name}.#{connection.quote_column_name "#{interface}_id"} #{in_or_equals_for_ids(safe_for_oracle_ids)} and #{reflection.klass.quoted_table_name}.#{connection.quote_column_name "#{interface}_type"} = '#{self.base_class.sti_name}'"
+ else
+ foreign_key = reflection.primary_key_name
+ conditions = "#{reflection.klass.quoted_table_name}.#{foreign_key} #{in_or_equals_for_ids(safe_for_oracle_ids)}"
+ end
- conditions << append_conditions(reflection, preload_options)
+ conditions << append_conditions(reflection, preload_options)
- reflection.klass.with_exclusive_scope do
- reflection.klass.find(:all,
+ reflection.klass.with_exclusive_scope do
+ associated_records += reflection.klass.find(:all,
:select => (preload_options[:select] || options[:select] || "#{table_name}.*"),
:include => preload_options[:include] || options[:include],
- :conditions => [conditions, ids],
+ :conditions => [conditions, safe_for_oracle_ids],
:joins => options[:joins],
:group => preload_options[:group] || options[:group],
:order => preload_options[:order] || options[:order])
- end
+ end
+ end
+ associated_records
+ # /SONAR
end