import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
-import org.slf4j.LoggerFactory;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Project;
this.orderIndex = orderIndex;
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
@Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this, new String[]{"id"});
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ActiveDashboardDto that = (ActiveDashboardDto) o;
+ return !(id != null ? !id.equals(that.id) : that.id != null);
+
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
@Override
- public boolean equals(Object obj) {
- return EqualsBuilder.reflectionEquals(this, obj, new String[]{"id"});
+ public int hashCode() {
+ return id != null ? id.hashCode() : 0;
}
-
}
* This list is hardcoded because we didn't succeed in using java.sql.DatabaseMetaData#getTables() in the same way
* for all the supported databases, particularly due to Oracle results.
*/
- public static final String[] TABLE_NAMES = {
+ static final String[] TABLE_NAMES = {
"action_plans",
"action_plans_reviews",
"active_dashboards",
}
}
- private void initDatasource() throws Exception {
+ private void initDatasource() throws Exception {//NOSONAR this exception is thrown by BasicDataSourceFactory
+ // but it's correctly caught by start()
+
LOG.info("Create JDBC datasource");
datasource = (BasicDataSource) BasicDataSourceFactory.createDataSource(extractCommonsDbcpProperties(properties));
package org.sonar.core.persistence.dialect;
import org.apache.commons.lang.StringUtils;
-import org.hibernate.HibernateException;
import org.hibernate.dialect.SQLServerDialect;
import org.sonar.api.database.DatabaseProperties;
registerColumnType(Types.CLOB, "nvarchar(max)");
}
- public String getTypeName(int code, int length, int precision, int scale) throws HibernateException {
+ public String getTypeName(int code, int length, int precision, int scale) {
if (code != 2005) {
return super.getTypeName(code, length, precision, scale);
} else {
package org.sonar.core.persistence.dialect;
import org.apache.commons.lang.StringUtils;
-import org.hibernate.MappingException;
import org.hibernate.dialect.Dialect;
import org.hibernate.id.PersistentIdentifierGenerator;
import org.hibernate.id.SequenceGenerator;
public static final String SEQUENCE_NAME_SUFFIX = "_SEQ";
@Override
- public void configure(Type type, Properties params, Dialect dialect)
- throws MappingException {
-
+ public void configure(Type type, Properties params, Dialect dialect) {
String tableName = params.getProperty(PersistentIdentifierGenerator.TABLE);
-
if (tableName != null) {
StringBuilder sequenceNameBuilder = new StringBuilder();
-
sequenceNameBuilder.append(tableName);
sequenceNameBuilder.append(SEQUENCE_NAME_SUFFIX);
-
params.setProperty(SEQUENCE, StringUtils.upperCase(sequenceNameBuilder.toString()));
}
-
super.configure(type, params, dialect);
}
*/
package org.sonar.core.persistence.dialect;
-import org.hibernate.MappingException;
import org.hibernate.dialect.Dialect;
import org.hibernate.id.PersistentIdentifierGenerator;
import org.hibernate.id.SequenceGenerator;
public static final String SEQUENCE_NAME_SUFFIX = "seq";
@Override
- public void configure(Type type, Properties params, Dialect dialect)
- throws MappingException {
+ public void configure(Type type, Properties params, Dialect dialect) {
String tableName = params.getProperty(PersistentIdentifierGenerator.TABLE);
String columnName = params.getProperty(PersistentIdentifierGenerator.PK);
*/
package org.sonar.core.resource;
-import java.util.List;
-
public interface ResourceIndexerMapper {
ResourceIndexDto selectMasterIndexByResourceId(int resourceId);
package org.sonar.api.resources;
import com.google.common.base.Predicate;
-import com.google.common.collect.*;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.io.IOCase;
import org.apache.commons.io.filefilter.*;
import org.apache.commons.lang.CharEncoding;
import org.apache.commons.lang.StringUtils;
/**
* An implementation of {@link ProjectFileSystem}.
* For internal use only.
- *
+ *
* @since 1.10
* @deprecated in 2.8. In fact this class should not be located in sonar-plugin-api and most of the methods were overridden by a component in sonar-batch.
*/
WildcardPattern[] exclusionPatterns = getExclusionPatterns(applyExclusionPatterns);
IOFileFilter initialFilesFilter = TrueFileFilter.INSTANCE;
- if (initialFiles!=null && !initialFiles.isEmpty()) {
+ if (initialFiles != null && !initialFiles.isEmpty()) {
initialFilesFilter = new FileSelectionFilter(initialFiles);
}
/**
* getRelativePath("c:/foo/src/my/package/Hello.java", "c:/foo/src") is "my/package/Hello.java"
- *
+ *
* @return null if file is not in dir (including recursive subdirectories)
*/
public static String getRelativePath(File file, File dir) {
* <p>
* Relative path is composed of slashes. Windows backslaches are replaced by /
* </p>
- *
+ *
* @return null if file is not in dir (including recursive subdirectories)
*/
public static String getRelativePath(File file, List<File> dirs) {