Browse Source

Fix quality flaws

tags/5.2-RC1
Simon Brandhof 8 years ago
parent
commit
a1d9480ac3

+ 1
- 1
sonar-batch/src/main/java/org/sonar/batch/deprecated/ResourceFilters.java View File

@@ -41,7 +41,7 @@ public class ResourceFilters {
check(logger, filters);
}

private void check(Logger logger, ResourceFilter[] filters) {
private static void check(Logger logger, ResourceFilter[] filters) {
if (filters.length > 0) {
logger.warn("ResourceFilters are not supported since version 4.2: " + Joiner.on(", ").join(filters));
}

+ 1
- 1
sonar-batch/src/main/java/org/sonar/batch/report/ActiveRulesPublisher.java View File

@@ -43,7 +43,7 @@ public class ActiveRulesPublisher implements ReportPublisherStep {
writer.writeActiveRules(activeRuleMessages);
}

private class ToMessage implements Function<ActiveRule, BatchReport.ActiveRule> {
private static class ToMessage implements Function<ActiveRule, BatchReport.ActiveRule> {
private final BatchReport.ActiveRule.Builder builder = BatchReport.ActiveRule.newBuilder();

@Override

+ 3
- 3
sonar-core/src/main/java/org/sonar/core/platform/PluginLoader.java View File

@@ -93,9 +93,9 @@ public class PluginLoader {
def.addFiles(explodedPlugin.getLibs());
def.addMainClass(info.getKey(), info.getMainClass());

for (String defaultSharedResource : DEFAULT_SHARED_RESOURCES) {
def.getExportMask().addInclusion(String.format("%s/%s/api/", defaultSharedResource, info.getKey()));
}
for (String defaultSharedResource : DEFAULT_SHARED_RESOURCES) {
def.getExportMask().addInclusion(String.format("%s/%s/api/", defaultSharedResource, info.getKey()));
}

// The plugins that extend other plugins can only add some files to classloader.
// They can't change metadata like ordering strategy or compatibility mode.

+ 24
- 0
sonar-db/src/main/java/org/sonar/core/persistence/package-info.java View File

@@ -0,0 +1,24 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@ParametersAreNonnullByDefault
package org.sonar.core.persistence;

import javax.annotation.ParametersAreNonnullByDefault;


+ 24
- 0
sonar-db/src/main/java/org/sonar/core/properties/package-info.java View File

@@ -0,0 +1,24 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@ParametersAreNonnullByDefault
package org.sonar.core.properties;

import javax.annotation.ParametersAreNonnullByDefault;


+ 1
- 1
sonar-db/src/main/java/org/sonar/core/user/DefaultUserFinder.java View File

@@ -59,7 +59,7 @@ public class DefaultUserFinder implements UserFinder {
return toUsers(dtos);
}

private List<User> toUsers(Collection<UserDto> dtos) {
private static List<User> toUsers(Collection<UserDto> dtos) {
List<User> users = Lists.newArrayList();
for (UserDto dto : dtos) {
users.add(dto.toUser());

+ 1
- 1
sonar-db/src/main/java/org/sonar/core/user/DeprecatedUserFinder.java View File

@@ -46,7 +46,7 @@ public class DeprecatedUserFinder implements UserFinder {
return copy(userDao.selectActiveUserByLogin(login));
}

private User copy(@Nullable UserDto dto) {
private static User copy(@Nullable UserDto dto) {
if (dto != null) {
User user = new User().setEmail(dto.getEmail()).setLogin(dto.getLogin()).setName(dto.getName());
user.setId(dto.getId().intValue());

+ 1
- 1
sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterDao.java View File

@@ -133,7 +133,7 @@ public class ResourceKeyUpdaterDao implements Dao {
}
}

private Set<ResourceDto> collectAllModules(long projectId, String stringToReplace, ResourceKeyUpdaterMapper mapper) {
private static Set<ResourceDto> collectAllModules(long projectId, String stringToReplace, ResourceKeyUpdaterMapper mapper) {
ResourceDto project = mapper.selectProject(projectId);
Set<ResourceDto> modules = Sets.newHashSet();
if (project.getKey().contains(stringToReplace)) {

+ 0
- 1
sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java View File

@@ -27,7 +27,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.CoreProperties;

+ 1
- 1
sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java View File

@@ -66,7 +66,7 @@ public abstract class ProfileExporter {
}

protected final ProfileExporter setSupportedLanguages(String... languages) {
supportedLanguages = (languages != null) ? languages : new String[0];
supportedLanguages = (languages != null ? languages : new String[0]);
return this;
}


+ 1
- 1
sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java View File

@@ -64,7 +64,7 @@ public abstract class ProfileImporter {
}

protected final ProfileImporter setSupportedLanguages(String... languages) {
supportedLanguages = ((languages != null) ? languages : new String[0]);
supportedLanguages = (languages != null ? languages : new String[0]);
return this;
}


Loading…
Cancel
Save