Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate SonarQube warnings #19

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/**
* Abstract class that can be used as a base class for {@link Component} implementations.
*/
@SuppressWarnings("java:S2176") // accept duplicate class name
public abstract class AbstractComponentImpl extends com.adobe.cq.wcm.core.components.util.AbstractComponentImpl implements ComponentExporter {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/**
* {@link LanguageNavigationItem} implementation.
*/
@SuppressWarnings("java:S110") // class hierarchy levels
public class LanguageNavigationItemV1Impl extends NavigationItemV1Impl implements LanguageNavigationItem {

private final Page page;
Expand All @@ -56,6 +57,7 @@ public class LanguageNavigationItemV1Impl extends NavigationItemV1Impl implement
* @param parentId Parent ID
* @param parentComponent The component that contains this list item
*/
@SuppressWarnings("java:S107") // number of parameters
public LanguageNavigationItemV1Impl(@NotNull Page page, @NotNull Link link,
int level, boolean active, boolean current, @NotNull List<NavigationItem> children,
@Nullable String title, @Nullable String parentId, @Nullable Component parentComponent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/**
* {@link LanguageNavigationItem} implementation.
*/
@SuppressWarnings("java:S110") // class hierarchy levels
public class LanguageNavigationItemV2Impl extends NavigationItemV2Impl implements LanguageNavigationItem {

private final Page page;
Expand All @@ -56,6 +57,7 @@ public class LanguageNavigationItemV2Impl extends NavigationItemV2Impl implement
* @param parentId Parent ID
* @param parentComponent The component that contains this list item
*/
@SuppressWarnings("java:S107") // number of parameters
public LanguageNavigationItemV2Impl(@NotNull Page page, @NotNull Link link,
int level, boolean active, boolean current, @NotNull List<NavigationItem> children,
@Nullable String title, @Nullable String parentId, @Nullable Component parentComponent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public LinkListItemV1Impl(@NotNull String title, @NotNull LinkWrapper link, @Not
/**
* @deprecated Deprecated in API
*/
@Deprecated
@Deprecated(forRemoval = true)
@Override
@JsonIgnore
public com.adobe.cq.wcm.core.components.commons.link.Link getLink() {
Expand All @@ -70,7 +70,7 @@ public com.adobe.cq.wcm.core.components.commons.link.Link getLink() {
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore(false)
public String getURL() {
return super.getURL();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public LinkListItemV2Impl(@NotNull String title, @NotNull LinkWrapper link, @Not
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore
public String getURL() {
return link.getURL();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/**
* {@link NavigationItem} implementation.
*/
@SuppressWarnings("java:S110") // class hierarchy levels
public class NavigationItemV1Impl extends PageListItemV1Impl implements NavigationItem {

private final Page page;
Expand All @@ -52,6 +53,7 @@ public class NavigationItemV1Impl extends PageListItemV1Impl implements Navigati
* @param parentId Parent ID
* @param parentComponent The component that contains this list item
*/
@SuppressWarnings("java:S107") // number of parameters
public NavigationItemV1Impl(@NotNull Page page, @NotNull Link link,
int level, boolean active, boolean current, @NotNull List<NavigationItem> children,
@Nullable String parentId, @Nullable Component parentComponent) {
Expand All @@ -67,7 +69,7 @@ public NavigationItemV1Impl(@NotNull Page page, @NotNull Link link,
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore
public Page getPage() {
return page;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/**
* {@link NavigationItem} implementation.
*/
@SuppressWarnings("java:S110") // class hierarchy levels
public class NavigationItemV2Impl extends PageListItemV2Impl implements NavigationItem {

private final Page page;
Expand All @@ -52,6 +53,7 @@ public class NavigationItemV2Impl extends PageListItemV2Impl implements Navigati
* @param parentId Parent ID
* @param parentComponent The component that contains this list item
*/
@SuppressWarnings("java:S107") // number of parameters
public NavigationItemV2Impl(@NotNull Page page, @NotNull Link link,
int level, boolean active, boolean current, @NotNull List<NavigationItem> children,
@Nullable String parentId, @Nullable Component parentComponent) {
Expand All @@ -67,7 +69,7 @@ public NavigationItemV2Impl(@NotNull Page page, @NotNull Link link,
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore
public Page getPage() {
return page;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
/**
* {@link ListItem} implementation for page links.
*/
@SuppressWarnings("java:S110") // class hierarchy levels
public class PageListItemV1Impl extends PageListItemV2Impl implements LinkMixin {

/**
Expand Down Expand Up @@ -63,7 +64,7 @@ public PageListItemV1Impl(@NotNull Page page, @NotNull Link link,
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore(false)
public String getURL() {
return super.getURL();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public PageListItemV4Impl(@NotNull Page page, @NotNull Link link,
* @deprecated Deprecated in API
*/
@Override
@Deprecated(since = "1.9.0-2.17.2")
@Deprecated(forRemoval = true, since = "1.9.0-2.17.2")
@JsonIgnore
public String getURL() {
return link.getURL();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class ButtonV1Impl extends ButtonV2Impl implements LinkMixin {
/**
* @deprecated Deprecated in API
*/
@Deprecated
@Deprecated(forRemoval = true)
@Override
@JsonIgnore
public com.adobe.cq.wcm.core.components.commons.link.Link getButtonLink() {
Expand All @@ -70,7 +70,7 @@ public com.adobe.cq.wcm.core.components.commons.link.Link getButtonLink() {
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore(false)
public String getLink() {
return super.getLink();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class LayoutContainerV1Impl extends AbstractContainerImpl implements Layo
*/
@Override
@JsonIgnore
@Deprecated(since = "1.13.0-2.22.6")
@Deprecated(forRemoval = true, since = "1.13.0-2.22.6")
public @NotNull List<ListItem> getItems() {
return delegate.getItems();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public com.adobe.cq.wcm.core.components.commons.link.Link getLink() {
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore(false)
@JsonProperty("linkURL")
public String getLinkURL() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
@JsonIgnoreProperties({
"page", "children", "level", "description", "lastModified", PROPERTY_PATH
})
@SuppressWarnings("java:S110") // class hierarchy levels
public class BreadcrumbV2ItemImpl extends NavigationItemV1Impl implements NavigationItem {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public Link getButtonLink() {
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore
public String getLink() {
return link.getURL();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public class TeaserV2Impl extends AbstractComponentImpl implements Teaser, Media
private boolean titleLinkHidden;

@PostConstruct
@SuppressWarnings({ "java:S3776", "java:S6541" }) // ignore complexity
private void activate() {
ValueMap properties = resource.getValueMap();

Expand Down Expand Up @@ -215,7 +216,7 @@ public Link getLink() {
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore
public String getLinkURL() {
return link.getURL();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public com.adobe.cq.wcm.core.components.commons.link.Link getLink() {
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore(false)
@JsonProperty("linkURL")
public String getLinkURL() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
@JsonIgnoreProperties({
"page", "children", "level", "description", "lastModified", PROPERTY_PATH
})
@SuppressWarnings("java:S110") // class hierarchy levels
public class BreadcrumbV3ItemImpl extends NavigationItemV2Impl implements NavigationItem {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void activate() {
* @deprecated Deprecated in API
*/
@Override
@Deprecated
@Deprecated(forRemoval = true)
@JsonIgnore
public String getLinkURL() {
return link.getURL();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import io.wcm.wcm.core.components.testcontext.AppAemContext;

@ExtendWith(AemContextExtension.class)
@SuppressWarnings("java:S5976") // similar tests
class NavigationV1ImplTest {

private final AemContext context = AppAemContext.newAemContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import io.wcm.wcm.core.components.testcontext.AppAemContext;

@ExtendWith(AemContextExtension.class)
@SuppressWarnings("java:S5976") // similar tests
class NavigationV2ImplTest {

private final AemContext context = AppAemContext.newAemContext();
Expand Down
Loading