Skip to content

Commit

Permalink
#29165 use final and Objects.isNull()
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinogiardino committed Aug 23, 2024
1 parent 01ede6c commit c0a1417
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.dotcms.variant.business.web.VariantWebAPI.RenderContext;
import java.io.IOException;
import java.util.Objects;
import java.util.Optional;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -538,9 +539,9 @@ protected final String inodePath(final Contentlet contentlet,
.append(StringPool.FORWARD_SLASH).append(field.variable()).toString();
}

private void validateContentlet(Contentlet contentlet, boolean live, String inode) throws DotDataException {
if (contentlet == null) {
String versionType = live ? PageMode.LIVE.name() : PageMode.WORKING.name();
private void validateContentlet(final Contentlet contentlet, final boolean live, final String inode) throws DotDataException {
if (Objects.isNull(contentlet)) {
final String versionType = live ? PageMode.LIVE.name() : PageMode.WORKING.name();
throw new DotDataException(String.format("No contentlet found for %s inode %s", versionType, inode));
}
}
Expand Down

0 comments on commit c0a1417

Please sign in to comment.