From 80d581035ac0d51a71913d861e2562a52e4ee863 Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 18 Oct 2021 16:42:53 +0200 Subject: [PATCH] SONAR-15487 change quickfix type to be false by default (Solving issue with Oracle) --- .../src/main/java/org/sonar/db/issue/IssueDto.java | 9 ++++----- .../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; } -- 2.39.5