diff options
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r-- | server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java | 9 | ||||
-rw-r--r-- | server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java index 80a8bc524d2..f1bc6419665 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java @@ -76,7 +76,7 @@ public final class IssueDto implements Serializable { private byte[] locations; private long createdAt; private long updatedAt; - private Boolean quickFixAvailable; + private boolean quickFixAvailable; // functional dates stored as Long private Long issueCreationDate; @@ -693,12 +693,11 @@ public final class IssueDto implements Serializable { return this; } - @CheckForNull - public Boolean isQuickFixAvailable() { + public boolean isQuickFixAvailable() { return quickFixAvailable; } - public IssueDto setQuickFixAvailable(@Nullable Boolean quickFixAvailable) { + public IssueDto setQuickFixAvailable(boolean quickFixAvailable) { this.quickFixAvailable = quickFixAvailable; return this; } @@ -758,7 +757,7 @@ public final class IssueDto implements Serializable { issue.setSelectedAt(selectedAt); issue.setLocations(parseLocations()); issue.setIsFromExternalRuleEngine(isExternal); - issue.setQuickFixAvailable(quickFixAvailable != null && quickFixAvailable); + issue.setQuickFixAvailable(quickFixAvailable); return issue; } } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java index d0a921dbb1e..0ee427cdeca 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java @@ -46,6 +46,7 @@ import static java.util.Arrays.asList; import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic; import static org.apache.commons.lang.math.RandomUtils.nextInt; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertFalse; import static org.junit.rules.ExpectedException.none; import static org.sonar.db.component.ComponentTesting.newDirectory; import static org.sonar.db.component.ComponentTesting.newFileDto; @@ -107,7 +108,7 @@ public class IssueDaoTest { assertThat(issue.getLocations()).isNull(); assertThat(issue.parseLocations()).isNull(); assertThat(issue.isExternal()).isTrue(); - assertThat(issue.isQuickFixAvailable()).isNull(); + assertFalse(issue.isQuickFixAvailable()); } @Test @@ -467,7 +468,6 @@ public class IssueDaoTest { dto.setIssueCreationTime(1_450_000_000_000L); dto.setIssueUpdateTime(1_450_000_000_000L); dto.setIssueCloseTime(1_450_000_000_000L); - dto.setQuickFixAvailable(null); return dto; } |