diff --git a/.all-contributorsrc b/.all-contributorsrc index cb5a734560..2fdad95a30 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7581,6 +7581,15 @@ "bug", "code" ] + }, + { + "login": "anuragagarwal561994", + "name": "Anurag Agarwal", + "avatar_url": "https://avatars.githubusercontent.com/u/6075379?v=4", + "profile": "https://github.com/anuragagarwal561994", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e92a17d9d..b19e8cc950 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/25/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/.github/workflows/git-repo-sync.yml b/.github/workflows/git-repo-sync.yml index e8a3597c88..c564eeea92 100644 --- a/.github/workflows/git-repo-sync.yml +++ b/.github/workflows/git-repo-sync.yml @@ -24,7 +24,7 @@ jobs: shell: bash run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/25/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV - name: Sync run: .ci/git-repo-sync.sh shell: bash diff --git a/.github/workflows/troubleshooting.yml b/.github/workflows/troubleshooting.yml index db94722919..58b1c56fcc 100644 --- a/.github/workflows/troubleshooting.yml +++ b/.github/workflows/troubleshooting.yml @@ -36,7 +36,7 @@ jobs: run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/25/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/do-release.sh b/do-release.sh index 03807ce8b9..ef34e1063a 100755 --- a/do-release.sh +++ b/do-release.sh @@ -254,7 +254,7 @@ permalink: pmd_release_notes.html keywords: changelog, release notes --- -## {{ site.pmd.date }} - {{ site.pmd.version }} +## {{ site.pmd.date | date: "%d-%B-%Y" }} - {{ site.pmd.version }} The PMD team is pleased to announce PMD {{ site.pmd.version }}. diff --git a/docs/_config.yml b/docs/_config.yml index 9bb2dec84c..29e464a84f 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -3,14 +3,15 @@ repository: pmd/pmd pmd: version: 7.3.0-SNAPSHOT previous_version: 7.2.0 - date: 28-June-2024 + date: 2024-06-28 + # release types: major, minor, bugfix release_type: minor -# release types: major, minor, bugfix - output: web # this property is useful for conditional filtering of content that is separate from the PDF. +sidebar_title: PMD + topnav_title: PMD Source Code Analyzer Project # this appears on the top navigation bar next to the home button diff --git a/docs/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml index 1902b8761d..7fbceac6f1 100644 --- a/docs/_data/sidebars/pmd_sidebar.yml +++ b/docs/_data/sidebars/pmd_sidebar.yml @@ -1,7 +1,5 @@ entries: - title: sidebar - product: PMD - version: '!PMD_VERSION!' folders: - title: null output: pdf @@ -31,6 +29,12 @@ entries: - title: Getting help url: /pmd_about_help.html output: web, pdf + - title: Release policies + url: /pmd_about_release_policies.html + output: web, pdf + - title: Support lifecycle + url: /pmd_about_support_lifecycle.html + output: web, pdf - title: User Documentation output: web, pdf folderitems: diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html index 46b916d90e..c68eb9a8a0 100644 --- a/docs/_includes/sidebar.html +++ b/docs/_includes/sidebar.html @@ -1,8 +1,8 @@ {% include custom/sidebarconfigs.html %}
column | endcolumn | line | endline | path |
---|---|---|---|---|
ID | Files | Lines | |
|
This renderer is available as "xmlold".
+ *
+ * @deprecated Update your tools to use the standard XML renderer "xml" again.
+ */
+@Deprecated
+public class XMLOldRenderer implements CPDReportRenderer {
+ private final XMLRenderer xmlRenderer;
+
+ public XMLOldRenderer() {
+ this(null);
+ }
+
+ public XMLOldRenderer(String encoding) {
+ this.xmlRenderer = new XMLRenderer(encoding, false);
+ }
+
+ @Override
+ public void render(CPDReport report, Writer writer) throws IOException {
+ xmlRenderer.render(report, writer);
+ }
+}
diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java
index 5365d1827a..8e9b8fe5b6 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java
@@ -6,7 +6,10 @@ package net.sourceforge.pmd.cpd;
import java.io.IOException;
import java.io.Writer;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.Map;
+import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -20,9 +23,11 @@ import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import net.sourceforge.pmd.PMDVersion;
import net.sourceforge.pmd.lang.document.Chars;
import net.sourceforge.pmd.lang.document.FileId;
import net.sourceforge.pmd.lang.document.FileLocation;
+import net.sourceforge.pmd.reporting.Report;
import net.sourceforge.pmd.util.StringUtil;
/**
@@ -31,14 +36,19 @@ import net.sourceforge.pmd.util.StringUtil;
*
*/
public final class XMLRenderer implements CPDReportRenderer {
+ private static final String NAMESPACE_URI = "https://pmd-code.org/schema/cpd-report";
+ private static final String NAMESPACE_LOCATION = "https://pmd.github.io/schema/cpd-report_1_0_0.xsd";
+ private static final String SCHEMA_VERSION = "1.0.0";
private String encoding;
+ private final boolean newFormat;
+
/**
* Creates a XML Renderer with the default (platform dependent) encoding.
*/
public XMLRenderer() {
- this(null);
+ this(null, true);
}
/**
@@ -49,7 +59,12 @@ public final class XMLRenderer implements CPDReportRenderer {
* dependent) encoding is used.
*/
public XMLRenderer(String encoding) {
+ this(encoding, true);
+ }
+
+ XMLRenderer(String encoding, boolean newFormat) {
setEncoding(encoding);
+ this.newFormat = newFormat;
}
public void setEncoding(String encoding) {
@@ -82,7 +97,11 @@ public final class XMLRenderer implements CPDReportRenderer {
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS, "codefragment");
+ if (newFormat) {
+ transformer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS, "{" + NAMESPACE_URI + "}codefragment");
+ } else {
+ transformer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS, "codefragment");
+ }
transformer.transform(new DOMSource(doc), new StreamResult(writer));
} catch (TransformerException e) {
throw new IllegalStateException(e);
@@ -93,14 +112,22 @@ public final class XMLRenderer implements CPDReportRenderer {
@Override
public void render(final CPDReport report, final Writer writer) throws IOException {
final Document doc = createDocument();
- final Element root = doc.createElement("pmd-cpd");
+ final Element root = createElement(doc, "pmd-cpd");
+
+ if (newFormat) {
+ root.setAttributeNS(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:schemaLocation", NAMESPACE_URI + " " + NAMESPACE_LOCATION);
+ root.setAttributeNS(NAMESPACE_URI, "version", SCHEMA_VERSION);
+ root.setAttributeNS(NAMESPACE_URI, "pmdVersion", PMDVersion.VERSION);
+ root.setAttributeNS(NAMESPACE_URI, "timestamp", OffsetDateTime.now().format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));
+ }
+
final Map> Long getValue(T enumValue, Function
+ |
|
{jjtThis.setType(ASTSqlStatement.Type.LOCK_TABLE); }
|