From 46a8d87fb7a76a187e6f959171a67eee9562075c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 1 Aug 2019 01:37:32 +0200 Subject: [PATCH] Try to fix confused image reference Build of #1956 is failing but just on macosx... See https://travis-ci.org/pmd/pmd/jobs/566211322 Idk what's the problem, maybe it's because '(?!)' looks like a negative lookahead --- .../main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java index 256872ea05..1ab25d40a6 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java @@ -49,7 +49,7 @@ public class DeadLinksChecker { private static final boolean CHECK_EXTERNAL_LINKS = Boolean.parseBoolean(System.getProperty(CHECK_EXTERNAL_LINKS_PROPERTY)); // Markdown-Link: something in []'s followed by something in ()'s - private static final Pattern LOCAL_LINK_PATTERN = Pattern.compile("(!?)\\[.*?\\]\\((.*?)\\)"); + private static final Pattern LOCAL_LINK_PATTERN = Pattern.compile("(!)?\\[.*?]\\((.*?)\\)"); // Markdown permalink-header and captions private static final Pattern MD_HEADER_PERMALINK = Pattern.compile("permalink:\\s*(.*)"); @@ -113,7 +113,7 @@ public class DeadLinksChecker { linkCheck: while (matcher.find()) { final String linkText = matcher.group(); - final boolean isImageLink = !matcher.group(1).isEmpty(); + final boolean isImageLink = matcher.group(1) != null; final String linkTarget = matcher.group(2); boolean linkOk;