}
}
- private List<String> sanitizeList(@Nullable List<String> list) {
+ private static List<String> sanitizeList(@Nullable List<String> list) {
if (list == null || list.isEmpty()) {
return Collections.emptyList();
}
return !actionPlanDao.selectByNameAndProjectId(name, findProject(projectKey).getId()).isEmpty();
}
- private List<ActionPlan> toActionPlans(List<ActionPlanDto> actionPlanDtos) {
+ private static List<ActionPlan> toActionPlans(List<ActionPlanDto> actionPlanDtos) {
return newArrayList(Iterables.transform(actionPlanDtos, ToActionPlan.INSTANCE));
}
}
}
- private boolean isJavaConstantStart(int character) {
+ private static boolean isJavaConstantStart(int character) {
return Character.isUpperCase(character);
}
- private boolean isJavaConstantPart(int character) {
+ private static boolean isJavaConstantPart(int character) {
return Character.isUpperCase(character) || character == '_' || character == '-' || Character.isDigit(character);
}
DashboardMapper dashboardMapper = session.getMapper(DashboardMapper.class);
WidgetMapper widgetMapper = session.getMapper(WidgetMapper.class);
WidgetPropertyMapper widgetPropertyMapper = session.getMapper(WidgetPropertyMapper.class);
- dashboardMapper.insert(dashboardDto);
- for (WidgetDto widgetDto : dashboardDto.getWidgets()) {
- widgetDto.setDashboardId(dashboardDto.getId());
- widgetMapper.insert(widgetDto);
- for (WidgetPropertyDto widgetPropertyDto : widgetDto.getWidgetProperties()) {
- widgetPropertyDto.setWidgetId(widgetDto.getId());
- widgetPropertyMapper.insert(widgetPropertyDto);
- }
+ dashboardMapper.insert(dashboardDto);
+ for (WidgetDto widgetDto : dashboardDto.getWidgets()) {
+ widgetDto.setDashboardId(dashboardDto.getId());
+ widgetMapper.insert(widgetDto);
+ for (WidgetPropertyDto widgetPropertyDto : widgetDto.getWidgetProperties()) {
+ widgetPropertyDto.setWidgetId(widgetDto.getId());
+ widgetPropertyMapper.insert(widgetPropertyDto);
}
+ }
}
public void insert(DashboardDto dashboardDto) {
public class GroupDao implements Dao {
- private static final String SQL_WILDCARD = "%";
private System2 system;
public GroupDao(System2 system) {
update.setLong(1, id);
return true;
}
+
+ private static String extractLanguage(String propertyKey) {
+ return propertyKey.substring("sonar.profile.".length());
+ }
+
}
private static final Logger LOGGER = Loggers.get(MoveProjectProfileAssociation.class);
}
}
- private static String extractLanguage(String propertyKey) {
- return propertyKey.substring("sonar.profile.".length());
- }
-
private Table<String, String, String> getProfileKeysByLanguageThenName(final Context context) throws SQLException {
final Table<String, String, String> profilesByLanguageAndName = HashBasedTable.create();
}
configureFields(activeRule, check);
return check;
- } catch (InstantiationException e) {
- throw failToInstantiateCheck(activeRule, checkClassOrInstance, e);
- } catch (IllegalAccessException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
throw failToInstantiateCheck(activeRule, checkClassOrInstance, e);
}
}
configureFields(activeRule, check);
return check;
- } catch (InstantiationException e) {
+ } catch (InstantiationException | IllegalAccessException e) {
throw new SonarException(CAN_NOT_INSTANTIATE_THE_CHECK_RELATED_TO_THE_RULE + activeRule, e);
- } catch (IllegalAccessException e) {
- throw new SonarException(CAN_NOT_INSTANTIATE_THE_CHECK_RELATED_TO_THE_RULE + activeRule, e);
}
}