提交 e879a0ac 编写于 作者: J johnniang

Fix build error complained by newest IDEA

上级 092241cc
package run.halo.app.core;
import org.jetbrains.annotations.NotNull;
import org.springframework.core.MethodParameter;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
......@@ -26,18 +25,18 @@ public class CommonResultControllerAdvice implements ResponseBodyAdvice<Object>
@Override
public boolean supports(MethodParameter returnType,
@NotNull Class<? extends HttpMessageConverter<?>> converterType) {
@NonNull Class<? extends HttpMessageConverter<?>> converterType) {
return AbstractJackson2HttpMessageConverter.class.isAssignableFrom(converterType);
}
@Override
@NonNull
public final Object beforeBodyWrite(@Nullable Object body,
@NotNull MethodParameter returnType,
@NotNull MediaType contentType,
@NotNull Class<? extends HttpMessageConverter<?>> converterType,
@NotNull ServerHttpRequest request,
@NotNull ServerHttpResponse response) {
@NonNull MethodParameter returnType,
@NonNull MediaType contentType,
@NonNull Class<? extends HttpMessageConverter<?>> converterType,
@NonNull ServerHttpRequest request,
@NonNull ServerHttpResponse response) {
MappingJacksonValue container = getOrCreateContainer(body);
// The contain body will never be null
beforeBodyWriteInternal(container, contentType, returnType, request, response);
......
......@@ -7,7 +7,7 @@ import com.vladsch.flexmark.util.ast.Document;
import com.vladsch.flexmark.util.ast.Node;
import com.vladsch.flexmark.util.ast.ReferencingNode;
import com.vladsch.flexmark.util.sequence.BasedSequence;
import org.jetbrains.annotations.NotNull;
import org.springframework.lang.NonNull;
import run.halo.app.utils.footnotes.internal.FootnoteRepository;
/**
......@@ -30,7 +30,7 @@ public class Footnote extends Node implements DelimitedNode, DoNotDecorate, Link
protected int referenceOrdinal;
@NotNull
@NonNull
@Override
public BasedSequence getReference() {
return text;
......@@ -80,14 +80,14 @@ public class Footnote extends Node implements DelimitedNode, DoNotDecorate, Link
this.footnoteBlock = footnoteBlock;
}
@NotNull
@NonNull
@Override
public BasedSequence[] getSegments() {
return new BasedSequence[] {openingMarker, text, closingMarker};
}
@Override
public void getAstExtra(@NotNull StringBuilder out) {
public void getAstExtra(@NonNull StringBuilder out) {
out.append(" ordinal: ")
.append(footnoteBlock != null ? footnoteBlock.getFootnoteOrdinal() : 0).append(" ");
delimitedSegmentSpanChars(out, openingMarker, text, closingMarker, "text");
......
......@@ -10,8 +10,8 @@ import com.vladsch.flexmark.util.data.DataHolder;
import com.vladsch.flexmark.util.sequence.BasedSequence;
import com.vladsch.flexmark.util.sequence.SequenceUtils;
import java.util.Objects;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import run.halo.app.utils.footnotes.internal.FootnoteRepository;
/**
......@@ -43,7 +43,7 @@ public class FootnoteBlock extends Block
@Nullable
@Override
public Footnote getReferencingNode(@NotNull Node node) {
public Footnote getReferencingNode(@NonNull Node node) {
return node instanceof Footnote ? (Footnote) node : null;
}
......@@ -74,7 +74,7 @@ public class FootnoteBlock extends Block
}
@Override
public void getAstExtra(@NotNull StringBuilder out) {
public void getAstExtra(@NonNull StringBuilder out) {
out.append(" ordinal: ").append(footnoteOrdinal).append(" ");
segmentSpan(out, openingMarker, "open");
segmentSpan(out, text, "text");
......@@ -82,7 +82,7 @@ public class FootnoteBlock extends Block
segmentSpan(out, footnote, "footnote");
}
@NotNull
@NonNull
@Override
public BasedSequence[] getSegments() {
return new BasedSequence[] {openingMarker, text, closingMarker, footnote};
......
......@@ -9,7 +9,7 @@ import com.vladsch.flexmark.util.data.DataKey;
import com.vladsch.flexmark.util.data.MutableDataHolder;
import com.vladsch.flexmark.util.format.options.ElementPlacement;
import com.vladsch.flexmark.util.format.options.ElementPlacementSort;
import org.jetbrains.annotations.NotNull;
import org.springframework.lang.NonNull;
import run.halo.app.utils.footnotes.internal.FootnoteBlockParser;
import run.halo.app.utils.footnotes.internal.FootnoteLinkRefProcessor;
import run.halo.app.utils.footnotes.internal.FootnoteNodeFormatter;
......@@ -63,8 +63,8 @@ public class FootnoteExtension
}
@Override
public void extend(@NotNull HtmlRenderer.Builder htmlRendererBuilder,
@NotNull String rendererType) {
public void extend(@NonNull HtmlRenderer.Builder htmlRendererBuilder,
@NonNull String rendererType) {
if (htmlRendererBuilder.isRendererType("HTML")) {
htmlRendererBuilder.nodeRendererFactory(new FootnoteNodeRenderer.Factory());
}
......@@ -77,7 +77,7 @@ public class FootnoteExtension
}
@Override
public void rendererOptions(@NotNull MutableDataHolder options) {
public void rendererOptions(@NonNull MutableDataHolder options) {
}
......
......@@ -16,8 +16,8 @@ import com.vladsch.flexmark.util.sequence.BasedSequence;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import run.halo.app.utils.footnotes.FootnoteBlock;
import run.halo.app.utils.footnotes.FootnoteExtension;
......@@ -115,9 +115,9 @@ public class FootnoteBlockParser extends AbstractBlockParser {
return false;
}
@NotNull
@NonNull
@Override
public BlockParserFactory apply(@NotNull DataHolder options) {
public BlockParserFactory apply(@NonNull DataHolder options) {
return new BlockFactory(options);
}
}
......
......@@ -6,7 +6,7 @@ import com.vladsch.flexmark.util.ast.Document;
import com.vladsch.flexmark.util.ast.Node;
import com.vladsch.flexmark.util.data.DataHolder;
import com.vladsch.flexmark.util.sequence.BasedSequence;
import org.jetbrains.annotations.NotNull;
import org.springframework.lang.NonNull;
import run.halo.app.utils.footnotes.Footnote;
import run.halo.app.utils.footnotes.FootnoteBlock;
import run.halo.app.utils.footnotes.FootnoteExtension;
......@@ -33,14 +33,14 @@ public class FootnoteLinkRefProcessor implements LinkRefProcessor {
}
@Override
public boolean isMatch(@NotNull BasedSequence nodeChars) {
public boolean isMatch(@NonNull BasedSequence nodeChars) {
return nodeChars.length() >= 3 && nodeChars.charAt(0) == '[' && nodeChars.charAt(1) == '^'
&& nodeChars.endCharAt(1) == ']';
}
@NotNull
@NonNull
@Override
public Node createNode(@NotNull BasedSequence nodeChars) {
public Node createNode(@NonNull BasedSequence nodeChars) {
BasedSequence footnoteId = nodeChars.midSequence(2, -1).trim();
FootnoteBlock footnoteBlock =
footnoteId.length() > 0 ? footnoteRepository.get(footnoteId.toString()) : null;
......@@ -55,39 +55,39 @@ public class FootnoteLinkRefProcessor implements LinkRefProcessor {
return footnote;
}
@NotNull
@NonNull
@Override
public BasedSequence adjustInlineText(@NotNull Document document, @NotNull Node node) {
public BasedSequence adjustInlineText(@NonNull Document document, @NonNull Node node) {
assert node instanceof Footnote;
return ((Footnote) node).getText();
}
@Override
public boolean allowDelimiters(@NotNull BasedSequence chars, @NotNull Document document,
@NotNull Node node) {
public boolean allowDelimiters(@NonNull BasedSequence chars, @NonNull Document document,
@NonNull Node node) {
return true;
}
@Override
public void updateNodeElements(@NotNull Document document, @NotNull Node node) {
public void updateNodeElements(@NonNull Document document, @NonNull Node node) {
}
public static class Factory implements LinkRefProcessorFactory {
@NotNull
@NonNull
@Override
public LinkRefProcessor apply(@NotNull Document document) {
public LinkRefProcessor apply(@NonNull Document document) {
return new FootnoteLinkRefProcessor(document);
}
@Override
public boolean getWantExclamationPrefix(@NotNull DataHolder options) {
public boolean getWantExclamationPrefix(@NonNull DataHolder options) {
return WANT_EXCLAMATION_PREFIX;
}
@Override
public int getBracketNestingLevel(@NotNull DataHolder options) {
public int getBracketNestingLevel(@NonNull DataHolder options) {
return BRACKET_NESTING_LEVEL;
}
}
......
......@@ -15,8 +15,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import run.halo.app.utils.footnotes.Footnote;
import run.halo.app.utils.footnotes.FootnoteBlock;
import run.halo.app.utils.footnotes.FootnoteExtension;
......@@ -100,9 +100,9 @@ public class FootnoteNodeFormatter
public static class Factory implements NodeFormatterFactory {
@NotNull
@NonNull
@Override
public NodeFormatter create(@NotNull DataHolder options) {
public NodeFormatter create(@NonNull DataHolder options) {
return new FootnoteNodeFormatter(options);
}
}
......
......@@ -18,7 +18,7 @@ import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.lang.NonNull;
import run.halo.app.utils.footnotes.Footnote;
import run.halo.app.utils.footnotes.FootnoteBlock;
import run.halo.app.utils.footnotes.FootnoteExtension;
......@@ -53,8 +53,8 @@ public class FootnoteNodeRenderer implements PhasedNodeRenderer {
}
@Override
public void renderDocument(@NotNull NodeRendererContext context, @NotNull HtmlWriter html,
@NotNull Document document, @NotNull RenderingPhase phase) {
public void renderDocument(@NonNull NodeRendererContext context, @NonNull HtmlWriter html,
@NonNull Document document, @NonNull RenderingPhase phase) {
if (phase == RenderingPhase.BODY_TOP) {
if (recheckUndefinedReferences) {
// need to see if have undefined footnotes that were defined after parsing
......@@ -171,9 +171,9 @@ public class FootnoteNodeRenderer implements PhasedNodeRenderer {
public static class Factory implements NodeRendererFactory {
@NotNull
@NonNull
@Override
public NodeRenderer apply(@NotNull DataHolder options) {
public NodeRenderer apply(@NonNull DataHolder options) {
return new FootnoteNodeRenderer(options);
}
}
......
......@@ -13,7 +13,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.jetbrains.annotations.NotNull;
import org.springframework.lang.NonNull;
import run.halo.app.utils.footnotes.Footnote;
import run.halo.app.utils.footnotes.FootnoteBlock;
import run.halo.app.utils.footnotes.FootnoteExtension;
......@@ -79,19 +79,19 @@ public class FootnoteRepository extends NodeRepository<FootnoteBlock> {
super(FootnoteExtension.FOOTNOTES_KEEP.get(options));
}
@NotNull
@NonNull
@Override
public DataKey<FootnoteRepository> getDataKey() {
return FootnoteExtension.FOOTNOTES;
}
@NotNull
@NonNull
@Override
public DataKey<KeepType> getKeepDataKey() {
return FootnoteExtension.FOOTNOTES_KEEP;
}
@NotNull
@NonNull
@Override
public Set<FootnoteBlock> getReferencedElements(Node parent) {
HashSet<FootnoteBlock> references = new HashSet<>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册