import org.sonar.api.issue.ActionPlan;
+import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;
* Sort action plans by chronological deadlines. Plans without deadline are
* located after plans with deadline.
*/
-public class ActionPlanDeadlineComparator implements Comparator<ActionPlan> {
+public class ActionPlanDeadlineComparator implements Comparator<ActionPlan>, Serializable {
@Override
public int compare(ActionPlan a1, ActionPlan a2) {
import org.sonar.api.rule.RuleKey;
import javax.annotation.Nullable;
+
import java.util.Map;
import java.util.UUID;
@Override
public DefaultIssue build() {
Preconditions.checkNotNull(componentKey, "Component key must be set");
- // TODO
- //Preconditions.checkNotNull(projectKey, "Project key must be set");
+ Preconditions.checkNotNull(projectKey, "Project key must be set");
Preconditions.checkNotNull(ruleKey, "Rule key must be set");
DefaultIssue issue = new DefaultIssue();
loadAlias(conf, "ActionPlanStats", ActionPlanStatsDto.class);
Class<?>[] mappers = {ActiveDashboardMapper.class, AuthorMapper.class, DashboardMapper.class,
- DependencyMapper.class, DuplicationMapper.class, GraphDtoMapper.class, IssueMapper.class, IssueStatsMapper.class, IssueChangeMapper.class, LoadedTemplateMapper.class,
- MeasureFilterMapper.class, PropertiesMapper.class, PurgeMapper.class, ResourceKeyUpdaterMapper.class, ResourceIndexerMapper.class, ResourceMapper.class,
+ DependencyMapper.class, DuplicationMapper.class, GraphDtoMapper.class,
+ // ResourceMapper has to be loaded before IssueMapper because this last one used it
+ ResourceMapper.class, IssueMapper.class, IssueStatsMapper.class, IssueChangeMapper.class,
+ LoadedTemplateMapper.class, MeasureFilterMapper.class, PropertiesMapper.class, PurgeMapper.class, ResourceKeyUpdaterMapper.class, ResourceIndexerMapper.class,
ResourceSnapshotMapper.class, RoleMapper.class, RuleMapper.class, SchemaMigrationMapper.class,
SemaphoreMapper.class, UserMapper.class, WidgetMapper.class, WidgetPropertyMapper.class, MeasureMapper.class, SnapshotDataMapper.class,
SnapshotSourceMapper.class, ActionPlanMapper.class, ActionPlanStatsMapper.class
};
+ // AuthorizationMapper has to be loaded before IssueMapper because this last one used it
loadMapper(conf, "org.sonar.core.user.AuthorizationMapper");
loadMappers(conf, mappers);
configureLogback(mappers);
String componentKey = "org.apache.struts:struts-core:Action.java";
DefaultIssue issue = (DefaultIssue) new DefaultIssueBuilder()
.componentKey(componentKey)
+ .projectKey("org.apache.struts:struts-parent")
.message("the message")
.line(123)
.effortToFix(10000.0)
public void should_not_set_default_severity() {
DefaultIssue issue = (DefaultIssue) new DefaultIssueBuilder()
.componentKey("Action.java")
+ .projectKey("org.apache.struts:struts-parent")
.ruleKey(RuleKey.of("squid", "NullDereference"))
.build();