Skip to content

Commit

Permalink
eliminate code warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Jun 18, 2024
1 parent 696b263 commit fd50f24
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/wcm/handler/link/type/MediaLinkType.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public boolean hasRichTextPlugin() {
@Override
public boolean accepts(@NotNull String linkRef) {
// accept as media link if the ref is inside default media subtrees
return MediaLinkType.isDefaultMediaContentPath(linkRef);
return isDefaultMediaContentPath(linkRef);
}

@SuppressWarnings("null")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Resource getParent() {
if (parentPath == null) {
return null;
}
return SyntheticNavigatableResource.get(parentPath, resolver);
return get(parentPath, resolver);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class SeoSitemapLinkExternalizerImplTest {
private Page page1;

@BeforeEach
void setUp() throws Exception {
void setUp() {

// simulate AEM built-in SitemapLinkExternalizer with lower service ranking
context.registerService(SitemapLinkExternalizer.class, aemSitemapLinkExternalizer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ public enum DummyAppTemplate {
this.resourceType = resourceTypeFromTemplatePath;
}

DummyAppTemplate(String templatePath, String resourceType) {
this.templatePath = templatePath;
this.resourceType = resourceType;
}

/**
* Template path
* @return Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void testGetSyntheticLinkResource() {
}

@Test
void testAccepts() throws Exception {
void testAccepts() {
LinkType underTest = AdaptTo.notNull(adaptable(), ExternalLinkType.class);

assertTrue(underTest.accepts("http://hostname"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected Adaptable adaptable() {
}

@BeforeEach
void setUp() throws Exception {
void setUp() {

// create current page in site context
context.currentPage(context.create().page("/content/unittest/de_test/brand/de/section/page",
Expand Down
16 changes: 8 additions & 8 deletions src/test/java/io/wcm/handler/link/type/InternalLinkTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected Adaptable adaptable() {
}

@BeforeEach
void setUp() throws Exception {
void setUp() {

// create current page in site context
context.currentPage(context.create().page("/content/unittest/de_test/brand/de/section/page",
Expand Down Expand Up @@ -219,7 +219,7 @@ void testSecureTargetPage() {
}

@Test
void testRedirectInternal() throws Exception {
void testRedirectInternal() {
LinkHandler linkHandler = AdaptTo.notNull(adaptable(), LinkHandler.class);

Page redirectInternalPage = context.create().page("/content/unittest/de_test/brand/de/section/redirectInternal",
Expand All @@ -240,7 +240,7 @@ void testRedirectInternal() throws Exception {
}

@Test
void testRedirectInternal_cqRedirectTarget() throws Exception {
void testRedirectInternal_cqRedirectTarget() {
LinkHandler linkHandler = AdaptTo.notNull(adaptable(), LinkHandler.class);

// redirect page using cq:redirectTarget property
Expand Down Expand Up @@ -282,7 +282,7 @@ void testRedirectInternal_EditMode() throws Exception {

@Test
@SuppressWarnings("null")
void testRedirectRedirectInternal() throws Exception {
void testRedirectRedirectInternal() {
LinkHandler linkHandler = AdaptTo.notNull(adaptable(), LinkHandler.class);

Page redirectInternalPage = context.create().page("/content/unittest/de_test/brand/de/section/redirectInternal",
Expand Down Expand Up @@ -313,7 +313,7 @@ void testRedirectRedirectInternal() throws Exception {

@Test
@SuppressWarnings("null")
void testRedirectExternal() throws Exception {
void testRedirectExternal() {
LinkHandler linkHandler = AdaptTo.notNull(adaptable(), LinkHandler.class);

Page redirectExternalPage = context.create().page("/content/unittest/de_test/brand/de/section/redirectExternal",
Expand All @@ -332,7 +332,7 @@ void testRedirectExternal() throws Exception {
}

@Test
void testRedirectCyclic() throws Exception {
void testRedirectCyclic() {
LinkHandler linkHandler = AdaptTo.notNull(adaptable(), LinkHandler.class);

String redirectInternalCyclic1Path = "/content/unittest/de_test/brand/de/section/redirectInternalCyclic1";
Expand Down Expand Up @@ -363,7 +363,7 @@ void testRedirectCyclic() throws Exception {
}

@Test
void testIntegrator() throws Exception {
void testIntegrator() {
LinkHandler linkHandler = AdaptTo.notNull(adaptable(), LinkHandler.class);

Page integratorPage = context.create().page("/content/unittest/de_test/brand/de/section/integrator",
Expand All @@ -382,7 +382,7 @@ void testIntegrator() throws Exception {
}

@Test
void testIntegrator_EditMode() throws Exception {
void testIntegrator_EditMode() {
if (!(adaptable() instanceof SlingHttpServletRequest)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class InternalLinkResolverTest {
private final AemContext context = AppAemContext.newAemContext();

@BeforeEach
void setUp() throws Exception {
void setUp() {

// create current page in site context
context.currentPage(context.create().page("/content/unittest/de_test/brand/de/section/page",
Expand Down

0 comments on commit fd50f24

Please sign in to comment.