From 44f29c3983ccec9afa30b81f011055bbda3b06e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 7 Apr 2024 21:27:24 +0200 Subject: [PATCH 01/66] Fix #4396 - Fix PLSQL CPD being case-sensitive --- .../pmd/lang/plsql/cpd/PLSQLCpdLexer.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java index c31a11d644..cdb371aba7 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java @@ -4,6 +4,8 @@ package net.sourceforge.pmd.lang.plsql.cpd; +import java.util.Locale; + import net.sourceforge.pmd.cpd.CpdLanguageProperties; import net.sourceforge.pmd.cpd.impl.JavaccCpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; @@ -37,16 +39,21 @@ public class PLSQLCpdLexer extends JavaccCpdLexer { String image = plsqlToken.getImage(); if (ignoreIdentifiers && plsqlToken.kind == PLSQLTokenKinds.IDENTIFIER) { - image = String.valueOf(plsqlToken.kind); - } - - if (ignoreLiterals && (plsqlToken.kind == PLSQLTokenKinds.UNSIGNED_NUMERIC_LITERAL + image = ""; + } else if (ignoreLiterals && (plsqlToken.kind == PLSQLTokenKinds.UNSIGNED_NUMERIC_LITERAL || plsqlToken.kind == PLSQLTokenKinds.FLOAT_LITERAL || plsqlToken.kind == PLSQLTokenKinds.INTEGER_LITERAL || plsqlToken.kind == PLSQLTokenKinds.CHARACTER_LITERAL || plsqlToken.kind == PLSQLTokenKinds.STRING_LITERAL || plsqlToken.kind == PLSQLTokenKinds.QUOTED_LITERAL)) { - image = String.valueOf(plsqlToken.kind); + // note that all tokens kinds are mapped to the same type. + image = ""; + } else if (plsqlToken.kind != PLSQLTokenKinds.CHARACTER_LITERAL + && plsqlToken.kind != PLSQLTokenKinds.STRING_LITERAL + && plsqlToken.kind != PLSQLTokenKinds.QUOTED_LITERAL) { + // PLSQL is case-insensitive, but of course the contents of + // string literals and the like are case-sensitive + image = image.toLowerCase(Locale.ROOT); } return image; } From 72408ca679d4fba5175b6a5aa919777c19ecaba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 8 Apr 2024 20:43:34 +0200 Subject: [PATCH 02/66] Normalize image of PLSQL tokens to uppercase, reuse strings --- .../pmd/lang/plsql/ast/PLSQLParser.java | 39 ++++++++++++++++++- .../pmd/lang/plsql/cpd/PLSQLCpdLexer.java | 10 +++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/ast/PLSQLParser.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/ast/PLSQLParser.java index ac50bdc6a3..e61e6f2350 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/ast/PLSQLParser.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/ast/PLSQLParser.java @@ -4,16 +4,53 @@ package net.sourceforge.pmd.lang.plsql.ast; +import org.checkerframework.checker.nullness.qual.Nullable; + import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream; +import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; +import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument.TokenDocumentBehavior; import net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeParserAdapter; import net.sourceforge.pmd.lang.plsql.symboltable.SymbolFacade; public class PLSQLParser extends JjtreeParserAdapter { - private static final TokenDocumentBehavior TOKEN_BEHAVIOR = new TokenDocumentBehavior(PLSQLTokenKinds.TOKEN_NAMES); + // Stores images of constant string literals. + // This is to reuse the image strings for PLSQL keywords. + // JavaCC unfortunately does not store a constant image for those + // keywords because the grammar is case-insensitive. + // This optimization has the effect that the image of keyword tokens + // is always upper-case, regardless of the actual case used in the code. + // The original casing can be found by looking at the TextDocument for the file. + + // NOTE: the size of this array should be greater than the number of tokens in the file. + private static final String[] STRING_LITERAL_IMAGES_EXTRA = new String[512]; + + static { + int i = 0; + String image = PLSQLTokenKinds.describe(i); + while (image != null && i < STRING_LITERAL_IMAGES_EXTRA.length) { + if (image.startsWith("\"") && image.endsWith("\"")) { + // a string literal image, remove the quotes + image = image.substring(1, image.length() - 1); + STRING_LITERAL_IMAGES_EXTRA[i] = image; + } + i++; + } + } + + private static final TokenDocumentBehavior TOKEN_BEHAVIOR = new TokenDocumentBehavior(PLSQLTokenKinds.TOKEN_NAMES) { + @Override + public JavaccToken createToken(JavaccTokenDocument self, int kind, CharStream cs, @Nullable String image) { + if (image == null) { + // fetch another constant image if possible. + image = STRING_LITERAL_IMAGES_EXTRA[kind]; + } + return super.createToken(self, kind, cs, image); + } + }; @Override protected TokenDocumentBehavior tokenBehavior() { diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java index cdb371aba7..0a64f5f613 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java @@ -51,9 +51,13 @@ public class PLSQLCpdLexer extends JavaccCpdLexer { } else if (plsqlToken.kind != PLSQLTokenKinds.CHARACTER_LITERAL && plsqlToken.kind != PLSQLTokenKinds.STRING_LITERAL && plsqlToken.kind != PLSQLTokenKinds.QUOTED_LITERAL) { - // PLSQL is case-insensitive, but of course the contents of - // string literals and the like are case-sensitive - image = image.toLowerCase(Locale.ROOT); + // PLSQL is case-insensitive, but the contents of + // string literals and the like are case-sensitive. + // Note: tokens are normalized to uppercase make CPD case-insensitive. + // We use uppercase and not lowercase because that way, PLSQL keywords + // will not be changed (they are already uppercase, see PLSQLParser), + // therefore creating less strings in memory. + image = image.toUpperCase(Locale.ROOT); } return image; } From 1c23df7286431770a0c6903e50e4b81ae50ffe3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 8 Apr 2024 20:54:52 +0200 Subject: [PATCH 03/66] Fix some weird things in PLSQL tokens --- pmd-plsql/etc/grammar/PLSQL.jjt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pmd-plsql/etc/grammar/PLSQL.jjt b/pmd-plsql/etc/grammar/PLSQL.jjt index 5108997fac..f914e51d17 100644 --- a/pmd-plsql/etc/grammar/PLSQL.jjt +++ b/pmd-plsql/etc/grammar/PLSQL.jjt @@ -5239,7 +5239,7 @@ TOKEN : ( "\"" ( | | "$" | "_" | "#" )* "\"" ) > | -< LEXICAL_PARAMETER: +< #LEXICAL_PARAMETER: ( ("&&" | "&") ( @@ -5263,12 +5263,6 @@ TOKEN : | < QUOTED_LITERAL: "\"" (<_WHATEVER_CHARACTER_WO_QUOTE> | | "\\\"")* "\"" > | -< SQLDATA_CLASS: "SQLData" > -| -< CUSTOMDATUM_CLASS: "CustomDatum" > -| -< ORADATA_CLASS: "OraData" > -| < JAVA_INTERFACE_CLASS: ( "SQLData" | "CustomDatum" | "OraData" ) > //| //< #BOOLEAN_LITERAL: "TRUE" | "FALSE" > @@ -6677,7 +6671,7 @@ ASTID ID(): {} //20120427 | //20120428 | //| - | | | | + | //20120427 | //SRT 20090608 ALTER TYPE key words //| @@ -6967,7 +6961,7 @@ ASTTypeKeyword TypeKeyword(): {} | | | | | | | | | | - | | | | + | ) { jjtThis.setImage(token.getImage()) ; jjtThis.value = token ; return jjtThis ; } } @@ -6975,7 +6969,7 @@ ASTTypeKeyword TypeKeyword(): {} ASTJavaInterfaceClass JavaInterfaceClass(): {} { ( - | | + ) { jjtThis.setImage(token.getImage()) ; jjtThis.value = token ; return jjtThis ; } } From 0cb2e37ce9b035d45a2a192aa37622d5f5d5399e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 8 Apr 2024 21:05:52 +0200 Subject: [PATCH 04/66] Update reference files --- .../pmd/lang/plsql/cpd/PLSQLCpdLexer.java | 4 +- .../lang/plsql/cpd/testdata/sample-plsql.txt | 776 +++++++++--------- .../pmd/lang/plsql/cpd/testdata/tabWidth.txt | 26 +- 3 files changed, 403 insertions(+), 403 deletions(-) diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java index 0a64f5f613..8a23a4731b 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/cpd/PLSQLCpdLexer.java @@ -55,8 +55,8 @@ public class PLSQLCpdLexer extends JavaccCpdLexer { // string literals and the like are case-sensitive. // Note: tokens are normalized to uppercase make CPD case-insensitive. // We use uppercase and not lowercase because that way, PLSQL keywords - // will not be changed (they are already uppercase, see PLSQLParser), - // therefore creating less strings in memory. + // will be returned unchanged (they are already uppercase, see PLSQLParser), + // therefore creating fewer strings in memory. image = image.toUpperCase(Locale.ROOT); } return image; diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/sample-plsql.txt b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/sample-plsql.txt index 74e9b756e6..710db10e23 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/sample-plsql.txt +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/sample-plsql.txt @@ -5,13 +5,13 @@ L1 [REPLACE] 11 18 L2 [PACKAGE] 1 8 - ["test_schema"] 9 22 + ["TEST_SCHEMA"] 9 22 [.] 22 23 ["BANK_DATA"] 23 34 L3 [IS] 1 3 L19 - [pi] 1 3 + [PI] 1 3 [CONSTANT] 5 13 [NUMBER] 14 20 [:] 21 22 @@ -19,15 +19,15 @@ L19 [3.1415] 24 30 [;] 30 31 L20 - [c] 1 2 + [C] 1 2 [CONSTANT] 5 13 [NUMBER] 14 20 [:] 21 22 [=] 22 23 - [3.2e9] 24 29 + [3.2E9] 24 29 [;] 29 30 L21 - [d] 1 2 + [D] 1 2 [CONSTANT] 5 13 [NUMBER] 14 20 [:] 21 22 @@ -35,7 +35,7 @@ L21 [3.2E9] 24 29 [;] 29 30 L22 - [year_created] 1 13 + [YEAR_CREATED] 1 13 [CONSTANT] 14 22 [NUMBER] 23 29 [:] 30 31 @@ -43,7 +43,7 @@ L22 [2001] 33 37 [;] 37 38 L23 - [author] 1 7 + [AUTHOR] 1 7 [CONSTANT] 9 17 [VARCHAR2] 18 26 [(] 26 27 @@ -54,7 +54,7 @@ L23 ['altumano ''the wolf'''] 35 58 [;] 58 59 L24 - [date_created] 1 13 + [DATE_CREATED] 1 13 [CONSTANT] 15 23 [DATE] 24 28 [:] 29 30 @@ -63,7 +63,7 @@ L24 [;] 43 44 L29 [TYPE] 1 5 - [assc_array] 6 16 + [ASSC_ARRAY] 6 16 [IS] 17 19 [TABLE] 20 25 [OF] 26 28 @@ -77,107 +77,107 @@ L29 [;] 58 59 L34 [TYPE] 1 5 - [bank_type] 6 15 + [BANK_TYPE] 6 15 [IS] 16 18 [RECORD] 19 25 [(] 26 27 L35 - [id] 3 5 + [ID] 3 5 [VARCHAR2] 30 38 [(] 38 39 [20] 39 41 [)] 41 42 [,] 42 43 L36 - [name] 3 7 + [NAME] 3 7 [VARCHAR2] 30 38 [(] 38 39 [100] 39 42 [)] 42 43 [,] 43 44 L37 - [address] 3 10 + [ADDRESS] 3 10 [VARCHAR2] 30 38 [(] 38 39 [105] 39 42 [)] 42 43 [,] 43 44 L38 - [location] 3 11 + [LOCATION] 3 11 [VARCHAR2] 30 38 [(] 38 39 [35] 39 41 [)] 41 42 [,] 42 43 L39 - [bic] 3 6 + [BIC] 3 6 [VARCHAR2] 30 38 [(] 38 39 [20] 39 41 [)] 41 42 [,] 42 43 L40 - [auth_key] 3 11 + [AUTH_KEY] 3 11 [VARCHAR2] 30 38 [(] 38 39 [1] 39 40 [)] 40 41 [,] 41 42 L41 - [contact] 3 10 + [CONTACT] 3 10 [VARCHAR2] 30 38 [(] 38 39 [100] 39 42 [)] 42 43 [,] 43 44 L42 - [phone] 3 8 + [PHONE] 3 8 [VARCHAR2] 30 38 [(] 38 39 [50] 39 41 [)] 41 42 [,] 42 43 L43 - [fax] 3 6 + [FAX] 3 6 [VARCHAR2] 30 38 [(] 38 39 [50] 39 41 [)] 41 42 [,] 42 43 L44 - [telex] 3 8 + [TELEX] 3 8 [VARCHAR2] 30 38 [(] 38 39 [100] 39 42 [)] 42 43 [,] 43 44 L45 - [medium] 3 9 + [MEDIUM] 3 9 [VARCHAR2] 30 38 [(] 38 39 [255] 39 42 [)] 42 43 [,] 43 44 L46 - [mod_time] 3 11 + [MOD_TIME] 3 11 [DATE] 30 34 [,] 34 35 L47 - [app_user] 3 11 + [APP_USER] 3 11 [VARCHAR2] 30 38 [(] 38 39 [20] 39 41 [)] 41 42 [,] 42 43 L48 - [db_user] 3 10 + [DB_USER] 3 10 [VARCHAR2] 30 38 [(] 38 39 [20] 39 41 [)] 41 42 [,] 42 43 L49 - [customer_id] 3 14 + [CUSTOMER_ID] 3 14 [VARCHAR2] 30 38 [(] 38 39 [20] 39 41 @@ -187,48 +187,48 @@ L50 [;] 2 3 L54 [TYPE] 1 5 - [bank_table] 6 16 + [BANK_TABLE] 6 16 [IS] 17 19 [TABLE] 20 25 [OF] 26 28 - [bank_type] 29 38 + [BANK_TYPE] 29 38 [INDEX] 39 44 [BY] 45 47 [BINARY_INTEGER] 48 62 [;] 62 63 L58 [TYPE] 1 5 - [ref_type] 6 14 + [REF_TYPE] 6 14 [IS] 15 17 [REF] 18 21 [CURSOR] 22 28 [RETURN] 29 35 - [bank_type] 36 45 + [BANK_TYPE] 36 45 [;] 45 46 L63 [SUBTYPE] 1 8 - [files_record] 9 21 + [FILES_RECORD] 9 21 [IS] 22 24 - [files] 25 30 + [FILES] 25 30 [%] 30 31 [ROWTYPE] 31 38 [;] 38 39 L66 - [current_pi] 1 11 + [CURRENT_PI] 1 11 [NUMBER] 12 18 [:] 19 20 [=] 20 21 [3.1415] 22 28 [;] 28 29 L67 - [current_year] 1 13 + [CURRENT_YEAR] 1 13 [NUMBER] 14 20 [:] 21 22 [=] 22 23 [2002] 24 28 [;] 28 29 L68 - [current_author] 1 15 + [CURRENT_AUTHOR] 1 15 [VARCHAR2] 16 24 [(] 24 25 [100] 25 28 @@ -238,74 +238,74 @@ L68 ['\\altumano\\ `the wolf` äöüõç'] 33 62 [;] 62 63 L69 - [current_date] 1 13 + [CURRENT_DATE] 1 13 [DATE] 15 19 [:] 20 21 [=] 21 22 ['24-feb-02'] 23 34 [;] 34 35 L72 - [cursor] 1 7 - [cur1] 8 12 + [CURSOR] 1 7 + [CUR1] 8 12 [(] 12 13 - [a] 13 14 - [varchar2] 15 23 + [A] 13 14 + [VARCHAR2] 15 23 [,] 23 24 - [b] 25 26 - [number] 27 33 + [B] 25 26 + [NUMBER] 27 33 [,] 33 34 - [c] 35 36 - [date] 37 41 + [C] 35 36 + [DATE] 37 41 [,] 41 42 - [d] 43 44 - [boolean] 45 52 + [D] 43 44 + [BOOLEAN] 45 52 [)] 52 53 - [return] 54 60 - [customer] 61 69 + [RETURN] 54 60 + [CUSTOMER] 61 69 [%] 69 70 - [rowtype] 70 77 + [ROWTYPE] 70 77 [;] 77 78 L73 - [cursor] 1 7 - [cur2] 8 12 + [CURSOR] 1 7 + [CUR2] 8 12 [(] 12 13 - [a] 13 14 - [varchar2] 15 23 + [A] 13 14 + [VARCHAR2] 15 23 [,] 23 24 - [b] 25 26 - [number] 27 33 + [B] 25 26 + [NUMBER] 27 33 [,] 33 34 - [c] 35 36 - [date] 37 41 + [C] 35 36 + [DATE] 37 41 [,] 41 42 - [d] 43 44 - [boolean] 45 52 + [D] 43 44 + [BOOLEAN] 45 52 [)] 52 53 - [is] 54 56 - [select] 57 63 + [IS] 54 56 + [SELECT] 57 63 [*] 64 65 - [from] 66 70 - [customer] 71 79 - [where] 80 85 - [id] 86 88 + [FROM] 66 70 + [CUSTOMER] 71 79 + [WHERE] 80 85 + [ID] 86 88 [=] 89 90 ['1'] 91 94 [;] 94 95 L86 [FUNCTION] 1 9 - [Get] 10 13 + [GET] 10 13 [(] 14 15 L87 - [p_id] 3 7 + [P_ID] 3 7 [VARCHAR2] 21 29 [,] 29 30 L88 - [r_bank_rec] 3 13 + [R_BANK_REC] 3 13 [OUT] 21 24 - [bank_type] 25 34 + [BANK_TYPE] 25 34 [,] 34 35 L89 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 @@ -315,290 +315,290 @@ L90 [;] 14 15 L93 [PROCEDURE] 1 10 - [Without_Parameters] 11 29 + [WITHOUT_PARAMETERS] 11 29 [;] 29 30 L96 [FUNCTION] 1 9 - [Get_Without_Parameters] 10 32 + [GET_WITHOUT_PARAMETERS] 10 32 [;] 32 33 L112 [PROCEDURE] 1 10 - [Get_By_ID] 11 20 + [GET_BY_ID] 11 20 [(] 21 22 L113 - [p_id] 3 7 + [P_ID] 3 7 [IN] 21 23 [VARCHAR2] 24 32 [,] 32 33 L114 - [r_records] 3 12 + [R_RECORDS] 3 12 [IN] 21 23 [OUT] 24 27 - [bank_table] 28 38 + [BANK_TABLE] 28 38 [)] 38 39 [;] 39 40 L123 [PROCEDURE] 1 10 - [Get_by_BIC] 11 21 + [GET_BY_BIC] 11 21 [(] 22 23 L124 - [p_bic] 3 8 + [P_BIC] 3 8 [VARCHAR2] 21 29 [,] 29 30 L125 - [r_bank_rec] 3 13 + [R_BANK_REC] 3 13 [OUT] 21 24 - [bank_type] 25 34 + [BANK_TYPE] 25 34 [,] 34 35 L126 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 21 24 [NUMBER] 25 31 [,] 31 32 L127 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 [;] 34 35 L130 [PROCEDURE] 1 10 - [Get_By_BIC] 11 21 + [GET_BY_BIC] 11 21 [(] 22 23 L131 - [p_bic] 3 8 + [P_BIC] 3 8 [VARCHAR2] 21 29 [,] 29 30 L132 - [r_record] 3 11 + [R_RECORD] 3 11 [IN] 21 23 [OUT] 24 27 - [bank_type] 28 37 + [BANK_TYPE] 28 37 [)] 37 38 [;] 38 39 L145 [FUNCTION] 1 9 - [Get_Table] 10 19 + [GET_TABLE] 10 19 [(] 20 21 L146 - [p_id] 3 7 + [P_ID] 3 7 [VARCHAR2] 21 29 [,] 29 30 L147 - [r_bank_tab] 3 13 + [R_BANK_TAB] 3 13 [IN] 21 23 [OUT] 24 27 - [bank_table] 28 38 + [BANK_TABLE] 28 38 [,] 38 39 L148 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 21 24 [NUMBER] 25 31 [,] 31 32 L149 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 L150 [RETURN] 1 7 - [varchar2] 8 16 + [VARCHAR2] 8 16 [;] 16 17 L162 [PROCEDURE] 1 10 - [Search] 11 17 + [SEARCH] 11 17 [(] 18 19 L163 - [p_id] 3 7 + [P_ID] 3 7 [VARCHAR2] 21 29 [,] 29 30 L164 - [p_bic] 3 8 + [P_BIC] 3 8 [VARCHAR2] 21 29 [,] 29 30 L165 - [p_name] 3 9 + [P_NAME] 3 9 [VARCHAR2] 21 29 [,] 29 30 L166 - [p_address] 3 12 + [P_ADDRESS] 3 12 [VARCHAR2] 21 29 [,] 29 30 L167 - [p_location] 3 13 + [P_LOCATION] 3 13 [VARCHAR2] 21 29 [,] 29 30 L168 - [r_bank_tab] 3 13 + [R_BANK_TAB] 3 13 [IN] 21 23 [OUT] 24 27 - [bank_table] 28 38 + [BANK_TABLE] 28 38 [,] 38 39 L169 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 21 24 [NUMBER] 25 31 [,] 31 32 L170 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 [;] 34 35 L176 [PROCEDURE] 1 10 - [Get] 11 14 + [GET] 11 14 [(] 15 16 L177 - [p_id] 3 7 + [P_ID] 3 7 [VARCHAR2] 21 29 [,] 29 30 L178 - [p_bic] 3 8 + [P_BIC] 3 8 [VARCHAR2] 21 29 [,] 29 30 L179 - [p_name] 3 9 + [P_NAME] 3 9 [VARCHAR2] 21 29 [,] 29 30 L180 - [p_address] 3 12 + [P_ADDRESS] 3 12 [VARCHAR2] 21 29 [,] 29 30 L181 - [p_location] 3 13 + [P_LOCATION] 3 13 [VARCHAR2] 21 29 [,] 29 30 L182 - [r_bank_tab] 3 13 + [R_BANK_TAB] 3 13 [IN] 21 23 [OUT] 24 27 - [bank_table] 28 38 + [BANK_TABLE] 28 38 [)] 38 39 [;] 39 40 L190 [PROCEDURE] 1 10 - [Get_By_Criteria] 11 26 + [GET_BY_CRITERIA] 11 26 [(] 27 28 L191 - [p_criteria] 3 13 - [bank_type] 21 30 + [P_CRITERIA] 3 13 + [BANK_TYPE] 21 30 [,] 30 31 L192 - [r_bank_tab] 3 13 + [R_BANK_TAB] 3 13 [IN] 21 23 [OUT] 24 27 - [bank_table] 28 38 + [BANK_TABLE] 28 38 [,] 38 39 L193 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 21 24 [NUMBER] 25 31 [,] 31 32 L194 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 [;] 34 35 L197 [PROCEDURE] 1 10 - [Ins] 11 14 + [INS] 11 14 [(] 15 16 L198 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [bank_type] 24 33 + [BANK_TYPE] 24 33 [)] 33 34 [;] 34 35 L201 [PROCEDURE] 1 10 - [Ins_Table] 11 20 + [INS_TABLE] 11 20 [(] 21 22 L202 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [bank_table] 24 34 + [BANK_TABLE] 24 34 [)] 34 35 [;] 35 36 L205 [PROCEDURE] 1 10 - [Upd] 11 14 + [UPD] 11 14 [(] 15 16 L206 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [bank_type] 24 33 + [BANK_TYPE] 24 33 [)] 33 34 [;] 34 35 L213 [PROCEDURE] 1 10 - [Upd_Table] 11 20 + [UPD_TABLE] 11 20 [(] 21 22 L214 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [bank_table] 24 34 + [BANK_TABLE] 24 34 [)] 34 35 [;] 35 36 L217 [PROCEDURE] 1 10 - [Del] 11 14 + [DEL] 11 14 [(] 15 16 L218 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [bank_type] 24 33 + [BANK_TYPE] 24 33 [)] 33 34 [;] 34 35 L221 [PROCEDURE] 1 10 - [Del_Table] 11 20 + [DEL_TABLE] 11 20 [(] 21 22 L222 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [bank_table] 24 34 + [BANK_TABLE] 24 34 [)] 34 35 [;] 35 36 L225 [PROCEDURE] 1 10 - [Lck] 11 14 + [LCK] 11 14 [(] 15 16 L226 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [bank_type] 24 33 + [BANK_TYPE] 24 33 [)] 33 34 [;] 34 35 L229 [PROCEDURE] 1 10 - [Lck_Table] 11 20 + [LCK_TABLE] 11 20 [(] 21 22 L230 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [bank_table] 24 34 + [BANK_TABLE] 24 34 [)] 34 35 [;] 35 36 L233 [PROCEDURE] 1 10 - [Get_Our] 11 18 + [GET_OUR] 11 18 [(] 19 20 L234 - [r_ourbank] 3 12 + [R_OURBANK] 3 12 [OUT] 21 24 - [bank_data] 25 34 + [BANK_DATA] 25 34 [.] 34 35 - [bank_type] 35 44 + [BANK_TYPE] 35 44 [,] 44 45 L235 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 21 24 [NUMBER] 25 31 [,] 31 32 L236 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 @@ -614,112 +614,112 @@ L243 [REPLACE] 11 18 L244 [PACKAGE] 1 8 - [Advice_Data] 9 20 + [ADVICE_DATA] 9 20 L245 [IS] 1 3 L257 [SUBTYPE] 1 8 - [advice_type_record] 9 27 + [ADVICE_TYPE_RECORD] 9 27 [IS] 28 30 - [advice_type] 31 42 + [ADVICE_TYPE] 31 42 [%] 42 43 [ROWTYPE] 43 50 [;] 50 51 L258 [TYPE] 1 5 - [advice_type_table] 6 23 + [ADVICE_TYPE_TABLE] 6 23 [IS] 24 26 [TABLE] 27 32 [OF] 33 35 - [advice_type_record] 36 54 + [ADVICE_TYPE_RECORD] 36 54 [INDEX] 55 60 [BY] 61 63 [BINARY_INTEGER] 64 78 [;] 78 79 L260 [SUBTYPE] 1 8 - [advice_medium_record] 9 29 + [ADVICE_MEDIUM_RECORD] 9 29 [IS] 30 32 - [advice_medium] 33 46 + [ADVICE_MEDIUM] 33 46 [%] 46 47 [ROWTYPE] 47 54 [;] 54 55 L261 [TYPE] 1 5 - [advice_medium_table] 6 25 + [ADVICE_MEDIUM_TABLE] 6 25 [IS] 26 28 [TABLE] 29 34 [OF] 35 37 - [advice_medium_record] 38 58 + [ADVICE_MEDIUM_RECORD] 38 58 [INDEX] 59 64 [BY] 65 67 [BINARY_INTEGER] 68 82 [;] 82 83 L263 [SUBTYPE] 1 8 - [advice_record] 9 22 + [ADVICE_RECORD] 9 22 [IS] 23 25 - [advices] 26 33 + [ADVICES] 26 33 [%] 33 34 [ROWTYPE] 34 41 [;] 41 42 L264 [TYPE] 1 5 - [advice_table] 6 18 + [ADVICE_TABLE] 6 18 [IS] 19 21 [TABLE] 22 27 [OF] 28 30 - [advice_record] 31 44 + [ADVICE_RECORD] 31 44 [INDEX] 45 50 [BY] 51 53 [BINARY_INTEGER] 54 68 [;] 68 69 L266 [SUBTYPE] 1 8 - [sw_advice_record] 9 25 + [SW_ADVICE_RECORD] 9 25 [IS] 26 28 - [sw_advice] 29 38 + [SW_ADVICE] 29 38 [%] 38 39 [ROWTYPE] 39 46 [;] 46 47 L267 [TYPE] 1 5 - [sw_advice_table] 6 21 + [SW_ADVICE_TABLE] 6 21 [IS] 22 24 [TABLE] 25 30 [OF] 31 33 - [sw_advice_record] 34 50 + [SW_ADVICE_RECORD] 34 50 [INDEX] 51 56 [BY] 57 59 [BINARY_INTEGER] 60 74 [;] 74 75 L269 [SUBTYPE] 1 8 - [files_record] 9 21 + [FILES_RECORD] 9 21 [IS] 22 24 - [files] 25 30 + [FILES] 25 30 [%] 30 31 [ROWTYPE] 31 38 [;] 38 39 L270 [TYPE] 1 5 - [files_table] 6 17 + [FILES_TABLE] 6 17 [IS] 18 20 [TABLE] 21 26 [OF] 27 29 - [files_record] 30 42 + [FILES_RECORD] 30 42 [INDEX] 43 48 [BY] 49 51 [BINARY_INTEGER] 52 66 [;] 66 67 L273 [FUNCTION] 1 9 - [Get_Advice_Types] 10 26 + [GET_ADVICE_TYPES] 10 26 [(] 27 28 L274 - [r_list] 3 9 + [R_LIST] 3 9 [OUT] 21 24 - [advice_type_table] 25 42 + [ADVICE_TYPE_TABLE] 25 42 [)] 42 43 L275 [RETURN] 1 7 @@ -727,57 +727,57 @@ L275 [;] 14 15 L289 [PROCEDURE] 1 10 - [Get_Advice_Defaults] 11 30 + [GET_ADVICE_DEFAULTS] 11 30 [(] 31 32 L290 - [p_sector] 3 11 + [P_SECTOR] 3 11 [VARCHAR2] 21 29 [,] 29 30 L291 - [p_dir] 3 8 + [P_DIR] 3 8 [VARCHAR2] 21 29 [,] 29 30 L292 - [p_type] 3 9 + [P_TYPE] 3 9 [VARCHAR2] 21 29 [,] 29 30 L293 - [def_medium] 3 13 + [DEF_MEDIUM] 3 13 [OUT] 21 24 [VARCHAR2] 25 33 [,] 33 34 L294 - [def_medium_option] 3 20 + [DEF_MEDIUM_OPTION] 3 20 [OUT] 21 24 [VARCHAR2] 25 33 [,] 33 34 L295 - [def_party] 3 12 + [DEF_PARTY] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [,] 33 34 L296 - [party_fixed] 3 14 + [PARTY_FIXED] 3 14 [OUT] 21 24 [VARCHAR2] 25 33 [,] 33 34 L297 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 21 24 [NUMBER] 25 31 [,] 31 32 L298 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 [;] 34 35 L302 [FUNCTION] 1 9 - [Get_Advice_Type_Name] 10 30 + [GET_ADVICE_TYPE_NAME] 10 30 [(] 31 32 L303 - [p_type] 3 9 + [P_TYPE] 3 9 [VARCHAR2] 21 29 [)] 29 30 L304 @@ -786,34 +786,34 @@ L304 [;] 16 17 L314 [PROCEDURE] 1 10 - [Get_Advice_Medium] 11 28 + [GET_ADVICE_MEDIUM] 11 28 [(] 29 30 L315 - [p_adv_type] 3 13 + [P_ADV_TYPE] 3 13 [VARCHAR2] 21 29 [,] 29 30 L316 - [p_medium] 3 11 + [P_MEDIUM] 3 11 [VARCHAR2] 21 29 [,] 29 30 L317 - [p_medium_option] 3 18 + [P_MEDIUM_OPTION] 3 18 [VARCHAR2] 21 29 [,] 29 30 L318 - [r_rec] 3 8 + [R_REC] 3 8 [IN] 21 23 [OUT] 24 27 - [advice_medium_record] 28 48 + [ADVICE_MEDIUM_RECORD] 28 48 [,] 48 49 L319 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L320 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -821,34 +821,34 @@ L320 [;] 37 38 L323 [PROCEDURE] 1 10 - [Get] 11 14 + [GET] 11 14 [(] 15 16 L324 - [p_contract_id] 3 16 + [P_CONTRACT_ID] 3 16 [VARCHAR2] 21 29 [,] 29 30 L325 - [p_step_seq] 3 13 + [P_STEP_SEQ] 3 13 [NUMBER] 21 27 [,] 27 28 L326 - [p_seq] 3 8 + [P_SEQ] 3 8 [NUMBER] 21 27 [,] 27 28 L327 - [r_rec] 3 8 + [R_REC] 3 8 [IN] 21 23 [OUT] 24 27 - [advice_record] 28 41 + [ADVICE_RECORD] 28 41 [,] 41 42 L328 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L329 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -856,124 +856,124 @@ L329 [;] 37 38 L332 [PROCEDURE] 1 10 - [List_Advices] 11 23 + [LIST_ADVICES] 11 23 [(] 24 25 L333 - [p_contract_id] 3 16 + [P_CONTRACT_ID] 3 16 [VARCHAR2] 21 29 [,] 29 30 L334 - [p_step_seq] 3 13 + [P_STEP_SEQ] 3 13 [NUMBER] 21 27 [,] 27 28 L335 - [p_in_out] 3 11 + [P_IN_OUT] 3 11 [VARCHAR2] 21 29 [,] 29 30 L336 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L337 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 [,] 36 37 L338 - [r_list] 3 9 + [R_LIST] 3 9 [IN] 21 23 [OUT] 24 27 - [advice_table] 28 40 + [ADVICE_TABLE] 28 40 [)] 40 41 [;] 41 42 L341 [PROCEDURE] 1 10 - [Ins] 11 14 + [INS] 11 14 [(] 15 16 L342 - [p] 3 4 + [P] 3 4 [IN] 23 25 [OUT] 26 29 - [advice_record] 30 43 + [ADVICE_RECORD] 30 43 [,] 43 44 L343 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 23 26 [NUMBER] 27 33 [,] 33 34 L344 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 23 26 [VARCHAR2] 27 35 [)] 35 36 [;] 36 37 L347 [PROCEDURE] 1 10 - [Del] 11 14 + [DEL] 11 14 [(] 15 16 L348 - [p] 3 4 + [P] 3 4 [IN] 23 25 [OUT] 26 29 - [advice_record] 30 43 + [ADVICE_RECORD] 30 43 [,] 43 44 L349 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 23 26 [NUMBER] 27 33 [,] 33 34 L350 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 23 26 [VARCHAR2] 27 35 [)] 35 36 [;] 36 37 L353 [PROCEDURE] 1 10 - [Ins_SW_Advice] 11 24 + [INS_SW_ADVICE] 11 24 [(] 25 26 L354 - [p] 3 4 + [P] 3 4 [IN] 23 25 [OUT] 26 29 - [sw_advice_record] 30 46 + [SW_ADVICE_RECORD] 30 46 [,] 46 47 L355 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 23 26 [NUMBER] 27 33 [,] 33 34 L356 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 23 26 [VARCHAR2] 27 35 [)] 35 36 [;] 36 37 L359 [PROCEDURE] 1 10 - [Get_SW_Advice] 11 24 + [GET_SW_ADVICE] 11 24 [(] 25 26 L360 - [p_id] 3 7 + [P_ID] 3 7 [VARCHAR2] 21 29 [,] 29 30 L361 - [r_list] 3 9 + [R_LIST] 3 9 [IN] 21 23 [OUT] 24 27 - [sw_advice_table] 28 43 + [SW_ADVICE_TABLE] 28 43 [,] 43 44 L362 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L363 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -981,47 +981,47 @@ L363 [;] 37 38 L366 [PROCEDURE] 1 10 - [Ins_File] 11 19 + [INS_FILE] 11 19 [(] 20 21 L367 - [p] 3 4 + [P] 3 4 [IN] 23 25 [OUT] 26 29 - [files_record] 30 42 + [FILES_RECORD] 30 42 [,] 42 43 L368 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 23 26 [NUMBER] 27 33 [,] 33 34 L369 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 23 26 [VARCHAR2] 27 35 [)] 35 36 [;] 36 37 L372 [PROCEDURE] 1 10 - [Get_Files] 11 20 + [GET_FILES] 11 20 [(] 21 22 L373 - [p_doc_id] 3 11 + [P_DOC_ID] 3 11 [VARCHAR2] 21 29 [,] 29 30 L374 - [r_list] 3 9 + [R_LIST] 3 9 [IN] 21 23 [OUT] 24 27 - [files_table] 28 39 + [FILES_TABLE] 28 39 [,] 39 40 L375 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L376 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -1029,28 +1029,28 @@ L376 [;] 37 38 L386 [PROCEDURE] 1 10 - [CFR_Advice_Out] 11 25 + [CFR_ADVICE_OUT] 11 25 [(] 26 27 L387 - [p_contract_id] 3 16 + [P_CONTRACT_ID] 3 16 [VARCHAR2] 21 29 [,] 29 30 L388 - [p_step] 3 9 + [P_STEP] 3 9 [NUMBER] 21 27 [,] 27 28 L389 - [p_app_user] 3 13 + [P_APP_USER] 3 13 [VARCHAR2] 21 29 [,] 29 30 L390 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L391 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -1058,28 +1058,28 @@ L391 [;] 37 38 L401 [PROCEDURE] 1 10 - [CFR_Advice_In] 11 24 + [CFR_ADVICE_IN] 11 24 [(] 25 26 L402 - [p_contract_id] 3 16 + [P_CONTRACT_ID] 3 16 [VARCHAR2] 21 29 [,] 29 30 L403 - [p_step] 3 9 + [P_STEP] 3 9 [NUMBER] 21 27 [,] 27 28 L404 - [p_app_user] 3 13 + [P_APP_USER] 3 13 [VARCHAR2] 21 29 [,] 29 30 L405 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L406 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -1087,28 +1087,28 @@ L406 [;] 37 38 L416 [PROCEDURE] 1 10 - [Release_Advice_Out] 11 29 + [RELEASE_ADVICE_OUT] 11 29 [(] 30 31 L417 - [p_contract_id] 3 16 + [P_CONTRACT_ID] 3 16 [VARCHAR2] 21 29 [,] 29 30 L418 - [p_step] 3 9 + [P_STEP] 3 9 [NUMBER] 21 27 [,] 27 28 L419 - [p_app_user] 3 13 + [P_APP_USER] 3 13 [VARCHAR2] 21 29 [,] 29 30 L420 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L421 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -1116,28 +1116,28 @@ L421 [;] 37 38 L431 [PROCEDURE] 1 10 - [Release_Advice_In] 11 28 + [RELEASE_ADVICE_IN] 11 28 [(] 29 30 L432 - [p_contract_id] 3 16 + [P_CONTRACT_ID] 3 16 [VARCHAR2] 21 29 [,] 29 30 L433 - [p_step] 3 9 + [P_STEP] 3 9 [NUMBER] 21 27 [,] 27 28 L434 - [p_app_user] 3 13 + [P_APP_USER] 3 13 [VARCHAR2] 21 29 [,] 29 30 L435 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L436 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -1158,101 +1158,101 @@ L443 L444 [IS] 1 3 L458 - [record_locked] 1 14 + [RECORD_LOCKED] 1 14 [EXCEPTION] 15 24 [;] 24 25 L460 [TYPE] 1 5 - [customer_type] 6 19 + [CUSTOMER_TYPE] 6 19 [IS] 20 22 [RECORD] 23 29 [(] 30 31 L461 - [id] 3 5 + [ID] 3 5 [VARCHAR2] 29 37 [(] 37 38 [20] 38 40 [)] 40 41 [,] 41 42 L462 - [name] 3 7 + [NAME] 3 7 [VARCHAR2] 29 37 [(] 37 38 [100] 38 41 [)] 41 42 [,] 42 43 L463 - [short_name] 3 13 + [SHORT_NAME] 3 13 [VARCHAR2] 29 37 [(] 37 38 [35] 38 40 [)] 40 41 [,] 41 42 L464 - [db_id] 3 8 + [DB_ID] 3 8 [VARCHAR2] 29 37 [(] 37 38 [20] 38 40 [)] 40 41 [,] 41 42 L465 - [sub_cust_code] 3 16 + [SUB_CUST_CODE] 3 16 [VARCHAR2] 29 37 [(] 37 38 [20] 38 40 [)] 40 41 [,] 41 42 L466 - [sub_account] 3 14 + [SUB_ACCOUNT] 3 14 [VARCHAR2] 29 37 [(] 37 38 [30] 38 40 [)] 40 41 [,] 41 42 L467 - [regno] 3 8 + [REGNO] 3 8 [VARCHAR2] 29 37 [(] 37 38 [50] 38 40 [)] 40 41 [,] 41 42 L468 - [residence] 3 12 + [RESIDENCE] 3 12 [VARCHAR2] 29 37 [(] 37 38 [10] 38 40 [)] 40 41 [,] 41 42 L469 - [ct_type] 3 10 + [CT_TYPE] 3 10 [VARCHAR2] 29 37 [(] 37 38 [10] 38 40 [)] 40 41 [,] 41 42 L470 - [ct_entity] 3 12 + [CT_ENTITY] 3 12 [VARCHAR2] 29 37 [(] 37 38 [10] 38 40 [)] 40 41 [,] 41 42 L471 - [language] 3 11 + [LANGUAGE] 3 11 [VARCHAR2] 29 37 [(] 37 38 [10] 38 40 [)] 40 41 [,] 41 42 L472 - [business_type] 3 16 + [BUSINESS_TYPE] 3 16 [VARCHAR2] 29 37 [(] 37 38 [10] 38 40 [)] 40 41 [,] 41 42 L473 - [tax_code] 3 11 + [TAX_CODE] 3 11 [VARCHAR2] 29 37 [(] 37 38 [10] 38 40 @@ -1262,55 +1262,55 @@ L474 [;] 2 3 L475 [TYPE] 1 5 - [customer_table] 6 20 + [CUSTOMER_TABLE] 6 20 [IS] 21 23 [TABLE] 24 29 [OF] 30 32 - [customer_type] 33 46 + [CUSTOMER_TYPE] 33 46 [INDEX] 47 52 [BY] 53 55 [BINARY_INTEGER] 56 70 [;] 70 71 L477 [SUBTYPE] 1 8 - [loan_customer_type] 9 27 + [LOAN_CUSTOMER_TYPE] 9 27 [IS] 28 30 - [loan_customers] 31 45 + [LOAN_CUSTOMERS] 31 45 [%] 45 46 [ROWTYPE] 46 53 [;] 53 54 L478 [TYPE] 1 5 - [loan_customer_table] 6 25 + [LOAN_CUSTOMER_TABLE] 6 25 [IS] 26 28 [TABLE] 29 34 [OF] 35 37 - [loan_customer_type] 38 56 + [LOAN_CUSTOMER_TYPE] 38 56 [INDEX] 57 62 [BY] 63 65 [BINARY_INTEGER] 66 80 [;] 80 81 L481 [PROCEDURE] 1 10 - [Get_Record] 11 21 + [GET_RECORD] 11 21 [(] 22 23 L482 - [p_id] 3 7 + [P_ID] 3 7 [VARCHAR2] 21 29 [,] 29 30 L483 - [r] 3 4 + [R] 3 4 [OUT] 21 24 - [customer_type] 25 38 + [CUSTOMER_TYPE] 25 38 [,] 38 39 L484 - [r_result] 3 11 + [R_RESULT] 3 11 [IN] 21 23 [OUT] 24 27 [NUMBER] 28 34 [,] 34 35 L485 - [r_message] 3 12 + [R_MESSAGE] 3 12 [IN] 21 23 [OUT] 24 27 [VARCHAR2] 28 36 @@ -1318,162 +1318,162 @@ L485 [;] 37 38 L488 [PROCEDURE] 1 10 - [Get_By_Id] 11 20 + [GET_BY_ID] 11 20 [(] 21 22 L489 - [p_id] 3 7 + [P_ID] 3 7 [IN] 21 23 [VARCHAR2] 24 32 [,] 32 33 L490 - [r_records] 3 12 + [R_RECORDS] 3 12 [IN] 21 23 [OUT] 24 27 - [customer_table] 28 42 + [CUSTOMER_TABLE] 28 42 [)] 42 43 [;] 43 44 L493 [PROCEDURE] 1 10 - [Get_By_Criteria] 11 26 + [GET_BY_CRITERIA] 11 26 [(] 27 28 L494 - [p_criteria] 3 13 + [P_CRITERIA] 3 13 [IN] 21 23 - [customer_type] 24 37 + [CUSTOMER_TYPE] 24 37 [,] 37 38 L495 - [r_records] 3 12 + [R_RECORDS] 3 12 [IN] 21 23 [OUT] 24 27 - [customer_table] 28 42 + [CUSTOMER_TABLE] 28 42 [)] 42 43 [;] 43 44 L498 [PROCEDURE] 1 10 - [Get] 11 14 + [GET] 11 14 [(] 15 16 L499 - [p_id] 3 7 + [P_ID] 3 7 [IN] 21 23 [VARCHAR2] 24 32 [,] 32 33 L500 - [p_name] 3 9 + [P_NAME] 3 9 [IN] 21 23 [VARCHAR2] 24 32 [,] 32 33 L501 - [p_short_name] 3 15 + [P_SHORT_NAME] 3 15 [IN] 21 23 [VARCHAR2] 24 32 [,] 32 33 L502 - [p_cust_code] 3 14 + [P_CUST_CODE] 3 14 [IN] 21 23 [VARCHAR2] 24 32 [,] 32 33 L503 - [p_account] 3 12 + [P_ACCOUNT] 3 12 [IN] 21 23 [VARCHAR2] 24 32 [,] 32 33 L504 - [p_regno] 3 10 + [P_REGNO] 3 10 [IN] 21 23 [VARCHAR2] 24 32 [,] 32 33 L505 - [r_records] 3 12 + [R_RECORDS] 3 12 [IN] 21 23 [OUT] 24 27 - [customer_table] 28 42 + [CUSTOMER_TABLE] 28 42 [)] 42 43 [;] 43 44 L508 [PROCEDURE] 1 10 - [Search_By_Account] 11 28 + [SEARCH_BY_ACCOUNT] 11 28 [(] 29 30 L509 - [p_account] 3 12 + [P_ACCOUNT] 3 12 [VARCHAR2] 21 29 [,] 29 30 L510 - [r_record] 3 11 + [R_RECORD] 3 11 [IN] 21 23 [OUT] 24 27 - [customer_type] 28 41 + [CUSTOMER_TYPE] 28 41 [,] 41 42 L511 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 21 24 [NUMBER] 25 31 [,] 31 32 L512 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 [;] 34 35 L515 [PROCEDURE] 1 10 - [Ins] 11 14 + [INS] 11 14 [(] 15 16 L516 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [customer_table] 24 38 + [CUSTOMER_TABLE] 24 38 [)] 38 39 [;] 39 40 L519 [PROCEDURE] 1 10 - [Upd] 11 14 + [UPD] 11 14 [(] 15 16 L520 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [customer_table] 24 38 + [CUSTOMER_TABLE] 24 38 [)] 38 39 [;] 39 40 L523 [PROCEDURE] 1 10 - [Del] 11 14 + [DEL] 11 14 [(] 15 16 L524 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [customer_table] 24 38 + [CUSTOMER_TABLE] 24 38 [)] 38 39 [;] 39 40 L527 [PROCEDURE] 1 10 - [Lck] 11 14 + [LCK] 11 14 [(] 15 16 L528 - [p_data] 3 9 + [P_DATA] 3 9 [IN] 21 23 - [customer_table] 24 38 + [CUSTOMER_TABLE] 24 38 [)] 38 39 [;] 39 40 L537 [PROCEDURE] 1 10 - [Get_Loan_Customer] 11 28 + [GET_LOAN_CUSTOMER] 11 28 [(] 29 30 L538 - [p_id] 3 7 + [P_ID] 3 7 [VARCHAR2] 21 29 [,] 29 30 L539 - [r] 3 4 + [R] 3 4 [OUT] 21 24 - [loan_customer_type] 25 43 + [LOAN_CUSTOMER_TYPE] 25 43 [,] 43 44 L540 - [r_result] 3 11 + [R_RESULT] 3 11 [OUT] 21 24 [NUMBER] 25 31 [,] 31 32 L541 - [r_message] 3 12 + [R_MESSAGE] 3 12 [OUT] 21 24 [VARCHAR2] 25 33 [)] 33 34 @@ -1488,13 +1488,13 @@ L546 [OR] 8 10 [REPLACE] 11 18 L547 - [Package] 1 8 + [PACKAGE] 1 8 [EXEC_SP] 12 19 L548 [IS] 1 3 L562 [DATEFORMAT] 1 11 - [constant] 12 20 + [CONSTANT] 12 20 [VARCHAR2] 21 29 [(] 29 30 [100] 30 33 @@ -1505,7 +1505,7 @@ L562 [;] 61 62 L563 [TYPE] 1 5 - [string_array] 6 18 + [STRING_ARRAY] 6 18 [IS] 19 21 [TABLE] 22 27 [OF] 28 30 @@ -1519,55 +1519,55 @@ L563 [;] 70 71 L565 [PROCEDURE] 1 10 - [Exec_SP] 11 18 + [EXEC_SP] 11 18 [(] 19 20 L566 - [sp_name] 3 10 + [SP_NAME] 3 10 [VARCHAR2] 15 23 [,] 23 24 L567 - [sp_package] 3 13 + [SP_PACKAGE] 3 13 [VARCHAR2] 15 23 [,] 23 24 L568 - [sp_schema] 3 12 + [SP_SCHEMA] 3 12 [VARCHAR2] 15 23 [,] 23 24 L569 - [sp_type] 3 10 + [SP_TYPE] 3 10 [VARCHAR2] 15 23 [,] 23 24 L570 - [arg_names] 3 12 + [ARG_NAMES] 3 12 [IN] 15 17 [OUT] 18 21 - [string_array] 22 34 + [STRING_ARRAY] 22 34 [,] 34 35 L571 - [arg_types] 3 12 + [ARG_TYPES] 3 12 [IN] 15 17 [OUT] 18 21 - [string_array] 22 34 + [STRING_ARRAY] 22 34 [,] 34 35 L572 - [arg_pass] 3 11 + [ARG_PASS] 3 11 [IN] 15 17 [OUT] 18 21 - [string_array] 22 34 + [STRING_ARRAY] 22 34 [,] 34 35 L573 - [arg_values] 3 13 + [ARG_VALUES] 3 13 [IN] 15 17 [OUT] 18 21 - [string_array] 22 34 + [STRING_ARRAY] 22 34 [,] 34 35 L574 - [error_code] 3 13 + [ERROR_CODE] 3 13 [OUT] 15 18 [NUMBER] 19 25 [,] 25 26 L575 - [error_msg] 3 12 + [ERROR_MSG] 3 12 [OUT] 15 18 [VARCHAR2] 19 27 [)] 27 28 @@ -1588,10 +1588,10 @@ L582 [IS] 1 3 L597 [FUNCTION] 1 9 - [put] 10 13 + [PUT] 10 13 [(] 13 14 L598 - [p_value] 3 10 + [P_VALUE] 3 10 [IN] 17 19 [VARCHAR2] 20 28 [)] 28 29 @@ -1601,10 +1601,10 @@ L599 [;] 14 15 L602 [FUNCTION] 1 9 - [get] 10 13 + [GET] 10 13 [(] 13 14 L603 - [p_id] 3 7 + [P_ID] 3 7 [IN] 17 19 [VARCHAR2] 20 28 [)] 28 29 @@ -1614,106 +1614,106 @@ L604 [;] 16 17 L607 [PROCEDURE] 1 10 - [remove] 11 17 + [REMOVE] 11 17 [(] 17 18 L608 - [p_id] 3 7 + [P_ID] 3 7 [IN] 17 19 [VARCHAR2] 20 28 [)] 28 29 [;] 29 30 L610 [FUNCTION] 1 9 - [HH_get_info] 10 21 + [HH_GET_INFO] 10 21 L611 [(] 1 2 - [erty_id_in] 3 13 + [ERTY_ID_IN] 3 13 [IN] 14 16 - [HH_t] 17 21 + [HH_T] 17 21 [.] 21 22 - [a_id] 22 26 + [A_ID] 22 26 [%] 26 27 [TYPE] 27 31 [DEFAULT] 33 40 [NULL] 41 45 L612 [,] 1 2 - [df_id_in] 3 11 + [DF_ID_IN] 3 11 [IN] 14 16 - [HH_t] 17 21 + [HH_T] 17 21 [.] 21 22 - [b_id] 22 26 + [B_ID] 22 26 [%] 26 27 [TYPE] 27 31 [DEFAULT] 33 40 [NULL] 41 45 L613 [,] 1 2 - [fghj_id_in] 3 13 + [FGHJ_ID_IN] 3 13 [IN] 14 16 - [HH_t] 17 21 + [HH_T] 17 21 [.] 21 22 - [c_id] 22 26 + [C_ID] 22 26 [%] 26 27 [TYPE] 27 31 [DEFAULT] 33 40 - [vk_asdgfh_pa] 41 53 + [VK_ASDGFH_PA] 41 53 [.] 53 54 - [some_function] 54 67 + [SOME_FUNCTION] 54 67 [(] 67 68 [)] 68 69 L614 [,] 1 2 - [cascade_in] 3 13 + [CASCADE_IN] 3 13 [IN] 14 16 [NUMBER] 17 23 [DEFAULT] 33 40 - [vk_asdgfh_pa] 41 53 + [VK_ASDGFH_PA] 41 53 [.] 53 54 - [some_constant] 54 67 + [SOME_CONSTANT] 54 67 L615 [)] 1 2 L616 [RETURN] 1 7 - [vk_types_pa] 8 19 + [VK_TYPES_PA] 8 19 [.] 19 20 - [type_rg_info_rec] 20 36 + [TYPE_RG_INFO_REC] 20 36 [;] 36 37 L618 [PROCEDURE] 1 10 - [start_batch_job] 11 26 + [START_BATCH_JOB] 11 26 [(] 27 28 - [p_interval] 28 38 + [P_INTERVAL] 28 38 [IN] 39 41 - [dba_jobs] 42 50 + [DBA_JOBS] 42 50 [.] 50 51 - [interval] 51 59 + [INTERVAL] 51 59 [%] 59 60 [TYPE] 60 64 [)] 64 65 [;] 65 66 L620 - [procedure] 1 10 - [out] 11 14 + [PROCEDURE] 1 10 + [OUT] 11 14 [(] 14 15 - [cursor] 15 21 + [CURSOR] 15 21 [VARCHAR2] 22 30 [)] 30 31 [;] 31 32 L622 [PROCEDURE] 1 10 - [refresh_all] 11 22 + [REFRESH_ALL] 11 22 [(] 22 23 - [kehtib] 23 29 - [date] 30 34 - [default] 35 42 - [last_day] 43 51 + [KEHTIB] 23 29 + [DATE] 30 34 + [DEFAULT] 35 42 + [LAST_DAY] 43 51 [(] 51 52 - [add_months] 52 62 + [ADD_MONTHS] 52 62 [(] 62 63 - [trunc] 63 68 + [TRUNC] 63 68 [(] 68 69 - [sysdate] 69 76 + [SYSDATE] 69 76 [)] 76 77 [,] 77 78 [1] 78 79 diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/tabWidth.txt b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/tabWidth.txt index c777bdf32c..03cbfe1cfd 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/tabWidth.txt +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/tabWidth.txt @@ -2,7 +2,7 @@ L1 [DECLARE] 1 8 L2 - [qty_on_hand] 2 13 + [QTY_ON_HAND] 2 13 [NUMBER] 14 20 [(] 20 21 [5] 21 22 @@ -12,47 +12,47 @@ L3 [BEGIN] 1 6 L4 [SELECT] 2 8 - [quantity] 9 17 + [QUANTITY] 9 17 [INTO] 18 22 - [qty_on_hand] 23 34 + [QTY_ON_HAND] 23 34 [FROM] 35 39 - [inventory] 40 49 + [INVENTORY] 40 49 L5 [WHERE] 3 8 - [product] 9 16 + [PRODUCT] 9 16 [=] 17 18 ['TENNIS RACKET'] 19 34 L6 [FOR] 3 6 [UPDATE] 7 13 [OF] 14 16 - [quantity] 17 25 + [QUANTITY] 17 25 [;] 25 26 L7 [IF] 2 4 - [qty_on_hand] 5 16 + [QTY_ON_HAND] 5 16 [>] 17 18 [0] 19 20 [THEN] 21 25 L8 [UPDATE] 3 9 - [inventory] 10 19 + [INVENTORY] 10 19 [SET] 20 23 - [quantity] 24 32 + [QUANTITY] 24 32 [=] 33 34 - [quantity] 35 43 + [QUANTITY] 35 43 [-] 44 45 [1] 46 47 L9 [WHERE] 4 9 - [product] 10 17 + [PRODUCT] 10 17 [=] 18 19 ['TENNIS RACKET'] 20 35 [;] 35 36 L10 [INSERT] 3 9 [INTO] 10 14 - [purchase_record] 15 30 + [PURCHASE_RECORD] 15 30 L11 [VALUES] 4 10 [(] 11 12 @@ -66,7 +66,7 @@ L12 L13 [INSERT] 3 9 [INTO] 10 14 - [purchase_record] 15 30 + [PURCHASE_RECORD] 15 30 L14 [VALUES] 4 10 [(] 11 12 From ab80b2443dbc0072aba47c75743f86499accd127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 8 Apr 2024 21:31:22 +0200 Subject: [PATCH 05/66] Also add this ability for Antlr lexers, adapt TSQL --- .../pmd/cpd/impl/AntlrCpdLexer.java | 11 +- .../ast/impl/antlr4/AntlrLexerBehavior.java | 32 + .../pmd/lang/ast/impl/antlr4/AntlrToken.java | 22 +- .../ast/impl/antlr4/AntlrTokenManager.java | 10 +- .../pmd/lang/tsql/cpd/TSqlCpdLexer.java | 19 + .../tsql/cpd/testdata/MailJobTimeLine.txt | 4052 ++++++++--------- .../pmd/lang/tsql/cpd/testdata/simple.txt | 42 +- 7 files changed, 2132 insertions(+), 2056 deletions(-) create mode 100644 pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrLexerBehavior.java diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrCpdLexer.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrCpdLexer.java index 3c06996210..a451e8400d 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrCpdLexer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrCpdLexer.java @@ -12,6 +12,7 @@ import org.antlr.v4.runtime.Lexer; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.TokenManager; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrLexerBehavior; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrToken; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTokenManager; import net.sourceforge.pmd.lang.document.TextDocument; @@ -23,7 +24,15 @@ public abstract class AntlrCpdLexer extends CpdLexerBase { @Override protected final TokenManager makeLexerImpl(TextDocument doc) throws IOException { CharStream charStream = CharStreams.fromReader(doc.newReader(), doc.getFileId().getAbsolutePath()); - return new AntlrTokenManager(getLexerForSource(charStream), doc); + return new AntlrTokenManager(getLexerForSource(charStream), doc, getLexerBehavior()); + } + + /** + * Override this method to customize some aspects of the + * lexer. + */ + protected AntlrLexerBehavior getLexerBehavior() { + return new AntlrLexerBehavior(); } protected abstract Lexer getLexerForSource(CharStream charStream); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrLexerBehavior.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrLexerBehavior.java new file mode 100644 index 0000000000..7d2e8cf24e --- /dev/null +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrLexerBehavior.java @@ -0,0 +1,32 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.ast.impl.antlr4; + +import org.antlr.v4.runtime.Token; + +import net.sourceforge.pmd.cpd.CpdLanguageProperties; + +/** + * Strategy to customize some aspects of the mapping + * from Antlr tokens to PMD/CPD tokens. + */ +public class AntlrLexerBehavior { + + + /** + * Return the image that the token should have, possibly applying a transformation. + * The default just returns {@link Token#getText()}. + * Transformations here are usually normalizations, for instance, mapping + * the image of all keywords to uppercase/lowercase to implement case-insensitivity, + * or replacing the image of literals by a placeholder to implement {@link CpdLanguageProperties#CPD_ANONYMIZE_LITERALS}. + * + * @param token A token from the Antlr Lexer + * + * @return The image + */ + protected String getTokenImage(Token token) { + return token.getText(); + } +} diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java index 8a7d08c1f5..d76586f73b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java @@ -17,9 +17,13 @@ import net.sourceforge.pmd.lang.document.TextRegion; */ public class AntlrToken implements GenericToken { - private final Token token; private final AntlrToken previousComment; private final TextDocument textDoc; + private final String image; + private final int endOffset; + private final int startOffset; + private final int channel; + private final int kind; AntlrToken next; @@ -30,10 +34,14 @@ public class AntlrToken implements GenericToken { * @param previousComment The previous comment * @param textDoc The text document */ - public AntlrToken(final Token token, final AntlrToken previousComment, TextDocument textDoc) { - this.token = token; + AntlrToken(final Token token, final AntlrToken previousComment, TextDocument textDoc, AntlrLexerBehavior behavior) { this.previousComment = previousComment; this.textDoc = textDoc; + this.image = behavior.getTokenImage(token); + this.startOffset = token.getStartIndex(); + this.endOffset = token.getStopIndex(); + this.channel = token.getChannel(); + this.kind = token.getType(); } @Override @@ -48,13 +56,13 @@ public class AntlrToken implements GenericToken { @Override public CharSequence getImageCs() { - return token.getText(); + return image; } /** Returns a text region with the coordinates of this token. */ @Override public TextRegion getRegion() { - return TextRegion.fromBothOffsets(token.getStartIndex(), token.getStopIndex() + 1); + return TextRegion.fromBothOffsets(startOffset, endOffset); } @Override @@ -74,7 +82,7 @@ public class AntlrToken implements GenericToken { @Override public int getKind() { - return token.getType(); + return kind; } public boolean isHidden() { @@ -82,6 +90,6 @@ public class AntlrToken implements GenericToken { } public boolean isDefault() { - return token.getChannel() == Lexer.DEFAULT_TOKEN_CHANNEL; + return channel == Lexer.DEFAULT_TOKEN_CHANNEL; } } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java index 5828195850..6c54e3ef05 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java @@ -20,12 +20,20 @@ public class AntlrTokenManager implements TokenManager { private final Lexer lexer; private final TextDocument textDoc; + private final AntlrLexerBehavior behavior; private AntlrToken previousToken; public AntlrTokenManager(final Lexer lexer, final TextDocument textDocument) { + this(lexer, textDocument, new AntlrLexerBehavior()); + } + + public AntlrTokenManager(final Lexer lexer, + final TextDocument textDocument, + final AntlrLexerBehavior behavior) { this.lexer = lexer; this.textDoc = textDocument; + this.behavior = behavior; resetListeners(); } @@ -40,7 +48,7 @@ public class AntlrTokenManager implements TokenManager { private AntlrToken getNextTokenFromAnyChannel() { final AntlrToken previousComment = previousToken != null && previousToken.isHidden() ? previousToken : null; - final AntlrToken currentToken = new AntlrToken(lexer.nextToken(), previousComment, textDoc); + final AntlrToken currentToken = new AntlrToken(lexer.nextToken(), previousComment, textDoc, this.behavior); if (previousToken != null) { previousToken.next = currentToken; } diff --git a/pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexer.java b/pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexer.java index 8d9b403f85..deea25c4fb 100644 --- a/pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexer.java +++ b/pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexer.java @@ -4,10 +4,14 @@ package net.sourceforge.pmd.lang.tsql.cpd; +import java.util.Locale; + import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.Token; import net.sourceforge.pmd.cpd.impl.AntlrCpdLexer; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrLexerBehavior; import net.sourceforge.pmd.lang.tsql.ast.TSqlLexer; /** @@ -19,4 +23,19 @@ public class TSqlCpdLexer extends AntlrCpdLexer { protected Lexer getLexerForSource(CharStream charStream) { return new TSqlLexer(new CaseChangingCharStream(charStream, true)); } + + @Override + protected AntlrLexerBehavior getLexerBehavior() { + return new AntlrLexerBehavior() { + @Override + protected String getTokenImage(Token token) { + if (token.getType() == TSqlLexer.STRING) { + // This path is for case-sensitive tokens + return super.getTokenImage(token); + } + // normalize case sensitive tokens + return token.getText().toUpperCase(Locale.ROOT); + } + }; + } } diff --git a/pmd-tsql/src/test/resources/net/sourceforge/pmd/lang/tsql/cpd/testdata/MailJobTimeLine.txt b/pmd-tsql/src/test/resources/net/sourceforge/pmd/lang/tsql/cpd/testdata/MailJobTimeLine.txt index 728d9ba318..aa21c30f09 100644 --- a/pmd-tsql/src/test/resources/net/sourceforge/pmd/lang/tsql/cpd/testdata/MailJobTimeLine.txt +++ b/pmd-tsql/src/test/resources/net/sourceforge/pmd/lang/tsql/cpd/testdata/MailJobTimeLine.txt @@ -1,2344 +1,2344 @@ [Image] or [Truncated image[ Bcol Ecol L14 - [SET] 1 4 - [NOCOUNT] 5 12 - [ON] 13 15 + [SET] 1 3 + [NOCOUNT] 5 11 + [ON] 13 14 L17 - [DECLARE] 1 8 - [@StartDate] 9 19 - [DATETIME] 20 28 + [DECLARE] 1 7 + [@STARTDATE] 9 18 + [DATETIME] 20 27 L18 - [DECLARE] 1 8 - [@EndDate] 9 17 - [DATETIME] 18 26 + [DECLARE] 1 7 + [@ENDDATE] 9 16 + [DATETIME] 18 25 L19 - [DECLARE] 1 8 - [@MinimalJobDurationInSeconds] 9 37 - [INT] 39 42 + [DECLARE] 1 7 + [@MINIMALJOBDURATIONINSECONDS] 9 36 + [INT] 39 41 L20 - [DECLARE] 1 8 - [@EmailTo] 9 17 - [VARCHAR] 18 25 - [(] 25 26 - [500] 26 29 - [)] 29 30 + [DECLARE] 1 7 + [@EMAILTO] 9 16 + [VARCHAR] 18 24 + [(] 25 25 + [500] 26 28 + [)] 29 29 L21 - [DECLARE] 1 8 - [@DaysPast] 9 18 - [INT] 19 22 + [DECLARE] 1 7 + [@DAYSPAST] 9 17 + [INT] 19 21 L22 - [DECLARE] 1 8 - [@HoursPast] 9 19 - [INT] 20 23 + [DECLARE] 1 7 + [@HOURSPAST] 9 18 + [INT] 20 22 L23 - [DECLARE] 1 8 - [@Servername] 9 20 - [VARCHAR] 21 28 - [(] 28 29 - [50] 29 31 - [)] 31 32 + [DECLARE] 1 7 + [@SERVERNAME] 9 19 + [VARCHAR] 21 27 + [(] 28 28 + [50] 29 30 + [)] 31 31 L32 - [SET] 1 4 - [@EmailTo] 5 13 - [=] 14 15 - ['John.Doe@xyz.com;Jennifer.Doe@xyz[ 16 55 + [SET] 1 3 + [@EMAILTO] 5 12 + [=] 14 14 + ['John.Doe@xyz.com;Jennifer.Doe@xyz[ 16 54 L35 - [SET] 1 4 - [@DaysPast] 5 14 - [=] 15 16 - [1] 17 18 + [SET] 1 3 + [@DAYSPAST] 5 13 + [=] 15 15 + [1] 17 17 L38 - [SET] 1 4 - [@HoursPast] 5 15 - [=] 16 17 - [0] 18 19 + [SET] 1 3 + [@HOURSPAST] 5 14 + [=] 16 16 + [0] 18 18 L41 - [SET] 1 4 - [@MinimalJobDurationInSeconds] 5 33 - [=] 35 36 - [0] 37 38 + [SET] 1 3 + [@MINIMALJOBDURATIONINSECONDS] 5 32 + [=] 35 35 + [0] 37 37 L55 - [SET] 1 4 - [@StartDate] 5 15 - [=] 16 17 - [DateAdd] 18 25 - [(] 25 26 - [hh] 26 28 - [,] 28 29 - [-] 30 31 - [(] 31 32 - [@HoursPast] 32 42 - [)] 42 43 - [,] 43 44 - [GETDATE] 45 52 - [(] 52 53 - [)] 53 54 - [-] 55 56 - [@DaysPast] 57 66 - [)] 66 67 + [SET] 1 3 + [@STARTDATE] 5 14 + [=] 16 16 + [DATEADD] 18 24 + [(] 25 25 + [HH] 26 27 + [,] 28 28 + [-] 30 30 + [(] 31 31 + [@HOURSPAST] 32 41 + [)] 42 42 + [,] 43 43 + [GETDATE] 45 51 + [(] 52 52 + [)] 53 53 + [-] 55 55 + [@DAYSPAST] 57 65 + [)] 66 66 L56 - [SET] 1 4 - [@EndDate] 5 13 - [=] 14 15 - [GETDATE] 16 23 - [(] 23 24 - [)] 24 25 + [SET] 1 3 + [@ENDDATE] 5 12 + [=] 14 14 + [GETDATE] 16 22 + [(] 23 23 + [)] 24 24 L64 - [DECLARE] 1 8 - [@TEXT_SUCCESS] 9 22 - [VARCHAR] 23 30 - [(] 30 31 - [20] 31 33 - [)] 33 34 + [DECLARE] 1 7 + [@TEXT_SUCCESS] 9 21 + [VARCHAR] 23 29 + [(] 30 30 + [20] 31 32 + [)] 33 33 L65 - [SET] 1 4 - [@TEXT_SUCCESS] 5 18 - [=] 19 20 - ['Successful'] 21 33 + [SET] 1 3 + [@TEXT_SUCCESS] 5 17 + [=] 19 19 + ['Successful'] 21 32 L74 - [DECLARE] 1 8 - [@COLOR_ERROR] 9 21 - [VARCHAR] 22 29 - [(] 29 30 - [10] 30 32 - [)] 32 33 + [DECLARE] 1 7 + [@COLOR_ERROR] 9 20 + [VARCHAR] 22 28 + [(] 29 29 + [10] 30 31 + [)] 32 32 L75 - [SET] 1 4 - [@COLOR_ERROR] 5 17 - [=] 18 19 - ['#FF4136'] 20 29 + [SET] 1 3 + [@COLOR_ERROR] 5 16 + [=] 18 18 + ['#FF4136'] 20 28 L77 - [DECLARE] 1 8 - [@COLOR_SUCCESS] 9 23 - [VARCHAR] 24 31 - [(] 31 32 - [10] 32 34 - [)] 34 35 + [DECLARE] 1 7 + [@COLOR_SUCCESS] 9 22 + [VARCHAR] 24 30 + [(] 31 31 + [10] 32 33 + [)] 34 34 L78 - [SET] 1 4 - [@COLOR_SUCCESS] 5 19 - [=] 20 21 - ['#2ECC40'] 22 31 + [SET] 1 3 + [@COLOR_SUCCESS] 5 18 + [=] 20 20 + ['#2ECC40'] 22 30 L80 - [DECLARE] 1 8 - [@COLOR_RETRY] 9 21 - [VARCHAR] 22 29 - [(] 29 30 - [10] 30 32 - [)] 32 33 + [DECLARE] 1 7 + [@COLOR_RETRY] 9 20 + [VARCHAR] 22 28 + [(] 29 29 + [10] 30 31 + [)] 32 32 L81 - [SET] 1 4 - [@COLOR_RETRY] 5 17 - [=] 18 19 - ['#FFDC00'] 20 29 + [SET] 1 3 + [@COLOR_RETRY] 5 16 + [=] 18 18 + ['#FFDC00'] 20 28 L83 - [DECLARE] 1 8 - [@COLOR_ABORTED] 9 23 - [VARCHAR] 24 31 - [(] 31 32 - [10] 32 34 - [)] 34 35 + [DECLARE] 1 7 + [@COLOR_ABORTED] 9 22 + [VARCHAR] 24 30 + [(] 31 31 + [10] 32 33 + [)] 34 34 L84 - [SET] 1 4 - [@COLOR_ABORTED] 5 19 - [=] 20 21 - ['#AAAAAA'] 22 31 + [SET] 1 3 + [@COLOR_ABORTED] 5 18 + [=] 20 20 + ['#AAAAAA'] 22 30 L86 - [DECLARE] 1 8 - [@COLOR_UNDEFINED] 9 25 - [VARCHAR] 26 33 - [(] 33 34 - [10] 34 36 - [)] 36 37 + [DECLARE] 1 7 + [@COLOR_UNDEFINED] 9 24 + [VARCHAR] 26 32 + [(] 33 33 + [10] 34 35 + [)] 36 36 L87 - [SET] 1 4 - [@COLOR_UNDEFINED] 5 21 - [=] 22 23 - ['#111111'] 24 33 + [SET] 1 3 + [@COLOR_UNDEFINED] 5 20 + [=] 22 22 + ['#111111'] 24 32 L89 - [DECLARE] 1 8 - [@COLOR_RUNNING] 9 23 - [VARCHAR] 24 31 - [(] 31 32 - [10] 32 34 - [)] 34 35 + [DECLARE] 1 7 + [@COLOR_RUNNING] 9 22 + [VARCHAR] 24 30 + [(] 31 31 + [10] 32 33 + [)] 34 34 L90 - [SET] 1 4 - [@COLOR_RUNNING] 5 19 - [=] 20 21 - ['#7FDBFF'] 22 31 + [SET] 1 3 + [@COLOR_RUNNING] 5 18 + [=] 20 20 + ['#7FDBFF'] 22 30 L92 - [DECLARE] 1 8 - [@COLOR_SERVERSTART] 9 27 - [VARCHAR] 28 35 - [(] 35 36 - [10] 36 38 - [)] 38 39 + [DECLARE] 1 7 + [@COLOR_SERVERSTART] 9 26 + [VARCHAR] 28 34 + [(] 35 35 + [10] 36 37 + [)] 38 38 L93 - [SET] 1 4 - [@COLOR_SERVERSTART] 5 23 - [=] 24 25 - ['#FF851B'] 26 35 + [SET] 1 3 + [@COLOR_SERVERSTART] 5 22 + [=] 24 24 + ['#FF851B'] 26 34 L102 - [IF] 1 3 - [OBJECT_ID] 4 13 - [(] 13 14 - ['tempdb..#JobExecutionTimes'] 14 42 - [)] 42 43 - [IS] 44 46 - [NOT] 47 50 - [NULL] 51 55 + [IF] 1 2 + [OBJECT_ID] 4 12 + [(] 13 13 + ['tempdb..#JobExecutionTimes'] 14 41 + [)] 42 42 + [IS] 44 45 + [NOT] 47 49 + [NULL] 51 54 L103 - [DROP] 4 8 - [TABLE] 9 14 - [#JobExecutionTimes] 15 33 - [;] 33 34 + [DROP] 4 7 + [TABLE] 9 13 + [#JOBEXECUTIONTIMES] 15 32 + [;] 33 33 L105 - [IF] 1 3 - [OBJECT_ID] 4 13 - [(] 13 14 - ['tempdb..##TimelineGraph'] 14 39 - [)] 39 40 - [IS] 41 43 - [NOT] 44 47 - [NULL] 48 52 + [IF] 1 2 + [OBJECT_ID] 4 12 + [(] 13 13 + ['tempdb..##TimelineGraph'] 14 38 + [)] 39 39 + [IS] 41 42 + [NOT] 44 46 + [NULL] 48 51 L106 - [DROP] 4 8 - [TABLE] 9 14 - [##TimelineGraph] 15 30 - [;] 30 31 + [DROP] 4 7 + [TABLE] 9 13 + [##TIMELINEGRAPH] 15 29 + [;] 30 30 L115 - [CREATE] 1 7 - [TABLE] 8 13 - [##TimelineGraph] 14 29 + [CREATE] 1 6 + [TABLE] 8 12 + [##TIMELINEGRAPH] 14 28 L116 - [(] 4 5 - [ID] 5 7 - [INT] 8 11 - [IDENTITY] 12 20 - [(] 20 21 - [1] 21 22 - [,] 22 23 - [1] 24 25 - [)] 25 26 + [(] 4 4 + [ID] 5 6 + [INT] 8 10 + [IDENTITY] 12 19 + [(] 20 20 + [1] 21 21 + [,] 22 22 + [1] 24 24 + [)] 25 25 L117 - [NOT] 12 15 - [NULL] 16 20 + [NOT] 12 14 + [NULL] 16 19 L118 - [,] 4 5 - [HTML] 5 9 - [VARCHAR] 10 17 - [(] 17 18 - [8000] 18 22 - [)] 22 23 - [NULL] 24 28 + [,] 4 4 + [HTML] 5 8 + [VARCHAR] 10 16 + [(] 17 17 + [8000] 18 21 + [)] 22 22 + [NULL] 24 27 L119 - [)] 4 5 + [)] 4 4 L128 - [SELECT] 1 7 - [JOBDATA] 10 17 - [.] 17 18 - [*] 18 19 + [SELECT] 1 6 + [JOBDATA] 10 16 + [.] 17 17 + [*] 18 18 L129 - [INTO] 1 5 - [#JobExecutionTimes] 10 28 + [INTO] 1 4 + [#JOBEXECUTIONTIMES] 10 27 L130 - [FROM] 1 5 - [(] 10 11 + [FROM] 1 4 + [(] 10 10 L132 - [SELECT] 11 17 - [JOB] 19 22 - [.] 22 23 - [name] 23 27 - [AS] 28 30 - [JobName] 31 38 + [SELECT] 11 16 + [JOB] 19 21 + [.] 22 22 + [NAME] 23 26 + [AS] 28 29 + [JOBNAME] 31 37 L133 - [,] 18 19 - [CAT] 19 22 - [.] 22 23 - [name] 23 27 - [AS] 28 30 - [CatName] 31 38 + [,] 18 18 + [CAT] 19 21 + [.] 22 22 + [NAME] 23 26 + [AS] 28 29 + [CATNAME] 31 37 L134 - [,] 18 19 - [CONVERT] 19 26 - [(] 26 27 - [DATETIME] 27 35 - [,] 35 36 - [CONVERT] 37 44 - [(] 44 45 - [CHAR] 45 49 - [(] 49 50 - [8] 50 51 - [)] 51 52 - [,] 52 53 - [HIS] 54 57 - [.] 57 58 - [run_date] 58 66 - [,] 66 67 - [112] 68 71 - [)] 71 72 - [+] 73 74 - [' '] 75 78 + [,] 18 18 + [CONVERT] 19 25 + [(] 26 26 + [DATETIME] 27 34 + [,] 35 35 + [CONVERT] 37 43 + [(] 44 44 + [CHAR] 45 48 + [(] 49 49 + [8] 50 50 + [)] 51 51 + [,] 52 52 + [HIS] 54 56 + [.] 57 57 + [RUN_DATE] 58 65 + [,] 66 66 + [112] 68 70 + [)] 71 71 + [+] 73 73 + [' '] 75 77 L135 - [+] 19 20 - [STUFF] 21 26 - [(] 26 27 - [STUFF] 27 32 - [(] 32 33 - [RIGHT] 33 38 - [(] 38 39 - ['000000'] 39 47 + [+] 19 19 + [STUFF] 21 25 + [(] 26 26 + [STUFF] 27 31 + [(] 32 32 + [RIGHT] 33 37 + [(] 38 38 + ['000000'] 39 46 L136 - [+] 39 40 - [CONVERT] 41 48 - [(] 48 49 - [VARCHAR] 49 56 - [(] 56 57 - [8] 57 58 - [)] 58 59 - [,] 59 60 - [HIS] 61 64 - [.] 64 65 - [run_time] 65 73 - [)] 73 74 - [,] 74 75 - [6] 76 77 - [)] 77 78 - [,] 78 79 + [+] 39 39 + [CONVERT] 41 47 + [(] 48 48 + [VARCHAR] 49 55 + [(] 56 56 + [8] 57 57 + [)] 58 58 + [,] 59 59 + [HIS] 61 63 + [.] 64 64 + [RUN_TIME] 65 72 + [)] 73 73 + [,] 74 74 + [6] 76 76 + [)] 77 77 + [,] 78 78 L137 - [5] 33 34 - [,] 34 35 - [0] 36 37 - [,] 37 38 - [':'] 39 42 - [)] 42 43 - [,] 43 44 - [3] 45 46 - [,] 46 47 - [0] 48 49 - [,] 49 50 - [':'] 51 54 - [)] 54 55 - [,] 55 56 - [120] 57 60 - [)] 60 61 - [AS] 62 64 - [SDT] 65 68 + [5] 33 33 + [,] 34 34 + [0] 36 36 + [,] 37 37 + [':'] 39 41 + [)] 42 42 + [,] 43 43 + [3] 45 45 + [,] 46 46 + [0] 48 48 + [,] 49 49 + [':'] 51 53 + [)] 54 54 + [,] 55 55 + [120] 57 59 + [)] 60 60 + [AS] 62 63 + [SDT] 65 67 L138 - [,] 18 19 - [DATEADD] 19 26 - [(] 26 27 - [s] 27 28 - [,] 28 29 + [,] 18 18 + [DATEADD] 19 25 + [(] 26 26 + [S] 27 27 + [,] 28 28 L139 - [(] 27 28 - [(] 28 29 - [HIS] 29 32 - [.] 32 33 - [run_duration] 33 45 - [/] 46 47 - [10000] 48 53 - [)] 53 54 - [%] 55 56 - [100] 57 60 - [*] 61 62 - [3600] 63 67 - [)] 67 68 + [(] 27 27 + [(] 28 28 + [HIS] 29 31 + [.] 32 32 + [RUN_DURATION] 33 44 + [/] 46 46 + [10000] 48 52 + [)] 53 53 + [%] 55 55 + [100] 57 59 + [*] 61 61 + [3600] 63 66 + [)] 67 67 L140 - [+] 27 28 - [(] 29 30 - [(] 30 31 - [HIS] 31 34 - [.] 34 35 - [run_duration] 35 47 - [/] 48 49 - [100] 50 53 - [)] 53 54 - [%] 55 56 - [100] 57 60 - [*] 61 62 - [60] 63 65 - [)] 65 66 + [+] 27 27 + [(] 29 29 + [(] 30 30 + [HIS] 31 33 + [.] 34 34 + [RUN_DURATION] 35 46 + [/] 48 48 + [100] 50 52 + [)] 53 53 + [%] 55 55 + [100] 57 59 + [*] 61 61 + [60] 63 64 + [)] 65 65 L141 - [+] 27 28 - [HIS] 29 32 - [.] 32 33 - [run_duration] 33 45 - [%] 46 47 - [100] 48 51 - [,] 51 52 + [+] 27 27 + [HIS] 29 31 + [.] 32 32 + [RUN_DURATION] 33 44 + [%] 46 46 + [100] 48 50 + [,] 51 51 L142 - [CONVERT] 27 34 - [(] 34 35 - [DATETIME] 35 43 - [,] 43 44 - [CONVERT] 45 52 - [(] 52 53 - [CHAR] 53 57 - [(] 57 58 - [8] 58 59 - [)] 59 60 - [,] 60 61 - [HIS] 62 65 - [.] 65 66 - [run_date] 66 74 - [,] 74 75 - [112] 76 79 - [)] 79 80 + [CONVERT] 27 33 + [(] 34 34 + [DATETIME] 35 42 + [,] 43 43 + [CONVERT] 45 51 + [(] 52 52 + [CHAR] 53 56 + [(] 57 57 + [8] 58 58 + [)] 59 59 + [,] 60 60 + [HIS] 62 64 + [.] 65 65 + [RUN_DATE] 66 73 + [,] 74 74 + [112] 76 78 + [)] 79 79 L143 - [+] 27 28 - [' '] 29 32 - [+] 33 34 - [STUFF] 35 40 - [(] 40 41 - [STUFF] 41 46 - [(] 46 47 - [RIGHT] 47 52 - [(] 52 53 - ['000000'] 53 61 + [+] 27 27 + [' '] 29 31 + [+] 33 33 + [STUFF] 35 39 + [(] 40 40 + [STUFF] 41 45 + [(] 46 46 + [RIGHT] 47 51 + [(] 52 52 + ['000000'] 53 60 L144 - [+] 53 54 - [CONVERT] 55 62 - [(] 62 63 - [VARCHAR] 63 70 - [(] 70 71 - [8] 71 72 - [)] 72 73 - [,] 73 74 - [HIS] 75 78 - [.] 78 79 - [run_time] 79 87 - [)] 87 88 - [,] 88 89 + [+] 53 53 + [CONVERT] 55 61 + [(] 62 62 + [VARCHAR] 63 69 + [(] 70 70 + [8] 71 71 + [)] 72 72 + [,] 73 73 + [HIS] 75 77 + [.] 78 78 + [RUN_TIME] 79 86 + [)] 87 87 + [,] 88 88 L145 - [6] 53 54 - [)] 54 55 - [,] 55 56 - [5] 57 58 - [,] 58 59 - [0] 60 61 - [,] 61 62 - [':'] 63 66 - [)] 66 67 - [,] 67 68 - [3] 69 70 - [,] 70 71 - [0] 72 73 - [,] 73 74 - [':'] 75 78 - [)] 78 79 - [,] 79 80 - [120] 81 84 - [)] 84 85 - [)] 85 86 - [AS] 87 89 - [EDT] 90 93 + [6] 53 53 + [)] 54 54 + [,] 55 55 + [5] 57 57 + [,] 58 58 + [0] 60 60 + [,] 61 61 + [':'] 63 65 + [)] 66 66 + [,] 67 67 + [3] 69 69 + [,] 70 70 + [0] 72 72 + [,] 73 73 + [':'] 75 77 + [)] 78 78 + [,] 79 79 + [120] 81 83 + [)] 84 84 + [)] 85 85 + [AS] 87 88 + [EDT] 90 92 L146 - [,] 18 19 - [JOB] 19 22 - [.] 22 23 - [description] 23 34 + [,] 18 18 + [JOB] 19 21 + [.] 22 22 + [DESCRIPTION] 23 33 L147 - [,] 18 19 - [HIS] 19 22 - [.] 22 23 - [run_status] 23 33 + [,] 18 18 + [HIS] 19 21 + [.] 22 22 + [RUN_STATUS] 23 32 L148 - [,] 18 19 - [CASE] 19 23 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [0] 46 47 - [THEN] 48 52 - [@COLOR_ERROR] 53 65 + [,] 18 18 + [CASE] 19 22 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [0] 46 46 + [THEN] 48 51 + [@COLOR_ERROR] 53 64 L149 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [1] 46 47 - [THEN] 48 52 - [@COLOR_SUCCESS] 53 67 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [1] 46 46 + [THEN] 48 51 + [@COLOR_SUCCESS] 53 66 L150 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [2] 46 47 - [THEN] 48 52 - [@COLOR_RETRY] 53 65 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [2] 46 46 + [THEN] 48 51 + [@COLOR_RETRY] 53 64 L151 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [3] 46 47 - [THEN] 48 52 - [@COLOR_ABORTED] 53 67 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [3] 46 46 + [THEN] 48 51 + [@COLOR_ABORTED] 53 66 L152 - [ELSE] 24 28 - [@COLOR_UNDEFINED] 29 45 + [ELSE] 24 27 + [@COLOR_UNDEFINED] 29 44 L153 - [END] 19 22 - [AS] 23 25 - [JobStatus] 26 35 + [END] 19 21 + [AS] 23 24 + [JOBSTATUS] 26 34 L154 - [,] 18 19 - [CASE] 19 23 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [0] 46 47 - [THEN] 48 52 - [HIS] 53 56 - [.] 56 57 - [message] 57 64 + [,] 18 18 + [CASE] 19 22 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [0] 46 46 + [THEN] 48 51 + [HIS] 53 55 + [.] 56 56 + [MESSAGE] 57 63 L155 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [1] 46 47 - [THEN] 48 52 - [@TEXT_SUCCESS] 53 66 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [1] 46 46 + [THEN] 48 51 + [@TEXT_SUCCESS] 53 65 L156 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [2] 46 47 - [THEN] 48 52 - [HIS] 53 56 - [.] 56 57 - [message] 57 64 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [2] 46 46 + [THEN] 48 51 + [HIS] 53 55 + [.] 56 56 + [MESSAGE] 57 63 L157 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [3] 46 47 - [THEN] 48 52 - [HIS] 53 56 - [.] 56 57 - [message] 57 64 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [3] 46 46 + [THEN] 48 51 + [HIS] 53 55 + [.] 56 56 + [MESSAGE] 57 63 L158 - [ELSE] 24 28 - [HIS] 29 32 - [.] 32 33 - [message] 33 40 + [ELSE] 24 27 + [HIS] 29 31 + [.] 32 32 + [MESSAGE] 33 39 L159 - [END] 19 22 - [AS] 23 25 - [JobMessage] 26 36 + [END] 19 21 + [AS] 23 24 + [JOBMESSAGE] 26 35 L161 - [FROM] 11 15 - [msdb] 19 23 - [.] 23 24 - [dbo] 24 27 - [.] 27 28 - [sysjobs] 28 35 - [AS] 36 38 - [JOB] 39 42 + [FROM] 11 14 + [MSDB] 19 22 + [.] 23 23 + [DBO] 24 26 + [.] 27 27 + [SYSJOBS] 28 34 + [AS] 36 37 + [JOB] 39 41 L162 - [LEFT] 11 15 - [JOIN] 16 20 - [msdb] 21 25 - [.] 25 26 - [dbo] 26 29 - [.] 29 30 - [sysjobhistory] 30 43 - [AS] 44 46 - [HIS] 47 50 - [ON] 51 53 - [HIS] 54 57 - [.] 57 58 - [job_id] 58 64 - [=] 65 66 - [job] 67 70 - [.] 70 71 - [job_id] 71 77 + [LEFT] 11 14 + [JOIN] 16 19 + [MSDB] 21 24 + [.] 25 25 + [DBO] 26 28 + [.] 29 29 + [SYSJOBHISTORY] 30 42 + [AS] 44 45 + [HIS] 47 49 + [ON] 51 52 + [HIS] 54 56 + [.] 57 57 + [JOB_ID] 58 63 + [=] 65 65 + [JOB] 67 69 + [.] 70 70 + [JOB_ID] 71 76 L163 - [INNER] 11 16 - [JOIN] 17 21 - [msdb] 22 26 - [.] 26 27 - [dbo] 27 30 - [.] 30 31 - [syscategories] 31 44 - [AS] 45 47 - [CAT] 48 51 - [ON] 52 54 - [CAT] 55 58 - [.] 58 59 - [category_id] 59 70 - [=] 71 72 - [JOB] 73 76 - [.] 76 77 - [category_id] 77 88 + [INNER] 11 15 + [JOIN] 17 20 + [MSDB] 22 25 + [.] 26 26 + [DBO] 27 29 + [.] 30 30 + [SYSCATEGORIES] 31 43 + [AS] 45 46 + [CAT] 48 50 + [ON] 52 53 + [CAT] 55 57 + [.] 58 58 + [CATEGORY_ID] 59 69 + [=] 71 71 + [JOB] 73 75 + [.] 76 76 + [CATEGORY_ID] 77 87 L164 - [WHERE] 11 16 - [CONVERT] 19 26 - [(] 26 27 - [DATETIME] 27 35 - [,] 35 36 - [CONVERT] 37 44 - [(] 44 45 - [CHAR] 45 49 - [(] 49 50 - [8] 50 51 - [)] 51 52 - [,] 52 53 - [HIS] 54 57 - [.] 57 58 - [run_date] 58 66 - [,] 66 67 - [112] 68 71 - [)] 71 72 - [+] 73 74 - [' '] 75 78 + [WHERE] 11 15 + [CONVERT] 19 25 + [(] 26 26 + [DATETIME] 27 34 + [,] 35 35 + [CONVERT] 37 43 + [(] 44 44 + [CHAR] 45 48 + [(] 49 49 + [8] 50 50 + [)] 51 51 + [,] 52 52 + [HIS] 54 56 + [.] 57 57 + [RUN_DATE] 58 65 + [,] 66 66 + [112] 68 70 + [)] 71 71 + [+] 73 73 + [' '] 75 77 L165 - [+] 19 20 - [STUFF] 21 26 - [(] 26 27 - [STUFF] 27 32 - [(] 32 33 - [RIGHT] 33 38 - [(] 38 39 - ['000000'] 39 47 + [+] 19 19 + [STUFF] 21 25 + [(] 26 26 + [STUFF] 27 31 + [(] 32 32 + [RIGHT] 33 37 + [(] 38 38 + ['000000'] 39 46 L166 - [+] 39 40 - [CONVERT] 41 48 - [(] 48 49 - [VARCHAR] 49 56 - [(] 56 57 - [8] 57 58 - [)] 58 59 - [,] 59 60 - [HIS] 61 64 - [.] 64 65 - [run_time] 65 73 - [)] 73 74 - [,] 74 75 - [6] 76 77 - [)] 77 78 - [,] 78 79 + [+] 39 39 + [CONVERT] 41 47 + [(] 48 48 + [VARCHAR] 49 55 + [(] 56 56 + [8] 57 57 + [)] 58 58 + [,] 59 59 + [HIS] 61 63 + [.] 64 64 + [RUN_TIME] 65 72 + [)] 73 73 + [,] 74 74 + [6] 76 76 + [)] 77 77 + [,] 78 78 L167 - [5] 33 34 - [,] 34 35 - [0] 36 37 - [,] 37 38 - [':'] 39 42 - [)] 42 43 - [,] 43 44 - [3] 45 46 - [,] 46 47 - [0] 48 49 - [,] 49 50 - [':'] 51 54 - [)] 54 55 - [,] 55 56 - [120] 57 60 - [)] 60 61 - [BETWEEN] 62 69 - [@StartDate] 70 80 + [5] 33 33 + [,] 34 34 + [0] 36 36 + [,] 37 37 + [':'] 39 41 + [)] 42 42 + [,] 43 43 + [3] 45 45 + [,] 46 46 + [0] 48 48 + [,] 49 49 + [':'] 51 53 + [)] 54 54 + [,] 55 55 + [120] 57 59 + [)] 60 60 + [BETWEEN] 62 68 + [@STARTDATE] 70 79 L168 - [AND] 62 65 + [AND] 62 64 L169 - [@EndDate] 63 71 + [@ENDDATE] 63 70 L170 - [AND] 19 22 - [HIS] 23 26 - [.] 26 27 - [step_id] 27 34 - [=] 35 36 - [0] 37 38 + [AND] 19 21 + [HIS] 23 25 + [.] 26 26 + [STEP_ID] 27 33 + [=] 35 35 + [0] 37 37 L171 - [AND] 19 22 - [(] 23 24 - [(] 24 25 - [HIS] 25 28 - [.] 28 29 - [run_duration] 29 41 - [/] 42 43 - [10000] 44 49 - [)] 49 50 - [%] 51 52 - [100] 53 56 - [*] 57 58 - [3600] 59 63 - [)] 63 64 + [AND] 19 21 + [(] 23 23 + [(] 24 24 + [HIS] 25 27 + [.] 28 28 + [RUN_DURATION] 29 40 + [/] 42 42 + [10000] 44 48 + [)] 49 49 + [%] 51 51 + [100] 53 55 + [*] 57 57 + [3600] 59 62 + [)] 63 63 L172 - [+] 19 20 - [(] 21 22 - [(] 22 23 - [HIS] 23 26 - [.] 26 27 - [run_duration] 27 39 - [/] 40 41 - [100] 42 45 - [)] 45 46 - [%] 47 48 - [100] 49 52 - [*] 53 54 - [60] 55 57 - [)] 57 58 - [+] 59 60 - [HIS] 61 64 - [.] 64 65 - [run_duration] 65 77 + [+] 19 19 + [(] 21 21 + [(] 22 22 + [HIS] 23 25 + [.] 26 26 + [RUN_DURATION] 27 38 + [/] 40 40 + [100] 42 44 + [)] 45 45 + [%] 47 47 + [100] 49 51 + [*] 53 53 + [60] 55 56 + [)] 57 57 + [+] 59 59 + [HIS] 61 63 + [.] 64 64 + [RUN_DURATION] 65 76 L173 - [%] 19 20 - [100] 21 24 - [>] 25 26 - [=] 26 27 - [@MinimalJobDurationInSeconds] 28 56 + [%] 19 19 + [100] 21 23 + [>] 25 25 + [=] 26 26 + [@MINIMALJOBDURATIONINSECONDS] 28 55 L175 - [UNION] 11 16 - [ALL] 17 20 + [UNION] 11 15 + [ALL] 17 19 L178 - [SELECT] 11 17 - [JOB] 19 22 - [.] 22 23 - [name] 23 27 - [AS] 28 30 - [JobName] 31 38 + [SELECT] 11 16 + [JOB] 19 21 + [.] 22 22 + [NAME] 23 26 + [AS] 28 29 + [JOBNAME] 31 37 L179 - [,] 18 19 - [CAT] 19 22 - [.] 22 23 - [name] 23 27 - [AS] 28 30 - [CatName] 31 38 + [,] 18 18 + [CAT] 19 21 + [.] 22 22 + [NAME] 23 26 + [AS] 28 29 + [CATNAME] 31 37 L180 - [,] 18 19 - [JA] 19 21 - [.] 21 22 - [start_execution_date] 22 42 - [AS] 43 45 - [SDT] 46 49 + [,] 18 18 + [JA] 19 20 + [.] 21 21 + [START_EXECUTION_DATE] 22 41 + [AS] 43 44 + [SDT] 46 48 L181 - [,] 18 19 - [GETDATE] 19 26 - [(] 26 27 - [)] 27 28 - [AS] 29 31 - [EDT] 32 35 + [,] 18 18 + [GETDATE] 19 25 + [(] 26 26 + [)] 27 27 + [AS] 29 30 + [EDT] 32 34 L182 - [,] 18 19 - [JOB] 19 22 - [.] 22 23 - [description] 23 34 + [,] 18 18 + [JOB] 19 21 + [.] 22 22 + [DESCRIPTION] 23 33 L183 - [,] 18 19 - [HIS] 19 22 - [.] 22 23 - [run_status] 23 33 + [,] 18 18 + [HIS] 19 21 + [.] 22 22 + [RUN_STATUS] 23 32 L184 - [,] 18 19 - [CASE] 19 23 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [0] 46 47 - [THEN] 48 52 - [@COLOR_ERROR] 53 65 + [,] 18 18 + [CASE] 19 22 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [0] 46 46 + [THEN] 48 51 + [@COLOR_ERROR] 53 64 L185 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [1] 46 47 - [THEN] 48 52 - [@COLOR_SUCCESS] 53 67 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [1] 46 46 + [THEN] 48 51 + [@COLOR_SUCCESS] 53 66 L186 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [2] 46 47 - [THEN] 48 52 - [@COLOR_RETRY] 53 65 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [2] 46 46 + [THEN] 48 51 + [@COLOR_RETRY] 53 64 L187 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [3] 46 47 - [THEN] 48 52 - [@COLOR_ABORTED] 53 67 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [3] 46 46 + [THEN] 48 51 + [@COLOR_ABORTED] 53 66 L188 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [IS] 44 46 - [NULL] 47 51 - [THEN] 52 56 - [@COLOR_RUNNING] 57 71 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [IS] 44 45 + [NULL] 47 50 + [THEN] 52 55 + [@COLOR_RUNNING] 57 70 L189 - [ELSE] 24 28 - [@COLOR_UNDEFINED] 29 45 + [ELSE] 24 27 + [@COLOR_UNDEFINED] 29 44 L190 - [END] 19 22 - [AS] 23 25 - [JobStatus] 26 35 + [END] 19 21 + [AS] 23 24 + [JOBSTATUS] 26 34 L191 - [,] 18 19 - [CASE] 19 23 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [0] 46 47 - [THEN] 48 52 - [HIS] 53 56 - [.] 56 57 - [message] 57 64 + [,] 18 18 + [CASE] 19 22 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [0] 46 46 + [THEN] 48 51 + [HIS] 53 55 + [.] 56 56 + [MESSAGE] 57 63 L192 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [1] 46 47 - [THEN] 48 52 - [@TEXT_SUCCESS] 53 66 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [1] 46 46 + [THEN] 48 51 + [@TEXT_SUCCESS] 53 65 L193 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [2] 46 47 - [THEN] 48 52 - [HIS] 53 56 - [.] 56 57 - [message] 57 64 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [2] 46 46 + [THEN] 48 51 + [HIS] 53 55 + [.] 56 56 + [MESSAGE] 57 63 L194 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [=] 44 45 - [3] 46 47 - [THEN] 48 52 - [HIS] 53 56 - [.] 56 57 - [message] 57 64 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [=] 44 44 + [3] 46 46 + [THEN] 48 51 + [HIS] 53 55 + [.] 56 56 + [MESSAGE] 57 63 L195 - [WHEN] 24 28 - [HIS] 29 32 - [.] 32 33 - [run_status] 33 43 - [IS] 44 46 - [NULL] 47 51 - [THEN] 52 56 - ['Running currently'] 57 76 + [WHEN] 24 27 + [HIS] 29 31 + [.] 32 32 + [RUN_STATUS] 33 42 + [IS] 44 45 + [NULL] 47 50 + [THEN] 52 55 + ['Running currently'] 57 75 L196 - [ELSE] 24 28 - [HIS] 29 32 - [.] 32 33 - [message] 33 40 + [ELSE] 24 27 + [HIS] 29 31 + [.] 32 32 + [MESSAGE] 33 39 L197 - [END] 19 22 - [AS] 23 25 - [JobMessage] 26 36 + [END] 19 21 + [AS] 23 24 + [JOBMESSAGE] 26 35 L199 - [FROM] 11 15 - [msdb] 19 23 - [.] 23 24 - [dbo] 24 27 - [.] 27 28 - [sysjobactivity] 28 42 - [AS] 43 45 - [JA] 46 48 + [FROM] 11 14 + [MSDB] 19 22 + [.] 23 23 + [DBO] 24 26 + [.] 27 27 + [SYSJOBACTIVITY] 28 41 + [AS] 43 44 + [JA] 46 47 L200 - [LEFT] 11 15 - [JOIN] 16 20 - [msdb] 21 25 - [.] 25 26 - [dbo] 26 29 - [.] 29 30 - [sysjobhistory] 30 43 - [AS] 44 46 - [HIS] 47 50 - [ON] 51 53 - [HIS] 54 57 - [.] 57 58 - [instance_id] 58 69 - [=] 70 71 - [JA] 72 74 - [.] 74 75 - [job_history_id] 75 89 + [LEFT] 11 14 + [JOIN] 16 19 + [MSDB] 21 24 + [.] 25 25 + [DBO] 26 28 + [.] 29 29 + [SYSJOBHISTORY] 30 42 + [AS] 44 45 + [HIS] 47 49 + [ON] 51 52 + [HIS] 54 56 + [.] 57 57 + [INSTANCE_ID] 58 68 + [=] 70 70 + [JA] 72 73 + [.] 74 74 + [JOB_HISTORY_ID] 75 88 L201 - [JOIN] 11 15 - [msdb] 19 23 - [.] 23 24 - [dbo] 24 27 - [.] 27 28 - [sysjobs] 28 35 - [AS] 36 38 - [JOB] 39 42 - [ON] 43 45 - [JOB] 46 49 - [.] 49 50 - [job_id] 50 56 - [=] 57 58 - [JA] 59 61 - [.] 61 62 - [job_id] 62 68 + [JOIN] 11 14 + [MSDB] 19 22 + [.] 23 23 + [DBO] 24 26 + [.] 27 27 + [SYSJOBS] 28 34 + [AS] 36 37 + [JOB] 39 41 + [ON] 43 44 + [JOB] 46 48 + [.] 49 49 + [JOB_ID] 50 55 + [=] 57 57 + [JA] 59 60 + [.] 61 61 + [JOB_ID] 62 67 L202 - [JOIN] 11 15 - [msdb] 19 23 - [.] 23 24 - [dbo] 24 27 - [.] 27 28 - [sysjobsteps] 28 39 - [AS] 40 42 - [JS] 43 45 - [ON] 46 48 - [JS] 49 51 - [.] 51 52 - [job_id] 52 58 - [=] 59 60 - [JA] 61 63 - [.] 63 64 - [job_id] 64 70 + [JOIN] 11 14 + [MSDB] 19 22 + [.] 23 23 + [DBO] 24 26 + [.] 27 27 + [SYSJOBSTEPS] 28 38 + [AS] 40 41 + [JS] 43 44 + [ON] 46 47 + [JS] 49 50 + [.] 51 51 + [JOB_ID] 52 57 + [=] 59 59 + [JA] 61 62 + [.] 63 63 + [JOB_ID] 64 69 L203 - [AND] 46 49 - [ISNULL] 50 56 - [(] 56 57 - [JA] 57 59 - [.] 59 60 - [last_executed_step_id] 60 81 - [,] 81 82 + [AND] 46 48 + [ISNULL] 50 55 + [(] 56 56 + [JA] 57 58 + [.] 59 59 + [LAST_EXECUTED_STEP_ID] 60 80 + [,] 81 81 L204 - [0] 57 58 - [)] 58 59 - [+] 60 61 - [1] 62 63 - [=] 64 65 - [JS] 66 68 - [.] 68 69 - [step_id] 69 76 + [0] 57 57 + [)] 58 58 + [+] 60 60 + [1] 62 62 + [=] 64 64 + [JS] 66 67 + [.] 68 68 + [STEP_ID] 69 75 L205 - [LEFT] 11 15 - [JOIN] 16 20 - [msdb] 21 25 - [.] 25 26 - [dbo] 26 29 - [.] 29 30 - [syscategories] 30 43 - [AS] 44 46 - [CAT] 47 50 - [ON] 51 53 - [CAT] 54 57 - [.] 57 58 - [category_id] 58 69 - [=] 70 71 - [JOB] 72 75 - [.] 75 76 - [category_id] 76 87 + [LEFT] 11 14 + [JOIN] 16 19 + [MSDB] 21 24 + [.] 25 25 + [DBO] 26 28 + [.] 29 29 + [SYSCATEGORIES] 30 42 + [AS] 44 45 + [CAT] 47 49 + [ON] 51 52 + [CAT] 54 56 + [.] 57 57 + [CATEGORY_ID] 58 68 + [=] 70 70 + [JOB] 72 74 + [.] 75 75 + [CATEGORY_ID] 76 86 L206 - [WHERE] 11 16 - [JA] 19 21 - [.] 21 22 - [session_id] 22 32 - [=] 33 34 - [(] 35 36 - [SELECT] 36 42 - [TOP] 43 46 - [1] 47 48 + [WHERE] 11 15 + [JA] 19 20 + [.] 21 21 + [SESSION_ID] 22 31 + [=] 33 33 + [(] 35 35 + [SELECT] 36 41 + [TOP] 43 45 + [1] 47 47 L207 - [session_id] 43 53 + [SESSION_ID] 43 52 L208 - [FROM] 36 40 - [msdb] 43 47 - [.] 47 48 - [dbo] 48 51 - [.] 51 52 - [syssessions] 52 63 + [FROM] 36 39 + [MSDB] 43 46 + [.] 47 47 + [DBO] 48 50 + [.] 51 51 + [SYSSESSIONS] 52 62 L209 - [ORDER] 36 41 - [BY] 42 44 - [agent_start_date] 45 61 - [DESC] 62 66 + [ORDER] 36 40 + [BY] 42 43 + [AGENT_START_DATE] 45 60 + [DESC] 62 65 L210 - [)] 35 36 + [)] 35 35 L211 - [AND] 19 22 - [JA] 23 25 - [.] 25 26 - [start_execution_date] 26 46 - [IS] 47 49 - [NOT] 50 53 - [NULL] 54 58 + [AND] 19 21 + [JA] 23 24 + [.] 25 25 + [START_EXECUTION_DATE] 26 45 + [IS] 47 48 + [NOT] 50 52 + [NULL] 54 57 L212 - [AND] 19 22 - [JA] 23 25 - [.] 25 26 - [stop_execution_date] 26 45 - [IS] 46 48 - [NULL] 49 53 + [AND] 19 21 + [JA] 23 24 + [.] 25 25 + [STOP_EXECUTION_DATE] 26 44 + [IS] 46 47 + [NULL] 49 52 L213 - [)] 10 11 - [AS] 12 14 - [JOBDATA] 15 22 + [)] 10 10 + [AS] 12 13 + [JOBDATA] 15 21 L215 - [ORDER] 1 6 - [BY] 7 9 - [JOBDATA] 10 17 - [.] 17 18 - [JobName] 18 25 + [ORDER] 1 5 + [BY] 7 8 + [JOBDATA] 10 16 + [.] 17 17 + [JOBNAME] 18 24 L217 - [IF] 1 3 - [NOT] 4 7 - [EXISTS] 8 14 - [(] 15 16 - [SELECT] 17 23 - [1] 25 26 + [IF] 1 2 + [NOT] 4 6 + [EXISTS] 8 13 + [(] 15 15 + [SELECT] 17 22 + [1] 25 25 L218 - [FROM] 17 21 - [#JobExecutionTimes] 25 43 - [)] 44 45 + [FROM] 17 20 + [#JOBEXECUTIONTIMES] 25 42 + [)] 44 44 L219 - [GOTO] 4 8 - [NothingToDo] 9 20 + [GOTO] 4 7 + [NOTHINGTODO] 9 19 L228 - [DECLARE] 1 8 - [@ERROR_COUNT] 9 21 - [AS] 22 24 - [INTEGER] 25 32 + [DECLARE] 1 7 + [@ERROR_COUNT] 9 20 + [AS] 22 23 + [INTEGER] 25 31 L229 - [DECLARE] 1 8 - [@ERROR_TEXT] 9 20 - [AS] 21 23 - [VARCHAR] 24 31 - [(] 31 32 - [50] 32 34 - [)] 34 35 + [DECLARE] 1 7 + [@ERROR_TEXT] 9 19 + [AS] 21 22 + [VARCHAR] 24 30 + [(] 31 31 + [50] 32 33 + [)] 34 34 L230 - [SET] 1 4 - [@ERROR_COUNT] 5 17 - [=] 18 19 - [(] 20 21 - [SELECT] 21 27 - [COUNT] 28 33 - [(] 33 34 - [*] 34 35 - [)] 35 36 - [FROM] 37 41 - [#JobExecutionTimes] 42 60 - [WHERE] 61 66 - [run_status] 67 77 - [=] 77 78 - [0] 78 79 - [)] 79 80 + [SET] 1 3 + [@ERROR_COUNT] 5 16 + [=] 18 18 + [(] 20 20 + [SELECT] 21 26 + [COUNT] 28 32 + [(] 33 33 + [*] 34 34 + [)] 35 35 + [FROM] 37 40 + [#JOBEXECUTIONTIMES] 42 59 + [WHERE] 61 65 + [RUN_STATUS] 67 76 + [=] 77 77 + [0] 78 78 + [)] 79 79 L231 - [IF] 1 3 - [@ERROR_COUNT] 4 16 - [>] 17 18 - [0] 19 20 + [IF] 1 2 + [@ERROR_COUNT] 4 15 + [>] 17 17 + [0] 19 19 L232 - [SET] 4 7 - [@ERROR_TEXT] 8 19 - [=] 20 21 - ['There are '] 22 34 - [+] 35 36 - [CONVERT] 37 44 - [(] 44 45 - [varchar] 45 52 - [(] 52 53 - [4] 53 54 - [)] 54 55 - [,] 55 56 - [@ERROR_COUNT] 57 69 - [)] 69 70 - [+] 71 72 - [' faulty jobs.'] 72 87 + [SET] 4 6 + [@ERROR_TEXT] 8 18 + [=] 20 20 + ['There are '] 22 33 + [+] 35 35 + [CONVERT] 37 43 + [(] 44 44 + [VARCHAR] 45 51 + [(] 52 52 + [4] 53 53 + [)] 54 54 + [,] 55 55 + [@ERROR_COUNT] 57 68 + [)] 69 69 + [+] 71 71 + [' faulty jobs.'] 72 86 L233 - [ELSE] 1 5 + [ELSE] 1 4 L234 - [SET] 4 7 - [@ERROR_TEXT] 8 19 - [=] 20 21 - [''] 22 24 + [SET] 4 6 + [@ERROR_TEXT] 8 18 + [=] 20 20 + [''] 22 23 L243 - [INSERT] 1 7 - [INTO] 10 14 - [##TimelineGraph] 15 30 + [INSERT] 1 6 + [INTO] 10 13 + [##TIMELINEGRAPH] 15 29 L244 - [(] 10 11 - [HTML] 11 15 + [(] 10 10 + [HTML] 11 14 L245 - [)] 10 11 + [)] 10 10 L246 - [SELECT] 1 7 - ['\n \n [ 10 2 + [SELECT] 1 6 + ['\n \n [ 10 89 L263 - [INSERT] 1 7 - [INTO] 10 14 - [##TimelineGraph] 15 30 + [INSERT] 1 6 + [INTO] 10 13 + [##TIMELINEGRAPH] 15 29 L264 - [(] 10 11 - [HTML] 11 15 + [(] 10 10 + [HTML] 11 14 L265 - [)] 10 11 + [)] 10 10 L266 - [SELECT] 1 7 - ['\n #legend[ 10 49 + [SELECT] 1 6 + ['\n #legend[ 10 48 L291 - [+] 49 50 - [@COLOR_SUCCESS] 51 65 - [+] 66 67 - [';\n }\n\n [ 68 49 + [+] 49 49 + [@COLOR_SUCCESS] 51 64 + [+] 66 66 + [';\n }\n\n [ 68 48 L295 - [+] 49 50 - [@COLOR_RUNNING] 51 65 - [+] 66 67 - [';\n }\n\n [ 68 49 + [+] 49 49 + [@COLOR_RUNNING] 51 64 + [+] 66 66 + [';\n }\n\n [ 68 48 L299 - [+] 49 50 - [@COLOR_ERROR] 51 63 - [+] 64 65 - [';\n }\n\n [ 66 49 + [+] 49 49 + [@COLOR_ERROR] 51 62 + [+] 64 64 + [';\n }\n\n [ 66 48 L303 - [+] 49 50 - [@COLOR_RETRY] 51 63 - [+] 64 65 - [';\n }\n\n [ 66 49 + [+] 49 49 + [@COLOR_RETRY] 51 62 + [+] 64 64 + [';\n }\n\n [ 66 48 L307 - [+] 49 50 - [@COLOR_ABORTED] 51 65 - [+] 66 67 - [';\n }\n\n [ 68 49 + [+] 49 49 + [@COLOR_ABORTED] 51 64 + [+] 66 66 + [';\n }\n\n [ 68 48 L311 - [+] 49 50 - [@COLOR_SERVERSTART] 51 69 - [+] 70 71 - [';\n }\n\n [ 72 49 + [+] 49 49 + [@COLOR_SERVERSTART] 51 68 + [+] 70 70 + [';\n }\n\n [ 72 48 L315 - [+] 49 50 - [@COLOR_UNDEFINED] 51 67 - [+] 68 69 + [+] 49 49 + [@COLOR_UNDEFINED] 51 66 + [+] 68 68 [';\n }\n\n'] 70 2 L321 - [INSERT] 1 7 - [INTO] 10 14 - [##TimelineGraph] 15 30 + [INSERT] 1 6 + [INTO] 10 13 + [##TIMELINEGRAPH] 15 29 L322 - [(] 10 11 - [HTML] 11 15 - [)] 15 16 + [(] 10 10 + [HTML] 11 14 + [)] 15 15 L323 - [SELECT] 1 7 - [''] 10 20 + [SELECT] 1 6 + [''] 10 19 L326 - [INSERT] 1 7 - [INTO] 10 14 - [##TimelineGraph] 15 30 + [INSERT] 1 6 + [INTO] 10 13 + [##TIMELINEGRAPH] 15 29 L327 - [(] 10 11 - [HTML] 11 15 + [(] 10 10 + [HTML] 11 14 L328 - [)] 10 11 + [)] 10 10 L329 - [SELECT] 1 7 - [' - - diff --git a/pmd-compat6/src/it/pmd-for-java/exception_ruleset.xml b/pmd-compat6/src/it/pmd-for-java/exception_ruleset.xml deleted file mode 100644 index bd7427e5a8..0000000000 --- a/pmd-compat6/src/it/pmd-for-java/exception_ruleset.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Use this rule to produce a processing error. - 3 - - - - - - - diff --git a/pmd-compat6/src/it/pmd-for-java/invoker.properties b/pmd-compat6/src/it/pmd-for-java/invoker.properties deleted file mode 100644 index d03166a079..0000000000 --- a/pmd-compat6/src/it/pmd-for-java/invoker.properties +++ /dev/null @@ -1,4 +0,0 @@ -invoker.goals.1 = verify -e -invoker.goals.2 = pmd:check -Dformat=csv -invoker.goals.3 = pmd:check -Dformat=txt -invoker.buildResult = failure diff --git a/pmd-compat6/src/it/pmd-for-java/pom.xml b/pmd-compat6/src/it/pmd-for-java/pom.xml deleted file mode 100644 index 13f0485c6f..0000000000 --- a/pmd-compat6/src/it/pmd-for-java/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - 4.0.0 - - net.sourceforge.pmd.pmd-compat6.it - pmd-for-java - 1.0-SNAPSHOT - - - 11 - 11 - UTF-8 - - - - - - org.apache.maven.plugins - maven-pmd-plugin - @maven-pmd-plugin.version.for.integrationtest@ - - - java-check - - check - - - - - true - true - 5 - true - - /rulesets/java/maven-pmd-plugin-default.xml - ${project.basedir}/exception_ruleset.xml - ${project.basedir}/config_error_ruleset.xml - - - - - net.sourceforge.pmd - pmd-compat6 - @project.version@ - - - net.sourceforge.pmd - pmd-core - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-java - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-javascript - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-jsp - @pmd.version.for.integrationtest@ - - - - - - diff --git a/pmd-compat6/src/it/pmd-for-java/src/main/java/org/example/Main.java b/pmd-compat6/src/it/pmd-for-java/src/main/java/org/example/Main.java deleted file mode 100644 index 8b4ddb6e37..0000000000 --- a/pmd-compat6/src/it/pmd-for-java/src/main/java/org/example/Main.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.example; - -public class Main { - public static void main(String[] args) { - String thisIsAUnusedLocalVar = "a"; - System.out.println("Hello world!"); - - String thisIsASuppressedUnusedLocalVar = "b"; // NOPMD suppressed - } -} diff --git a/pmd-compat6/src/it/pmd-for-java/verify.bsh b/pmd-compat6/src/it/pmd-for-java/verify.bsh deleted file mode 100644 index 5e813cab8b..0000000000 --- a/pmd-compat6/src/it/pmd-for-java/verify.bsh +++ /dev/null @@ -1,59 +0,0 @@ -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; - -String readFile(File file) throws IOException { - StringBuilder content = new StringBuilder(); - for (String line : Files.readAllLines(file.toPath(), StandardCharsets.UTF_8)) { - content.append(line).append(System.lineSeparator()); - } - return content.toString(); -} - -File buildLogPath = new File(basedir, "build.log"); -String buildLog = readFile(buildLogPath); -if (buildLog.contains("An API incompatibility was encountered while")) { - throw new RuntimeException("Executing failed due to API incompatibility"); -} -if (!buildLog.contains("[INFO] PMD Failure: org.example.Main:5 Rule:UnusedLocalVariable")) { - throw new RuntimeException("No pmd violation detected, did PMD run?"); -} - -File pmdXmlReport = new File(basedir, "target/pmd.xml"); -if(!pmdXmlReport.exists()) { - throw new FileNotFoundException("Could not find pmd xml report: " + pmdXmlReport); -} -String pmdXml = readFile(pmdXmlReport); -if (!pmdXml.contains("")) { - throw new RuntimeException("Expected violation has not been reported"); -} -if (!pmdXml.contains("")) { - throw new RuntimeException("Configuration error has not been reported"); -} - -File pmdCsvReport = new File(basedir, "target/pmd.csv"); -if (!pmdCsvReport.exists()) { - throw new FileNotFoundException("Could not find pmd CSV report: " + pmdCsvReport); -} -String csvReport = readFile(pmdCsvReport); -if (!csvReport.contains(mainFile + "\",\"3\",\"5\",\"Avoid unused local")) { - throw new RuntimeException("Expected violation has not been reported in CSV"); -} - -File pmdTextReport = new File(basedir, "target/pmd.txt"); -if (!pmdTextReport.exists()) { - throw new FileNotFoundException("Could not find pmd TXT report: " + pmdTextReport); -} -String textReport = readFile(pmdTextReport); -if (!textReport.contains(mainFile + ":5:\tUnusedLocalVariable")) { - throw new RuntimeException("Expected violation has not been reported in TXT"); -} diff --git a/pmd-compat6/src/it/pmd-for-javascript/invoker.properties b/pmd-compat6/src/it/pmd-for-javascript/invoker.properties deleted file mode 100644 index 0d92d959f3..0000000000 --- a/pmd-compat6/src/it/pmd-for-javascript/invoker.properties +++ /dev/null @@ -1,2 +0,0 @@ -invoker.goals = verify -invoker.buildResult = failure diff --git a/pmd-compat6/src/it/pmd-for-javascript/pom.xml b/pmd-compat6/src/it/pmd-for-javascript/pom.xml deleted file mode 100644 index e1fd383e42..0000000000 --- a/pmd-compat6/src/it/pmd-for-javascript/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - 4.0.0 - - net.sourceforge.pmd.pmd-compat6.it - pmd-for-javascript - 1.0-SNAPSHOT - - - UTF-8 - - - - - - org.apache.maven.plugins - maven-pmd-plugin - @maven-pmd-plugin.version.for.integrationtest@ - - - javascript-check - - check - - - - - true - false - 5 - javascript - - /category/ecmascript/bestpractices.xml - - - **/*.js - - - ${basedir}/src/main/js - - - - - net.sourceforge.pmd - pmd-compat6 - @project.version@ - - - net.sourceforge.pmd - pmd-core - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-java - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-javascript - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-jsp - @pmd.version.for.integrationtest@ - - - - - - diff --git a/pmd-compat6/src/it/pmd-for-javascript/src/main/js/globalVariable.js b/pmd-compat6/src/it/pmd-for-javascript/src/main/js/globalVariable.js deleted file mode 100644 index d9c86cf398..0000000000 --- a/pmd-compat6/src/it/pmd-for-javascript/src/main/js/globalVariable.js +++ /dev/null @@ -1,7 +0,0 @@ -function(arg) { - notDeclaredVariable = 1; // this will create a global variable and trigger the rule - - var someVar = 1; // this is a local variable, that's ok - - window.otherGlobal = 2; // this will not trigger the rule, although it is a global variable. -} diff --git a/pmd-compat6/src/it/pmd-for-javascript/verify.bsh b/pmd-compat6/src/it/pmd-for-javascript/verify.bsh deleted file mode 100644 index 0d190f5f00..0000000000 --- a/pmd-compat6/src/it/pmd-for-javascript/verify.bsh +++ /dev/null @@ -1,33 +0,0 @@ -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; - -String readFile(File file) throws IOException { - StringBuilder content = new StringBuilder(); - for (String line : Files.readAllLines(file.toPath(), StandardCharsets.UTF_8)) { - content.append(line).append(System.lineSeparator()); - } - return content.toString(); -} - -File buildLogPath = new File(basedir, "build.log"); -String buildLog = readFile(buildLogPath); -if (!buildLog.contains("[INFO] PMD Failure: globalVariable.js:2 Rule:GlobalVariable")) { - throw new RuntimeException("No pmd violation detected, did PMD run?"); -} - -File pmdXmlReport = new File(basedir, "target/pmd.xml"); -if(!pmdXmlReport.exists()) -{ - throw new FileNotFoundException("Could not find pmd xml report: " + pmdXmlReport); -} -String pmdXml = readFile(pmdXmlReport); -if (!pmdXml.contains("")) { - throw new RuntimeException("Expected violation has not been reported"); -} diff --git a/pmd-compat6/src/it/pmd-for-jsp/invoker.properties b/pmd-compat6/src/it/pmd-for-jsp/invoker.properties deleted file mode 100644 index 0d92d959f3..0000000000 --- a/pmd-compat6/src/it/pmd-for-jsp/invoker.properties +++ /dev/null @@ -1,2 +0,0 @@ -invoker.goals = verify -invoker.buildResult = failure diff --git a/pmd-compat6/src/it/pmd-for-jsp/pom.xml b/pmd-compat6/src/it/pmd-for-jsp/pom.xml deleted file mode 100644 index 3784e88e69..0000000000 --- a/pmd-compat6/src/it/pmd-for-jsp/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - 4.0.0 - - net.sourceforge.pmd.pmd-compat6.it - pmd-for-jsp - 1.0-SNAPSHOT - - - UTF-8 - - - - - - org.apache.maven.plugins - maven-pmd-plugin - @maven-pmd-plugin.version.for.integrationtest@ - - - jsp-check - - check - - - - - true - false - 5 - jsp - - /category/jsp/bestpractices.xml - - - **/*.jsp - - - ${basedir}/src/main/jsp - - - - - net.sourceforge.pmd - pmd-compat6 - @project.version@ - - - net.sourceforge.pmd - pmd-core - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-java - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-javascript - @pmd.version.for.integrationtest@ - - - net.sourceforge.pmd - pmd-jsp - @pmd.version.for.integrationtest@ - - - - - - diff --git a/pmd-compat6/src/it/pmd-for-jsp/src/main/jsp/classAttribute.jsp b/pmd-compat6/src/it/pmd-for-jsp/src/main/jsp/classAttribute.jsp deleted file mode 100644 index c86ca5aa9c..0000000000 --- a/pmd-compat6/src/it/pmd-for-jsp/src/main/jsp/classAttribute.jsp +++ /dev/null @@ -1,3 +0,0 @@ - -

Some text

- diff --git a/pmd-compat6/src/it/pmd-for-jsp/verify.bsh b/pmd-compat6/src/it/pmd-for-jsp/verify.bsh deleted file mode 100644 index 55f734081e..0000000000 --- a/pmd-compat6/src/it/pmd-for-jsp/verify.bsh +++ /dev/null @@ -1,33 +0,0 @@ -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; - -String readFile(File file) throws IOException { - StringBuilder content = new StringBuilder(); - for (String line : Files.readAllLines(file.toPath(), StandardCharsets.UTF_8)) { - content.append(line).append(System.lineSeparator()); - } - return content.toString(); -} - -File buildLogPath = new File(basedir, "build.log"); -String buildLog = readFile(buildLogPath); -if (!buildLog.contains("[INFO] PMD Failure: classAttribute.jsp:2 Rule:NoClassAttribute")) { - throw new RuntimeException("No pmd violation detected, did PMD run?"); -} - -File pmdXmlReport = new File(basedir, "target/pmd.xml"); -if(!pmdXmlReport.exists()) -{ - throw new FileNotFoundException("Could not find pmd xml report: " + pmdXmlReport); -} -String pmdXml = readFile(pmdXmlReport); -if (!pmdXml.contains("")) { - throw new RuntimeException("Expected violation has not been reported"); -} diff --git a/pmd-compat6/src/it/settings.xml b/pmd-compat6/src/it/settings.xml deleted file mode 100644 index b7724658de..0000000000 --- a/pmd-compat6/src/it/settings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - it-repo - - - local.central - @localRepositoryUrl@ - - true - - - true - - - - - - local.central - @localRepositoryUrl@ - - true - - - true - - - - - - - it-repo - - diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/PMDConfiguration.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/PMDConfiguration.java deleted file mode 100644 index f058699d12..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/PMDConfiguration.java +++ /dev/null @@ -1,604 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: -// - setSourceEncoding -// - setBenchmark (non-functional) -// - getMinimumPriority - -package net.sourceforge.pmd; - -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.nio.charset.Charset; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Properties; - -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.slf4j.LoggerFactory; - -import net.sourceforge.pmd.annotation.DeprecatedUntil700; -import net.sourceforge.pmd.cache.internal.AnalysisCache; -import net.sourceforge.pmd.cache.internal.FileAnalysisCache; -import net.sourceforge.pmd.cache.internal.NoopAnalysisCache; -import net.sourceforge.pmd.internal.util.ClasspathClassLoader; -import net.sourceforge.pmd.lang.Language; -import net.sourceforge.pmd.lang.LanguageRegistry; -import net.sourceforge.pmd.lang.LanguageVersion; -import net.sourceforge.pmd.lang.rule.RuleSetLoader; -import net.sourceforge.pmd.renderers.Renderer; -import net.sourceforge.pmd.renderers.RendererFactory; -import net.sourceforge.pmd.util.AssertionUtil; -import net.sourceforge.pmd.util.log.internal.SimpleMessageReporter; - -/** - * This class contains the details for the runtime configuration of a - * PMD run. Once configured, use {@link PmdAnalysis#create(PMDConfiguration)} - * in a try-with-resources to execute the analysis (see {@link PmdAnalysis}). - * - *

Rulesets

- * - *
    - *
  • You can configure paths to the rulesets to use with {@link #addRuleSet(String)}. - * These can be file paths or classpath resources.
  • - *
  • Use {@link #setMinimumPriority(RulePriority)} to control the minimum priority a - * rule must have to be included. Defaults to the lowest priority, ie all rules are loaded.
  • - *
  • Use {@link #setRuleSetFactoryCompatibilityEnabled(boolean)} to disable the - * compatibility measures for removed and renamed rules in the rulesets that will - * be loaded. - *
- * - *

Source files

- * - *
    - *
  • The default encoding of source files is the system default as - * returned by System.getProperty("file.encoding"). - * You can set it with {@link #setSourceEncoding(Charset)}.
  • - *
  • The source files to analyze can be given in many ways. See - * {@link #addInputPath(Path)} {@link #setInputFilePath(Path)}, {@link #setInputUri(URI)}. - *
  • Files are assigned a language based on their name. The language - * version of languages can be given with - * {@link #setDefaultLanguageVersion(LanguageVersion)}. - * The default language assignment can be overridden with - * {@link #setForceLanguageVersion(LanguageVersion)}.
  • - *
- * - *

Rendering

- * - *
    - *
  • The renderer format to use for Reports. {@link #getReportFormat()}
  • - *
  • The file to which the Report should render. {@link #getReportFile()}
  • - *
  • Configure the root paths that are used to relativize file names in reports via {@link #addRelativizeRoot(Path)}. - * This enables to get short names in reports.
  • - *
  • The initialization properties to use when creating a Renderer instance. - * {@link #getReportProperties()}
  • - *
  • An indicator of whether to show suppressed Rule violations in Reports. - * {@link #isShowSuppressedViolations()}
  • - *
- * - *

Language configuration

- *
    - *
  • Use {@link #setSuppressMarker(String)} to change the comment marker for suppression comments. Defaults to {@value #DEFAULT_SUPPRESS_MARKER}.
  • - *
  • See {@link #setClassLoader(ClassLoader)} and {@link #prependAuxClasspath(String)} for - * information for how to configure classpath for Java analysis.
  • - *
  • You can set additional language properties with {@link #getLanguageProperties(Language)}
  • - *
- * - *

Miscellaneous

- *
    - *
  • Use {@link #setThreads(int)} to control the parallelism of the analysis. Defaults - * one thread per available processor. {@link #getThreads()}
  • - *
- */ -public class PMDConfiguration extends AbstractConfiguration { - private static final LanguageRegistry DEFAULT_REGISTRY = LanguageRegistry.PMD; - - /** The default suppress marker string. */ - public static final String DEFAULT_SUPPRESS_MARKER = "NOPMD"; - private Path reportFile; - - // General behavior options - private String suppressMarker = DEFAULT_SUPPRESS_MARKER; - private int threads = Runtime.getRuntime().availableProcessors(); - private ClassLoader classLoader = getClass().getClassLoader(); - - // Rule and source file options - private List ruleSets = new ArrayList<>(); - private RulePriority minimumPriority = RulePriority.LOW; - private boolean ruleSetFactoryCompatibilityEnabled = true; - - // Reporting options - private String reportFormat; - private Properties reportProperties = new Properties(); - private boolean showSuppressedViolations = false; - private boolean failOnViolation = true; - - private AnalysisCache analysisCache = new NoopAnalysisCache(); - private boolean ignoreIncrementalAnalysis; - - public PMDConfiguration() { - this(DEFAULT_REGISTRY); - } - - public PMDConfiguration(@NonNull LanguageRegistry languageRegistry) { - super(languageRegistry, new SimpleMessageReporter(LoggerFactory.getLogger(PmdAnalysis.class))); - } - - /** - * Get the suppress marker. This is the source level marker used to indicate - * a RuleViolation should be suppressed. - * - * @return The suppress marker. - */ - public String getSuppressMarker() { - return suppressMarker; - } - - /** - * Set the suppress marker. - * - * @param suppressMarker - * The suppress marker to use. - */ - public void setSuppressMarker(String suppressMarker) { - Objects.requireNonNull(suppressMarker, "Suppress marker was null"); - this.suppressMarker = suppressMarker; - } - - /** - * Get the number of threads to use when processing Rules. - * - * @return The number of threads. - */ - public int getThreads() { - return threads; - } - - /** - * Set the number of threads to use when processing Rules. - * - * @param threads - * The number of threads. - */ - public void setThreads(int threads) { - this.threads = threads; - } - - /** - * Get the ClassLoader being used by PMD when processing Rules. - * - * @return The ClassLoader being used - */ - public ClassLoader getClassLoader() { - return classLoader; - } - - /** - * Set the ClassLoader being used by PMD when processing Rules. Setting a - * value of null will cause the default ClassLoader to be used. - * - * @param classLoader - * The ClassLoader to use - */ - public void setClassLoader(ClassLoader classLoader) { - if (classLoader == null) { - this.classLoader = getClass().getClassLoader(); - } else { - this.classLoader = classLoader; - } - } - - /** - * Prepend the specified classpath like string to the current ClassLoader of - * the configuration. If no ClassLoader is currently configured, the - * ClassLoader used to load the {@link PMDConfiguration} class will be used - * as the parent ClassLoader of the created ClassLoader. - * - *

If the classpath String looks like a URL to a file (i.e. starts with - * file://) the file will be read with each line representing - * an entry on the classpath.

- * - * @param classpath - * The prepended classpath. - * @throws IOException - * if the given classpath is invalid (e.g. does not exist) - * @see PMDConfiguration#setClassLoader(ClassLoader) - * @see ClasspathClassLoader - * - * @deprecated Use {@link #prependAuxClasspath(String)}, which doesn't - * throw a checked {@link IOException} - */ - @Deprecated - public void prependClasspath(String classpath) throws IOException { - try { - prependAuxClasspath(classpath); - } catch (IllegalArgumentException e) { - throw new IOException(e); - } - } - - /** - * Prepend the specified classpath like string to the current ClassLoader of - * the configuration. If no ClassLoader is currently configured, the - * ClassLoader used to load the {@link PMDConfiguration} class will be used - * as the parent ClassLoader of the created ClassLoader. - * - *

If the classpath String looks like a URL to a file (i.e. starts with - * file://) the file will be read with each line representing - * an entry on the classpath.

- * - *

You can specify multiple class paths separated by `:` on Unix-systems or `;` under Windows. - * See {@link File#pathSeparator}. - * - * @param classpath The prepended classpath. - * - * @throws IllegalArgumentException if the given classpath is invalid (e.g. does not exist) - * @see PMDConfiguration#setClassLoader(ClassLoader) - */ - public void prependAuxClasspath(String classpath) { - try { - if (classLoader == null) { - classLoader = PMDConfiguration.class.getClassLoader(); - } - if (classpath != null) { - classLoader = new ClasspathClassLoader(classpath, classLoader); - } - } catch (IOException e) { - // Note: IOExceptions shouldn't appear anymore, they should already be converted - // to IllegalArgumentException in ClasspathClassLoader. - throw new IllegalArgumentException(e); - } - } - - /** - * Get the comma separated list of RuleSet URIs. - * - * @return The RuleSet URIs. - * - * @deprecated Use {@link #getRuleSetPaths()} - */ - @Deprecated - @DeprecatedUntil700 - public @Nullable String getRuleSets() { - if (ruleSets.isEmpty()) { - return null; - } - return String.join(",", ruleSets); - } - - /** - * Returns the list of ruleset URIs. - * - * @see RuleSetLoader#loadFromResource(String) - */ - public @NonNull List<@NonNull String> getRuleSetPaths() { - return ruleSets; - } - - /** - * Sets the list of ruleset paths to load when starting the analysis. - * - * @param ruleSetPaths A list of ruleset paths, understandable by {@link RuleSetLoader#loadFromResource(String)}. - * - * @throws NullPointerException If the parameter is null - */ - public void setRuleSets(@NonNull List<@NonNull String> ruleSetPaths) { - AssertionUtil.requireParamNotNull("ruleSetPaths", ruleSetPaths); - AssertionUtil.requireContainsNoNullValue("ruleSetPaths", ruleSetPaths); - this.ruleSets = new ArrayList<>(ruleSetPaths); - } - - /** - * Add a new ruleset paths to load when starting the analysis. - * This list is initially empty. - * - * @param rulesetPath A ruleset path, understandable by {@link RuleSetLoader#loadFromResource(String)}. - * - * @throws NullPointerException If the parameter is null - */ - public void addRuleSet(@NonNull String rulesetPath) { - AssertionUtil.requireParamNotNull("rulesetPath", rulesetPath); - this.ruleSets.add(rulesetPath); - } - - /** - * Set the comma separated list of RuleSet URIs. - * - * @param ruleSets the rulesets to set - * - * @deprecated Use {@link #setRuleSets(List)} or {@link #addRuleSet(String)}. - */ - @Deprecated - @DeprecatedUntil700 - public void setRuleSets(@Nullable String ruleSets) { - if (ruleSets == null) { - this.ruleSets = new ArrayList<>(); - } else { - this.ruleSets = new ArrayList<>(Arrays.asList(ruleSets.split(","))); - } - } - - /** - * Get the minimum priority threshold when loading Rules from RuleSets. - * - * @return The minimum priority threshold. - */ - public RulePriority getMinimumPriority() { - return minimumPriority; - } - - /** - * Set the minimum priority threshold when loading Rules from RuleSets. - * - * @param minimumPriority - * The minimum priority. - */ - public void setMinimumPriority(RulePriority minimumPriority) { - this.minimumPriority = minimumPriority; - } - - public void setMinimumPriority(net.sourceforge.pmd.lang.rule.RulePriority mininumPriority) { - this.minimumPriority = RulePriority.valueOf(mininumPriority.name()); - } - - /** - * Create a Renderer instance based upon the configured reporting options. - * No writer is created. - * - * @return renderer - */ - public Renderer createRenderer() { - return createRenderer(false); - } - - /** - * Create a Renderer instance based upon the configured reporting options. - * If withReportWriter then we'll configure it with a writer for the - * reportFile specified. - * - * @param withReportWriter - * whether to configure a writer or not - * @return A Renderer instance. - */ - public Renderer createRenderer(boolean withReportWriter) { - Renderer renderer = RendererFactory.createRenderer(reportFormat, reportProperties); - renderer.setShowSuppressedViolations(showSuppressedViolations); - if (withReportWriter) { - renderer.setReportFile(getReportFile()); - } - return renderer; - } - - /** - * Get the report format. - * - * @return The report format. - */ - public String getReportFormat() { - return reportFormat; - } - - /** - * Set the report format. This should be a name of a Renderer. - * - * @param reportFormat - * The report format. - * - * @see Renderer - */ - public void setReportFormat(String reportFormat) { - this.reportFormat = reportFormat; - } - - /** - * Get whether the report should show suppressed violations. - * - * @return true if showing suppressed violations, - * false otherwise. - */ - public boolean isShowSuppressedViolations() { - return showSuppressedViolations; - } - - /** - * Set whether the report should show suppressed violations. - * - * @param showSuppressedViolations - * true if showing suppressed violations, - * false otherwise. - */ - public void setShowSuppressedViolations(boolean showSuppressedViolations) { - this.showSuppressedViolations = showSuppressedViolations; - } - - /** - * Get the Report properties. These are used to create the Renderer. - * - * @return The report properties. - */ - public Properties getReportProperties() { - return reportProperties; - } - - /** - * Set the Report properties. These are used to create the Renderer. - * - * @param reportProperties - * The Report properties to set. - */ - public void setReportProperties(Properties reportProperties) { - this.reportProperties = reportProperties; - } - - /** - * Whether PMD should exit with status 4 (the default behavior, true) if - * violations are found or just with 0 (to not break the build, e.g.). - * - * @return failOnViolation - */ - public boolean isFailOnViolation() { - return failOnViolation; - } - - /** - * Sets whether PMD should exit with status 4 (the default behavior, true) - * if violations are found or just with 0 (to not break the build, e.g.). - * - * @param failOnViolation - * failOnViolation - */ - public void setFailOnViolation(boolean failOnViolation) { - this.failOnViolation = failOnViolation; - } - - /** - * Checks if the rule set factory compatibility feature is enabled. - * - * @return true, if the rule set factory compatibility feature is enabled - * - */ - public boolean isRuleSetFactoryCompatibilityEnabled() { - return ruleSetFactoryCompatibilityEnabled; - } - - /** - * Sets the rule set factory compatibility feature enabled/disabled. - * - * @param ruleSetFactoryCompatibilityEnabled {@code true} if the feature should be enabled - * - */ - public void setRuleSetFactoryCompatibilityEnabled(boolean ruleSetFactoryCompatibilityEnabled) { - this.ruleSetFactoryCompatibilityEnabled = ruleSetFactoryCompatibilityEnabled; - } - - /** - * Retrieves the currently used analysis cache. Will never be null. - * - * @return The currently used analysis cache. Never null. - */ - public AnalysisCache getAnalysisCache() { - // Make sure we are not null - if (analysisCache == null || isIgnoreIncrementalAnalysis() && !(analysisCache instanceof NoopAnalysisCache)) { - // sets a noop cache - setAnalysisCache(new NoopAnalysisCache()); - } - - return analysisCache; - } - - /** - * Sets the analysis cache to be used. Setting a - * value of {@code null} will cause a Noop AnalysisCache to be used. - * If incremental analysis was explicitly disabled ({@link #isIgnoreIncrementalAnalysis()}), - * then this method is a noop. - * - * @param cache The analysis cache to be used. - */ - public void setAnalysisCache(final AnalysisCache cache) { - // the doc says it's a noop if incremental analysis was disabled, - // but it's actually the getter that enforces that - this.analysisCache = cache == null ? new NoopAnalysisCache() : cache; - } - - /** - * Sets the location of the analysis cache to be used. This will automatically configure - * and appropriate AnalysisCache implementation. - * - * @param cacheLocation The location of the analysis cache to be used. - */ - public void setAnalysisCacheLocation(final String cacheLocation) { - setAnalysisCache(cacheLocation == null - ? new NoopAnalysisCache() - : new FileAnalysisCache(new File(cacheLocation))); - } - - - /** - * Sets whether the user has explicitly disabled incremental analysis or not. - * If so, incremental analysis is not used, and all suggestions to use it are - * disabled. The analysis cached location is ignored, even if it's specified. - * - * @param noCache Whether to ignore incremental analysis or not - */ - public void setIgnoreIncrementalAnalysis(boolean noCache) { - // see #getAnalysisCache for the implementation. - this.ignoreIncrementalAnalysis = noCache; - } - - - /** - * Returns whether incremental analysis was explicitly disabled by the user - * or not. - * - * @return {@code true} if incremental analysis is explicitly disabled - */ - public boolean isIgnoreIncrementalAnalysis() { - return ignoreIncrementalAnalysis; - } - - - /** - * Get the file to which the report should render. - * - * @return The file to which to render. - * @deprecated Use {@link #getReportFilePath()} - */ - @Deprecated - public String getReportFile() { - return reportFile == null ? null : reportFile.toString(); - } - - /** - * Get the file to which the report should render. - * - * @return The file to which to render. - */ - public Path getReportFilePath() { - return reportFile; - } - - /** - * Set the file to which the report should render. - * - * @param reportFile the file to set - * @deprecated Use {@link #setReportFile(Path)} - */ - @Deprecated - public void setReportFile(String reportFile) { - this.reportFile = reportFile == null ? null : Paths.get(reportFile); - } - - /** - * Set the file to which the report should render. - * - * @param reportFile the file to set - */ - public void setReportFile(Path reportFile) { - this.reportFile = reportFile; - } - - // ------------------- compat extensions -------------------- - @Deprecated - public void setSourceEncoding(String sourceEncoding) { - setSourceEncoding(Charset.forName(Objects.requireNonNull(sourceEncoding))); - } - - @Deprecated - public void setBenchmark(boolean benchmark) { - // ignored - } - - // new method to be compatible with PMD 7 - RulePriority has changed package - public net.sourceforge.pmd.lang.rule.RulePriority getMinimumPriority$$bridge() { // SUPPRESS CHECKSTYLE ignore - return minimumPriority.asPMD7RulePriority(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/PmdAnalysis.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/PmdAnalysis.java deleted file mode 100644 index 42b769b42a..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/PmdAnalysis.java +++ /dev/null @@ -1,625 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: performAnalysisAndCollectReport, changes due to Report moved package - -package net.sourceforge.pmd; - -import static net.sourceforge.pmd.util.CollectionUtil.listOf; - -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.event.Level; - -import net.sourceforge.pmd.benchmark.TimeTracker; -import net.sourceforge.pmd.benchmark.TimedOperation; -import net.sourceforge.pmd.benchmark.TimedOperationCategory; -import net.sourceforge.pmd.cache.internal.AnalysisCacheListener; -import net.sourceforge.pmd.cache.internal.NoopAnalysisCache; -import net.sourceforge.pmd.internal.LogMessages; -import net.sourceforge.pmd.internal.util.ClasspathClassLoader; -import net.sourceforge.pmd.internal.util.FileCollectionUtil; -import net.sourceforge.pmd.internal.util.IOUtil; -import net.sourceforge.pmd.lang.InternalApiBridge; -import net.sourceforge.pmd.lang.JvmLanguagePropertyBundle; -import net.sourceforge.pmd.lang.Language; -import net.sourceforge.pmd.lang.LanguageProcessor.AnalysisTask; -import net.sourceforge.pmd.lang.LanguageProcessorRegistry; -import net.sourceforge.pmd.lang.LanguageProcessorRegistry.LanguageTerminationException; -import net.sourceforge.pmd.lang.LanguagePropertyBundle; -import net.sourceforge.pmd.lang.LanguageRegistry; -import net.sourceforge.pmd.lang.LanguageVersion; -import net.sourceforge.pmd.lang.LanguageVersionDiscoverer; -import net.sourceforge.pmd.lang.document.FileCollector; -import net.sourceforge.pmd.lang.document.TextFile; -import net.sourceforge.pmd.lang.rule.RuleSet; -import net.sourceforge.pmd.lang.rule.RuleSetLoader; -import net.sourceforge.pmd.renderers.Renderer; -import net.sourceforge.pmd.reporting.ConfigurableFileNameRenderer; -import net.sourceforge.pmd.reporting.FileAnalysisListener; -import net.sourceforge.pmd.reporting.GlobalAnalysisListener; -import net.sourceforge.pmd.reporting.ListenerInitializer; -import net.sourceforge.pmd.reporting.Report; -import net.sourceforge.pmd.reporting.ReportStats; -import net.sourceforge.pmd.reporting.ReportStatsListener; -import net.sourceforge.pmd.util.AssertionUtil; -import net.sourceforge.pmd.util.StringUtil; -import net.sourceforge.pmd.util.log.PmdReporter; - -/** - * Main programmatic API of PMD. This is not a CLI entry point, see module - * {@code pmd-cli} for that. - * - *

Usage overview

- * - *

Create and configure a {@link PMDConfiguration}, - * then use {@link #create(PMDConfiguration)} to obtain an instance. - * You can perform additional configuration on the instance, e.g. adding - * files to process, or additional rulesets and renderers. Then, call - * {@link #performAnalysis()} or one of the related terminal methods. - * - *

Simple example

- * - *
{@code
- *   PMDConfiguration config = new PMDConfiguration();
- *   config.setDefaultLanguageVersion(LanguageRegistry.findLanguageByTerseName("java").getVersion("11"));
- *   config.addInputPath(Path.of("src/main/java"));
- *   config.prependClasspath("target/classes");
- *   config.setMinimumPriority(RulePriority.HIGH);
- *   config.addRuleSet("rulesets/java/quickstart.xml");
- *   config.setReportFormat("xml");
- *   config.setReportFile("target/pmd-report.xml");
- *
- *   try (PmdAnalysis pmd = PmdAnalysis.create(config)) {
- *     // note: don't use `config` once a PmdAnalysis has been created.
- *     // optional: add more rulesets
- *     pmd.addRuleSet(pmd.newRuleSetLoader().loadFromResource("custom-ruleset.xml"));
- *     // optional: add more files
- *     pmd.files().addFile(Paths.get("src", "main", "more-java", "ExtraSource.java"));
- *     // optional: add more renderers
- *     pmd.addRenderer(renderer);
- *
- *     pmd.performAnalysis();
- *   }
- * }
- * - *

Rendering reports

- * - *

If you just want to render a report to a file like with the CLI, you - * should use a {@link Renderer}. You can add a custom one with {@link PmdAnalysis#addRenderer(Renderer)}. - * You can add one of the builtin renderers from its ID using {@link PMDConfiguration#setReportFormat(String)}. - * - *

Reports and events

- * - *

If you want strongly typed access to violations and other analysis events, - * you can implement and register a {@link GlobalAnalysisListener} with {@link #addListener(GlobalAnalysisListener)}. - * The listener needs to provide a new {@link FileAnalysisListener} for each file, - * which will receive events from the analysis. The listener's lifecycle - * happens only once the analysis is started ({@link #performAnalysis()}). - * - *

If you want access to all events once the analysis ends instead of processing - * events as they go, you can obtain a {@link Report} instance from {@link #performAnalysisAndCollectReport()}, - * or use {@link Report.GlobalReportBuilderListener} manually. Keep in - * mind collecting a report is less memory-efficient than using a listener. - * - *

If you want to process events in batches, one per file, you can - * use {@link Report.ReportBuilderListener}. to implement {@link GlobalAnalysisListener#startFileAnalysis(TextFile)}. - * - *

Listeners can be used alongside renderers. - * - *

Specifying the Java classpath

- * - *

Java rules work better if you specify the path to the compiled classes - * of the analysed sources. See {@link PMDConfiguration#prependAuxClasspath(String)}. - * - *

Customizing message output

- * - *

The analysis reports messages like meta warnings and errors through a - * {@link PmdReporter} instance. To override how those messages are output, - * you can set it in {@link PMDConfiguration#setReporter(PmdReporter)}. - * By default, it forwards messages to SLF4J. - * - */ -public final class PmdAnalysis implements AutoCloseable { - - private static final Logger LOG = LoggerFactory.getLogger(PmdAnalysis.class); - - private final FileCollector collector; - private final List renderers = new ArrayList<>(); - private final List listeners = new ArrayList<>(); - private final List ruleSets = new ArrayList<>(); - private final PMDConfiguration configuration; - private final PmdReporter reporter; - - private final Map langProperties = new HashMap<>(); - private boolean closed; - private final ConfigurableFileNameRenderer fileNameRenderer = new ConfigurableFileNameRenderer(); - - /** - * Constructs a new instance. The files paths (input files, filelist, - * exclude list, etc) given in the configuration are collected into - * the file collector ({@link #files()}), but more can be added - * programmatically using the file collector. - */ - private PmdAnalysis(PMDConfiguration config) { - this.configuration = config; - this.reporter = config.getReporter(); - this.collector = net.sourceforge.pmd.lang.document.InternalApiBridge.newCollector( - config.getLanguageVersionDiscoverer(), - reporter - ); - - } - - /** - * Constructs a new instance from a configuration. - * - *

    - *
  • The files paths (input files, filelist, - * exclude list, etc) are explored and the files to analyse are - * collected into the file collector ({@link #files()}). - * More can be added programmatically using the file collector. - *
  • The rulesets given in the configuration are loaded ({@link PMDConfiguration#getRuleSets()}) - *
  • A renderer corresponding to the parameters of the configuration - * is created and added (but not started). - *
- */ - public static PmdAnalysis create(PMDConfiguration config) { - PmdAnalysis pmd = new PmdAnalysis(config); - - // note: do not filter files by language - // they could be ignored later. The problem is if you call - // addRuleSet later, then you could be enabling new languages - // So the files should not be pruned in advance - FileCollectionUtil.collectFiles(config, pmd.files()); - - if (config.getReportFormat() != null) { - Renderer renderer = config.createRenderer(true); - pmd.addRenderer(renderer); - } - - if (!config.getRuleSetPaths().isEmpty()) { - final net.sourceforge.pmd.lang.rule.RuleSetLoader ruleSetLoader = pmd.newRuleSetLoader(); - final List ruleSets = net.sourceforge.pmd.lang.rule.InternalApiBridge.loadRuleSetsWithoutException(ruleSetLoader, config.getRuleSetPaths()); - pmd.addRuleSets(ruleSets); - } - - for (Language language : config.getLanguageRegistry()) { - LanguagePropertyBundle props = config.getLanguageProperties(language); - assert props.getLanguage().equals(language); - pmd.langProperties.put(language, props); - - LanguageVersion forcedVersion = config.getForceLanguageVersion(); - if (forcedVersion != null && forcedVersion.getLanguage().equals(language)) { - props.setLanguageVersion(forcedVersion.getVersion()); - } - - // TODO replace those with actual language properties when the - // CLI syntax is implemented. - props.setProperty(LanguagePropertyBundle.SUPPRESS_MARKER, config.getSuppressMarker()); - if (props instanceof JvmLanguagePropertyBundle) { - ((JvmLanguagePropertyBundle) props).setClassLoader(config.getClassLoader()); - } - } - - for (Path path : config.getRelativizeRoots()) { - pmd.fileNameRenderer.relativizeWith(path); - } - - return pmd; - } - - // test only - List rulesets() { - return ruleSets; - } - - // test only - List renderers() { - return renderers; - } - - - /** - * Returns the file collector for the analysed sources. - */ - public FileCollector files() { - return collector; // todo user can close collector programmatically - } - - /** - * Returns a new ruleset loader, which can be used to create new - * rulesets (add them then with {@link #addRuleSet(RuleSet)}). - * - *
{@code
-     * try (PmdAnalysis pmd = create(config)) {
-     *     pmd.addRuleSet(pmd.newRuleSetLoader().loadFromResource("custom-ruleset.xml"));
-     * }
-     * }
- */ - public net.sourceforge.pmd.lang.rule.RuleSetLoader newRuleSetLoader() { - return RuleSetLoader.fromPmdConfig(configuration); - } - - /** - * Add a new renderer. The given renderer must not already be started, - * it will be started by {@link #performAnalysis()}. - * - * @throws NullPointerException If the parameter is null - */ - public void addRenderer(Renderer renderer) { - AssertionUtil.requireParamNotNull("renderer", renderer); - this.renderers.add(renderer); - } - - /** - * Add several renderers at once. - * - * @throws NullPointerException If the parameter is null, or any of its items is null. - */ - public void addRenderers(Collection renderers) { - renderers.forEach(this::addRenderer); - } - - /** - * Add a new listener. As per the contract of {@link GlobalAnalysisListener}, - * this object must be ready for interaction. However, nothing will - * be done with the listener until {@link #performAnalysis()} is called. - * The listener will be closed by {@link #performAnalysis()}, or - * {@link #close()}, whichever happens first. - * - * @throws NullPointerException If the parameter is null - */ - public void addListener(GlobalAnalysisListener listener) { - AssertionUtil.requireParamNotNull("listener", listener); - this.listeners.add(listener); - } - - /** - * Add several listeners at once. - * - * @throws NullPointerException If the parameter is null, or any of its items is null. - * @see #addListener(GlobalAnalysisListener) - */ - public void addListeners(Collection listeners) { - listeners.forEach(this::addListener); - } - - /** - * Add a new ruleset. - * - * @throws NullPointerException If the parameter is null - */ - public void addRuleSet(RuleSet ruleSet) { - AssertionUtil.requireParamNotNull("rule set", ruleSet); - this.ruleSets.add(ruleSet); - } - - /** - * Add several rulesets at once. - * - * @throws NullPointerException If the parameter is null, or any of its items is null. - */ - public void addRuleSets(Collection ruleSets) { - ruleSets.forEach(this::addRuleSet); - } - - /** - * Returns an unmodifiable view of the ruleset list. That will be - * processed. - */ - public List getRulesets() { - return Collections.unmodifiableList(ruleSets); - } - - - /** - * Returns a mutable bundle of language properties that are associated - * to the given language (always the same for a given language). - * - * @param language A language, which must be registered - */ - public LanguagePropertyBundle getLanguageProperties(Language language) { - configuration.checkLanguageIsRegistered(language); - return langProperties.computeIfAbsent(language, Language::newPropertyBundle); - } - - - public ConfigurableFileNameRenderer fileNameRenderer() { - return fileNameRenderer; - } - - /** - * Run PMD with the current state of this instance. This will start - * and finish the registered renderers, and close all - * {@linkplain #addListener(GlobalAnalysisListener) registered listeners}. - * All files collected in the {@linkplain #files() file collector} are - * processed. This does not return a report, as the analysis results - * are consumed by {@link GlobalAnalysisListener} instances (of which - * Renderers are a special case). Note that this does - * not throw, errors are instead accumulated into a {@link PmdReporter}. - */ - public void performAnalysis() { - performAnalysisImpl(Collections.emptyList()); - } - - /** - * Run PMD with the current state of this instance. This will start - * and finish the registered renderers. All files collected in the - * {@linkplain #files() file collector} are processed. Returns the - * output report. Note that this does not throw, errors are instead - * accumulated into a {@link PmdReporter}. - */ - public Report performAnalysisAndCollectReport() { - try (Report.GlobalReportBuilderListener reportBuilder = new Report.GlobalReportBuilderListener()) { - performAnalysisImpl(listOf(reportBuilder)); // closes the report builder - return reportBuilder.getResultImpl(); - } - } - - void performAnalysisImpl(List extraListeners) { - try (FileCollector files = collector) { - files.filterLanguages(getApplicableLanguages(false)); - performAnalysisImpl(extraListeners, files.getCollectedFiles()); - } - } - - void performAnalysisImpl(List extraListeners, List textFiles) { - net.sourceforge.pmd.lang.rule.internal.RuleSets rulesets = new net.sourceforge.pmd.lang.rule.internal.RuleSets(this.ruleSets); - - GlobalAnalysisListener listener; - try { - @SuppressWarnings("PMD.CloseResource") - AnalysisCacheListener cacheListener = new AnalysisCacheListener(configuration.getAnalysisCache(), - rulesets, - configuration.getClassLoader(), - textFiles); - listener = GlobalAnalysisListener.tee(listOf(createComposedRendererListener(renderers), - GlobalAnalysisListener.tee(listeners), - GlobalAnalysisListener.tee(extraListeners), - cacheListener)); - - // Initialize listeners - try (ListenerInitializer initializer = listener.initializer()) { - initializer.setNumberOfFilesToAnalyze(textFiles.size()); - initializer.setFileNameRenderer(fileNameRenderer()); - } - } catch (Exception e) { - reporter.errorEx("Exception while initializing analysis listeners", e); - throw new RuntimeException("Exception while initializing analysis listeners", e); - } - - try (TimedOperation ignored = TimeTracker.startOperation(TimedOperationCategory.FILE_PROCESSING)) { - for (final Rule rule : removeBrokenRules(rulesets)) { - // todo Just like we throw for invalid properties, "broken rules" - // shouldn't be a "config error". This is the only instance of - // config errors... - // see https://github.com/pmd/pmd/issues/3901 - listener.onConfigError(new Report.ConfigurationError(rule, rule.dysfunctionReason())); - } - - encourageToUseIncrementalAnalysis(configuration); - - try (LanguageProcessorRegistry lpRegistry = LanguageProcessorRegistry.create( - // only start the applicable languages (and dependencies) - new LanguageRegistry(getApplicableLanguages(true)), - langProperties, - reporter - )) { - // Note the analysis task is shared: all processors see - // the same file list, which may contain files for other - // languages. - AnalysisTask analysisTask = InternalApiBridge.createAnalysisTask( - rulesets, - textFiles, - listener, - configuration.getThreads(), - configuration.getAnalysisCache(), - reporter, - lpRegistry - ); - - List analyses = new ArrayList<>(); - try { - for (Language lang : lpRegistry.getLanguages()) { - analyses.add(lpRegistry.getProcessor(lang).launchAnalysis(analysisTask)); - } - } finally { - Exception e = IOUtil.closeAll(analyses); - if (e != null) { - reporter.errorEx("Error while joining analysis", e); - } - } - - } catch (LanguageTerminationException e) { - reporter.errorEx("Error while closing language processors", e); - } - } finally { - try { - listener.close(); - } catch (Exception e) { - reporter.errorEx("Exception while closing analysis listeners", e); - // todo better exception - throw new RuntimeException("Exception while closing analysis listeners", e); - } - } - } - - - private GlobalAnalysisListener createComposedRendererListener(List renderers) throws Exception { - if (renderers.isEmpty()) { - return GlobalAnalysisListener.noop(); - } - - List rendererListeners = new ArrayList<>(renderers.size()); - for (Renderer renderer : renderers) { - try { - @SuppressWarnings("PMD.CloseResource") - GlobalAnalysisListener listener = - Objects.requireNonNull(renderer.newListener(), "Renderer should provide non-null listener"); - rendererListeners.add(listener); - } catch (Exception ioe) { - // close listeners so far, throw their close exception or the ioe - IOUtil.ensureClosed(rendererListeners, ioe); - throw AssertionUtil.shouldNotReachHere("ensureClosed should have thrown", ioe); - } - } - return GlobalAnalysisListener.tee(rendererListeners); - } - - private Set getApplicableLanguages(boolean quiet) { - Set languages = new HashSet<>(); - LanguageVersionDiscoverer discoverer = configuration.getLanguageVersionDiscoverer(); - - for (RuleSet ruleSet : ruleSets) { - for (Rule rule : ruleSet.getRules()) { - Language ruleLanguage = rule.getLanguage(); - Objects.requireNonNull(ruleLanguage, "Rule has no language " + rule); - if (!languages.contains(ruleLanguage)) { - LanguageVersion version = discoverer.getDefaultLanguageVersion(ruleLanguage); - if (net.sourceforge.pmd.lang.rule.InternalApiBridge.ruleSetApplies((net.sourceforge.pmd.lang.rule.Rule) rule, version)) { - configuration.checkLanguageIsRegistered(ruleLanguage); - languages.add(ruleLanguage); - if (!quiet) { - LOG.trace("Using {} version ''{}''", version.getLanguage().getName(), version.getTerseName()); - } - } - } - } - } - - // collect all dependencies, they shouldn't be filtered out - LanguageRegistry reg = configuration.getLanguageRegistry(); - boolean changed; - do { - changed = false; - for (Language lang : new HashSet<>(languages)) { - for (String depId : lang.getDependencies()) { - Language depLang = reg.getLanguageById(depId); - if (depLang == null) { - // todo maybe report all then throw - throw new IllegalStateException( - "Language " + lang.getId() + " has unsatisfied dependencies: " - + depId + " is not found in " + reg - ); - } - changed |= languages.add(depLang); - } - } - } while (changed); - return languages; - } - - /** - * Remove and return the misconfigured rules from the rulesets and log them - * for good measure. - */ - private Set removeBrokenRules(final RuleSets ruleSets) { - final Set brokenRules = new HashSet<>(); - ruleSets.removeDysfunctionalRules(brokenRules); - - for (final Rule rule : brokenRules) { - reporter.warn("Removed misconfigured rule: {0} cause: {1}", - rule.getName(), rule.dysfunctionReason()); - } - - return brokenRules; - } - - - public PmdReporter getReporter() { - return reporter; - } - - @Override - public void close() { - if (closed) { - return; - } - closed = true; - collector.close(); - - // close listeners if analysis is not run. - IOUtil.closeAll(listeners); - - /* - * Make sure it's our own classloader before attempting to close it.... - * Maven + Jacoco provide us with a cloaseable classloader that if closed - * will throw a ClassNotFoundException. - */ - if (configuration.getClassLoader() instanceof ClasspathClassLoader) { - IOUtil.tryCloseClassLoader(configuration.getClassLoader()); - } - } - - public ReportStats runAndReturnStats() { - if (getRulesets().isEmpty()) { - return ReportStats.empty(); - } - - @SuppressWarnings("PMD.CloseResource") - ReportStatsListener listener = new ReportStatsListener(); - - addListener(listener); - - try { - performAnalysis(); - } catch (Exception e) { - getReporter().errorEx("Exception during processing", e); - ReportStats stats = listener.getResult(); - printErrorDetected(1 + stats.getNumErrors()); - return stats; // should have been closed - } - ReportStats stats = listener.getResult(); - - if (stats.getNumErrors() > 0) { - printErrorDetected(stats.getNumErrors()); - } - - return stats; - } - - static void printErrorDetected(PmdReporter reporter, int errors) { - String msg = LogMessages.errorDetectedMessage(errors, "PMD"); - // note: using error level here increments the error count of the reporter, - // which we don't want. - reporter.info(StringUtil.quoteMessageFormat(msg)); - } - - void printErrorDetected(int errors) { - printErrorDetected(getReporter(), errors); - } - - private static void encourageToUseIncrementalAnalysis(final PMDConfiguration configuration) { - final PmdReporter reporter = configuration.getReporter(); - - if (!configuration.isIgnoreIncrementalAnalysis() - && configuration.getAnalysisCache() instanceof NoopAnalysisCache - && reporter.isLoggable(Level.WARN)) { - final String version = - PMDVersion.isUnknown() || PMDVersion.isSnapshot() ? "latest" : "pmd-doc-" + PMDVersion.VERSION; - reporter.warn("This analysis could be faster, please consider using Incremental Analysis: " - + "https://docs.pmd-code.org/{0}/pmd_userdocs_incremental_analysis.html", version); - } - } - - // ---- compatibility - - // new method to be compatible with PMD 6 - Report has changed package - public net.sourceforge.pmd.Report performAnalysisAndCollectReport$$bridge() { // SUPPRESS CHECKSTYLE ignore - return performAnalysisAndCollectReport(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/Report.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/Report.java deleted file mode 100644 index c02ae1a01f..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/Report.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: filterViolations(net.sourceforge.pmd.util.Predicate filter) - -package net.sourceforge.pmd; - -import static java.util.Collections.synchronizedList; - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.function.Consumer; -import java.util.function.Predicate; - -import net.sourceforge.pmd.annotation.DeprecatedUntil700; -import net.sourceforge.pmd.annotation.Experimental; -import net.sourceforge.pmd.annotation.InternalApi; -import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.document.TextFile; -import net.sourceforge.pmd.renderers.AbstractAccumulatingRenderer; -import net.sourceforge.pmd.reporting.FileAnalysisListener; -import net.sourceforge.pmd.reporting.GlobalAnalysisListener; -import net.sourceforge.pmd.reporting.ViolationSuppressor; -import net.sourceforge.pmd.util.BaseResultProducingCloseable; - -/** - * A {@link Report} collects all information during a PMD execution. This - * includes violations, suppressed violations, metrics, error during processing - * and configuration errors. - * - *

A report may be created by a {@link GlobalReportBuilderListener} that you - * use as the {@linkplain GlobalAnalysisListener} in {@link PmdAnalysis#performAnalysisAndCollectReport() PMD's entry point}. - * You can also create one manually with {@link #buildReport(Consumer)}. - * - *

For special use cases, like filtering the report after PMD analysis and - * before rendering the report, some transformation operations are provided: - *

    - *
  • {@link #filterViolations(Predicate)}
  • - *
  • {@link #union(Report)}
  • - *
- * These methods create a new {@link Report} rather than modifying their receiver. - */ -public class Report { - // todo move to package reporting - - protected final List violations = synchronizedList(new ArrayList<>()); - protected final List suppressedRuleViolations = synchronizedList(new ArrayList<>()); - protected final List errors = synchronizedList(new ArrayList<>()); - protected final List configErrors = synchronizedList(new ArrayList<>()); - - @DeprecatedUntil700 - @InternalApi - public Report() { // NOPMD - UnnecessaryConstructor - // TODO: should be package-private, you have to use a listener to build a report. - } - - /** - * Represents a configuration error. - */ - public static class ConfigurationError { - - private final Rule rule; - private final String issue; - - /** - * Creates a new configuration error for a specific rule. - * - * @param theRule - * the rule which is configured wrongly - * @param theIssue - * the reason, why the configuration is wrong - */ - public ConfigurationError(Rule theRule, String theIssue) { - rule = theRule; - issue = theIssue; - } - - /** - * Gets the wrongly configured rule - * - * @return the wrongly configured rule - */ - public Rule rule() { - return rule; - } - - /** - * Gets the reason for the configuration error. - * - * @return the issue - */ - public String issue() { - return issue; - } - } - - /** - * Represents a processing error, such as a parse error. - */ - public static class ProcessingError { - - private final Throwable error; - private final FileId file; - - /** - * Creates a new processing error - * - * @param error - * the error - * @param file - * the file during which the error occurred - */ - public ProcessingError(Throwable error, FileId file) { - this.error = error; - this.file = file; - } - - public String getMsg() { - return error.getClass().getSimpleName() + ": " + error.getMessage(); - } - - public String getDetail() { - try (StringWriter stringWriter = new StringWriter(); - PrintWriter writer = new PrintWriter(stringWriter)) { - error.printStackTrace(writer); - return stringWriter.toString(); - } catch (IOException e) { - // IOException on close - should never happen when using StringWriter - throw new RuntimeException(e); - } - } - - public FileId getFileId() { - return file; - } - - public Throwable getError() { - return error; - } - - // ------------------- compat extensions -------------------- - public String getFile() { - return file.getAbsolutePath(); - } - } - - /** - * Represents a violation, that has been suppressed. - */ - public static class SuppressedViolation { - - private final RuleViolation rv; - private final String userMessage; - private final ViolationSuppressor suppressor; - - /** - * Creates a suppressed violation. - * - * @param rv The violation, that has been suppressed - * @param suppressor The suppressor which suppressed the violation - * @param userMessage Any relevant info given by the suppressor - */ - public SuppressedViolation(RuleViolation rv, ViolationSuppressor suppressor, String userMessage) { - this.suppressor = suppressor; - this.rv = rv; - this.userMessage = userMessage; - } - - public ViolationSuppressor getSuppressor() { - return suppressor; - } - - public RuleViolation getRuleViolation() { - return this.rv; - } - - public String getUserMessage() { - return userMessage; - } - } - - /** - * Adds a new rule violation to the report and notify the listeners. - * - * @param violation the violation to add - * - * @deprecated PMD's way of creating a report is internal and may be changed in pmd 7. - */ - @DeprecatedUntil700 - @Deprecated - @InternalApi - public void addRuleViolation(RuleViolation violation) { - synchronized (violations) { - // note that this binary search is inefficient as we usually - // report violations file by file. - int index = Collections.binarySearch(violations, violation, RuleViolation.DEFAULT_COMPARATOR); - violations.add(index < 0 ? -index - 1 : index, violation); - } - } - - /** - * Adds a new suppressed violation. - */ - private void addSuppressedViolation(SuppressedViolation sv) { - suppressedRuleViolations.add(sv); - } - - /** - * Adds a new configuration error to the report. - * - * @param error the error to add - * - * @deprecated PMD's way of creating a report is internal and may be changed in pmd 7. - */ - @DeprecatedUntil700 - @Deprecated - @InternalApi - public void addConfigError(ConfigurationError error) { - configErrors.add(error); - } - - /** - * Adds a new processing error to the report. - * - * @param error - * the error to add - * @deprecated PMD's way of creating a report is internal and may be changed in pmd 7. - */ - @DeprecatedUntil700 - @Deprecated - @InternalApi - public void addError(ProcessingError error) { - errors.add(error); - } - - /** - * Merges the given report into this report. This might be necessary, if a - * summary over all violations is needed as PMD creates one report per file - * by default. - * - *

This is synchronized on an internal lock (note that other mutation - * operations are not synchronized, todo for pmd 7). - * - * @param r the report to be merged into this. - * - * @see AbstractAccumulatingRenderer - * - * @deprecated Convert Renderer to use the reports. - */ - @Deprecated - public void merge(Report r) { - errors.addAll(r.errors); - configErrors.addAll(r.configErrors); - suppressedRuleViolations.addAll(r.suppressedRuleViolations); - - for (RuleViolation violation : r.getViolations()) { - addRuleViolation(violation); - } - } - - - /** - * Returns an unmodifiable list of violations that were suppressed. - */ - public List getSuppressedViolations() { - return Collections.unmodifiableList(suppressedRuleViolations); - } - - /** - * Returns an unmodifiable list of violations that have been - * recorded until now. None of those violations were suppressed. - * - *

The violations list is sorted with {@link RuleViolation#DEFAULT_COMPARATOR}. - */ - public List getViolations() { - return Collections.unmodifiableList(violations); - } - - - /** - * Returns an unmodifiable list of processing errors that have been - * recorded until now. - */ - public List getProcessingErrors() { - return Collections.unmodifiableList(errors); - } - - - /** - * Returns an unmodifiable list of configuration errors that have - * been recorded until now. - */ - public List getConfigurationErrors() { - return Collections.unmodifiableList(configErrors); - } - - /** - * Create a report by making side effects on a {@link FileAnalysisListener}. - * This wraps a {@link ReportBuilderListener}. - */ - public static Report buildReport(Consumer lambda) { - return BaseResultProducingCloseable.using(new ReportBuilderListener(), lambda); - } - - /** - * A {@link FileAnalysisListener} that accumulates events into a - * {@link Report}. - */ - public static /*final*/ class ReportBuilderListener extends BaseResultProducingCloseable implements FileAnalysisListener { - - private final Report report; - - public ReportBuilderListener() { - this(new Report()); - } - - ReportBuilderListener(Report report) { - this.report = report; - } - - @Override - protected Report getResultImpl() { - return report; - } - - @Override - public void onRuleViolation(net.sourceforge.pmd.reporting.RuleViolation violation) { - report.addRuleViolation(violation); - } - - @Override - public void onSuppressedRuleViolation(net.sourceforge.pmd.reporting.Report.SuppressedViolation violation) { - report.addSuppressedViolation(violation); - } - - @Override - public void onError(net.sourceforge.pmd.reporting.Report.ProcessingError error) { - report.addError(error); - } - - @Override - public String toString() { - return "ReportBuilderListener"; - } - } - - /** - * A {@link GlobalAnalysisListener} that accumulates the events of - * all files into a {@link Report}. - */ - public static /*final*/ class GlobalReportBuilderListener extends BaseResultProducingCloseable implements GlobalAnalysisListener { - - private final net.sourceforge.pmd.reporting.Report report = new net.sourceforge.pmd.reporting.Report(); - - @Override - public FileAnalysisListener startFileAnalysis(TextFile file) { - // note that the report is shared, but Report is now thread-safe - return new ReportBuilderListener(this.report); - } - - @Override - public void onConfigError(net.sourceforge.pmd.reporting.Report.ConfigurationError error) { - report.addConfigError(error); - } - - @Override - protected net.sourceforge.pmd.reporting.Report getResultImpl() { - return report; - } - } - - /** - * Creates a new report taking all the information from this report, - * but filtering the violations. - * - * @param filter when true, the violation will be kept. - * @return copy of this report - */ - @Experimental - public Report filterViolations(Predicate filter) { - Report copy = new Report(); - - for (RuleViolation violation : violations) { - if (filter.test(violation)) { - copy.addRuleViolation(violation); - } - } - - copy.suppressedRuleViolations.addAll(suppressedRuleViolations); - copy.errors.addAll(errors); - copy.configErrors.addAll(configErrors); - return copy; - } - - /** - * Creates a new report by combining this report with another report. - * This is similar to {@link #merge(Report)}, but instead a new report - * is created. The lowest start time and greatest end time are kept in the copy. - * - * @param other the other report to combine - * @return - */ - @Experimental - public Report union(Report other) { - Report copy = new Report(); - - for (RuleViolation violation : violations) { - copy.addRuleViolation(violation); - } - for (RuleViolation violation : other.violations) { - copy.addRuleViolation(violation); - } - - copy.suppressedRuleViolations.addAll(suppressedRuleViolations); - copy.suppressedRuleViolations.addAll(other.suppressedRuleViolations); - - copy.errors.addAll(errors); - copy.errors.addAll(other.errors); - copy.configErrors.addAll(configErrors); - copy.configErrors.addAll(other.configErrors); - - return copy; - } - - // ------------------- compat extensions -------------------- - @Deprecated - public Report filterViolations(net.sourceforge.pmd.util.Predicate filter) { - Predicate javaPredicate = filter::test; - return filterViolations(javaPredicate); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/Rule.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/Rule.java deleted file mode 100644 index 29116c858f..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/Rule.java +++ /dev/null @@ -1,321 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// Old version of this class. In PMD 7, this has been moved into sub-package "rule". -// Changes: -// - deepCopy - -package net.sourceforge.pmd; - -import java.util.List; -import java.util.Optional; -import java.util.regex.Pattern; - -import net.sourceforge.pmd.lang.Language; -import net.sourceforge.pmd.lang.LanguageProcessor; -import net.sourceforge.pmd.lang.LanguageVersion; -import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.rule.RulePriority; -import net.sourceforge.pmd.lang.rule.RuleSet; -import net.sourceforge.pmd.lang.rule.RuleTargetSelector; -import net.sourceforge.pmd.properties.PropertyDescriptor; -import net.sourceforge.pmd.properties.PropertyFactory; -import net.sourceforge.pmd.properties.PropertySource; -import net.sourceforge.pmd.reporting.RuleContext; - -/** - * This is the basic Rule interface for PMD rules. - * - *

- * Thread safety: PMD will create one instance of a rule per - * thread. The instances are not shared across different threads. However, a - * single rule instance is reused for analyzing multiple files. - *

- */ -public interface Rule extends PropertySource { - - // TODO these should not be properties - - /** - * The property descriptor to universally suppress violations with messages - * matching a regular expression. - */ - PropertyDescriptor> VIOLATION_SUPPRESS_REGEX_DESCRIPTOR = - PropertyFactory.regexProperty("violationSuppressRegex") - .desc("Suppress violations with messages matching a regular expression") - .toOptional("") - .defaultValue(Optional.empty()) - .build(); - - /** - * Name of the property to universally suppress violations on nodes which - * match a given relative XPath expression. - */ - PropertyDescriptor> VIOLATION_SUPPRESS_XPATH_DESCRIPTOR = - PropertyFactory.stringProperty("violationSuppressXPath") - .desc("Suppress violations on nodes which match a given relative XPath expression.") - .toOptional("") - .defaultValue(Optional.empty()) - .build(); - - /** - * Get the Language of this Rule. - * - * @return the language - */ - Language getLanguage(); - - /** - * Set the Language of this Rule. - * - * @param language - * the language - */ - void setLanguage(Language language); - - /** - * Get the minimum LanguageVersion to which this Rule applies. If this value - * is null it indicates there is no minimum bound. - * - * @return the minimum language version - */ - LanguageVersion getMinimumLanguageVersion(); - - /** - * Set the minimum LanguageVersion to which this Rule applies. - * - * @param minimumLanguageVersion - * the minimum language version - */ - void setMinimumLanguageVersion(LanguageVersion minimumLanguageVersion); - - /** - * Get the maximum LanguageVersion to which this Rule applies. If this value - * is null it indicates there is no maximum bound. - * - * @return the maximum language version - */ - LanguageVersion getMaximumLanguageVersion(); - - /** - * Set the maximum LanguageVersion to which this Rule applies. - * - * @param maximumLanguageVersion - * the maximum language version - */ - void setMaximumLanguageVersion(LanguageVersion maximumLanguageVersion); - - /** - * Gets whether this Rule is deprecated. A deprecated Rule is one which: - *
    - *
  • is scheduled for removal in a future version of PMD
  • - *
  • or, has been removed and replaced with a non-functioning place-holder - * and will be completely removed in a future version of PMD
  • - *
  • or, has been renamed/moved and the old name will be completely - * removed in a future version of PMD
  • - *
- * - * @return true if this rule is deprecated - */ - boolean isDeprecated(); - - /** - * Sets whether this Rule is deprecated. - * - * @param deprecated - * whether this rule is deprecated - */ - void setDeprecated(boolean deprecated); - - /** - * Get the name of this Rule. - * - * @return the name - */ - @Override - String getName(); - - /** - * Set the name of this Rule. - * - * @param name - * the name - */ - void setName(String name); - - /** - * Get the version of PMD in which this Rule was added. Return - * null if not applicable. - * - * @return version of PMD since when this rule was added - */ - String getSince(); - - /** - * Set the version of PMD in which this Rule was added. - * - * @param since - * the version of PMD since when this rule was added - */ - void setSince(String since); - - /** - * Get the implementation class of this Rule. - * - * @return the implementation class name of this rule. - */ - String getRuleClass(); - - /** - * Set the class of this Rule. - * - * @param ruleClass - * the class name of this rule. - */ - void setRuleClass(String ruleClass); - - /** - * Get the name of the RuleSet containing this Rule. - * - * @return the name of th ruleset containing this rule. - * @see RuleSet - */ - String getRuleSetName(); - - /** - * Set the name of the RuleSet containing this Rule. - * - * @param name - * the name of the ruleset containing this rule. - * @see RuleSet - */ - void setRuleSetName(String name); - - /** - * Get the message to show when this Rule identifies a violation. - * - * @return the message to show for a violation. - */ - String getMessage(); - - /** - * Set the message to show when this Rule identifies a violation. - * - * @param message - * the message to show for a violation. - */ - void setMessage(String message); - - /** - * Get the description of this Rule. - * - * @return the description - */ - String getDescription(); - - /** - * Set the description of this Rule. - * - * @param description - * the description - */ - void setDescription(String description); - - /** - * Get the list of examples for this Rule. - * - * @return the list of examples for this rule. - */ - List getExamples(); - - /** - * Add a single example for this Rule. - * - * @param example - * a single example to add - */ - void addExample(String example); - - /** - * Get a URL for external information about this Rule. - * - * @return the URL for external information about this rule. - */ - String getExternalInfoUrl(); - - /** - * Set a URL for external information about this Rule. - * - * @param externalInfoUrl - * the URL for external information about this rule. - */ - void setExternalInfoUrl(String externalInfoUrl); - - /** - * Get the priority of this Rule. - * - * @return the priority - */ - RulePriority getPriority(); - - /** - * Set the priority of this Rule. - * - * @param priority - * the priority - */ - void setPriority(RulePriority priority); - - - /** - * Returns the object that selects the nodes to which this rule applies. - * The selected nodes will be handed to {@link #apply(Node, RuleContext)}. - */ - RuleTargetSelector getTargetSelector(); - - /** - * Initialize the rule using the language processor if needed. - * - * @param languageProcessor The processor for the rule's language - */ - default void initialize(LanguageProcessor languageProcessor) { - // by default do nothing - } - - /** - * Start processing. Called once per file, before apply() is first called. - * - * @param ctx the rule context - */ - void start(RuleContext ctx); - - - /** - * Process the given node. The nodes that are fed to this method - * are the nodes selected by {@link #getTargetSelector()}. - * - * @param target Node on which to apply the rule - * @param ctx Rule context, handling violations - */ - void apply(Node target, RuleContext ctx); - - /** - * End processing. Called once per file, after apply() is last called. - * - * @param ctx - * the rule context - */ - void end(RuleContext ctx); - - /** - * Creates a new copy of this rule. - * @return A new exact copy of this rule - */ - net.sourceforge.pmd.lang.rule.Rule deepCopy(); - - // new method to be compatible with PMD 6 - Rule has changed package - default Rule deepCopy$$bridge() { // SUPPRESS CHECKSTYLE ignore - return deepCopy(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/RulePriority.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/RulePriority.java deleted file mode 100644 index c624f1200e..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/RulePriority.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// Copy of net.sourceforge.pmd.lang.rule.RulePriority -// Added method: -// - asPMD7RulePriority - -package net.sourceforge.pmd; - -/** - * These are the possible Rule priority values. - * - * For backward compatibility, priorities range in value from 1 to 5, with 5 - * being the lowest priority. This means the ordinal value of the Enum should be - * avoided in favor of {@link RulePriority#getPriority()} and - * {@link RulePriority#valueOf(int)} - * - * @see How - * to define rules priority - */ -public enum RulePriority { - - /** High: Change absolutely required. Behavior is critically broken/buggy */ - HIGH(1, "High"), - /** - * Medium to high: Change highly recommended. Behavior is quite likely to be - * broken/buggy. - */ - MEDIUM_HIGH(2, "Medium High"), - /** - * Medium: Change recommended. Behavior is confusing, perhaps buggy, and/or - * against standards/best practices. - */ - MEDIUM(3, "Medium"), - /** - * Medium to low: Change optional. Behavior is not likely to be buggy, but - * more just flies in the face of standards/style/good taste. - */ - MEDIUM_LOW(4, "Medium Low"), - /** - * Low: Change highly optional. Nice to have, such as a consistent naming - * policy for package/class/fields... - */ - LOW(5, "Low"); - - private final int priority; - private final String name; - - RulePriority(int priority, String name) { - this.priority = priority; - this.name = name; - } - - /** - * Get the priority value as a number. This is the value to be used in the - * externalized form of a priority (e.g. in RuleSet XML). - * - * @return The int value of the priority. - */ - public int getPriority() { - return priority; - } - - /** - * Get the descriptive name of this priority. - * - * @return The descriptive name. - */ - public String getName() { - return name; - } - - /** - * Returns the descriptive name of the priority. - * - * @return descriptive name of the priority - * @see #getName() - */ - @Override - public String toString() { - return name; - } - - /** - * Get the priority which corresponds to the given number as returned by - * {@link RulePriority#getPriority()}. If the number is an invalid value, - * then {@link RulePriority#LOW} will be returned. - * - * @param priority - * The numeric priority value. - * @return The priority. - */ - public static RulePriority valueOf(int priority) { - try { - return RulePriority.values()[priority - 1]; - } catch (ArrayIndexOutOfBoundsException e) { - return LOW; - } - } - - /** - * Returns the priority which corresponds to the given number as returned by - * {@link RulePriority#getPriority()}. If the number is an invalid value, - * then null will be returned. - * - * @param priority The numeric priority value. - */ - public static RulePriority valueOfNullable(int priority) { - try { - return RulePriority.values()[priority - 1]; - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } - } - - /** - * Returns the priority which corresponds to the given number as returned by - * {@link RulePriority#getPriority()}. If the number is an invalid value, - * then null will be returned. - * - * @param priority The numeric priority value. - */ - public static RulePriority valueOfNullable(String priority) { - try { - int integer = Integer.parseInt(priority); - return RulePriority.values()[integer - 1]; - } catch (ArrayIndexOutOfBoundsException | NumberFormatException e) { - return null; - } - } - - // ---- compatibility extensions - - public net.sourceforge.pmd.lang.rule.RulePriority asPMD7RulePriority() { - return net.sourceforge.pmd.lang.rule.RulePriority.valueOf(name()); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetFactoryCompatibility.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetFactoryCompatibility.java deleted file mode 100644 index 2e79697725..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetFactoryCompatibility.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Before removing RuleSetFactoryCompatibility (#4314) - -package net.sourceforge.pmd; - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Provides a simple filter mechanism to avoid failing to parse an old ruleset, - * which references rules, that have either been removed from PMD already or - * renamed or moved to another ruleset. - * - * @see issue 1360 - */ -final class RuleSetFactoryCompatibility { - - static final RuleSetFactoryCompatibility EMPTY = new RuleSetFactoryCompatibility(); - /** The instance with the built-in filters for the modified PMD rules. */ - static final RuleSetFactoryCompatibility DEFAULT = new RuleSetFactoryCompatibility(); - - - static { - // PMD 5.3.0 - DEFAULT.addFilterRuleRenamed("java", "design", "UncommentedEmptyMethod", "UncommentedEmptyMethodBody"); - DEFAULT.addFilterRuleRemoved("java", "controversial", "BooleanInversion"); - - // PMD 5.3.1 - DEFAULT.addFilterRuleRenamed("java", "design", "UseSingleton", "UseUtilityClass"); - - // PMD 5.4.0 - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyCatchBlock"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyIfStatement"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyWhileStmt"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyTryBlock"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyFinallyBlock"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptySwitchStatements"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptySynchronizedBlock"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyStatementNotInLoop"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyInitializer"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyStatementBlock"); - DEFAULT.addFilterRuleMoved("java", "basic", "empty", "EmptyStaticInitializer"); - DEFAULT.addFilterRuleMoved("java", "basic", "unnecessary", "UnnecessaryConversionTemporary"); - DEFAULT.addFilterRuleMoved("java", "basic", "unnecessary", "UnnecessaryReturn"); - DEFAULT.addFilterRuleMoved("java", "basic", "unnecessary", "UnnecessaryFinalModifier"); - DEFAULT.addFilterRuleMoved("java", "basic", "unnecessary", "UselessOverridingMethod"); - DEFAULT.addFilterRuleMoved("java", "basic", "unnecessary", "UselessOperationOnImmutable"); - DEFAULT.addFilterRuleMoved("java", "basic", "unnecessary", "UnusedNullCheckInEquals"); - DEFAULT.addFilterRuleMoved("java", "basic", "unnecessary", "UselessParentheses"); - - // PMD 5.6.0 - DEFAULT.addFilterRuleRenamed("java", "design", "AvoidConstantsInterface", "ConstantsInInterface"); - // unused/UnusedModifier moved AND renamed, order is important! - DEFAULT.addFilterRuleMovedAndRenamed("java", "unusedcode", "UnusedModifier", "unnecessary", "UnnecessaryModifier"); - - // PMD 6.0.0 - DEFAULT.addFilterRuleMoved("java", "controversial", "unnecessary", "UnnecessaryParentheses"); - DEFAULT.addFilterRuleRenamed("java", "unnecessary", "UnnecessaryParentheses", "UselessParentheses"); - DEFAULT.addFilterRuleMoved("java", "typeresolution", "coupling", "LooseCoupling"); - DEFAULT.addFilterRuleMoved("java", "typeresolution", "clone", "CloneMethodMustImplementCloneable"); - DEFAULT.addFilterRuleMoved("java", "typeresolution", "imports", "UnusedImports"); - DEFAULT.addFilterRuleMoved("java", "typeresolution", "strictexception", "SignatureDeclareThrowsException"); - DEFAULT.addFilterRuleRenamed("java", "naming", "MisleadingVariableName", "MIsLeadingVariableName"); - DEFAULT.addFilterRuleRenamed("java", "unnecessary", "UnnecessaryFinalModifier", "UnnecessaryModifier"); - DEFAULT.addFilterRuleRenamed("java", "empty", "EmptyStaticInitializer", "EmptyInitializer"); - // GuardLogStatementJavaUtil moved and renamed... - DEFAULT.addFilterRuleMovedAndRenamed("java", "logging-java", "GuardLogStatementJavaUtil", "logging-jakarta-commons", "GuardLogStatement"); - DEFAULT.addFilterRuleRenamed("java", "logging-jakarta-commons", "GuardDebugLogging", "GuardLogStatement"); - - } - - - private static final Logger LOG = LoggerFactory.getLogger(RuleSetFactoryCompatibility.class); - - private final List filters = new ArrayList<>(); - - - void addFilterRuleMovedAndRenamed(String language, String oldRuleset, String oldName, String newRuleset, String newName) { - filters.add(RuleSetFilter.ruleMoved(language, oldRuleset, newRuleset, oldName)); - filters.add(RuleSetFilter.ruleRenamed(language, newRuleset, oldName, newName)); - } - - void addFilterRuleRenamed(String language, String ruleset, String oldName, String newName) { - filters.add(RuleSetFilter.ruleRenamed(language, ruleset, oldName, newName)); - } - - void addFilterRuleMoved(String language, String oldRuleset, String newRuleset, String ruleName) { - filters.add(RuleSetFilter.ruleMoved(language, oldRuleset, newRuleset, ruleName)); - } - - void addFilterRuleRemoved(String language, String ruleset, String name) { - filters.add(RuleSetFilter.ruleRemoved(language, ruleset, name)); - } - - @Nullable String applyRef(String ref) { - return applyRef(ref, false); - } - - - /** - * Returns the new rule ref, or null if the rule was deleted. Returns - * the argument if no replacement is needed. - * - * @param ref Original ref - * @param warn Whether to output a warning if a replacement is done - */ - public @Nullable String applyRef(String ref, boolean warn) { - String result = ref; - for (RuleSetFilter filter : filters) { - result = filter.applyRef(result, warn); - if (result == null) { - return null; - } - } - return result; - } - - /** - * Returns the new rule name, or null if the rule was deleted. Returns - * the argument if no replacement is needed. - * - * @param rulesetRef Ruleset name - * @param excludeName Original excluded name - * @param warn Whether to output a warning if a replacement is done - */ - public @Nullable String applyExclude(String rulesetRef, String excludeName, boolean warn) { - String result = excludeName; - for (RuleSetFilter filter : filters) { - result = filter.applyExclude(rulesetRef, result, warn); - if (result == null) { - return null; - } - } - return result; - } - - private static final class RuleSetFilter { - - private static final String MOVED_MESSAGE = "The rule \"{1}\" has been moved from ruleset \"{0}\" to \"{2}\". Please change your ruleset!"; - private static final String RENAMED_MESSAGE = "The rule \"{1}\" has been renamed to \"{3}\". Please change your ruleset!"; - private static final String REMOVED_MESSAGE = "The rule \"{1}\" in ruleset \"{0}\" has been removed from PMD and no longer exists. Please change your ruleset!"; - private final String ruleRef; - private final String oldRuleset; - private final String oldName; - private final String newRuleset; - private final String newName; - private final String logMessage; - - private RuleSetFilter(String oldRuleset, - String oldName, - @Nullable String newRuleset, - @Nullable String newName, - String logMessage) { - this.oldRuleset = oldRuleset; - this.oldName = oldName; - this.newRuleset = newRuleset; - this.newName = newName; - this.logMessage = logMessage; - this.ruleRef = oldRuleset + "/" + oldName; - } - - public static RuleSetFilter ruleRenamed(String language, String ruleset, String oldName, String newName) { - String base = "rulesets/" + language + "/" + ruleset + ".xml"; - return new RuleSetFilter(base, oldName, base, newName, RENAMED_MESSAGE); - } - - public static RuleSetFilter ruleMoved(String language, String oldRuleset, String newRuleset, String ruleName) { - String base = "rulesets/" + language + "/"; - return new RuleSetFilter(base + oldRuleset + ".xml", ruleName, - base + newRuleset + ".xml", ruleName, - MOVED_MESSAGE); - } - - public static RuleSetFilter ruleRemoved(String language, String ruleset, String name) { - String oldRuleset = "rulesets/" + language + "/" + ruleset + ".xml"; - return new RuleSetFilter(oldRuleset, name, - null, null, - REMOVED_MESSAGE); - } - - @Nullable String applyExclude(String ref, String name, boolean warn) { - if (oldRuleset.equals(ref) - && oldName.equals(name) - && oldRuleset.equals(newRuleset)) { - if (warn) { - warn(); - } - - return newName; - } - - return name; - } - - @Nullable String applyRef(String ref, boolean warn) { - - if (ref.equals(this.ruleRef)) { - - if (warn) { - warn(); - } - - if (newName != null) { - return newRuleset + "/" + newName; - } else { - // deleted - return null; - } - } - - return ref; - } - - private void warn() { - if (LOG.isWarnEnabled()) { - String log = MessageFormat.format(logMessage, oldRuleset, oldName, newRuleset, newName); - LOG.warn("Applying rule set filter: {}", log); - } - } - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java deleted file mode 100644 index 4af60a4d22..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd; - -import org.checkerframework.checker.nullness.qual.NonNull; - -public class RuleSetLoadException extends net.sourceforge.pmd.lang.rule.RuleSetLoadException { - public RuleSetLoadException(RuleSetReferenceId rsetId, @NonNull Throwable cause) { - super(rsetId, cause); - } - - public RuleSetLoadException(RuleSetReferenceId rsetId, String message) { - super(rsetId, message); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetLoader.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetLoader.java deleted file mode 100644 index 20e91f3069..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetLoader.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// Copy from PMD 7 with minimized functionality. -// Only the methods called by maven-pmd-plugin are kept, -// but they do nothing. That means, that maven-pmd-plugin can't report deprecated -// rules properly anymore. -// The ruleset for actual PMD analysis is loaded by PMD itself later on, and not -// through this class. - -package net.sourceforge.pmd; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import net.sourceforge.pmd.lang.rule.RuleSet; - -public final class RuleSetLoader { - public RuleSetLoader warnDeprecated(boolean warn) { - return this; - } - - public List loadFromResources(Collection paths) { - return Collections.emptyList(); - } - - public static RuleSetLoader fromPmdConfig(PMDConfiguration configuration) { - return new RuleSetLoader(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java deleted file mode 100644 index 0cb348899a..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd; - -public class RuleSetReferenceId extends net.sourceforge.pmd.lang.rule.internal.RuleSetReferenceId { - public RuleSetReferenceId(String id) { - super(id); - } - - public RuleSetReferenceId(String id, RuleSetReferenceId externalRuleSetReferenceId) { - super(id, externalRuleSetReferenceId); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSets.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSets.java deleted file mode 100644 index 7ee5ec4daa..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleSets.java +++ /dev/null @@ -1,222 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// And it is kept in the old package. -// The moved class is in net.sourceforge.pmd.lang.rule.internal - -package net.sourceforge.pmd; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import net.sourceforge.pmd.benchmark.TimeTracker; -import net.sourceforge.pmd.benchmark.TimedOperation; -import net.sourceforge.pmd.benchmark.TimedOperationCategory; -import net.sourceforge.pmd.lang.LanguageProcessorRegistry; -import net.sourceforge.pmd.lang.ast.RootNode; -import net.sourceforge.pmd.lang.document.TextFile; -import net.sourceforge.pmd.lang.rule.InternalApiBridge; -import net.sourceforge.pmd.lang.rule.Rule; -import net.sourceforge.pmd.lang.rule.RuleSet; -import net.sourceforge.pmd.lang.rule.internal.RuleApplicator; -import net.sourceforge.pmd.reporting.FileAnalysisListener; -import net.sourceforge.pmd.util.log.PmdReporter; - -/** - * Grouping of Rules per Language in a RuleSet. - * - * @author pieter_van_raemdonck - Application Engineers NV/SA - www.ae.be - */ -public class RuleSets { - - private final List ruleSets; - - private RuleApplicator ruleApplicator; - - /** - * Copy constructor. Deep copies RuleSets. - * - * @param ruleSets The RuleSets to copy. - */ - public RuleSets(final RuleSets ruleSets) { - List rsets = new ArrayList<>(); - for (final RuleSet rs : ruleSets.ruleSets) { - rsets.add(new RuleSet(rs)); - } - this.ruleSets = Collections.unmodifiableList(rsets); - } - - public RuleSets(Collection ruleSets) { - this.ruleSets = Collections.unmodifiableList(new ArrayList<>(ruleSets)); - } - - /** - * Public constructor. Add the given rule set. - * - * @param ruleSet the RuleSet - */ - public RuleSets(RuleSet ruleSet) { - this.ruleSets = Collections.singletonList(ruleSet); - } - - public void initializeRules(LanguageProcessorRegistry lpReg, PmdReporter reporter) { - // this is abusing the mutability of RuleSet, will go away eventually. - for (RuleSet rset : ruleSets) { - for (Iterator iterator = rset.getRules().iterator(); iterator.hasNext();) { - Rule rule = iterator.next(); - try { - rule.initialize(lpReg.getProcessor(rule.getLanguage())); - } catch (Exception e) { - reporter.errorEx( - "Exception while initializing rule " + rule.getName() + ", the rule will not be run", e); - iterator.remove(); - } - } - } - } - - private RuleApplicator prepareApplicator() { - return RuleApplicator.build(ruleSets.stream().flatMap(it -> it.getRules().stream())::iterator); - } - - /** - * Get all the RuleSets. - * - * @return RuleSet[] - */ - public RuleSet[] getAllRuleSets() { - return ruleSets.toArray(new RuleSet[0]); - } - - // internal - List getRuleSetsInternal() { - return ruleSets; - } - - public Iterator getRuleSetsIterator() { - return ruleSets.iterator(); - } - - /** - * Return all rules from all rulesets. - * - * @return Set - */ - public Set getAllRules() { - Set result = new HashSet<>(); - for (RuleSet r : ruleSets) { - result.addAll(r.getRules()); - } - return result; - } - - /** - * Check if a given source file should be checked by rules in this RuleSets. - * - * @param file - * the source file to check - * @return true if the file should be checked, - * false otherwise - */ - public boolean applies(TextFile file) { - for (RuleSet ruleSet : ruleSets) { - if (InternalApiBridge.ruleSetApplies(ruleSet, file.getFileId())) { - return true; - } - } - return false; - } - - /** - * Apply all applicable rules to the compilation units. Applicable means the - * language of the rules must match the language of the source (@see - * applies). - * - * @param root the List of compilation units; the type these must have, - * depends on the source language - * @param listener Listener that will handle events while analysing. - */ - public void apply(RootNode root, FileAnalysisListener listener) { - if (ruleApplicator == null) { - // initialize here instead of ctor, because some rules properties - // are set after creating the ruleset, and jaxen xpath queries - // initialize their XPath expressions when calling getRuleChainVisits()... fixme - this.ruleApplicator = prepareApplicator(); - } - - try (TimedOperation ignored = TimeTracker.startOperation(TimedOperationCategory.RULE_AST_INDEXATION)) { - ruleApplicator.index(root); - } - - for (RuleSet ruleSet : ruleSets) { - if (InternalApiBridge.ruleSetApplies(ruleSet, root.getTextDocument().getFileId())) { - ruleApplicator.apply(ruleSet.getRules(), listener); - } - } - } - - /** - * Returns the first Rule found with the given name. - * - * Note: Since we support multiple languages, rule names are not expected to - * be unique within any specific ruleset. - * - * @param ruleName - * the exact name of the rule to find - * @return the rule or null if not found - */ - public Rule getRuleByName(String ruleName) { - Rule rule = null; - for (Iterator i = ruleSets.iterator(); i.hasNext() && rule == null;) { - RuleSet ruleSet = i.next(); - rule = ruleSet.getRuleByName(ruleName); - } - return rule; - } - - /** - * Determines the total count of rules that are used in all rule sets. - * - * @return the count - */ - public int ruleCount() { - int count = 0; - for (RuleSet r : ruleSets) { - count += r.getRules().size(); - } - return count; - } - - - /** - * Remove and collect any rules that report problems. - * - * @param collector - */ - public void removeDysfunctionalRules(Collection collector) { - for (RuleSet ruleSet : ruleSets) { - ruleSet.removeDysfunctionalRules(collector); - } - } - - /** - * Retrieves a checksum of the rulesets being used. Any change to any rule - * of any ruleset should trigger a checksum change. - * - * @return The checksum for this ruleset collection. - */ - public long getChecksum() { - long checksum = 1; - for (final RuleSet ruleSet : ruleSets) { - checksum = checksum * 31 + ruleSet.getChecksum(); - } - return checksum; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleViolation.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleViolation.java deleted file mode 100644 index b1d685bf46..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/RuleViolation.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: -// - getFilename -// - getRule returns n.s.pmd.rule.Rule or the old n.s.pmd.Rule - -package net.sourceforge.pmd; - -import java.util.Comparator; -import java.util.Map; - -import net.sourceforge.pmd.annotation.DeprecatedUntil700; -import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.document.FileLocation; - -/** - * A RuleViolation is created by a Rule when it identifies a violation of the - * Rule constraints. RuleViolations are simple data holders that are collected - * into a {@link Report}. - * - *

Since PMD 6.21.0, implementations of this interface are considered internal - * API and hence deprecated. Clients should exclusively use this interface. - * - * @see Rule - */ -public interface RuleViolation { - // todo move to package reporting - - /** - * A comparator for rule violations. This compares all exposed attributes - * of a violation, filename first. The remaining parameters are compared - * in an unspecified order. - */ - Comparator DEFAULT_COMPARATOR = - Comparator.comparing(RuleViolation::getFileId) - .thenComparingInt(RuleViolation::getBeginLine) - .thenComparingInt(RuleViolation::getBeginColumn) - .thenComparing(RuleViolation::getDescription, Comparator.nullsLast(Comparator.naturalOrder())) - .thenComparingInt(RuleViolation::getEndLine) - .thenComparingInt(RuleViolation::getEndColumn) - .thenComparing(rv -> rv.getRule().getName()); - - - /** - * Key in {@link #getAdditionalInfo()} for the name of the class in - * which the violation was identified. - */ - String CLASS_NAME = "className"; - /** - * Key in {@link #getAdditionalInfo()} for the name of the variable - * related to the violation. - */ - String VARIABLE_NAME = "variableName"; - /** - * Key in {@link #getAdditionalInfo()} for the name of the method in - * which the violation was identified. - */ - String METHOD_NAME = "methodName"; - /** - * Key in {@link #getAdditionalInfo()} for the name of the package in - * which the violation was identified. - */ - String PACKAGE_NAME = "packageName"; - - /** - * Get the Rule which identified this violation. - * - * @return The identifying Rule. - */ - net.sourceforge.pmd.lang.rule.Rule getRule(); - - /** - * Get the description of this violation. - * - * @return The description. - */ - String getDescription(); - - - /** - * Returns the location where the violation should be reported. - */ - FileLocation getLocation(); - - /** - * Return the ID of the file where the violation was found. - */ - default FileId getFileId() { - return getLocation().getFileId(); - } - - /** - * Get the begin line number in the source file in which this violation was - * identified. - * - * @return Begin line number. - */ - default int getBeginLine() { - return getLocation().getStartPos().getLine(); - } - - /** - * Get the column number of the begin line in the source file in which this - * violation was identified. - * - * @return Begin column number. - */ - default int getBeginColumn() { - return getLocation().getStartPos().getColumn(); - } - - /** - * Get the end line number in the source file in which this violation was - * identified. - * - * @return End line number. - */ - default int getEndLine() { - return getLocation().getEndPos().getLine(); - } - - /** - * Get the column number of the end line in the source file in which this - * violation was identified. - * - * @return End column number. - */ - default int getEndColumn() { - return getLocation().getEndPos().getColumn(); - } - - /** - * A map of additional key-value pairs known about this violation. - * What data is in there is language specific. Common keys supported - * by several languages are defined as constants on this interface. - * The map is unmodifiable. - */ - Map getAdditionalInfo(); - - - /** - * Get the package name of the Class in which this violation was identified. - * - * @return The package name. - * - * @deprecated Use {@link #PACKAGE_NAME} - */ - @Deprecated - @DeprecatedUntil700 - default String getPackageName() { - return getAdditionalInfo().get(PACKAGE_NAME); - } - - /** - * Get the name of the Class in which this violation was identified. - * - * @return The Class name. - * @deprecated Use {@link #CLASS_NAME} - */ - @Deprecated - @DeprecatedUntil700 - default String getClassName() { - return getAdditionalInfo().get(CLASS_NAME); - } - - /** - * Get the method name in which this violation was identified. - * - * @return The method name. - * @deprecated Use {@link #METHOD_NAME} - */ - @Deprecated - @DeprecatedUntil700 - default String getMethodName() { - return getAdditionalInfo().get(METHOD_NAME); - } - - /** - * Get the variable name on which this violation was identified. - * - * @return The variable name. - * @deprecated Use {@link #VARIABLE_NAME} - */ - @Deprecated - @DeprecatedUntil700 - default String getVariableName() { - return getAdditionalInfo().get(VARIABLE_NAME); - } - - // ------------------- compat extensions -------------------- - @Deprecated - default String getFilename() { - return getLocation().getFileId().getFileName(); - } - - // returns the PMD 6 compatible Rule - default net.sourceforge.pmd.Rule getRule$$bridge() { // SUPPRESS CHECKSTYLE ignore - return getRule(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/annotation/DeprecatedUntil700.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/annotation/DeprecatedUntil700.java deleted file mode 100644 index c74f37fc42..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/annotation/DeprecatedUntil700.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// Moved from pmd-core 7.0.0-SNAPSHOT - -package net.sourceforge.pmd.annotation; - -/** - * Tags a deprecated member that should not be removed before PMD 7.0.0. - * Such members were made deprecated on the PMD 7 development branch and - * may be kept for backwards compatibility on the day of the PMD 7 release, - * because the replacement API cannot be backported to PMD 6. - */ -public @interface DeprecatedUntil700 { -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java deleted file mode 100644 index c6d1d84760..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.cpd; - -import java.io.FilenameFilter; -import java.util.Arrays; -import java.util.List; -import java.util.Properties; - -import net.sourceforge.pmd.util.filter.Filters; - -public abstract class AbstractLanguage implements Language { - private final String name; - private final String terseName; - private final Tokenizer tokenizer; - private final FilenameFilter fileFilter; - private final List extensions; - - public AbstractLanguage(String name, String terseName, Tokenizer tokenizer, String... extensions) { - this.name = name; - this.terseName = terseName; - this.tokenizer = tokenizer; - fileFilter = Filters.toFilenameFilter(Filters.getFileExtensionOrDirectoryFilter(extensions)); - this.extensions = Arrays.asList(extensions); - } - - @Override - public FilenameFilter getFileFilter() { - return fileFilter; - } - - @Override - public Tokenizer getTokenizer() { - return tokenizer; - } - - @Override - public void setProperties(Properties properties) { - // needs to be implemented by subclasses. - } - - @Override - public String getName() { - return name; - } - - @Override - public String getTerseName() { - return terseName; - } - - @Override - public List getExtensions() { - return extensions; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPD.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPD.java deleted file mode 100644 index c570dcec07..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPD.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import net.sourceforge.pmd.internal.util.FileFinder; -import net.sourceforge.pmd.internal.util.IOUtil; - -/** - * Adapter for PMD 7. This exposes CPD interface of PMD 6 but runs PMD 7 under the hood. - */ -public class CPD { - private final CPDConfiguration configuration; - private final List files = new ArrayList<>(); - private Set current = new HashSet<>(); - private CPDReport report; - - public CPD(CPDConfiguration configuration) { - this.configuration = configuration; - } - - public void addAllInDirectory(File dir) throws IOException { - addDirectory(dir, false); - } - - public void addRecursively(File dir) throws IOException { - addDirectory(dir, true); - } - - public void add(List files) throws IOException { - for (File f : files) { - add(f); - } - } - - private void addDirectory(File dir, boolean recurse) throws IOException { - if (!dir.exists()) { - throw new FileNotFoundException("Couldn't find directory " + dir); - } - FileFinder finder = new FileFinder(); - // TODO - could use SourceFileSelector here - add(finder.findFilesFrom(dir, configuration.filenameFilter(), recurse)); - } - - public void add(File file) throws IOException { - if (configuration.isSkipDuplicates()) { - // TODO refactor this thing into a separate class - String signature = file.getName() + '_' + file.length(); - if (current.contains(signature)) { - System.err.println("Skipping " + file.getAbsolutePath() - + " since it appears to be a duplicate file and --skip-duplicate-files is set"); - return; - } - current.add(signature); - } - - if (!IOUtil.equalsNormalizedPaths(file.getAbsoluteFile().getCanonicalPath(), file.getAbsolutePath())) { - System.err.println("Skipping " + file + " since it appears to be a symlink"); - return; - } - - if (!file.exists()) { - System.err.println("Skipping " + file + " since it doesn't exist (broken symlink?)"); - return; - } - - files.add(file.toPath()); - } - - public void go() { - try (CpdAnalysis cpd = CpdAnalysis.create(configuration)) { - files.forEach(cpd.files()::addFile); - cpd.performAnalysis(this::collectReport); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - private void collectReport(CPDReport cpdReport) { - this.report = cpdReport; - } - - public Iterator getMatches() { - return report.getMatches().iterator(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java deleted file mode 100644 index c49b21586c..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java +++ /dev/null @@ -1,345 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: setLanguage, setSourceEncoding, filenameFilter - -package net.sourceforge.pmd.cpd; - -import java.beans.IntrospectionException; -import java.beans.PropertyDescriptor; -import java.io.File; -import java.io.FilenameFilter; -import java.lang.reflect.Method; -import java.nio.charset.Charset; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.slf4j.LoggerFactory; - -import net.sourceforge.pmd.AbstractConfiguration; -import net.sourceforge.pmd.cpd.internal.CpdLanguagePropertiesDefaults; -import net.sourceforge.pmd.internal.util.FileFinder; -import net.sourceforge.pmd.internal.util.FileUtil; -import net.sourceforge.pmd.lang.LanguageRegistry; -import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; -import net.sourceforge.pmd.lang.java.JavaLanguageModule; -import net.sourceforge.pmd.lang.jsp.JspLanguageModule; -import net.sourceforge.pmd.util.log.internal.SimpleMessageReporter; - -/** - * - * @author Brian Remedios - * @author Romain Pelisse - <belaran@gmail.com> - */ -public class CPDConfiguration extends AbstractConfiguration { - - public static final String DEFAULT_LANGUAGE = "java"; - public static final String DEFAULT_RENDERER = "text"; - - private static final Map> RENDERERS = new HashMap<>(); - - - static { - RENDERERS.put(DEFAULT_RENDERER, SimpleRenderer.class); - RENDERERS.put("xml", XMLRenderer.class); - RENDERERS.put("csv", CSVRenderer.class); - RENDERERS.put("csv_with_linecount_per_file", CSVWithLinecountPerFileRenderer.class); - RENDERERS.put("vs", VSRenderer.class); - } - - - private int minimumTileSize; - - private boolean skipDuplicates; - - private String rendererName = DEFAULT_RENDERER; - - private @Nullable CPDReportRenderer cpdReportRenderer; - - private boolean ignoreLiterals; - - private boolean ignoreIdentifiers; - - private boolean ignoreAnnotations; - - private boolean ignoreUsings; - - private boolean ignoreLiteralSequences = false; - - private boolean ignoreIdentifierAndLiteralSequences = false; - - private boolean skipLexicalErrors = false; - - private boolean noSkipBlocks = false; - - private String skipBlocksPattern = CpdLanguagePropertiesDefaults.DEFAULT_SKIP_BLOCKS_PATTERN; - - private boolean help; - - private boolean failOnViolation = true; - - - public CPDConfiguration() { - this(LanguageRegistry.CPD); - } - - public CPDConfiguration(LanguageRegistry languageRegistry) { - super(languageRegistry, new SimpleMessageReporter(LoggerFactory.getLogger(CpdAnalysis.class))); - } - - @Override - public void setSourceEncoding(Charset sourceEncoding) { - super.setSourceEncoding(sourceEncoding); - if (cpdReportRenderer != null) { - setRendererEncoding(cpdReportRenderer, sourceEncoding); - } - } - - static CPDReportRenderer createRendererByName(String name, Charset encoding) { - if (name == null || "".equals(name)) { - name = DEFAULT_RENDERER; - } - Class rendererClass = RENDERERS.get(name.toLowerCase(Locale.ROOT)); - if (rendererClass == null) { - Class klass; - try { - klass = Class.forName(name); - if (CPDReportRenderer.class.isAssignableFrom(klass)) { - rendererClass = (Class) klass; - } else { - throw new IllegalArgumentException("Class " + name + " does not implement " + CPDReportRenderer.class); - } - } catch (ClassNotFoundException e) { - throw new IllegalArgumentException("Cannot find class " + name); - } - } - - CPDReportRenderer renderer; - try { - renderer = rendererClass.getDeclaredConstructor().newInstance(); - setRendererEncoding(renderer, encoding); - } catch (Exception e) { - System.err.println("Couldn't instantiate renderer, defaulting to SimpleRenderer: " + e); - renderer = new SimpleRenderer(); - } - return renderer; - } - - private static void setRendererEncoding(@NonNull Object renderer, Charset encoding) { - try { - PropertyDescriptor encodingProperty = new PropertyDescriptor("encoding", renderer.getClass()); - Method method = encodingProperty.getWriteMethod(); - if (method == null) { - return; - } - if (method.getParameterTypes()[0] == Charset.class) { - method.invoke(renderer, encoding); - } else if (method.getParameterTypes()[0] == String.class) { - method.invoke(renderer, encoding.name()); - } - } catch (IntrospectionException | ReflectiveOperationException ignored) { - // ignored - maybe this renderer doesn't have a encoding property - } - } - - public static Set getRenderers() { - return Collections.unmodifiableSet(RENDERERS.keySet()); - } - - public int getMinimumTileSize() { - return minimumTileSize; - } - - public void setMinimumTileSize(int minimumTileSize) { - this.minimumTileSize = minimumTileSize; - } - - public boolean isSkipDuplicates() { - return skipDuplicates; - } - - public void setSkipDuplicates(boolean skipDuplicates) { - this.skipDuplicates = skipDuplicates; - } - - public String getRendererName() { - return rendererName; - } - - public void setRendererName(String rendererName) { - this.rendererName = rendererName; - if (rendererName == null) { - this.cpdReportRenderer = null; - } - this.cpdReportRenderer = createRendererByName(rendererName, getSourceEncoding()); - } - - - public CPDReportRenderer getCPDReportRenderer() { - return cpdReportRenderer; - } - - void setRenderer(CPDReportRenderer renderer) { - this.cpdReportRenderer = renderer; - } - - public boolean isIgnoreLiterals() { - return ignoreLiterals; - } - - public void setIgnoreLiterals(boolean ignoreLiterals) { - this.ignoreLiterals = ignoreLiterals; - } - - public boolean isIgnoreIdentifiers() { - return ignoreIdentifiers; - } - - public void setIgnoreIdentifiers(boolean ignoreIdentifiers) { - this.ignoreIdentifiers = ignoreIdentifiers; - } - - public boolean isIgnoreAnnotations() { - return ignoreAnnotations; - } - - public void setIgnoreAnnotations(boolean ignoreAnnotations) { - this.ignoreAnnotations = ignoreAnnotations; - } - - public boolean isIgnoreUsings() { - return ignoreUsings; - } - - public void setIgnoreUsings(boolean ignoreUsings) { - this.ignoreUsings = ignoreUsings; - } - - public boolean isIgnoreLiteralSequences() { - return ignoreLiteralSequences; - } - - public void setIgnoreLiteralSequences(boolean ignoreLiteralSequences) { - this.ignoreLiteralSequences = ignoreLiteralSequences; - } - - public boolean isIgnoreIdentifierAndLiteralSequences() { - return ignoreIdentifierAndLiteralSequences; - } - - public void setIgnoreIdentifierAndLiteralSequences(boolean ignoreIdentifierAndLiteralSequences) { - this.ignoreIdentifierAndLiteralSequences = ignoreIdentifierAndLiteralSequences; - } - - public boolean isSkipLexicalErrors() { - return skipLexicalErrors; - } - - public void setSkipLexicalErrors(boolean skipLexicalErrors) { - this.skipLexicalErrors = skipLexicalErrors; - } - - public boolean isHelp() { - return help; - } - - public void setHelp(boolean help) { - this.help = help; - } - - public boolean isNoSkipBlocks() { - return noSkipBlocks; - } - - public void setNoSkipBlocks(boolean noSkipBlocks) { - this.noSkipBlocks = noSkipBlocks; - } - - public String getSkipBlocksPattern() { - return skipBlocksPattern; - } - - public void setSkipBlocksPattern(String skipBlocksPattern) { - this.skipBlocksPattern = skipBlocksPattern; - } - - public boolean isFailOnViolation() { - return failOnViolation; - } - - public void setFailOnViolation(boolean failOnViolation) { - this.failOnViolation = failOnViolation; - } - - // ------------------- compat extensions -------------------- - private FilenameFilter filenameFilter; - - public void setLanguage(Language language) { - if (language instanceof JavaLanguage) { - filenameFilter = language.getFileFilter(); - setForceLanguageVersion(JavaLanguageModule.getInstance().getDefaultVersion()); - } else if (language instanceof EcmascriptLanguage) { - filenameFilter = language.getFileFilter(); - setForceLanguageVersion(EcmascriptLanguageModule.getInstance().getDefaultVersion()); - } else if (language instanceof JSPLanguage) { - filenameFilter = language.getFileFilter(); - setForceLanguageVersion(JspLanguageModule.getInstance().getDefaultVersion()); - } else if (language instanceof LanguageFactory.CpdLanguageAdapter) { - filenameFilter = language.getFileFilter(); - setForceLanguageVersion(((LanguageFactory.CpdLanguageAdapter) language).getLanguage().getDefaultVersion()); - } else { - throw new UnsupportedOperationException("Language " + language.getName() + " is not supported"); - } - } - - public void setSourceEncoding(String sourceEncoding) { - setSourceEncoding(Charset.forName(Objects.requireNonNull(sourceEncoding))); - } - - public FilenameFilter filenameFilter() { - if (getForceLanguageVersion() == null) { - throw new IllegalStateException("Language is null."); - } - - final FilenameFilter languageFilter = filenameFilter; - final Set exclusions = new HashSet<>(); - - if (getExcludes() != null) { - FileFinder finder = new FileFinder(); - for (Path excludedFile : getExcludes()) { - if (Files.isDirectory(excludedFile)) { - List files = finder.findFilesFrom(excludedFile.toFile(), languageFilter, true); - for (File f : files) { - exclusions.add(FileUtil.normalizeFilename(f.getAbsolutePath())); - } - } else { - exclusions.add(FileUtil.normalizeFilename(excludedFile.toAbsolutePath().toString())); - } - } - } - - return new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - File f = new File(dir, name); - if (exclusions.contains(FileUtil.normalizeFilename(f.getAbsolutePath()))) { - System.err.println("Excluding " + f.getAbsolutePath()); - return false; - } - return languageFilter.accept(dir, name); - } - }; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CSVRenderer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CSVRenderer.java deleted file mode 100644 index 366386b1c5..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/CSVRenderer.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: implements old interface CPDRenderer, old render(Iterator matches, Writer writer) method - -package net.sourceforge.pmd.cpd; - -import java.io.IOException; -import java.io.Writer; -import java.util.Iterator; - -import org.apache.commons.lang3.StringEscapeUtils; - -import net.sourceforge.pmd.cpd.renderer.CPDRenderer; -import net.sourceforge.pmd.lang.document.FileLocation; - -/** - * Renders a report to CSV. The CSV format renders each match (duplication) - * as a single line with the following columns: - *

    - *
  • lines (optional): The number of lines the first mark of a match spans. - * Only output if the {@code lineCountPerFile} is disabled (see ctor params).
  • - *
  • tokens: The number of duplicated tokens in a match (size of the match).
  • - *
  • occurrences: The number of duplicates in a match (number of times the tokens were found in distinct places).
  • - *
- * - *

Trailing each line are pairs (or triples, if {@code lineCountPerFile} is enabled) - * of fields describing each file where the duplication was found in the format - * {@code (start line, line count (optional), file path)}. These repeat at least twice. - * - *

Examples

- *

- * Example without {@code lineCountPerFile}: - *

{@code
- * lines,tokens,occurrences
- * 10,75,2,48,/var/file1,73,/var/file2
- * }
- * This describes one match with the following characteristics: - *
    - *
  • The first duplicate instance is 10 lines long; - *
  • 75 duplicated tokens; - *
  • 2 duplicate instances; - *
  • The first duplicate instance is in file {@code /var/file1} and starts at line 48;
  • - *
  • The second duplicate instance is in file {@code /var/file2} and starts at line 73.
  • - *
- *

- * Example with {@code lineCountPerFile}: - *

{@code
- * tokens,occurrences
- * 75,2,48,10,/var/file1,73,12,/var/file2
- * }
- * This describes one match with the following characteristics: - *
    - *
  • 75 duplicated tokens - *
  • 2 duplicate instances - *
  • The first duplicate instance is in file {@code /var/file1}, starts at line 48, and is 10 lines long;
  • - *
  • The second duplicate instance is in file {@code /var/file2}, starts at line 73, and is 12 lines long.
  • - *
- */ -public class CSVRenderer implements CPDReportRenderer, CPDRenderer { - - private final char separator; - private final boolean lineCountPerFile; - - public static final char DEFAULT_SEPARATOR = ','; - public static final boolean DEFAULT_LINECOUNTPERFILE = false; - - public CSVRenderer() { - this(DEFAULT_SEPARATOR, DEFAULT_LINECOUNTPERFILE); - } - - public CSVRenderer(boolean lineCountPerFile) { - this(DEFAULT_SEPARATOR, lineCountPerFile); - } - - public CSVRenderer(char separatorChar) { - this(separatorChar, DEFAULT_LINECOUNTPERFILE); - } - - public CSVRenderer(char separatorChar, boolean lineCountPerFile) { - this.separator = separatorChar; - this.lineCountPerFile = lineCountPerFile; - } - - @Override - public void render(CPDReport report, Writer writer) throws IOException { - if (!lineCountPerFile) { - writer.append("lines").append(separator); - } - writer.append("tokens").append(separator).append("occurrences").append(System.lineSeparator()); - - for (Match match : report.getMatches()) { - if (!lineCountPerFile) { - writer.append(String.valueOf(match.getLineCount())).append(separator); - } - writer.append(String.valueOf(match.getTokenCount())).append(separator) - .append(String.valueOf(match.getMarkCount())).append(separator); - for (Iterator marks = match.iterator(); marks.hasNext();) { - Mark mark = marks.next(); - FileLocation loc = mark.getLocation(); - - writer.append(String.valueOf(loc.getStartLine())).append(separator); - if (lineCountPerFile) { - writer.append(String.valueOf(loc.getLineCount())).append(separator); - } - writer.append(StringEscapeUtils.escapeCsv(report.getDisplayName(loc.getFileId()))); - if (marks.hasNext()) { - writer.append(separator); - } - } - writer.append(System.lineSeparator()); - } - writer.flush(); - } - - // ------------------- compat extensions -------------------- - @Override - public void render(Iterator matches, Writer writer) throws IOException { - RendererHelper.render(matches, writer, this); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/EcmascriptLanguage.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/EcmascriptLanguage.java deleted file mode 100644 index ecd2a5a2cf..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/EcmascriptLanguage.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.cpd; - -/** - * - * @author Zev Blut zb@ubit.com - */ -public class EcmascriptLanguage extends AbstractLanguage { - public EcmascriptLanguage() { - super("JavaScript", "ecmascript", new EcmascriptTokenizer(), ".js"); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/EcmascriptTokenizer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/EcmascriptTokenizer.java deleted file mode 100644 index a63b348db2..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/EcmascriptTokenizer.java +++ /dev/null @@ -1,8 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -public class EcmascriptTokenizer extends net.sourceforge.pmd.lang.ecmascript.cpd.EcmascriptCpdLexer implements Tokenizer { -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JSPLanguage.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JSPLanguage.java deleted file mode 100644 index e1501bad5d..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JSPLanguage.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.cpd; - -public class JSPLanguage extends AbstractLanguage { - public JSPLanguage() { - super("JSP", "jsp", new JSPTokenizer(), ".jsp", ".jspx", ".jspf", ".tag"); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JSPTokenizer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JSPTokenizer.java deleted file mode 100644 index 2e6f8d112b..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JSPTokenizer.java +++ /dev/null @@ -1,8 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -public class JSPTokenizer extends net.sourceforge.pmd.lang.jsp.cpd.JspCpdLexer implements Tokenizer { -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JavaLanguage.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JavaLanguage.java deleted file mode 100644 index 344a5d9bbc..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JavaLanguage.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 -// Changes: setProperties doesn't work, provide properties in constructor already - -package net.sourceforge.pmd.cpd; - -import java.util.Properties; - -public class JavaLanguage extends AbstractLanguage { - public JavaLanguage() { - this(System.getProperties()); - } - - public JavaLanguage(Properties properties) { - super("Java", "java", new JavaTokenizer(properties), ".java"); - } - - @Override - public final void setProperties(Properties properties) { - // note: this might be actually incompatible - throw new UnsupportedOperationException(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JavaTokenizer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JavaTokenizer.java deleted file mode 100644 index 39f2013699..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/JavaTokenizer.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -import java.util.Properties; - -import net.sourceforge.pmd.lang.java.JavaLanguageModule; -import net.sourceforge.pmd.lang.java.internal.JavaLanguageProperties; - -public class JavaTokenizer extends net.sourceforge.pmd.lang.java.cpd.JavaCpdLexer implements Tokenizer { - public JavaTokenizer(Properties properties) { - super(convertLanguageProperties(properties)); - } - - public static final String IGNORE_LITERALS = "ignore_literals"; - public static final String IGNORE_IDENTIFIERS = "ignore_identifiers"; - public static final String IGNORE_ANNOTATIONS = "ignore_annotations"; - - private static JavaLanguageProperties convertLanguageProperties(Properties properties) { - boolean ignoreAnnotations = Boolean.parseBoolean(properties.getProperty(IGNORE_ANNOTATIONS, "false")); - boolean ignoreLiterals = Boolean.parseBoolean(properties.getProperty(IGNORE_LITERALS, "false")); - boolean ignoreIdentifiers = Boolean.parseBoolean(properties.getProperty(IGNORE_IDENTIFIERS, "false")); - - JavaLanguageProperties javaLanguageProperties = (JavaLanguageProperties) JavaLanguageModule.getInstance().newPropertyBundle(); - javaLanguageProperties.setProperty(CpdLanguageProperties.CPD_IGNORE_METADATA, ignoreAnnotations); - javaLanguageProperties.setProperty(CpdLanguageProperties.CPD_ANONYMIZE_LITERALS, ignoreLiterals); - javaLanguageProperties.setProperty(CpdLanguageProperties.CPD_ANONYMIZE_IDENTIFIERS, ignoreIdentifiers); - - return javaLanguageProperties; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Language.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Language.java deleted file mode 100644 index d2ee070bb5..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Language.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.cpd; - -import java.io.FilenameFilter; -import java.util.List; -import java.util.Properties; - -public interface Language { - String getName(); - - String getTerseName(); - - Tokenizer getTokenizer(); - - FilenameFilter getFileFilter(); - - void setProperties(Properties properties); - - List getExtensions(); -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/LanguageFactory.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/LanguageFactory.java deleted file mode 100644 index 8191bcb298..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/LanguageFactory.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class is here just to make maven-pmd-plugin compile with -// pmd 7.0.0 including this compat6 module. -// It would only be used, if a custom language (other than java, jsp or javascript) -// would be requested. - -package net.sourceforge.pmd.cpd; - -import java.util.Properties; -import java.util.stream.Collectors; - -import net.sourceforge.pmd.lang.LanguagePropertyBundle; -import net.sourceforge.pmd.lang.LanguageRegistry; -import net.sourceforge.pmd.properties.PropertyDescriptor; - -public final class LanguageFactory { - private LanguageFactory() { - // utility class - } - - public static Language createLanguage(String name, Properties properties) { - CpdCapableLanguage cpdLanguage = (CpdCapableLanguage) LanguageRegistry.CPD.getLanguageById(name); - if (cpdLanguage != null) { - return new CpdLanguageAdapter(cpdLanguage, properties); - } - throw new UnsupportedOperationException("Language " + name + " is not supported"); - } - - public static class CpdLanguageAdapter extends AbstractLanguage { - private CpdCapableLanguage language; - - public CpdLanguageAdapter(CpdCapableLanguage cpdCapableLanguage, Properties properties) { - super(cpdCapableLanguage.getName(), cpdCapableLanguage.getId(), createLexer(cpdCapableLanguage, properties), convertExtensions(cpdCapableLanguage)); - this.language = cpdCapableLanguage; - } - - private static Tokenizer createLexer(CpdCapableLanguage cpdCapableLanguage, Properties properties) { - LanguagePropertyBundle propertyBundle = cpdCapableLanguage.newPropertyBundle(); - for (String propName : properties.stringPropertyNames()) { - PropertyDescriptor propertyDescriptor = propertyBundle.getPropertyDescriptor(propName); - if (propertyDescriptor != null) { - setProperty(propertyBundle, propertyDescriptor, properties.getProperty(propName)); - } - } - CpdLexer cpdLexer = cpdCapableLanguage.createCpdLexer(propertyBundle); - return cpdLexer::tokenize; - } - - private static void setProperty(LanguagePropertyBundle propertyBundle, PropertyDescriptor propertyDescriptor, String stringValue) { - T value = propertyDescriptor.serializer().fromString(stringValue); - propertyBundle.setProperty(propertyDescriptor, value); - } - - private static String[] convertExtensions(CpdCapableLanguage cpdCapableLanguage) { - return cpdCapableLanguage.getExtensions().stream().map(s -> "." + s).collect(Collectors.toList()).toArray(new String[0]); - } - - public CpdCapableLanguage getLanguage() { - return language; - } - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Mark.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Mark.java deleted file mode 100644 index 2bcfdc15ea..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Mark.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: getFilename - -package net.sourceforge.pmd.cpd; - -import java.util.Objects; - -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; - -import net.sourceforge.pmd.lang.document.FileId; -import net.sourceforge.pmd.lang.document.FileLocation; -import net.sourceforge.pmd.lang.document.TextRange2d; - -/** - * A range of tokens in a source file, identified by a start and end - * token (both included in the range). The start and end token may be - * the same token. - */ -public final class Mark implements Comparable { - - private final @NonNull TokenEntry token; - private @Nullable TokenEntry endToken; - - Mark(@NonNull TokenEntry token) { - this.token = token; - } - - @NonNull TokenEntry getToken() { - return this.token; - } - - @NonNull TokenEntry getEndToken() { - return endToken == null ? token : endToken; - } - - /** - * Return the location of this source range in the source file. - */ - public FileLocation getLocation() { - TokenEntry endToken = getEndToken(); - return FileLocation.range( - getFileId(), - TextRange2d.range2d(token.getBeginLine(), token.getBeginColumn(), - endToken.getEndLine(), endToken.getEndColumn())); - } - - FileId getFileId() { - return token.getFileId(); - } - - public int getBeginTokenIndex() { - return this.token.getIndex(); - } - - public int getEndTokenIndex() { - return getEndToken().getIndex(); - } - - void setEndToken(@NonNull TokenEntry endToken) { - assert endToken.getFileId().equals(token.getFileId()) - : "Tokens are not from the same file"; - this.endToken = endToken; - } - - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + token.hashCode(); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - Mark other = (Mark) obj; - return Objects.equals(token, other.token) - && Objects.equals(endToken, other.endToken); - } - - @Override - public int compareTo(Mark other) { - return getToken().compareTo(other.getToken()); - } - - // ------------------- compat extensions -------------------- - public String getFilename() { - return this.token.getFileId().getOriginalPath(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/RendererHelper.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/RendererHelper.java deleted file mode 100644 index f7291e9ae5..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/RendererHelper.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -import java.io.IOException; -import java.io.Writer; -import java.nio.charset.StandardCharsets; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import net.sourceforge.pmd.lang.document.TextFile; -import net.sourceforge.pmd.lang.java.JavaLanguageModule; - -final class RendererHelper { - private RendererHelper() { - // utility class - } - - static void render(Iterator matches, Writer writer, CPDReportRenderer renderer) throws IOException { - List matchesList = new ArrayList<>(); - matches.forEachRemaining(matchesList::add); - - List textFiles = new ArrayList<>(); - Set paths = new HashSet<>(); - for (Match match : matchesList) { - for (Mark mark : match.getMarkSet()) { - paths.add(mark.getFilename()); - } - } - for (String path : paths) { - textFiles.add(TextFile.forPath(Paths.get(path), StandardCharsets.UTF_8, JavaLanguageModule.getInstance().getDefaultVersion())); - } - - try (SourceManager sourceManager = new SourceManager(textFiles)) { - CPDReport report = new CPDReport(sourceManager, matchesList, Collections.emptyMap()); - renderer.render(report, writer); - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/SimpleRenderer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/SimpleRenderer.java deleted file mode 100644 index d4aaff8038..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/SimpleRenderer.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: implements old interface CPDRenderer, old render(Iterator matches, Writer writer) method - -package net.sourceforge.pmd.cpd; - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.Writer; -import java.util.Iterator; - -import net.sourceforge.pmd.cpd.renderer.CPDRenderer; -import net.sourceforge.pmd.lang.document.Chars; -import net.sourceforge.pmd.lang.document.FileLocation; -import net.sourceforge.pmd.util.StringUtil; - -public class SimpleRenderer implements CPDReportRenderer, CPDRenderer { - - private String separator; - private boolean trimLeadingWhitespace; - - public static final String DEFAULT_SEPARATOR = "====================================================================="; - - public SimpleRenderer() { - this(false); - } - - public SimpleRenderer(boolean trimLeadingWhitespace) { - this(DEFAULT_SEPARATOR); - this.trimLeadingWhitespace = trimLeadingWhitespace; - } - - public SimpleRenderer(String theSeparator) { - separator = theSeparator; - } - - @Override - public void render(CPDReport report, Writer writer0) throws IOException { - PrintWriter writer = new PrintWriter(writer0); - Iterator matches = report.getMatches().iterator(); - if (matches.hasNext()) { - renderOn(report, writer, matches.next()); - } - - while (matches.hasNext()) { - Match match = matches.next(); - writer.println(separator); - renderOn(report, writer, match); - } - writer.flush(); - } - - private void renderOn(CPDReport report, PrintWriter writer, Match match) throws IOException { - - writer.append("Found a ").append(String.valueOf(match.getLineCount())).append(" line (").append(String.valueOf(match.getTokenCount())) - .append(" tokens) duplication in the following files: ").println(); - - for (Mark mark : match) { - FileLocation loc = mark.getLocation(); - writer.append("Starting at line ") - .append(String.valueOf(loc.getStartLine())) - .append(" of ").append(report.getDisplayName(loc.getFileId())) - .println(); - } - - writer.println(); // add a line to separate the source from the desc above - - Chars source = report.getSourceCodeSlice(match.getFirstMark()); - - if (trimLeadingWhitespace) { - for (Chars line : StringUtil.linesWithTrimIndent(source)) { - line.writeFully(writer); - writer.println(); - } - return; - } - - source.writeFully(writer); - writer.println(); - } - - // ------------------- compat extensions -------------------- - @Override - public void render(Iterator matches, Writer writer) throws IOException { - RendererHelper.render(matches, writer, this); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Tokenizer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Tokenizer.java deleted file mode 100644 index ece7fc3618..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/Tokenizer.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.cpd; - -public interface Tokenizer extends CpdLexer { -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java deleted file mode 100644 index 31f2b41d0a..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/XMLRenderer.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: implements old interface CPDRenderer, old render(Iterator matches, Writer writer) method - -package net.sourceforge.pmd.cpd; - -import java.io.IOException; -import java.io.Writer; -import java.util.Iterator; -import java.util.Map; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import net.sourceforge.pmd.cpd.renderer.CPDRenderer; -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.util.StringUtil; - -/** - * @author Philippe T'Seyen - original implementation - * @author Romain Pelisse - javax.xml implementation - * - */ -public final class XMLRenderer implements CPDReportRenderer, CPDRenderer { - - private String encoding; - - /** - * Creates a XML Renderer with the default (platform dependent) encoding. - */ - public XMLRenderer() { - this(null); - } - - /** - * Creates a XML Renderer with a specific output encoding. - * - * @param encoding - * the encoding to use or null. If null, default (platform - * dependent) encoding is used. - */ - public XMLRenderer(String encoding) { - setEncoding(encoding); - } - - public void setEncoding(String encoding) { - if (encoding != null) { - this.encoding = encoding; - } else { - this.encoding = System.getProperty("file.encoding"); - } - } - - public String getEncoding() { - return this.encoding; - } - - private Document createDocument() { - try { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder parser = factory.newDocumentBuilder(); - return parser.newDocument(); - } catch (ParserConfigurationException e) { - throw new IllegalStateException(e); - } - } - - private void dumpDocToWriter(Document doc, Writer writer) { - try { - TransformerFactory tf = TransformerFactory.newInstance(); - Transformer transformer = tf.newTransformer(); - transformer.setOutputProperty(OutputKeys.VERSION, "1.0"); - transformer.setOutputProperty(OutputKeys.METHOD, "xml"); - transformer.setOutputProperty(OutputKeys.ENCODING, encoding); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - transformer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS, "codefragment"); - transformer.transform(new DOMSource(doc), new StreamResult(writer)); - } catch (TransformerException e) { - throw new IllegalStateException(e); - } - } - - - @Override - public void render(final CPDReport report, final Writer writer) throws IOException { - final Document doc = createDocument(); - final Element root = doc.createElement("pmd-cpd"); - final Map numberOfTokensPerFile = report.getNumberOfTokensPerFile(); - doc.appendChild(root); - - for (final Map.Entry pair : numberOfTokensPerFile.entrySet()) { - final Element fileElement = doc.createElement("file"); - fileElement.setAttribute("path", report.getDisplayName(pair.getKey())); - fileElement.setAttribute("totalNumberOfTokens", String.valueOf(pair.getValue())); - root.appendChild(fileElement); - } - - for (Match match : report.getMatches()) { - Element dupElt = createDuplicationElement(doc, match); - addFilesToDuplicationElement(doc, dupElt, match, report); - addCodeSnippet(doc, dupElt, match, report); - root.appendChild(dupElt); - } - dumpDocToWriter(doc, writer); - writer.flush(); - } - - private void addFilesToDuplicationElement(Document doc, Element duplication, Match match, CPDReport report) { - for (Mark mark : match) { - final Element file = doc.createElement("file"); - FileLocation loc = mark.getLocation(); - file.setAttribute("line", String.valueOf(loc.getStartLine())); - // only remove invalid characters, escaping is done by the DOM impl. - String filenameXml10 = StringUtil.removedInvalidXml10Characters(report.getDisplayName(loc.getFileId())); - file.setAttribute("path", filenameXml10); - file.setAttribute("endline", String.valueOf(loc.getEndLine())); - file.setAttribute("column", String.valueOf(loc.getStartColumn())); - file.setAttribute("endcolumn", String.valueOf(loc.getEndColumn())); - file.setAttribute("begintoken", String.valueOf(mark.getBeginTokenIndex())); - file.setAttribute("endtoken", String.valueOf(mark.getEndTokenIndex())); - duplication.appendChild(file); - } - } - - private void addCodeSnippet(Document doc, Element duplication, Match match, CPDReport report) { - Chars codeSnippet = report.getSourceCodeSlice(match.getFirstMark()); - if (codeSnippet != null) { - // the code snippet has normalized line endings - String platformSpecific = codeSnippet.toString().replace("\n", System.lineSeparator()); - Element codefragment = doc.createElement("codefragment"); - // only remove invalid characters, escaping is not necessary in CDATA. - // if the string contains the end marker of a CDATA section, then the DOM impl will - // create two cdata sections automatically. - codefragment.appendChild(doc.createCDATASection(StringUtil.removedInvalidXml10Characters(platformSpecific))); - duplication.appendChild(codefragment); - } - } - - private Element createDuplicationElement(Document doc, Match match) { - Element duplication = doc.createElement("duplication"); - duplication.setAttribute("lines", String.valueOf(match.getLineCount())); - duplication.setAttribute("tokens", String.valueOf(match.getTokenCount())); - return duplication; - } - - // ------------------- compat extensions -------------------- - @Override - public void render(Iterator matches, Writer writer) throws IOException { - RendererHelper.render(matches, writer, this); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/renderer/CPDRenderer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/renderer/CPDRenderer.java deleted file mode 100644 index 5776309eba..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/cpd/renderer/CPDRenderer.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.cpd.renderer; - -import java.io.IOException; -import java.io.Writer; -import java.util.Iterator; - -import net.sourceforge.pmd.cpd.Match; - -/** - * @deprecated Use {@link net.sourceforge.pmd.cpd.CPDReportRenderer} - */ -@Deprecated -public interface CPDRenderer { - void render(Iterator matches, Writer writer) throws IOException; -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/LanguageRegistry.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/LanguageRegistry.java deleted file mode 100644 index 8cf677dabd..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/LanguageRegistry.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: The following methods are still here, but deleted in 7.0.0 -// LanguageRegistry#getLanguage -// LanguageRegistry#findLanguageByTerseName -// LanguageRegistry#findByExtension - -package net.sourceforge.pmd.lang; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.ServiceConfigurationError; -import java.util.ServiceLoader; -import java.util.Set; -import java.util.TreeSet; -import java.util.function.Function; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import net.sourceforge.pmd.annotation.DeprecatedUntil700; -import net.sourceforge.pmd.cpd.CpdCapableLanguage; -import net.sourceforge.pmd.util.CollectionUtil; - -/** - * A set of languages with convenient methods. In the PMD CLI, languages - * are loaded from the classloader of this class. These are in the registry - * {@link #PMD}. You can otherwise create different registries with different - * languages, eg filter some out. - */ -public final class LanguageRegistry implements Iterable { - - private static final Logger LOG = LoggerFactory.getLogger(LanguageRegistry.class); - - private static final LanguageRegistry ALL_LANGUAGES = - loadLanguages(LanguageRegistry.class.getClassLoader()); - - /** - * Contains the languages that support PMD and are found on the classpath - * of the classloader of this class. This can be used as a "default" registry. - */ - public static final LanguageRegistry PMD = ALL_LANGUAGES.filter(it -> it instanceof PmdCapableLanguage); - - /** - * Contains the languages that support CPD and are found on the classpath - * of the classloader of this class. - */ - public static final LanguageRegistry CPD = ALL_LANGUAGES.filter(it -> it instanceof CpdCapableLanguage); - - private final Set languages; - - private final Map languagesById; - private final Map languagesByFullName; - - /** - * Create a new registry that contains the given set of languages. - * @throws NullPointerException If the parameter is null - */ - public LanguageRegistry(Set languages) { - this.languages = languages.stream() - .sorted(Comparator.comparing(Language::getId, String::compareToIgnoreCase)) - .collect(CollectionUtil.toUnmodifiableSet()); - this.languagesById = CollectionUtil.associateBy(languages, Language::getId); - this.languagesByFullName = CollectionUtil.associateBy(languages, Language::getName); - } - - /** - * Create a new registry with the languages that satisfy the predicate. - */ - public LanguageRegistry filter(Predicate filterFun) { - return new LanguageRegistry(languages.stream().filter(filterFun) - .collect(Collectors.toSet())); - } - - /** - * Creates a language registry containing a single language. Note - * that this may be inconvertible to a {@link LanguageProcessorRegistry} - * if the language depends on other languages. - */ - public static LanguageRegistry singleton(Language l) { - return new LanguageRegistry(Collections.singleton(l)); - } - - /** - * Creates a language registry containing the given language and - * its dependencies, fetched from this language registry or the - * parameter. - * - * @throws IllegalStateException If dependencies cannot be fulfilled. - */ - public LanguageRegistry getDependenciesOf(Language lang) { - Set result = new HashSet<>(); - result.add(lang); - addDepsOrThrow(lang, result); - return new LanguageRegistry(result); - } - - private void addDepsOrThrow(Language l, Set languages) { - for (String depId : l.getDependencies()) { - Language dep = getLanguageById(depId); - if (dep == null) { - throw new IllegalStateException( - "Cannot find language " + depId + " in " + this); - } - if (languages.add(dep)) { - addDepsOrThrow(dep, languages); - } - } - } - - @Override - public @NonNull Iterator iterator() { - return languages.iterator(); - } - - /** - * Create a new registry by loading the languages registered via {@link ServiceLoader} - * on the classpath of the given classloader. - * - * @param classLoader A classloader - */ - public static @NonNull LanguageRegistry loadLanguages(ClassLoader classLoader) { - // sort languages by terse name. Avoiding differences in the order of languages - // across JVM versions / OS. - Set languages = new TreeSet<>(Comparator.comparing(Language::getId, String::compareToIgnoreCase)); - ServiceLoader languageLoader = ServiceLoader.load(Language.class, classLoader); - Iterator iterator = languageLoader.iterator(); - while (true) { - // this loop is weird, but both hasNext and next may throw ServiceConfigurationError, - // it's more robust that way - try { - if (iterator.hasNext()) { - Language language = iterator.next(); - languages.add(language); - } else { - break; - } - } catch (UnsupportedClassVersionError | ServiceConfigurationError e) { - // Some languages require java8 and are therefore only available - // if java8 or later is used as runtime. - LOG.warn("Cannot load PMD language, ignored", e); - } - } - return new LanguageRegistry(languages); - } - - /** - * Returns a set of all the known languages. The ordering of the languages - * is by terse name. - */ - public Set getLanguages() { - return languages; - } - - /** - * Returns a language from its {@linkplain Language#getName() full name} - * (eg {@code "Java"}). This is case sensitive. - * - * @param languageName Language name - * - * @return A language, or null if the name is unknown - * - * @deprecated Use {@link #getLanguageByFullName(String) LanguageRegistry.PMD.getLanguageByFullName} - */ - @Deprecated - @DeprecatedUntil700 - public static Language getLanguage(String languageName) { - return PMD.getLanguageByFullName(languageName); - } - - /** - * Returns a language from its {@linkplain Language#getId() ID} - * (eg {@code "java"}). This is case-sensitive. - * - * @param langId Language ID - * - * @return A language, or null if the name is unknown, or the parameter is null - */ - public @Nullable Language getLanguageById(@Nullable String langId) { - return languagesById.get(langId); - } - - /** - * Returns a language version from its {@linkplain Language#getId() language ID} - * (eg {@code "java"}). This is case-sensitive. - * - * @param langId Language ID - * @param version Version ID - * - * @return A language, or null if the name is unknown - */ - public @Nullable LanguageVersion getLanguageVersionById(@Nullable String langId, @Nullable String version) { - Language lang = languagesById.get(langId); - if (lang == null) { - return null; - } - return version == null ? lang.getDefaultVersion() - : lang.getVersion(version); - } - - /** - * Returns a language from its {@linkplain Language#getName() full name} - * (eg {@code "Java"}). This is case sensitive. - * - * @param languageName Language name - * - * @return A language, or null if the name is unknown - */ - public @Nullable Language getLanguageByFullName(String languageName) { - return languagesByFullName.get(languageName); - } - - /** - * Returns a language from its {@linkplain Language#getId() terse name} - * (eg {@code "java"}). This is case sensitive. - * - * @param terseName Language terse name - * - * @return A language, or null if the name is unknown - * - * @deprecated Use {@link #getLanguageById(String) LanguageRegistry.PMD.getLanguageById}. - */ - @Deprecated - @DeprecatedUntil700 - public static @Nullable Language findLanguageByTerseName(@Nullable String terseName) { - return PMD.getLanguageById(terseName); - } - - /** - * Returns all languages that support the given extension. - * - * @param extensionWithoutDot A file extension (without '.' prefix) - * - * @deprecated Not replaced, extension will be extended to match full name in PMD 7. - */ - @Deprecated - @DeprecatedUntil700 - public static List findByExtension(String extensionWithoutDot) { - List languages = new ArrayList<>(); - for (Language language : PMD.getLanguages()) { - if (language.hasExtension(extensionWithoutDot)) { - languages.add(language); - } - } - return languages; - } - - /** - * Formats the set of languages with the given formatter, sort and - * join everything with commas. Convenience method. - */ - public @NonNull String commaSeparatedList(Function languageToString) { - return getLanguages().stream().map(languageToString).sorted().collect(Collectors.joining(", ")); - } - - @Override - public String toString() { - return "LanguageRegistry(" + commaSeparatedList(Language::getId) + ")"; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/Rule.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/Rule.java deleted file mode 100644 index a152534e5f..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/Rule.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// The class net.sourceforge.pmd.Rule has been moved into sub-package rule -// in 7.0.0-SNAPSHOT. All rules should be interchangeable. - -package net.sourceforge.pmd.lang.rule; - -public interface Rule extends net.sourceforge.pmd.Rule { -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/RuleSetLoadException.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/RuleSetLoadException.java deleted file mode 100644 index 5cc43b7131..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/RuleSetLoadException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// Copied from 7.0.0-SNAPSHOT -// Changes: constructors are public again - -package net.sourceforge.pmd.lang.rule; - -import org.checkerframework.checker.nullness.qual.NonNull; - -import net.sourceforge.pmd.lang.rule.internal.RuleSetReferenceId; - -/** - * An exception that is thrown when something wrong occurs while - * {@linkplain RuleSetLoader loading rulesets}. This may be because the - * XML is not well-formed, does not respect the ruleset schema, is - * not a valid ruleset or is otherwise unparsable. - */ -public class RuleSetLoadException extends RuntimeException { - - /** - * @apiNote Internal API. - */ - public RuleSetLoadException(RuleSetReferenceId rsetId, @NonNull Throwable cause) { - super("Cannot load ruleset " + rsetId + ": " + cause.getMessage(), cause); - } - - /** - * @apiNote Internal API. - */ - public RuleSetLoadException(RuleSetReferenceId rsetId, String message) { - super("Cannot load ruleset " + rsetId + ": " + message); - } - -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java deleted file mode 100644 index eb11ac7e77..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java +++ /dev/null @@ -1,8 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.rule; - -public class XPathRule extends net.sourceforge.pmd.lang.rule.xpath.XPathRule { -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleSets.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleSets.java deleted file mode 100644 index dbf505107a..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleSets.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.rule.internal; - -import java.util.Collection; - -import net.sourceforge.pmd.lang.rule.RuleSet; - -public class RuleSets extends net.sourceforge.pmd.RuleSets { - public RuleSets(net.sourceforge.pmd.RuleSets ruleSets) { - super(ruleSets); - } - - public RuleSets(net.sourceforge.pmd.lang.rule.internal.RuleSets ruleSets) { - super(ruleSets); - } - - public RuleSets(Collection ruleSets) { - super(ruleSets); - } - - public RuleSets(RuleSet ruleSet) { - super(ruleSet); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/xpath/XPathRule.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/xpath/XPathRule.java deleted file mode 100644 index 6f567f1ed7..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/lang/rule/xpath/XPathRule.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: not final anymore to allow a subclass in the old package - -package net.sourceforge.pmd.lang.rule.xpath; - -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.exception.ContextedRuntimeException; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import net.sourceforge.pmd.lang.LanguageProcessor; -import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.rule.AbstractRule; -import net.sourceforge.pmd.lang.rule.Rule; -import net.sourceforge.pmd.lang.rule.RuleTargetSelector; -import net.sourceforge.pmd.lang.rule.xpath.internal.DeprecatedAttrLogger; -import net.sourceforge.pmd.lang.rule.xpath.internal.SaxonXPathRuleQuery; -import net.sourceforge.pmd.properties.PropertyDescriptor; -import net.sourceforge.pmd.properties.PropertyFactory; -import net.sourceforge.pmd.reporting.RuleContext; -import net.sourceforge.pmd.util.IteratorUtil; - - -/** - * Rule that tries to match an XPath expression against a DOM view of an AST. - */ -public /*final*/ class XPathRule extends AbstractRule { - - private static final Logger LOG = LoggerFactory.getLogger(XPathRule.class); - - /** - * @deprecated Use {@link #XPathRule(XPathVersion, String)} - */ - @Deprecated - public static final PropertyDescriptor XPATH_DESCRIPTOR = - PropertyFactory.stringProperty("xpath") - .desc("XPath expression") - .defaultValue("") - .build(); - - /** - * This is initialized only once when calling {@link #apply(Node, RuleContext)} or {@link #getTargetSelector()}. - */ - private SaxonXPathRuleQuery xpathRuleQuery; - - - // this is shared with rules forked by deepCopy, used by the XPathRuleQuery - private DeprecatedAttrLogger attrLogger = DeprecatedAttrLogger.create(this); - - - /** - * @deprecated This is now only used by the ruleset loader. When - * we have syntactic sugar for XPath rules in the XML, we won't - * need this anymore. - */ - @Deprecated - public XPathRule() { - definePropertyDescriptor(XPATH_DESCRIPTOR); - } - - /** - * Make a new XPath rule with the given version + expression - * - * @param version Version of the XPath language - * @param expression XPath expression - * - * @throws NullPointerException If any of the arguments is null - */ - public XPathRule(XPathVersion version, String expression) { - this(); - - Objects.requireNonNull(version, "XPath version is null"); - Objects.requireNonNull(expression, "XPath expression is null"); - - setProperty(XPathRule.XPATH_DESCRIPTOR, expression); - } - - - @Override - public Rule deepCopy() { - XPathRule rule = (XPathRule) super.deepCopy(); - rule.attrLogger = this.attrLogger; - return rule; - } - - /** - * Returns the XPath expression that implements this rule. - */ - public String getXPathExpression() { - return getProperty(XPATH_DESCRIPTOR); - } - - - @Override - public void apply(Node target, RuleContext ctx) { - SaxonXPathRuleQuery query = getQueryMaybeInitialize(); - - List nodesWithViolation; - try { - nodesWithViolation = query.evaluate(target); - } catch (PmdXPathException e) { - throw addExceptionContext(e); - } - - for (Node nodeWithViolation : nodesWithViolation) { - // see Deprecate getImage/@Image #4787 https://github.com/pmd/pmd/issues/4787 - String messageArg = nodeWithViolation.getImage(); - // Nodes might already have been refactored to not use getImage anymore. - // Therefore, try several other common names - if (messageArg == null) { - messageArg = getFirstMessageArgFromNode(nodeWithViolation, "Name", "SimpleName", "MethodName"); - } - ctx.addViolation(nodeWithViolation, messageArg); - } - } - - private String getFirstMessageArgFromNode(Node node, String... attributeNames) { - List nameList = Arrays.asList(attributeNames); - return IteratorUtil.toStream(node.getXPathAttributesIterator()) - .filter(a -> nameList.contains(a.getName())) - .findFirst() - .map(Attribute::getStringValue) - .orElse(null); - } - - private ContextedRuntimeException addExceptionContext(PmdXPathException e) { - return e.addRuleName(getName()); - } - - @Override - public void initialize(LanguageProcessor languageProcessor) { - String xpath = getXPathExpression(); - XPathVersion version = XPathVersion.DEFAULT; - - try { - xpathRuleQuery = new SaxonXPathRuleQuery(xpath, - version, - getPropertiesByPropertyDescriptor(), - languageProcessor.services().getXPathHandler(), - attrLogger); - } catch (PmdXPathException e) { - throw addExceptionContext(e); - } - } - - private SaxonXPathRuleQuery getQueryMaybeInitialize() throws PmdXPathException { - if (xpathRuleQuery == null) { - throw new IllegalStateException("Not initialized"); - } - return xpathRuleQuery; - } - - - @Override - protected @NonNull RuleTargetSelector buildTargetSelector() { - - List visits = getQueryMaybeInitialize().getRuleChainVisits(); - - logXPathRuleChainUsage(!visits.isEmpty()); - - return visits.isEmpty() ? RuleTargetSelector.forRootOnly() - : RuleTargetSelector.forXPathNames(visits); - } - - - private void logXPathRuleChainUsage(boolean usesRuleChain) { - LOG.debug("{} rule chain for XPath rule: {} ({})", - usesRuleChain ? "Using" : "no", - getName(), - getRuleSetName()); - } - - - @Override - public String dysfunctionReason() { - if (StringUtils.isBlank(getXPathExpression())) { - return "Missing XPath expression"; - } - return null; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/renderers/Renderer.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/renderers/Renderer.java deleted file mode 100644 index 3013dbc7d1..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/renderers/Renderer.java +++ /dev/null @@ -1,288 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT -// Changes: renderFileReport - -package net.sourceforge.pmd.renderers; - -import java.io.IOException; -import java.io.Writer; - -import net.sourceforge.pmd.annotation.Experimental; -import net.sourceforge.pmd.benchmark.TimeTracker; -import net.sourceforge.pmd.benchmark.TimedOperation; -import net.sourceforge.pmd.benchmark.TimedOperationCategory; -import net.sourceforge.pmd.lang.document.TextFile; -import net.sourceforge.pmd.properties.PropertyDescriptor; -import net.sourceforge.pmd.properties.PropertySource; -import net.sourceforge.pmd.reporting.FileAnalysisListener; -import net.sourceforge.pmd.reporting.FileNameRenderer; -import net.sourceforge.pmd.reporting.GlobalAnalysisListener; -import net.sourceforge.pmd.reporting.ListenerInitializer; -import net.sourceforge.pmd.reporting.Report; -import net.sourceforge.pmd.reporting.Report.ConfigurationError; -import net.sourceforge.pmd.reporting.Report.GlobalReportBuilderListener; -import net.sourceforge.pmd.reporting.Report.ProcessingError; -import net.sourceforge.pmd.reporting.Report.ReportBuilderListener; -import net.sourceforge.pmd.reporting.Report.SuppressedViolation; -import net.sourceforge.pmd.reporting.RuleViolation; - -/** - * This is an interface for rendering a Report. When a Renderer is being - * invoked, the sequence of method calls is something like the following: - *
    - *
  1. Renderer construction/initialization
  2. - *
  3. {@link Renderer#setShowSuppressedViolations(boolean)}
  4. - *
  5. {@link Renderer#setWriter(Writer)}
  6. - *
  7. {@link Renderer#start()}
  8. - *
  9. {@link Renderer#startFileAnalysis(TextFile)} for each source file - * processed
  10. - *
  11. {@link Renderer#renderFileReport(Report)} for each Report instance
  12. - *
  13. {@link Renderer#end()}
  14. - *
- *

- * An implementation of the Renderer interface is expected to have a default - * constructor. Properties should be defined using the - * {@link #definePropertyDescriptor(PropertyDescriptor)} - * method. After the instance is created, the property values are set. This - * means, you won't have access to property values in your constructor. - */ -// TODO Are implementations expected to be thread-safe? -public interface Renderer extends PropertySource { - - /** - * Get the name of the Renderer. - * - * @return The name of the Renderer. - */ - @Override - String getName(); - - /** - * Set the name of the Renderer. - * - * @param name - * The name of the Renderer. - */ - void setName(String name); - - /** - * Get the description of the Renderer. - * - * @return The description of the Renderer. - */ - String getDescription(); - - /** - * Return the default filename extension to use. - * - * @return String - */ - String defaultFileExtension(); - - /** - * Set the description of the Renderer. - * - * @param description - * The description of the Renderer. - */ - void setDescription(String description); - - /** - * Get the indicator for whether to show suppressed violations. - * - * @return true if suppressed violations should show, - * false otherwise. - */ - boolean isShowSuppressedViolations(); - - /** - * Set the indicator for whether to show suppressed violations. - * - * @param showSuppressedViolations - * Whether to show suppressed violations. - */ - void setShowSuppressedViolations(boolean showSuppressedViolations); - - /** - * Get the Writer for the Renderer. - * - * @return The Writer. - */ - Writer getWriter(); - - /** - * Set the {@link FileNameRenderer} used to render file paths to the report. - * Note that this renderer does not have to use the parameter to output paths. - * Some report formats require a specific format for paths (eg a URI), and are - * allowed to circumvent the provided strategy. - * - * @param fileNameRenderer a non-null file name renderer - */ - void setFileNameRenderer(FileNameRenderer fileNameRenderer); - - /** - * Set the Writer for the Renderer. - * - * @param writer The Writer. - */ - void setWriter(Writer writer); - - /** - * This method is called before any source files are processed. The Renderer - * will have been fully initialized by the time this method is called, so - * the Writer and other state will be available. - * - * @throws IOException - */ - void start() throws IOException; - - /** - * This method is called each time a source file is processed. It is called - * after {@link Renderer#start()}, but before - * {@link Renderer#renderFileReport(Report)} and {@link Renderer#end()}. - * - * This method may be invoked by different threads which are processing - * files independently. Therefore, any non-trivial implementation of this - * method needs to be thread-safe. - * - * @param dataSource - * The source file. - */ - void startFileAnalysis(TextFile dataSource); - - /** - * Render the given file Report. There may be multiple Report instances - * which need to be rendered if produced by different threads. It is called - * after {@link Renderer#start()} and - * {@link Renderer#startFileAnalysis(TextFile)}, but before - * {@link Renderer#end()}. - * - * @param report - * A file Report. - * @throws IOException - * - * @see Report - */ - void renderFileReport(Report report) throws IOException; - - /** - * This method is at the very end of the Rendering process, after - * {@link Renderer#renderFileReport(Report)}. - */ - void end() throws IOException; - - void flush() throws IOException; - - /** - * Sets the filename where the report should be written to. If no filename is provided, - * the renderer should write to stdout. - * - *

Implementations must initialize the writer of the renderer. - * - *

See {@link AbstractRenderer#setReportFile(String)} for the default impl. - * - * @param reportFilename the filename (optional). - */ - @Experimental - void setReportFile(String reportFilename); - - - - /** - * Returns a new analysis listener, that handles violations by rendering - * them in an implementation-defined way. - */ - // TODO the default implementation matches the current behavior, - // ie violations are batched by file and forwarded to the renderer - // when the file is done. Many renderers could directly handle - // violations as they come though. - default GlobalAnalysisListener newListener() throws IOException { - try (TimedOperation ignored = TimeTracker.startOperation(TimedOperationCategory.REPORTING)) { - this.start(); - } - - return new GlobalAnalysisListener() { - - // guard for the close routine - final Object reportMergeLock = new Object(); - - final GlobalReportBuilderListener configErrorReport = new GlobalReportBuilderListener(); - - @Override - public void onConfigError(ConfigurationError error) { - configErrorReport.onConfigError(error); - } - - @Override - public ListenerInitializer initializer() { - return new ListenerInitializer() { - @Override - public void setFileNameRenderer(FileNameRenderer fileNameRenderer) { - Renderer.this.setFileNameRenderer(fileNameRenderer); - } - }; - } - - @Override - public FileAnalysisListener startFileAnalysis(TextFile file) { - Renderer renderer = Renderer.this; - - renderer.startFileAnalysis(file); // this routine is thread-safe by contract - return new FileAnalysisListener() { - final ReportBuilderListener reportBuilder = new ReportBuilderListener(); - - @Override - public void onRuleViolation(RuleViolation violation) { - reportBuilder.onRuleViolation(violation); - } - - @Override - public void onSuppressedRuleViolation(SuppressedViolation violation) { - reportBuilder.onSuppressedRuleViolation(violation); - } - - @Override - public void onError(ProcessingError error) { - reportBuilder.onError(error); - } - - @Override - public void close() throws Exception { - reportBuilder.close(); - synchronized (reportMergeLock) { - // TODO renderFileReport should be thread-safe instead - try (TimedOperation ignored = TimeTracker.startOperation(TimedOperationCategory.REPORTING)) { - renderer.renderFileReport(reportBuilder.getResult()); - } - } - } - - @Override - public String toString() { - return "FileRendererListener[" + Renderer.this + "]"; - } - }; - } - - @Override - public void close() throws Exception { - configErrorReport.close(); - Renderer.this.renderFileReport(configErrorReport.getResult()); - try (TimedOperation ignored = TimeTracker.startOperation(TimedOperationCategory.REPORTING)) { - end(); - flush(); - } - } - }; - } - - // --- compat - default void renderFileReport(net.sourceforge.pmd.Report report) throws IOException { - Report newReport = new Report(); - newReport.merge(report); - renderFileReport(newReport); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/Report.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/Report.java deleted file mode 100644 index db6ae84f83..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/Report.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.reporting; - -import java.util.function.Predicate; - -import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.lang.document.FileId; - -public class Report extends net.sourceforge.pmd.Report { - - public static class ConfigurationError extends net.sourceforge.pmd.Report.ConfigurationError { - public ConfigurationError(Rule theRule, String theIssue) { - super(theRule, theIssue); - } - - @Override - public net.sourceforge.pmd.lang.rule.Rule rule() { - return (net.sourceforge.pmd.lang.rule.Rule) super.rule(); - } - } - - public static class ProcessingError extends net.sourceforge.pmd.Report.ProcessingError { - public ProcessingError(Throwable error, FileId file) { - super(error, file); - } - } - - public static class SuppressedViolation extends net.sourceforge.pmd.Report.SuppressedViolation { - private final RuleViolation rv; - - public SuppressedViolation(RuleViolation rv, ViolationSuppressor suppressor, String userMessage) { - super(rv, suppressor, userMessage); - this.rv = rv; - } - - @Override - public net.sourceforge.pmd.reporting.RuleViolation getRuleViolation() { - return rv; - } - } - - public static final class GlobalReportBuilderListener extends net.sourceforge.pmd.Report.GlobalReportBuilderListener { - } - - public static final class ReportBuilderListener extends net.sourceforge.pmd.Report.ReportBuilderListener { - } - - @Override - public Report filterViolations(Predicate filter) { - Report copy = new Report(); - - for (net.sourceforge.pmd.RuleViolation violation : violations) { - if (filter.test(violation)) { - copy.addRuleViolation(violation); - } - } - - copy.suppressedRuleViolations.addAll(suppressedRuleViolations); - copy.errors.addAll(errors); - copy.configErrors.addAll(configErrors); - return copy; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/RuleViolation.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/RuleViolation.java deleted file mode 100644 index d501b9820e..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/reporting/RuleViolation.java +++ /dev/null @@ -1,8 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.reporting; - -public interface RuleViolation extends net.sourceforge.pmd.RuleViolation { -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/Predicate.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/Predicate.java deleted file mode 100644 index a6d0e68ce1..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/Predicate.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This class has been taken from 7.0.0-SNAPSHOT - -package net.sourceforge.pmd.util; - -/** - * Simple predicate of one argument. - * - * @param the type of the input to the predicate - */ -//@Experimental -public interface Predicate { - - boolean test(T t); -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AbstractCompoundFilter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AbstractCompoundFilter.java deleted file mode 100644 index 851c4bb492..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AbstractCompoundFilter.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * A base class for Filters which implements behavior using a List of other - * Filters. - * - * @param - * The underlying type on which the filter applies. - * @deprecated See {@link Filter} - */ -@Deprecated -public abstract class AbstractCompoundFilter implements Filter { - - protected List> filters; - - public AbstractCompoundFilter() { - filters = new ArrayList<>(2); - } - - public AbstractCompoundFilter(Filter... filters) { - this.filters = Arrays.asList(filters); - } - - public List> getFilters() { - return filters; - } - - public void setFilters(List> filters) { - this.filters = filters; - } - - public void addFilter(Filter filter) { - filters.add(filter); - } - - protected abstract String getOperator(); - - @Override - public String toString() { - - if (filters.isEmpty()) { - return "()"; - } - - StringBuilder builder = new StringBuilder(); - builder.append('(').append(filters.get(0)); - - for (int i = 1; i < filters.size(); i++) { - builder.append(' ').append(getOperator()).append(' '); - builder.append(filters.get(i)); - } - builder.append(')'); - return builder.toString(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AbstractDelegateFilter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AbstractDelegateFilter.java deleted file mode 100644 index e6ca4e47d2..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AbstractDelegateFilter.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -/** - * A base class for Filters which implements behavior using delegation to an - * underlying filter. - * - * @param - * The underlying type on which the filter applies. - * @deprecated See {@link Filter} - */ -@Deprecated -public abstract class AbstractDelegateFilter implements Filter { - protected Filter filter; - - public AbstractDelegateFilter() { - // default constructor - } - - public AbstractDelegateFilter(Filter filter) { - this.filter = filter; - } - - public Filter getFilter() { - return filter; - } - - public void setFilter(Filter filter) { - this.filter = filter; - } - - // Subclass should override to do something other the simply delegate. - @Override - public boolean filter(T obj) { - return filter.filter(obj); - } - - // Subclass should override to do something other the simply delegate. - @Override - public String toString() { - return filter.toString(); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AndFilter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AndFilter.java deleted file mode 100644 index be8ff31fea..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/AndFilter.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -/** - * A logical AND of a list of Filters. This implementation is short circuiting. - * - * @param - * The underlying type on which the filter applies. - * @deprecated See {@link Filter} - */ -@Deprecated -public class AndFilter extends AbstractCompoundFilter { - - public AndFilter() { - super(); - } - - public AndFilter(Filter... filters) { - super(filters); - } - - @Override - public boolean filter(T obj) { - boolean match = true; - for (Filter filter : filters) { - if (!filter.filter(obj)) { - match = false; - break; - } - } - return match; - } - - @Override - protected String getOperator() { - return "and"; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/DirectoryFilter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/DirectoryFilter.java deleted file mode 100644 index c1669e91d3..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/DirectoryFilter.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -import java.io.File; - -/** - * Directory filter. - * @deprecated See {@link Filter} - */ -@Deprecated -public final class DirectoryFilter implements Filter { - public static final DirectoryFilter INSTANCE = new DirectoryFilter(); - - private DirectoryFilter() { - } - - @Override - public boolean filter(File file) { - return file.isDirectory(); - } - - @Override - public String toString() { - return "is Directory"; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/FileExtensionFilter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/FileExtensionFilter.java deleted file mode 100644 index 06259afce3..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/FileExtensionFilter.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -import java.io.File; -import java.util.Locale; - -/** - * @deprecated See {@link Filter} - */ -@Deprecated -public class FileExtensionFilter implements Filter { - protected final String[] extensions; - protected final boolean ignoreCase; - - /** - * Matches any files with the given extensions, ignoring case - */ - public FileExtensionFilter(String... extensions) { - this(true, extensions); - } - - /** - * Matches any files with the given extensions, optionally ignoring case. - */ - public FileExtensionFilter(boolean ignoreCase, String... extensions) { - this.extensions = extensions; - this.ignoreCase = ignoreCase; - if (ignoreCase) { - for (int i = 0; i < this.extensions.length; i++) { - this.extensions[i] = this.extensions[i].toUpperCase(Locale.ROOT); - } - } - } - - @Override - public boolean filter(File file) { - boolean accept = extensions == null; - if (!accept) { - for (String extension : extensions) { - String name = file.getName(); - if (ignoreCase ? name.toUpperCase(Locale.ROOT).endsWith(extension) : name.endsWith(extension)) { - accept = true; - break; - } - } - } - return accept; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/Filter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/Filter.java deleted file mode 100644 index e99a14bb44..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/Filter.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -/** - * A Filter interface, used for filtering arbitrary objects. - * - * @param - * The underlying type on which the filter applies. - * - * @deprecated Will be replaced with standard java.util.function.Predicate with 7.0.0 - */ -@Deprecated -public interface Filter { - boolean filter(T obj); -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/Filters.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/Filters.java deleted file mode 100644 index 699b614308..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/Filters.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -import java.io.File; -import java.io.FilenameFilter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.sourceforge.pmd.annotation.InternalApi; - -/** - * Utility class for working with Filters. Contains builder style methods, apply - * methods, as well as mechanisms for adapting Filters and FilenameFilters. - * - * @deprecated Internal API, see {@link Filter} - */ -@Deprecated -@InternalApi -public final class Filters { - - private Filters() { } - - /** - * Filter a given Collection. - * - * @param - * Type of the Collection. - * @param filter - * A Filter upon the Type of objects in the Collection. - * @param collection - * The Collection to filter. - * @return A List containing only those objects for which the Filter - * returned true. - */ - public static List filter(Filter filter, Collection collection) { - List list = new ArrayList<>(); - for (T obj : collection) { - if (filter.filter(obj)) { - list.add(obj); - } - } - return list; - } - - /** - * Get a File Filter for files with the given extensions, ignoring case. - * - * @param extensions - * The extensions to filter. - * @return A File Filter. - */ - public static Filter getFileExtensionFilter(String... extensions) { - return new FileExtensionFilter(extensions); - } - - /** - * Get a File Filter for directories. - * - * @return A File Filter. - */ - public static Filter getDirectoryFilter() { - return DirectoryFilter.INSTANCE; - } - - /** - * Get a File Filter for directories or for files with the given extensions, - * ignoring case. - * - * @param extensions - * The extensions to filter. - * @return A File Filter. - */ - public static Filter getFileExtensionOrDirectoryFilter(String... extensions) { - return new OrFilter<>(getFileExtensionFilter(extensions), getDirectoryFilter()); - } - - /** - * Given a String Filter, expose as a File Filter. The File paths are - * normalized to a standard pattern using / as a path separator - * which can be used cross platform easily in a regular expression based - * String Filter. - * - * @param filter - * A String Filter. - * @return A File Filter. - */ - public static Filter toNormalizedFileFilter(final Filter filter) { - return new Filter() { - @Override - public boolean filter(File file) { - String path = file.getPath(); - path = path.replace('\\', '/'); - return filter.filter(path); - } - - @Override - public String toString() { - return filter.toString(); - } - }; - } - - /** - * Given a String Filter, expose as a Filter on another type. The - * toString() method is called on the objects of the other type - * and delegated to the String Filter. - * - * @param - * The desired type. - * @param filter - * The existing String Filter. - * @return A Filter on the desired type. - */ - public static Filter fromStringFilter(final Filter filter) { - return new Filter() { - @Override - public boolean filter(T obj) { - return filter.filter(obj.toString()); - } - - @Override - public String toString() { - return filter.toString(); - } - }; - } - - /** - * Given a File Filter, expose as a FilenameFilter. - * - * @param filter - * The File Filter. - * @return A FilenameFilter. - */ - public static FilenameFilter toFilenameFilter(final Filter filter) { - return new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return filter.filter(new File(dir, name)); - } - - @Override - public String toString() { - return filter.toString(); - } - }; - } - - /** - * Given a FilenameFilter, expose as a File Filter. - * - * @param filter - * The FilenameFilter. - * @return A File Filter. - */ - public static Filter toFileFilter(final FilenameFilter filter) { - return new Filter() { - @Override - public boolean filter(File file) { - return filter.accept(file.getParentFile(), file.getName()); - } - - @Override - public String toString() { - return filter.toString(); - } - }; - } - - /** - * Construct a String Filter using set of include and exclude regular - * expressions. If there are no include regular expressions provide, then a - * regular expression is added which matches every String by default. A - * String is included as long as it matches an include regular expression - * and does not match an exclude regular expression. - *

- * In other words, exclude patterns override include patterns. - * - * @param includeRegexes - * The include regular expressions. May be null. - * @param excludeRegexes - * The exclude regular expressions. May be null. - * @return A String Filter. - */ - public static Filter buildRegexFilterExcludeOverInclude(List includeRegexes, - List excludeRegexes) { - OrFilter includeFilter = new OrFilter<>(); - if (includeRegexes == null || includeRegexes.isEmpty()) { - includeFilter.addFilter(new RegexStringFilter(".*")); - } else { - for (String includeRegex : includeRegexes) { - includeFilter.addFilter(new RegexStringFilter(includeRegex)); - } - } - - OrFilter excludeFilter = new OrFilter<>(); - if (excludeRegexes != null) { - for (String excludeRegex : excludeRegexes) { - excludeFilter.addFilter(new RegexStringFilter(excludeRegex)); - } - } - - return new AndFilter<>(includeFilter, new NotFilter<>(excludeFilter)); - } - - /** - * Construct a String Filter using set of include and exclude regular - * expressions. If there are no include regular expressions provide, then a - * regular expression is added which matches every String by default. A - * String is included as long as the case that there is an include which - * matches or there is not an exclude which matches. - *

- * In other words, include patterns override exclude patterns. - * - * @param includeRegexes - * The include regular expressions. May be null. - * @param excludeRegexes - * The exclude regular expressions. May be null. - * @return A String Filter. - */ - public static Filter buildRegexFilterIncludeOverExclude(List includeRegexes, - List excludeRegexes) { - OrFilter includeFilter = new OrFilter<>(); - if (includeRegexes != null) { - for (String includeRegex : includeRegexes) { - includeFilter.addFilter(new RegexStringFilter(includeRegex)); - } - } - - OrFilter excludeFilter = new OrFilter<>(); - if (excludeRegexes != null) { - for (String excludeRegex : excludeRegexes) { - excludeFilter.addFilter(new RegexStringFilter(excludeRegex)); - } - } - - return new OrFilter<>(includeFilter, new NotFilter<>(excludeFilter)); - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/NotFilter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/NotFilter.java deleted file mode 100644 index 26cc124571..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/NotFilter.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -/** - * A logical NEGATION of a Filter. - * - * @param - * The underlying type on which the filter applies. - * @deprecated See {@link Filter} - */ -@Deprecated -public class NotFilter extends net.sourceforge.pmd.util.filter.AbstractDelegateFilter { - public NotFilter() { - super(); - } - - public NotFilter(Filter filter) { - super(filter); - } - - @Override - public boolean filter(T obj) { - return !filter.filter(obj); - } - - @Override - public String toString() { - return "not (" + filter + ")"; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/OrFilter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/OrFilter.java deleted file mode 100644 index 9c57d99a1f..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/OrFilter.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -/** - * A logical OR of a list of Filters. This implementation is short circuiting. - * - * @param - * The underlying type on which the filter applies. - * @deprecated See {@link Filter} - */ -@Deprecated -public class OrFilter extends AbstractCompoundFilter { - - public OrFilter() { - super(); - } - - public OrFilter(Filter... filters) { - super(filters); - } - - @Override - public boolean filter(T obj) { - boolean match = false; - for (Filter filter : filters) { - if (filter.filter(obj)) { - match = true; - break; - } - } - return match; - } - - @Override - protected String getOperator() { - return "or"; - } -} diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/RegexStringFilter.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/RegexStringFilter.java deleted file mode 100644 index 010f8f6065..0000000000 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/util/filter/RegexStringFilter.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -// This file has been taken from 6.55.0 - -package net.sourceforge.pmd.util.filter; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - -/** - * A filter which uses a regular expression to match Strings. Invalid regular - * expressions will match nothing. - *

- * Because regular expression matching is slow, and a common usage is to match - * some sort of relative file path, the regular expression is checked to see if - * it can be evaluated using much faster calls to - * {@link String#endsWith(String)}. - * @deprecated See {@link Filter} - */ -@Deprecated -public class RegexStringFilter implements Filter { - /** - * Matches regular expressions begin with an optional {@code ^}, then - * {@code .*}, then a literal path, with an optional file extension, and - * finally an optional {@code $} at the end. The {@code .} in the extension - * may or may not be preceded by a {@code \} escape. The literal path - * portion is determine by the absence of any of the following characters: - * \ [ ( . * ? + | { $ - * - * There are two capturing groups in the expression. The first is for the - * literal path. The second is for the file extension, without the escaping. - * The concatenation of these two captures creates the {@link String} which - * can be used with {@link String#endsWith(String)}. - * - * For ease of reference, the non-Java escaped form of this pattern is: - * \^?\.\*([^\\\[\(\.\*\?\+\|\{\$]+)(?:\\?(\.\w+))?\$? - */ - private static final Pattern ENDS_WITH = Pattern - .compile("\\^?\\.\\*([^\\\\\\[\\(\\.\\*\\?\\+\\|\\{\\$]+)(?:\\\\?(\\.\\w+))?\\$?"); - - protected String regex; - protected Pattern pattern; - protected String endsWith; - - public RegexStringFilter(String regex) { - this.regex = regex; - optimize(); - } - - public String getRegex() { - return this.regex; - } - - public String getEndsWith() { - return this.endsWith; - } - - protected void optimize() { - final Matcher matcher = ENDS_WITH.matcher(this.regex); - if (matcher.matches()) { - final String literalPath = matcher.group(1); - final String fileExtension = matcher.group(2); - if (fileExtension != null) { - this.endsWith = literalPath + fileExtension; - } else { - this.endsWith = literalPath; - } - } else { - try { - this.pattern = Pattern.compile(this.regex); - } catch (PatternSyntaxException ignored) { - // If the regular expression is invalid, then pattern will be - // null. - } - } - } - - @Override - public boolean filter(String obj) { - if (this.endsWith != null) { - return obj.endsWith(this.endsWith); - } - - return this.pattern != null && this.pattern.matcher(obj).matches(); - // if pattern was null, - // The regular expression must have been bad, so it will match - // nothing. - } - - @Override - public String toString() { - return "matches " + this.regex; - } -} diff --git a/pom.xml b/pom.xml index 393f3b7ee7..a09d82f29e 100644 --- a/pom.xml +++ b/pom.xml @@ -1324,18 +1324,6 @@ pmd-dist - - - pmd-compat6-module - - - !skip-pmd-compat6 - - - - pmd-compat6 - - From 18c30415d0476e9594ed6c04e89f68da7c8af4c5 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 20 Jun 2024 15:26:21 +0200 Subject: [PATCH 44/66] [java] Make impl of ASTLiteral#getLiteralText() public Fixes #4885 --- docs/pages/release_notes.md | 2 ++ .../xpath/impl/AttributeAxisIterator.java | 19 ++++++------------- .../xpath/impl/dummyast/AbstractNode.java | 10 +++++----- .../xpath/impl/dummyast/ConcreteNode.java | 6 ++++++ .../pmd/lang/java/ast/ASTBooleanLiteral.java | 9 ++++++++- .../pmd/lang/java/ast/ASTCharLiteral.java | 6 +++++- .../pmd/lang/java/ast/ASTNullLiteral.java | 9 ++++++++- .../pmd/lang/java/ast/ASTNumericLiteral.java | 7 ++++++- .../pmd/lang/java/ast/ASTStringLiteral.java | 7 ++++++- .../pmd/lang/java/ast/AbstractLiteral.java | 14 ++++++++++---- 10 files changed, 62 insertions(+), 27 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index aca33a5526..19f58e0947 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -17,6 +17,8 @@ This is a {{ site.pmd.release_type }} release. ### 🐛 Fixed Issues * apex * [#5053](https://github.com/pmd/pmd/issues/5053): \[apex] CPD fails to parse string literals with escaped characters +* java + * [#4885](https://github.com/pmd/pmd/issues/4885): \[java] AssertionError: Method should be accessible * java-bestpractices * [#5047](https://github.com/pmd/pmd/issues/5047): \[java] UnusedPrivateMethod FP for Generics & Overloads * plsql diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java index 001e32572c..3ca70f0686 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.rule.xpath.impl; -import static net.sourceforge.pmd.util.CollectionUtil.emptyList; import static net.sourceforge.pmd.util.CollectionUtil.setOf; import java.lang.invoke.MethodHandle; @@ -91,7 +90,7 @@ public class AttributeAxisIterator implements Iterator { .filter(m -> isAttributeAccessor(nodeClass, m)) .map(m -> { try { - return new MethodWrapper(m, nodeClass); + return new MethodWrapper(m); } catch (ReflectiveOperationException e) { throw AssertionUtil.shouldNotReachHere("Method '" + m + "' should be accessible, but: " + e, e); } @@ -210,19 +209,13 @@ public class AttributeAxisIterator implements Iterator { public final String name; - MethodWrapper(Method m, Class nodeClass) throws IllegalAccessException, NoSuchMethodException { + MethodWrapper(Method m) throws IllegalAccessException { this.method = m; this.name = truncateMethodName(m.getName()); - - if (!Modifier.isPublic(m.getDeclaringClass().getModifiers())) { - // This is a public method of a non-public class. - // To call it from reflection we need to call it via invokevirtual, - // whereas the default handle would use invokespecial. - MethodType methodType = MethodType.methodType(m.getReturnType(), emptyList()); - this.methodHandle = MethodWrapper.LOOKUP.findVirtual(nodeClass, m.getName(), methodType).asType(GETTER_TYPE); - } else { - this.methodHandle = LOOKUP.unreflect(m).asType(GETTER_TYPE); - } + // Note: We only support public methods on public types. If the method being called is implemented + // in a package-private class, this won't work. + // See git history here and https://github.com/pmd/pmd/issues/4885 + this.methodHandle = LOOKUP.unreflect(m).asType(GETTER_TYPE); } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/dummyast/AbstractNode.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/dummyast/AbstractNode.java index 7f1d4a366e..7ca1219450 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/dummyast/AbstractNode.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/dummyast/AbstractNode.java @@ -8,16 +8,16 @@ import net.sourceforge.pmd.lang.ast.DummyNode; import net.sourceforge.pmd.lang.document.Chars; // This class is package private -// and provides the implementation for getValue(). This -// class is the DeclaringClass for that method. -class AbstractNode extends DummyNode implements ValueNode { +// and provides the implementation for getValue(). +// This method is not accessible from outside this package, +// it is made available in the subclass ConcreteNode. +class AbstractNode extends DummyNode { AbstractNode() { } - @Override - public final Chars getValue() { + Chars getValue() { return Chars.wrap("actual_value"); } } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/dummyast/ConcreteNode.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/dummyast/ConcreteNode.java index bd2b214529..ebc4c3d634 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/dummyast/ConcreteNode.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/dummyast/ConcreteNode.java @@ -4,5 +4,11 @@ package net.sourceforge.pmd.lang.rule.xpath.impl.dummyast; +import net.sourceforge.pmd.lang.document.Chars; + public final class ConcreteNode extends AbstractNode implements ValueNode { + @Override + public Chars getValue() { + return super.getValue(); + } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java index 694ae630fb..619cca36f4 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java @@ -6,10 +6,12 @@ package net.sourceforge.pmd.lang.java.ast; import org.checkerframework.checker.nullness.qual.NonNull; +import net.sourceforge.pmd.lang.document.Chars; + /** * The boolean literal, either "true" or "false". */ -public final class ASTBooleanLiteral extends AbstractLiteral { +public final class ASTBooleanLiteral extends AbstractLiteral implements ASTLiteral { private boolean isTrue; @@ -32,6 +34,11 @@ public final class ASTBooleanLiteral extends AbstractLiteral { return isTrue; } + @Override + public Chars getLiteralText() { + return super.getLiteralText(); + } + @Override protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java index 5cc8e60b6f..aa0e25d324 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java @@ -15,7 +15,7 @@ import net.sourceforge.pmd.lang.document.Chars; * retrieve the actual runtime value. Use {@link #getLiteralText()} to * retrieve the text. */ -public final class ASTCharLiteral extends AbstractLiteral { +public final class ASTCharLiteral extends AbstractLiteral implements ASTLiteral { ASTCharLiteral(int id) { @@ -39,4 +39,8 @@ public final class ASTCharLiteral extends AbstractLiteral { return StringEscapeUtils.UNESCAPE_JAVA.translate(woDelims).charAt(0); } + @Override + public Chars getLiteralText() { + return super.getLiteralText(); + } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java index 05a1cb1b24..da168327c2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java @@ -6,6 +6,8 @@ package net.sourceforge.pmd.lang.java.ast; import org.checkerframework.checker.nullness.qual.Nullable; +import net.sourceforge.pmd.lang.document.Chars; + /** * The null literal. * @@ -15,7 +17,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; * * */ -public final class ASTNullLiteral extends AbstractLiteral { +public final class ASTNullLiteral extends AbstractLiteral implements ASTLiteral { ASTNullLiteral(int id) { super(id); } @@ -35,4 +37,9 @@ public final class ASTNullLiteral extends AbstractLiteral { public @Nullable Object getConstValue() { return null; } + + @Override + public Chars getLiteralText() { + return super.getLiteralText(); + } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java index c0e4d21383..c8f711fdb5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java @@ -14,7 +14,7 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType; /** * A numeric literal of any type (double, int, long, float, etc). */ -public final class ASTNumericLiteral extends AbstractLiteral { +public final class ASTNumericLiteral extends AbstractLiteral implements ASTLiteral { /** * True if this is an integral literal, ie int OR long, @@ -36,6 +36,11 @@ public final class ASTNumericLiteral extends AbstractLiteral { return visitor.visit(this, data); } + @Override + public Chars getLiteralText() { + return super.getLiteralText(); + } + @Override public @NonNull Number getConstValue() { return (Number) super.getConstValue(); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java index 928138bb5f..ab3684fb36 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java @@ -18,7 +18,7 @@ import net.sourceforge.pmd.util.StringUtil; * in the source ({@link #getLiteralText()}). {@link #getConstValue()} allows to recover * the actual runtime value, by processing escapes. */ -public final class ASTStringLiteral extends AbstractLiteral { +public final class ASTStringLiteral extends AbstractLiteral implements ASTLiteral { private static final String TEXTBLOCK_DELIMITER = "\"\"\""; @@ -36,6 +36,11 @@ public final class ASTStringLiteral extends AbstractLiteral { return getText().toString(); } + @Override + public Chars getLiteralText() { + return super.getLiteralText(); + } + void setTextBlock() { this.isTextBlock = true; } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractLiteral.java index 7c48889275..677204c967 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractLiteral.java @@ -10,8 +10,11 @@ import net.sourceforge.pmd.lang.rule.xpath.NoAttribute; /** * @author Clément Fournier + * @see ASTLiteral#getLiteralText() + * @see #getLiteralText() */ -abstract class AbstractLiteral extends AbstractJavaExpr implements ASTLiteral { +// Note: This class must not implement ASTLiteral, see comment on #getLiteralText() +abstract class AbstractLiteral extends AbstractJavaExpr { private JavaccToken literalToken; @@ -41,13 +44,16 @@ abstract class AbstractLiteral extends AbstractJavaExpr implements ASTLiteral { return firstToken.getImageCs(); } - @Override - public final Chars getLiteralText() { + // This method represents ASTLiteral#getLiteralText(). + // However, since this class is package private, this method is not reliably accessible + // via reflection/method handles (see https://github.com/pmd/pmd/issues/4885). + // Subclasses of this class need to implement ASTLiteral and override this method + // as public. + Chars getLiteralText() { assert literalToken.getImageCs() != null; return literalToken.getImageCs(); } - @Override public boolean isCompileTimeConstant() { return true; // note: NullLiteral overrides this to false From d285082709d4dfdf81f885914640337805191290 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 21 Jun 2024 19:23:55 +0200 Subject: [PATCH 45/66] Updated doc to mention 7.3.0 --- docs/pages/pmd/userdocs/cli_reference.md | 6 +++--- docs/pages/pmd/userdocs/cpd/cpd.md | 10 +++++----- docs/pages/pmd/userdocs/tools/ant.md | 2 +- .../src/main/java/net/sourceforge/pmd/ant/CPDTask.java | 4 ++-- .../net/sourceforge/pmd/AbstractConfiguration.java | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md index cf90f0e39b..a499b49cf8 100644 --- a/docs/pages/pmd/userdocs/cli_reference.md +++ b/docs/pages/pmd/userdocs/cli_reference.md @@ -5,7 +5,7 @@ tags: [userdocs] keywords: [command, line, options, help, formats, renderers] permalink: pmd_userdocs_cli_reference.html author: Tom Copeland , Xavier Le Vourch , Juan Martín Sotuyo Dodero -last_updated: May 2024 (7.2.0) +last_updated: June 2024 (7.3.0) --- @@ -210,7 +210,7 @@ Or you can set the environment variable `CLASSPATH` before starting PMD, e.g. ## Exit Status -Please note that if PMD detects any violations, it will exit with status 4 (since 5.3) or 5 (since 7.2.0). +Please note that if PMD detects any violations, it will exit with status 4 (since 5.3) or 5 (since 7.3.0). This behavior has been introduced to ease PMD integration into scripts or hooks, such as SVN hooks. @@ -219,7 +219,7 @@ This behavior has been introduced to ease PMD integration into scripts or hooks, + To ignore recoverable errors, use --no-fail-on-error.

Since PMD 7.3.0.

2Usage error. Command-line parameters are invalid or missing.
4At least one violation has been detected, unless --no-fail-on-violation is set.

Since PMD 5.3.

5At least one recoverable error has occurred. There might be additionally zero or more violations detected. - To ignore recoverable errors, use --no-fail-on-error.

Since PMD 7.2.0.

{%include note.html content="If PMD exits with 5, then PMD had either trouble parsing one or more files or a rule failed with an exception. diff --git a/docs/pages/pmd/userdocs/cpd/cpd.md b/docs/pages/pmd/userdocs/cpd/cpd.md index 0be9c12cac..1bf2954c18 100644 --- a/docs/pages/pmd/userdocs/cpd/cpd.md +++ b/docs/pages/pmd/userdocs/cpd/cpd.md @@ -4,7 +4,7 @@ tags: [cpd, userdocs] summary: "Learn how to use CPD, the copy-paste detector shipped with PMD." permalink: pmd_userdocs_cpd.html author: Tom Copeland -last_updated: May 2024 (7.2.0) +last_updated: June 2024 (7.3.0) --- ## Overview @@ -284,7 +284,7 @@ If you specify a source directory but don't want to scan the sub-directories, yo ### Exit status -Please note that if CPD detects duplicated source code, it will exit with status 4 (since 5.0) or 5 (since 7.2.0). +Please note that if CPD detects duplicated source code, it will exit with status 4 (since 5.0) or 5 (since 7.3.0). This behavior has been introduced to ease CPD integration into scripts or hooks, such as SVN hooks. @@ -293,7 +293,7 @@ This behavior has been introduced to ease CPD integration into scripts or hooks, + To ignore recoverable errors, use --no-fail-on-error.

Since PMD 7.3.0.

2Usage error. Command-line parameters are invalid or missing.
4At least one code duplication has been detected unless --no-fail-on-violation is set.

Since PMD 5.0.

5At least one recoverable error has occurred. There might be additionally zero or more duplications detected. - To ignore recoverable errors, use --no-fail-on-error.

Since PMD 7.2.0.

{%include note.html content="If PMD exits with 5, then PMD had trouble lexing one or more files. @@ -402,7 +402,7 @@ Andy Glover wrote an Ant task for CPD; here's how to use it: If not specified, CPD uses the system default encoding." %} {% include custom/cli_option_row.html options="failOnError" - description="Whether to fail the build if any errors occurred while processing the files. Since PMD 7.2.0." + description="Whether to fail the build if any errors occurred while processing the files. Since PMD 7.3.0." default="true" %} {% include custom/cli_option_row.html options="format" @@ -441,7 +441,7 @@ Andy Glover wrote an Ant task for CPD; here's how to use it: {% include custom/cli_option_row.html options="skipLexicalErrors" description="Deprecated Skip files which can't be tokenized due to invalid characters instead of aborting CPD. This parameter is deprecated and - ignored since PMD 7.2.0. It is now by default true. Use `failOnError` instead to fail the build." + ignored since PMD 7.3.0. It is now by default true. Use `failOnError` instead to fail the build." default="true" %} {% include custom/cli_option_row.html options="skipBlocks" diff --git a/docs/pages/pmd/userdocs/tools/ant.md b/docs/pages/pmd/userdocs/tools/ant.md index f81e1aa546..b37ea8ad5f 100644 --- a/docs/pages/pmd/userdocs/tools/ant.md +++ b/docs/pages/pmd/userdocs/tools/ant.md @@ -6,7 +6,7 @@ author: > David Dixon-Peugh , Tom Copeland , Xavier Le Vourch -last_updated: May 2024 (7.2.0) +last_updated: June 2024 (7.3.0) --- ## PMD diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java index b82671c22f..e27ca93821 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java @@ -103,7 +103,7 @@ public class CPDTask extends Task { config.setSkipDuplicates(skipDuplicateFiles); if (skipLexicalErrors) { - log("skipLexicalErrors is deprecated since 7.2.0 and the property is ignored. " + log("skipLexicalErrors is deprecated since 7.3.0 and the property is ignored. " + "Lexical errors are now skipped by default and the build is failed. " + "Use failOnError=\"false\" to not fail the build.", Project.MSG_WARN); } @@ -277,7 +277,7 @@ public class CPDTask extends Task { /** * Whether to fail the build if any recoverable errors occurred while processing the files. * - * @since 7.2.0 + * @since 7.3.0 */ public void setFailOnError(boolean failOnError) { this.failOnError = failOnError; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java b/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java index 567917a98f..0960a0fd48 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java @@ -416,13 +416,13 @@ public abstract class AbstractConfiguration { * Whether PMD should exit with status 5 (the default behavior, true) if * recoverable errors occurred or just with 0 (to not break the build, e.g.). * - *

Note: If only violations are found, the exist status is 4. See + *

Note: If only violations are found, the exit status is 4. See * {@link #isFailOnViolation()}. * * @return failOnError * * @see #isFailOnViolation() - * @since 7.2.0 + * @since 7.3.0 */ public boolean isFailOnError() { return failOnError; @@ -432,13 +432,13 @@ public abstract class AbstractConfiguration { * Sets whether PMD should exit with status 5 (the default behavior, true) * if recoverable errors occurred or just with 0 (to not break the build, e.g.). * - *

Note: If only violations are found, the exist status is 4. See + *

Note: If only violations are found, the exit status is 4. See * {@link #isFailOnViolation()}. * * @param failOnError whether to exit with 5 and fail the build if recoverable errors occurred. * * @see #isFailOnViolation() - * @since 7.2.0 + * @since 7.3.0 */ public void setFailOnError(boolean failOnError) { this.failOnError = failOnError; From f5ab687c6a3b646c778ea9fba73f200311a361c2 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 27 Jun 2024 10:40:49 +0200 Subject: [PATCH 46/66] [java] Use Objects.equals consistently in SymbolEquality --- .../pmd/lang/java/symbols/internal/SymbolEquality.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/SymbolEquality.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/SymbolEquality.java index 2d516f184b..2f009f7304 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/SymbolEquality.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/SymbolEquality.java @@ -50,7 +50,7 @@ public final class SymbolEquality { } JTypeParameterSymbol m2 = (JTypeParameterSymbol) o; - return m1.nameEquals(m2.getSimpleName()) + return Objects.equals(m1.getSimpleName(), m2.getSimpleName()) && m1.getDeclaringSymbol().equals(m2.getDeclaringSymbol()); } }; @@ -136,7 +136,7 @@ public final class SymbolEquality { return false; } JFieldSymbol f2 = (JFieldSymbol) o; - return f1.nameEquals(f2.getSimpleName()) + return Objects.equals(f1.getSimpleName(), f2.getSimpleName()) && f1.getEnclosingClass().equals(f2.getEnclosingClass()); } @@ -171,7 +171,7 @@ public final class SymbolEquality { return false; } JFormalParamSymbol f2 = (JFormalParamSymbol) o; - return f1.nameEquals(f2.getSimpleName()) + return Objects.equals(f1.getSimpleName(), f2.getSimpleName()) && f1.getDeclaringSymbol().equals(f2.getDeclaringSymbol()); } @@ -190,7 +190,7 @@ public final class SymbolEquality { return false; } JRecordComponentSymbol f2 = (JRecordComponentSymbol) o; - return f1.nameEquals(f2.getSimpleName()) + return Objects.equals(f1.getSimpleName(), f2.getSimpleName()) && f1.getEnclosingClass().equals(f2.getEnclosingClass()); } From 31b4e3745a2ccbb201770a2bd3733f0ffe1ef5fa Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 27 Jun 2024 10:49:20 +0200 Subject: [PATCH 47/66] [doc] Update release notes (#5050, #5051) --- docs/pages/release_notes.md | 9 +++++++++ .../sourceforge/pmd/lang/java/ast/ASTRecordPattern.java | 6 +++++- .../pmd/lang/java/symbols/JRecordComponentSymbol.java | 2 +- .../java/rule/performance/xml/StringInstantiation.xml | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e8d7cdbf90..3a8d070f22 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -15,9 +15,18 @@ This is a {{ site.pmd.release_type }} release. ### 🚀 New and noteworthy ### 🐛 Fixed Issues +* pmd-java + * [#5050](https://github.com/pmd/pmd/issues/5050): \[java] Problems with pattern variables in switch branches ### 🚨 API Changes +#### Deprecated for removal + +* pmd-java + * {%jdoc java::lang.java.ast.ASTRecordPattern#getVarId() %} This method was added here by mistake. Record + patterns don't declare a pattern variable for the whole pattern, but rather for individual record + components, which can be accessed via {%jdoc java::lang.java.ast.ASTRecordPattern#getComponentPatterns() %}. + ### ✨ External Contributions {% endtocmaker %} diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java index 8de3dd187c..874570e383 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java @@ -38,6 +38,8 @@ public final class ASTRecordPattern extends AbstractJavaPattern { /** * Return the patterns for each record component. + * + * @since 7.3.0 */ public ASTPatternList getComponentPatterns() { return firstChild(ASTPatternList.class); @@ -47,7 +49,9 @@ public final class ASTRecordPattern extends AbstractJavaPattern { /** * Returns the declared variable. * - * @deprecated This method was added here by mistake + * @deprecated This method was added here by mistake. Record patterns don't declare a pattern variable + * for the whole pattern, but rather for individual record components, which can be accessed via + * {@link #getComponentPatterns()}. */ @Deprecated public ASTVariableId getVarId() { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JRecordComponentSymbol.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JRecordComponentSymbol.java index 4906a0facb..ef5d130868 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JRecordComponentSymbol.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JRecordComponentSymbol.java @@ -18,7 +18,7 @@ import net.sourceforge.pmd.lang.java.types.Substitution; * with a private final {@link JFieldSymbol} and a public * {@linkplain JMethodSymbol accessor method}. * - * @since 7.0.0 + * @since 7.3.0 */ public interface JRecordComponentSymbol extends JAccessibleElementSymbol, BoundToNode { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/StringInstantiation.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/StringInstantiation.xml index d89377f03b..c38e4cb5f6 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/StringInstantiation.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/StringInstantiation.xml @@ -162,7 +162,7 @@ public class Foo { ]]> - FP in switch + FP in switch #5050 0 Date: Thu, 27 Jun 2024 10:55:55 +0200 Subject: [PATCH 48/66] [java] Rebuild SomeRecordsTestData.java --- .../symbols/recordclasses/Annotated.class | Bin 1935 -> 1935 bytes .../recordclasses/AnnotatedForRecord.class | Bin 1430 -> 1430 bytes .../symbols/recordclasses/GenericBox.class | Bin 1719 -> 1719 bytes .../java/symbols/recordclasses/Point.class | Bin 1363 -> 1363 bytes .../symbols/recordclasses/RecordAnnot.class | Bin 445 -> 445 bytes .../recordclasses/SomeRecordsTestData.java | 2 +- .../recordclasses/TypeAnnotation.class | Bin 440 -> 440 bytes .../java/symbols/recordclasses/Varargs.class | Bin 1293 -> 1293 bytes 8 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/Annotated.class b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/Annotated.class index f4c0c0f3929e44cf91290ef43248d30ee1ede1a1..d86a911c8c940598fb108ee53e76a43953fe2b33 100644 GIT binary patch delta 17 YcmeC@@8{<@^>5cc1_lPljU4Ul06V1y4FCWD delta 17 YcmeC@@8{<@^>5cc1_lPFjU4Ul06VG%4gdfE diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/AnnotatedForRecord.class b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/AnnotatedForRecord.class index 5c63ba6c43c24fb61548f0e5347f83861587ae2d..638730a3bc5cfda5d3b564891ba80175405d538a 100644 GIT binary patch delta 17 ZcmbQnJ&l{=)W2Q(7#J8FH*)l`0suT21{eSU delta 17 ZcmbQnJ&l{=)W2Q(7#J9wHgfc_0suT71{nYV diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/GenericBox.class b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/GenericBox.class index 75b5ac28d393b6b52fbb130e276fbfca7d5e4a2f..47420f346a5d8f20f1e94da8da4f149feef558ce 100644 GIT binary patch delta 17 ZcmdnayPcQg)W2Q(7#J8FH*&0J0{}p{27mwn delta 17 ZcmdnayPcQg)W2Q(7#J9wHgc?I0{}q127v$o diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/Point.class b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/Point.class index 124c1482088c70f844a8cb1be722a46c97a1461a..54c0564e9d42f6dd5276820d1ece971fcd3b159d 100644 GIT binary patch delta 17 Zcmcc2b(xFf)W2Q(7#J8FH*$Eh0suo522B6} delta 17 Zcmcc2b(xFf)W2Q(7#J9wHgb5g0suoA22KC~ diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/RecordAnnot.class b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/RecordAnnot.class index 3fa12663e0155f599050c5195cb92444047f5a04..d45b4f4d02ee97d84f9f0cf1bd30231fbd591c72 100644 GIT binary patch delta 17 ZcmdnXyqB5d)W2Q(7#J8FH*#!c1OPx&26+Gg delta 17 ZcmdnXyqB5d)W2Q(7#J9wHgarb1OPx-26_Mh diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/SomeRecordsTestData.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/SomeRecordsTestData.java index cd00a98e6b..b4e1304b61 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/SomeRecordsTestData.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/SomeRecordsTestData.java @@ -9,7 +9,7 @@ import java.lang.annotation.Target; /** * Note: this is compiled manually as it uses features of Java 21. * Compile with - * javac pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/SomeRecordsTestData.java + * javac --release 21 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/SomeRecordsTestData.java */ diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/TypeAnnotation.class b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/TypeAnnotation.class index 522146fce7312ac2948f455ce4e7f060cb00e7d3..82334a492624b64fb3d974bbaefc4219de853df8 100644 GIT binary patch delta 17 ZcmdnNyn~tJ)W2Q(7#J8FH*#!X1OPv&25JBR delta 17 ZcmdnNyn~tJ)W2Q(7#J9wHgarW1OPv-25SHS diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/Varargs.class b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/symbols/recordclasses/Varargs.class index 6536249118f587911017a6b33e449b30c8390030..47e8e8a28b9c9b6b3162a671a81c7d4200f72deb 100644 GIT binary patch delta 17 YcmeC>>gD1%^>5cc1_lPljU24306ED8djJ3c delta 17 YcmeC>>gD1%^>5cc1_lPFjU24306ESDd;kCd From f37d432b9e07bb907468909943904e7a6804b6c7 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 27 Jun 2024 11:29:00 +0200 Subject: [PATCH 49/66] Revert "support TreeSet/Map" This reverts commit 209fc134621862b7043dd05ac72265cd21a838d2. --- .../bestpractices/UseEnumCollectionsRule.java | 9 ++------- .../resources/category/java/bestpractices.xml | 6 +++--- .../bestpractices/xml/UseEnumCollections.xml | 17 ++++------------- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseEnumCollectionsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseEnumCollectionsRule.java index b4acae55e6..a90b971544 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseEnumCollectionsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseEnumCollectionsRule.java @@ -7,8 +7,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.TreeMap; -import java.util.TreeSet; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; @@ -35,11 +33,8 @@ public class UseEnumCollectionsRule extends AbstractJavaRulechainRule { JTypeMirror builtType = call.getTypeMirror(); if (!builtType.isRaw()) { - boolean isMap = TypeTestUtil.isExactlyA(HashMap.class, builtType) - || TypeTestUtil.isExactlyA(TreeMap.class, builtType); - if (isMap - || TypeTestUtil.isExactlyA(HashSet.class, builtType) - || TypeTestUtil.isExactlyA(TreeSet.class, builtType)) { + boolean isMap = TypeTestUtil.isExactlyA(HashMap.class, builtType); + if (isMap || TypeTestUtil.isExactlyA(HashSet.class, builtType)) { List typeArgs = ((JClassType) builtType).getTypeArgs(); JTypeDeclSymbol keySymbol = typeArgs.get(0).getSymbol(); diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index b965db740f..3a45bbaacd 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -1731,9 +1731,9 @@ public class Foo { class="net.sourceforge.pmd.lang.java.rule.bestpractices.UseEnumCollectionsRule" externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#useenumcollections"> - Wherever possible, use `EnumSet` or `EnumMap` instead of more generic set and map implementations when the keys - are of an enum type. The specialized collections are more space- and time-efficient. - This rule reports constructor expressions for hash and tree sets or maps whose key type is an enum type. + Wherever possible, use `EnumSet` or `EnumMap` instead of `HashSet` and `HashMap` when the keys + are of an enum type. This rule reports constructor expressions for hash sets or maps whose key + type is an enum type. 3 diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UseEnumCollections.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UseEnumCollections.xml index 76f474e3b5..c98b1d7124 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UseEnumCollections.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UseEnumCollections.xml @@ -6,11 +6,10 @@ Use enumset - 2 - 8,12 + 1 + 8 This collection could be an EnumSet - This collection could be an EnumSet set = new HashSet<>(); return set.contains(E.A); } - public static boolean bar2() { - Set set = new TreeSet<>(); - return set.contains(E.A); - } } ]]> @@ -35,11 +30,10 @@ Use enummap - 2 - 7,10 + 1 + 7 This collection could be an EnumMap - This collection could be an EnumMap bar() { return new HashMap<>(); } - public static Map bar() { - return new TreeMap<>(); - } } ]]> From bf8e11d9b454c82c775cac88d14392c00768a61f Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 27 Jun 2024 11:40:18 +0200 Subject: [PATCH 50/66] [doc] Update release notes (#577, #5038) --- docs/pages/release_notes.md | 6 ++++++ pmd-java/src/main/resources/category/java/bestpractices.xml | 3 ++- pmd-java/src/main/resources/rulesets/java/quickstart.xml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e8d7cdbf90..b7ee338344 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -14,7 +14,13 @@ This is a {{ site.pmd.release_type }} release. ### 🚀 New and noteworthy +#### ✨ New Rules +* The new Java rule {%rule java/bestpractices/UseEnumCollections %} reports usages for `HashSet` and `HashMap` + when the keys are of an enum type. The specialized enum collections are more space- and time-efficient. + ### 🐛 Fixed Issues +* java + * [#577](https://github.com/pmd/pmd/issues/577): \[java] New Rule: Check that Map is an EnumMap if K is an enum value ### 🚨 API Changes diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml index 3a45bbaacd..a8a3169254 100644 --- a/pmd-java/src/main/resources/category/java/bestpractices.xml +++ b/pmd-java/src/main/resources/category/java/bestpractices.xml @@ -1732,7 +1732,8 @@ public class Foo { externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#useenumcollections"> Wherever possible, use `EnumSet` or `EnumMap` instead of `HashSet` and `HashMap` when the keys - are of an enum type. This rule reports constructor expressions for hash sets or maps whose key + are of an enum type. The specialized enum collections are more space- and time-efficient. + This rule reports constructor expressions for hash sets or maps whose key type is an enum type. 3 diff --git a/pmd-java/src/main/resources/rulesets/java/quickstart.xml b/pmd-java/src/main/resources/rulesets/java/quickstart.xml index da02719225..4afb964163 100644 --- a/pmd-java/src/main/resources/rulesets/java/quickstart.xml +++ b/pmd-java/src/main/resources/rulesets/java/quickstart.xml @@ -52,6 +52,7 @@ + From 9b20ec524af849b06fb8b30bfdd90f7e2198b743 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 27 Jun 2024 21:15:10 +0200 Subject: [PATCH 51/66] [core] Remove AntlrLexerBehavior --- .../pmd/cpd/impl/AntlrCpdLexer.java | 11 +------ .../ast/impl/antlr4/AntlrLexerBehavior.java | 32 ------------------- .../pmd/lang/ast/impl/antlr4/AntlrToken.java | 21 +++++------- .../ast/impl/antlr4/AntlrTokenManager.java | 10 +----- .../pmd/lang/tsql/cpd/TSqlCpdLexer.java | 22 +++++-------- 5 files changed, 18 insertions(+), 78 deletions(-) delete mode 100644 pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrLexerBehavior.java diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrCpdLexer.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrCpdLexer.java index a451e8400d..3c06996210 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrCpdLexer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/impl/AntlrCpdLexer.java @@ -12,7 +12,6 @@ import org.antlr.v4.runtime.Lexer; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.TokenManager; -import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrLexerBehavior; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrToken; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTokenManager; import net.sourceforge.pmd.lang.document.TextDocument; @@ -24,15 +23,7 @@ public abstract class AntlrCpdLexer extends CpdLexerBase { @Override protected final TokenManager makeLexerImpl(TextDocument doc) throws IOException { CharStream charStream = CharStreams.fromReader(doc.newReader(), doc.getFileId().getAbsolutePath()); - return new AntlrTokenManager(getLexerForSource(charStream), doc, getLexerBehavior()); - } - - /** - * Override this method to customize some aspects of the - * lexer. - */ - protected AntlrLexerBehavior getLexerBehavior() { - return new AntlrLexerBehavior(); + return new AntlrTokenManager(getLexerForSource(charStream), doc); } protected abstract Lexer getLexerForSource(CharStream charStream); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrLexerBehavior.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrLexerBehavior.java deleted file mode 100644 index 7d2e8cf24e..0000000000 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrLexerBehavior.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.ast.impl.antlr4; - -import org.antlr.v4.runtime.Token; - -import net.sourceforge.pmd.cpd.CpdLanguageProperties; - -/** - * Strategy to customize some aspects of the mapping - * from Antlr tokens to PMD/CPD tokens. - */ -public class AntlrLexerBehavior { - - - /** - * Return the image that the token should have, possibly applying a transformation. - * The default just returns {@link Token#getText()}. - * Transformations here are usually normalizations, for instance, mapping - * the image of all keywords to uppercase/lowercase to implement case-insensitivity, - * or replacing the image of literals by a placeholder to implement {@link CpdLanguageProperties#CPD_ANONYMIZE_LITERALS}. - * - * @param token A token from the Antlr Lexer - * - * @return The image - */ - protected String getTokenImage(Token token) { - return token.getText(); - } -} diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java index 22a4fcbdc3..4a12e8388d 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java @@ -33,23 +33,18 @@ public class AntlrToken implements GenericToken { * @param token The antlr token implementation * @param previousComment The previous comment * @param textDoc The text document - */ - AntlrToken(final Token token, final AntlrToken previousComment, TextDocument textDoc, AntlrLexerBehavior behavior) { - this.previousComment = previousComment; - this.textDoc = textDoc; - this.image = behavior.getTokenImage(token); - this.startOffset = token.getStartIndex(); - this.endOffset = token.getStopIndex() + 1; // exclusive - this.channel = token.getChannel(); - this.kind = token.getType(); - } - - /** + * * @deprecated Don't create antlr tokens directly, use an {@link AntlrTokenManager} */ @Deprecated public AntlrToken(final Token token, final AntlrToken previousComment, TextDocument textDoc) { - this(token, previousComment, textDoc, new AntlrLexerBehavior()); + this.previousComment = previousComment; + this.textDoc = textDoc; + this.image = token.getText(); + this.startOffset = token.getStartIndex(); + this.endOffset = token.getStopIndex() + 1; // exclusive + this.channel = token.getChannel(); + this.kind = token.getType(); } @Override diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java index 6c54e3ef05..5828195850 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTokenManager.java @@ -20,20 +20,12 @@ public class AntlrTokenManager implements TokenManager { private final Lexer lexer; private final TextDocument textDoc; - private final AntlrLexerBehavior behavior; private AntlrToken previousToken; public AntlrTokenManager(final Lexer lexer, final TextDocument textDocument) { - this(lexer, textDocument, new AntlrLexerBehavior()); - } - - public AntlrTokenManager(final Lexer lexer, - final TextDocument textDocument, - final AntlrLexerBehavior behavior) { this.lexer = lexer; this.textDoc = textDocument; - this.behavior = behavior; resetListeners(); } @@ -48,7 +40,7 @@ public class AntlrTokenManager implements TokenManager { private AntlrToken getNextTokenFromAnyChannel() { final AntlrToken previousComment = previousToken != null && previousToken.isHidden() ? previousToken : null; - final AntlrToken currentToken = new AntlrToken(lexer.nextToken(), previousComment, textDoc, this.behavior); + final AntlrToken currentToken = new AntlrToken(lexer.nextToken(), previousComment, textDoc); if (previousToken != null) { previousToken.next = currentToken; } diff --git a/pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexer.java b/pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexer.java index deea25c4fb..3e82239cda 100644 --- a/pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexer.java +++ b/pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/cpd/TSqlCpdLexer.java @@ -8,10 +8,9 @@ import java.util.Locale; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Lexer; -import org.antlr.v4.runtime.Token; import net.sourceforge.pmd.cpd.impl.AntlrCpdLexer; -import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrLexerBehavior; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrToken; import net.sourceforge.pmd.lang.tsql.ast.TSqlLexer; /** @@ -25,17 +24,12 @@ public class TSqlCpdLexer extends AntlrCpdLexer { } @Override - protected AntlrLexerBehavior getLexerBehavior() { - return new AntlrLexerBehavior() { - @Override - protected String getTokenImage(Token token) { - if (token.getType() == TSqlLexer.STRING) { - // This path is for case-sensitive tokens - return super.getTokenImage(token); - } - // normalize case sensitive tokens - return token.getText().toUpperCase(Locale.ROOT); - } - }; + protected String getImage(AntlrToken token) { + if (token.getKind() == TSqlLexer.STRING) { + // This path is for case-sensitive tokens + return token.getImage(); + } + // normalize case-insensitive tokens + return token.getImage().toUpperCase(Locale.ROOT); } } From 70296aeef640f698a82ce81232ceb867c946499a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 27 Jun 2024 21:17:04 +0200 Subject: [PATCH 52/66] [plsql] Fix unit tests after KEYWORD_UNRESERVED is removed --- pmd-plsql/etc/grammar/PLSQL.jjt | 4 ++++ .../ast/CompoundTriggerWithAdditionalDeclarations4270.txt | 2 -- .../pmd/lang/plsql/ast/ExceptionHandlerTomKytesDespair.txt | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pmd-plsql/etc/grammar/PLSQL.jjt b/pmd-plsql/etc/grammar/PLSQL.jjt index 40c781c0d0..e1b14b3992 100644 --- a/pmd-plsql/etc/grammar/PLSQL.jjt +++ b/pmd-plsql/etc/grammar/PLSQL.jjt @@ -171,6 +171,10 @@ import net.sourceforge.pmd.lang.plsql.ast.internal.ParsingExclusion; import java.util.ArrayList; import java.util.List; +/** + * @deprecated PLSQLParserImpl should have been package private because this is an implementation class + * that should not be used directly. + */ @Deprecated public class PLSQLParserImpl { diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/CompoundTriggerWithAdditionalDeclarations4270.txt b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/CompoundTriggerWithAdditionalDeclarations4270.txt index 4be12a3962..0e6b2a5f06 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/CompoundTriggerWithAdditionalDeclarations4270.txt +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/CompoundTriggerWithAdditionalDeclarations4270.txt @@ -151,7 +151,6 @@ | +- ExceptionHandler[@CanonicalImage = null] | +- QualifiedName[@CanonicalImage = "OTHERS", @Image = "OTHERS"] | | +- UnqualifiedID[@CanonicalImage = "OTHERS", @Image = "OTHERS"] - | | +- KEYWORD_UNRESERVED[@CanonicalImage = "OTHERS", @Image = "OTHERS"] | +- Statement[@CanonicalImage = null] | +- UnlabelledStatement[@CanonicalImage = null] | +- Expression[@CanonicalImage = "RAISE_APPLICATION_ERROR", @Image = "RAISE_APPLICATION_ERROR"] @@ -206,7 +205,6 @@ | +- ExceptionHandler[@CanonicalImage = null] | +- QualifiedName[@CanonicalImage = "OTHERS", @Image = "OTHERS"] | | +- UnqualifiedID[@CanonicalImage = "OTHERS", @Image = "OTHERS"] - | | +- KEYWORD_UNRESERVED[@CanonicalImage = "OTHERS", @Image = "OTHERS"] | +- Statement[@CanonicalImage = null] | +- UnlabelledStatement[@CanonicalImage = null] | +- Expression[@CanonicalImage = "RAISE_APPLICATION_ERROR", @Image = "RAISE_APPLICATION_ERROR"] diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ExceptionHandlerTomKytesDespair.txt b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ExceptionHandlerTomKytesDespair.txt index dd4ad1a27d..7e7abb1895 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ExceptionHandlerTomKytesDespair.txt +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ExceptionHandlerTomKytesDespair.txt @@ -182,7 +182,6 @@ | +- ExceptionHandler[@CanonicalImage = null] | | +- QualifiedName[@CanonicalImage = "OTHERS", @Image = "OTHERS"] | | | +- UnqualifiedID[@CanonicalImage = "OTHERS", @Image = "OTHERS"] - | | | +- KEYWORD_UNRESERVED[@CanonicalImage = "OTHERS", @Image = "OTHERS"] | | +- Statement[@CanonicalImage = null] | | +- UnlabelledStatement[@CanonicalImage = null] | | +- Expression[@CanonicalImage = "NULL", @Image = "NULL"] From 12b9ecefb191eeadca3a886608a1b1d2fa462556 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 27 Jun 2024 21:18:04 +0200 Subject: [PATCH 53/66] [doc] Update release notes (#4396) --- .../major_contributions/adding_new_cpd_language.md | 9 ++++++++- docs/pages/release_notes.md | 8 ++++++++ .../pmd/lang/ast/impl/javacc/JavaccToken.java | 7 ++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md index 64bcacf81a..2cf623881e 100644 --- a/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md +++ b/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md @@ -3,7 +3,7 @@ title: How to add a new CPD language short_title: Adding a new CPD language tags: [devdocs, extending] summary: How to add a new language module with CPD support. -last_updated: April 2023 (7.0.0) +last_updated: June 2024 (7.3.0) permalink: pmd_devdocs_major_adding_new_cpd_language.html author: Matías Fraga, Clément Fournier --- @@ -45,8 +45,15 @@ Use the following guide to set up a new language module that supports CPD. } ``` + - If your language is case-insensitive, then you might want to overwrite `getImage(AntlrToken)`. There you can + change each token e.g. into uppercase, so that CPD sees the same strings and can find duplicates even when + the casing differs. See {% jdoc tsql::lang.tsql.cpd.TSqlCpdLexer %} for an example. You will also need a + "CaseChangingCharStream", so that antlr itself is case-insensitive. - For JavaCC grammars, place your grammar in `etc/grammar` and edit the `pom.xml` like the [Python implementation](https://github.com/pmd/pmd/blob/master/pmd-python/pom.xml) does. You can then subclass {% jdoc core::cpd.impl.JavaccCpdLexer %} instead of AntlrCpdLexer. + - If your JavaCC based language is case-insensitive (option `IGNORE_CASE=true`), then you need to implement + {%jdoc core::lang.ast.impl.javacc.JavaccTokenDocument.TokenDocumentBehavior %}, which can change each token + e.g. into uppercase. See {%jdoc plsql::lang.plsql.ast.PLSQLParser %} for an example. - For any other scenario just implement the interface however you can. Look at the Scala or Apex module for existing implementations. 3. Create a {% jdoc core::lang.Language %} implementation, and make it implement {% jdoc core::cpd.CpdCapableLanguage %}. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 3efe00d5c4..8b6b88b2fe 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -39,6 +39,7 @@ See also [Maven PMD Plugin]({{ baseurl }}pmd_userdocs_tools_maven.html). * cli * [#2827](https://github.com/pmd/pmd/issues/2827): \[cli] Consider processing errors in exit status * core + * [#4396](https://github.com/pmd/pmd/issues/4396): \[core] CPD is always case sensitive * [#4992](https://github.com/pmd/pmd/pull/4992): \[core] CPD: Include processing errors in XML report * apex * [#4922](https://github.com/pmd/pmd/issues/4922): \[apex] SOQL syntax error with TYPEOF in sub-query @@ -112,11 +113,18 @@ read the XML format should be updated. * {% jdoc !!core::cpd.CPDConfiguration#isSkipLexicalErrors() %} and {% jdoc core::cpd.CPDConfiguration#setSkipLexicalErrors(boolean) %}: Use {%jdoc core::AbstractConfiguration#setFailOnError(boolean) %} to control whether to ignore errors or fail the build. * {%jdoc !!core::cpd.XMLOldRenderer %} (the CPD format "xmlold"). + * The constructor + {%jdoc !!core::lang.ast.impl.antlr4.AntlrToken#AntlrToken(org.antlr.v4.runtime.Token,core::lang.ast.impl.antlr4.AntlrToken,core::lang.document.TextDocument) %} + shouldn't be used directly. Use {%jdoc core::lang.ast.impl.antlr4.AntlrTokenManager %} instead. * pmd-java * {% jdoc !!java::lang.java.ast.ASTResource#getStableName() %} and the corresponding attribute `@StableName`. * {%jdoc !!java::lang.java.ast.ASTRecordPattern#getVarId() %} This method was added here by mistake. Record patterns don't declare a pattern variable for the whole pattern, but rather for individual record components, which can be accessed via {%jdoc java::lang.java.ast.ASTRecordPattern#getComponentPatterns() %}. +* pmd-plsql + * {%jdoc plsql::lang.plsql.ast.PLSQLParserImpl %} is deprecated now. It should have been package-private + because this is an implementation class that should not be used directly. + * The node {%jdoc plsql::lang.plsql.ast.ASTKEYWORD_UNRESERVED %} is deprecated and is now removed from the AST. #### Breaking changes: pmd-compat6 removed diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaccToken.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaccToken.java index f8e2d1442f..70bbc59b8a 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaccToken.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/JavaccToken.java @@ -147,7 +147,12 @@ public class JavaccToken implements GenericToken { return image.toString(); } - /** Returns the original text of the token. The image may be normalized. */ + /** + * Returns the original text of the token. + * The image may be normalized, e.g. for case-insensitive languages. + * + * @since 7.3.0 + */ public Chars getText() { return document.getTextDocument().sliceOriginalText(getRegion()); } From 10bfa395e547e18e1fae47a88d731a34fdf5a5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 27 Jun 2024 20:29:15 -0300 Subject: [PATCH 54/66] Explicitely use no-arg constructor - Inadvertly I was using the constructor that received an int as initial capacity, which instantiated massive collections leading to an increase in memory usage. --- .../main/java/net/sourceforge/pmd/cpd/MatchCollector.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/MatchCollector.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/MatchCollector.java index 36c6e99c2f..d2d4264f2b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/MatchCollector.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/MatchCollector.java @@ -68,7 +68,7 @@ class MatchCollector { * - BC * It should be reduced to a single match with 3 marks */ - if (tokenMatchSets.computeIfAbsent(mark1.getIndex(), HashSet::new).contains(mark2.getIndex())) { + if (tokenMatchSets.computeIfAbsent(mark1.getIndex(), (i) -> new HashSet<>()).contains(mark2.getIndex())) { return; } @@ -76,7 +76,7 @@ class MatchCollector { // always rely on the lowest mark index, as that's the order in which process them final int lowestKey = tokenMatchSets.get(mark1.getIndex()).stream().reduce(mark1.getIndex(), Math::min); - List matches = matchTree.computeIfAbsent(lowestKey, ArrayList::new); + List matches = matchTree.computeIfAbsent(lowestKey, (i) -> new ArrayList<>()); Iterator matchIterator = matches.iterator(); while (matchIterator.hasNext()) { Match m = matchIterator.next(); @@ -116,8 +116,8 @@ class MatchCollector { } private void registerTokenMatch(TokenEntry mark1, TokenEntry mark2) { - tokenMatchSets.computeIfAbsent(mark1.getIndex(), HashSet::new).add(mark2.getIndex()); - tokenMatchSets.computeIfAbsent(mark2.getIndex(), HashSet::new).add(mark1.getIndex()); + tokenMatchSets.computeIfAbsent(mark1.getIndex(), (i) -> new HashSet<>()).add(mark2.getIndex()); + tokenMatchSets.computeIfAbsent(mark2.getIndex(), (i) -> new HashSet<>()).add(mark1.getIndex()); } List getMatches() { From a9d43d0ad01702ade51c9f88b7ca86321c6fdafb Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 08:27:34 +0200 Subject: [PATCH 55/66] [doc] Update release notes (#5090, #5066) --- docs/pages/release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 3efe00d5c4..0ec2a2936a 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -40,6 +40,7 @@ See also [Maven PMD Plugin]({{ baseurl }}pmd_userdocs_tools_maven.html). * [#2827](https://github.com/pmd/pmd/issues/2827): \[cli] Consider processing errors in exit status * core * [#4992](https://github.com/pmd/pmd/pull/4992): \[core] CPD: Include processing errors in XML report + * [#5066](https://github.com/pmd/pmd/issues/5066): \[core] CPD throws java.lang.OutOfMemoryError: Java heap space (since 7.1.0) * apex * [#4922](https://github.com/pmd/pmd/issues/4922): \[apex] SOQL syntax error with TYPEOF in sub-query * [#5053](https://github.com/pmd/pmd/issues/5053): \[apex] CPD fails to parse string literals with escaped characters From 93e3020a1d92a31b09b5c8a04b50a16a5df3b862 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 10:31:51 +0200 Subject: [PATCH 56/66] [doc] Update all-contributors - Add @stephen-carter-at-sf as a contributor - Add @Meijuh as a contributor - Add @codefriar as a contributor - Add @szymanp23 as a contributor - Add @johnzhao9 as a contributor --- .all-contributorsrc | 47 ++++ docs/pages/pmd/projectdocs/credits.md | 305 +++++++++++++------------- 2 files changed, 202 insertions(+), 150 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 898c8d6350..02a86f1818 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7591,6 +7591,7 @@ "bug" ] }, + { "login": "pablogomez2197", "name": "pablogomez2197", "avatar_url": "https://avatars.githubusercontent.com/u/110610165?v=4", @@ -7598,6 +7599,52 @@ "contributions": [ "bug" ] + }, + { + "login": "stephen-carter-at-sf", + "name": "Stephen Carter", + "avatar_url": "https://avatars.githubusercontent.com/u/123964848?v=4", + "profile": "https://github.com/stephen-carter-at-sf", + "contributions": [ + "bug" + ] + }, + { + "login": "Meijuh", + "name": "Jeroen Meijer", + "avatar_url": "https://avatars.githubusercontent.com/u/1567680?v=4", + "profile": "http://jmeijer.nl/", + "contributions": [ + "bug" + ] + }, + { + "login": "codefriar", + "name": "Kevin Poorman", + "avatar_url": "https://avatars.githubusercontent.com/u/642589?v=4", + "profile": "http://www.codefriar.com/", + "contributions": [ + "bug" + ] + }, + { + "login": "szymanp23", + "name": "szymanp23", + "avatar_url": "https://avatars.githubusercontent.com/u/4140681?v=4", + "profile": "https://github.com/szymanp23", + "contributions": [ + "bug", + "code" + ] + }, + { + "login": "johnzhao9", + "name": "johnzhao9", + "avatar_url": "https://avatars.githubusercontent.com/u/13734035?v=4", + "profile": "https://github.com/johnzhao9", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index 0f97c47bec..97c0ea98da 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -363,721 +363,726 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Jeff May
Jeff May

🐛 Jens Gerdes
Jens Gerdes

🐛 Jeroen Borgers
Jeroen Borgers

🐛 💻 📢 - Jeroen van Wilgenburg
Jeroen van Wilgenburg

📖 + Jeroen Meijer
Jeroen Meijer

🐛 + Jeroen van Wilgenburg
Jeroen van Wilgenburg

📖 Jerome Russ
Jerome Russ

🐛 JerritEic
JerritEic

💻 📖 🐛 Jiri Pejchal
Jiri Pejchal

🐛 Jithin Sunny
Jithin Sunny

🐛 Jiří Škorpil
Jiří Škorpil

🐛 Joao Machado
Joao Machado

🐛 - Jochen Krauss
Jochen Krauss

🐛 + Jochen Krauss
Jochen Krauss

🐛 Johan Hammar
Johan Hammar

🐛 John Karp
John Karp

🐛 John Zhang
John Zhang

🐛 John-Teng
John-Teng

💻 🐛 Jon Moroney
Jon Moroney

💻 🐛 Jonas Geiregat
Jonas Geiregat

🐛 - Jonas Keßler
Jonas Keßler

🐛 + Jonas Keßler
Jonas Keßler

🐛 Jonathan Wiesel
Jonathan Wiesel

💻 🐛 Jordan
Jordan

🐛 Jordi Llach
Jordi Llach

🐛 Jorge Solórzano
Jorge Solórzano

🐛 JorneVL
JorneVL

🐛 Jose Palafox
Jose Palafox

🐛 - Jose Stovall
Jose Stovall

🐛 + Jose Stovall
Jose Stovall

🐛 Joseph
Joseph

💻 Joseph Heenan
Joseph Heenan

🐛 Josh Feingold
Josh Feingold

💻 🐛 Josh Holthaus
Josh Holthaus

🐛 Joshua S Arquilevich
Joshua S Arquilevich

🐛 João Dinis Ferreira
João Dinis Ferreira

📖 - João Ferreira
João Ferreira

💻 🐛 + João Ferreira
João Ferreira

💻 🐛 João Pedro Schmitt
João Pedro Schmitt

🐛 Juan Martín Sotuyo Dodero
Juan Martín Sotuyo Dodero

💻 📖 🐛 🚧 Juan Pablo Civile
Juan Pablo Civile

🐛 Julian Voronetsky
Julian Voronetsky

🐛 Julien
Julien

🐛 Julius
Julius

🐛 - JustPRV
JustPRV

🐛 + JustPRV
JustPRV

🐛 Jörn Huxhorn
Jörn Huxhorn

🐛 KThompso
KThompso

🐛 Kai Amundsen
Kai Amundsen

🐛 Karel Vervaeke
Karel Vervaeke

🐛 Karl-Andero Mere
Karl-Andero Mere

🐛 Karl-Philipp Richter
Karl-Philipp Richter

🐛 - Karsten Silz
Karsten Silz

🐛 + Karsten Silz
Karsten Silz

🐛 Kazuma Watanabe
Kazuma Watanabe

🐛 Kev
Kev

🐛 Keve Müller
Keve Müller

🐛 Kevin Guerra
Kevin Guerra

💻 Kevin Jones
Kevin Jones

🐛 💻 - Kevin Wayne
Kevin Wayne

🐛 - Kieran Black
Kieran Black

🐛 + Kevin Poorman
Kevin Poorman

🐛 + Kevin Wayne
Kevin Wayne

🐛 + Kieran Black
Kieran Black

🐛 Kirill Zubov
Kirill Zubov

🐛 Kirk Clemens
Kirk Clemens

💻 🐛 Klaus Hartl
Klaus Hartl

🐛 Koen Van Looveren
Koen Van Looveren

🐛 Kris Scheibe
Kris Scheibe

💻 🐛 - Krystian Dabrowski
Krystian Dabrowski

🐛 💻 - Kunal Thanki
Kunal Thanki

🐛 + Krystian Dabrowski
Krystian Dabrowski

🐛 💻 + Kunal Thanki
Kunal Thanki

🐛 LaLucid
LaLucid

💻 Larry Diamond
Larry Diamond

💻 🐛 Lars Knickrehm
Lars Knickrehm

🐛 Laurent Bovet
Laurent Bovet

🐛 💻 Leo Gutierrez
Leo Gutierrez

🐛 - LiGaOg
LiGaOg

💻 - Liam Sharp
Liam Sharp

🐛 + LiGaOg
LiGaOg

💻 + Liam Sharp
Liam Sharp

🐛 Lintsi
Lintsi

🐛 Linus Fernandes
Linus Fernandes

🐛 Lixon Lookose
Lixon Lookose

🐛 Logesh
Logesh

🐛 Lorenzo Gabriele
Lorenzo Gabriele

🐛 - Loïc Ledoyen
Loïc Ledoyen

🐛 - Lucas
Lucas

🐛 + Loïc Ledoyen
Loïc Ledoyen

🐛 + Lucas
Lucas

🐛 Lucas Silva
Lucas Silva

🐛 Lucas Soncini
Lucas Soncini

💻 🐛 Luis Alcantar
Luis Alcantar

💻 Lukasz Slonina
Lukasz Slonina

🐛 Lukebray
Lukebray

🐛 - Lynn
Lynn

💻 🐛 - Lyor Goldstein
Lyor Goldstein

🐛 + Lynn
Lynn

💻 🐛 + Lyor Goldstein
Lyor Goldstein

🐛 MCMicS
MCMicS

🐛 Macarse
Macarse

🐛 Machine account for PMD
Machine account for PMD

💻 Maciek Siemczyk
Maciek Siemczyk

🐛 Maikel Steneker
Maikel Steneker

💻 🐛 - Maksim Moiseikin
Maksim Moiseikin

🐛 - Manfred Koch
Manfred Koch

🐛 + Maksim Moiseikin
Maksim Moiseikin

🐛 + Manfred Koch
Manfred Koch

🐛 Manuel Moya Ferrer
Manuel Moya Ferrer

💻 🐛 Manuel Ryan
Manuel Ryan

🐛 Marat Vyshegorodtsev
Marat Vyshegorodtsev

🐛 Marcel Härle
Marcel Härle

🐛 Marcello Fialho
Marcello Fialho

🐛 - Marcin Dąbrowski
Marcin Dąbrowski

💻 - Marcin Rataj
Marcin Rataj

🐛 + Marcin Dąbrowski
Marcin Dąbrowski

💻 + Marcin Rataj
Marcin Rataj

🐛 Marcono1234
Marcono1234

🐛 Mark Adamcin
Mark Adamcin

🐛 Mark Hall
Mark Hall

💻 🐛 Mark Kolich
Mark Kolich

🐛 Mark Pritchard
Mark Pritchard

🐛 - Markus Rathgeb
Markus Rathgeb

🐛 - Marquis Wang
Marquis Wang

🐛 + Markus Rathgeb
Markus Rathgeb

🐛 + Marquis Wang
Marquis Wang

🐛 MartGit
MartGit

🐛 Martin Feldsztejn
Martin Feldsztejn

🐛 Martin Lehmann
Martin Lehmann

🐛 Martin Spamer
Martin Spamer

🐛 Martin Tarjányi
Martin Tarjányi

🐛 - MatFl
MatFl

🐛 - Mateusz Stefanski
Mateusz Stefanski

🐛 + MatFl
MatFl

🐛 + Mateusz Stefanski
Mateusz Stefanski

🐛 Mathieu Gouin
Mathieu Gouin

🐛 MatiasComercio
MatiasComercio

💻 🐛 Matt Benson
Matt Benson

🐛 Matt De Poorter
Matt De Poorter

🐛 Matt Hargett
Matt Hargett

💻 💵 - Matt Harrah
Matt Harrah

🐛 - Matt Nelson
Matt Nelson

🐛 + Matt Harrah
Matt Harrah

🐛 + Matt Nelson
Matt Nelson

🐛 Matthew Amos
Matthew Amos

🐛 Matthew Duggan
Matthew Duggan

🐛 Matthew Hall
Matthew Hall

🐛 Matías Fraga
Matías Fraga

💻 🐛 Maxime Robert
Maxime Robert

💻 🐛 - MetaBF
MetaBF

🐛 - Metin Dagcilar
Metin Dagcilar

🐛 + MetaBF
MetaBF

🐛 + Metin Dagcilar
Metin Dagcilar

🐛 Michael
Michael

🐛 Michael Bell
Michael Bell

🐛 Michael Bernstein
Michael Bernstein

🐛 Michael Clay
Michael Clay

🐛 Michael Dombrowski
Michael Dombrowski

🐛 - Michael Hausegger
Michael Hausegger

🐛 - Michael Hoefer
Michael Hoefer

🐛 + Michael Hausegger
Michael Hausegger

🐛 + Michael Hoefer
Michael Hoefer

🐛 Michael Kolesnikov
Michael Kolesnikov

🐛 Michael Möbius
Michael Möbius

🐛 Michael N. Lipp
Michael N. Lipp

🐛 Michael Pellegrini
Michael Pellegrini

🐛 Michal Kordas
Michal Kordas

🐛 - Michał Borek
Michał Borek

🐛 - Michał Kuliński
Michał Kuliński

🐛 + Michał Borek
Michał Borek

🐛 + Michał Kuliński
Michał Kuliński

🐛 Miguel Núñez Díaz-Montes
Miguel Núñez Díaz-Montes

🐛 Mihai Ionut
Mihai Ionut

🐛 Mikhail Kuchma
Mikhail Kuchma

🐛 Mirek Hankus
Mirek Hankus

🐛 Mitch Spano
Mitch Spano

🐛 - Mladjan Gadzic
Mladjan Gadzic

🐛 - MrAngry52
MrAngry52

🐛 + Mladjan Gadzic
Mladjan Gadzic

🐛 + MrAngry52
MrAngry52

🐛 Muminur Choudhury
Muminur Choudhury

🐛 Mykhailo Palahuta
Mykhailo Palahuta

💻 🐛 Nagendra Kumar Singh
Nagendra Kumar Singh

🐛 Nahuel Barrios
Nahuel Barrios

🐛 Nakul Sharma
Nakul Sharma

🐛 - Nathan Braun
Nathan Braun

🐛 - Nathan Reynolds
Nathan Reynolds

🐛 + Nathan Braun
Nathan Braun

🐛 + Nathan Reynolds
Nathan Reynolds

🐛 Nathan Reynolds
Nathan Reynolds

🐛 Nathanaël
Nathanaël

🐛 Naveen
Naveen

💻 Nazdravi
Nazdravi

🐛 Neha-Dhonde
Neha-Dhonde

🐛 - Nicholas Doyle
Nicholas Doyle

🐛 - Nick Butcher
Nick Butcher

🐛 + Nicholas Doyle
Nicholas Doyle

🐛 + Nick Butcher
Nick Butcher

🐛 Nico Gallinal
Nico Gallinal

🐛 Nicola Dal Maso
Nicola Dal Maso

🐛 Nicolas Filotto
Nicolas Filotto

💻 Nicolas Vervelle
Nicolas Vervelle

🐛 Nicolas Vuillamy
Nicolas Vuillamy

📖 - Nikita Chursin
Nikita Chursin

🐛 - Niklas Baudy
Niklas Baudy

🐛 + Nikita Chursin
Nikita Chursin

🐛 + Niklas Baudy
Niklas Baudy

🐛 Nikolas Havrikov
Nikolas Havrikov

🐛 Nilesh Virkar
Nilesh Virkar

🐛 Nimit Patel
Nimit Patel

🐛 Niranjan Harpale
Niranjan Harpale

🐛 Nirvik Patel
Nirvik Patel

💻 - Noah Sussman
Noah Sussman

🐛 - Noah0120
Noah0120

🐛 + Noah Sussman
Noah Sussman

🐛 + Noah0120
Noah0120

🐛 Noam Tamim
Noam Tamim

🐛 Noel Grandin
Noel Grandin

🐛 Olaf Haalstra
Olaf Haalstra

🐛 Oleg Andreych
Oleg Andreych

💻 🐛 Oleg Pavlenko
Oleg Pavlenko

🐛 - Oleksii Dykov
Oleksii Dykov

💻 🐛 - Oliver Eikemeier
Oliver Eikemeier

🐛 + Oleksii Dykov
Oleksii Dykov

💻 🐛 + Oliver Eikemeier
Oliver Eikemeier

🐛 Oliver Siegmar
Oliver Siegmar

💵 Olivier Parent
Olivier Parent

💻 🐛 Ollie Abbey
Ollie Abbey

💻 🐛 OverDrone
OverDrone

🐛 Ozan Gulle
Ozan Gulle

💻 🐛 - PUNEET JAIN
PUNEET JAIN

🐛 - Parbati Bose
Parbati Bose

🐛 + PUNEET JAIN
PUNEET JAIN

🐛 + Parbati Bose
Parbati Bose

🐛 Paul Berg
Paul Berg

🐛 Paul Guyot
Paul Guyot

💻 Pavel Bludov
Pavel Bludov

🐛 Pavel Mička
Pavel Mička

🐛 Pedro Nuno Santos
Pedro Nuno Santos

🐛 - Pedro Rijo
Pedro Rijo

🐛 - Pelisse Romain
Pelisse Romain

💻 📖 🐛 + Pedro Rijo
Pedro Rijo

🐛 + Pelisse Romain
Pelisse Romain

💻 📖 🐛 Per Abich
Per Abich

💻 Pete Davids
Pete Davids

🐛 Peter Bruin
Peter Bruin

🐛 Peter Chittum
Peter Chittum

💻 🐛 Peter Cudmore
Peter Cudmore

🐛 - Peter Kasson
Peter Kasson

🐛 - Peter Kofler
Peter Kofler

🐛 + Peter Kasson
Peter Kasson

🐛 + Peter Kofler
Peter Kofler

🐛 Peter Paul Bakker
Peter Paul Bakker

💻 Peter Rader
Peter Rader

🐛 Pham Hai Trung
Pham Hai Trung

🐛 Philip Graf
Philip Graf

💻 🐛 Philip Hachey
Philip Hachey

🐛 - Philippe Ozil
Philippe Ozil

🐛 - Phinehas Artemix
Phinehas Artemix

🐛 + Philippe Ozil
Philippe Ozil

🐛 + Phinehas Artemix
Phinehas Artemix

🐛 Phokham Nonava
Phokham Nonava

🐛 Pim van der Loos
Pim van der Loos

💻 ⚠️ Piotr Szymański
Piotr Szymański

🐛 Piotrek Żygieło
Piotrek Żygieło

💻 🐛 📖 Pranay Jaiswal
Pranay Jaiswal

🐛 - Prasad Kamath
Prasad Kamath

🐛 - Prasanna
Prasanna

🐛 + Prasad Kamath
Prasad Kamath

🐛 + Prasanna
Prasanna

🐛 Presh-AR
Presh-AR

🐛 Puneet1726
Puneet1726

🐛 Rafael Cortês
Rafael Cortês

🐛 RaheemShaik999
RaheemShaik999

🐛 RajeshR
RajeshR

💻 🐛 - Ramachandra Mohan
Ramachandra Mohan

🐛 - Ramel0921
Ramel0921

🐛 + Ramachandra Mohan
Ramachandra Mohan

🐛 + Ramel0921
Ramel0921

🐛 Raquel Pau
Raquel Pau

🐛 Ravikiran Janardhana
Ravikiran Janardhana

🐛 Reda Benhemmouche
Reda Benhemmouche

🐛 Reinhard Schiedermeier
Reinhard Schiedermeier

🐛 Renato Oliveira
Renato Oliveira

💻 🐛 - Rich DiCroce
Rich DiCroce

🐛 - Richard Corfield
Richard Corfield

💻 + Rich DiCroce
Rich DiCroce

🐛 + Richard Corfield
Richard Corfield

💻 Richard Corfield
Richard Corfield

🐛 💻 Riot R1cket
Riot R1cket

🐛 Rishabh Jain
Rishabh Jain

🐛 RishabhDeep Singh
RishabhDeep Singh

🐛 Rob Baillie
Rob Baillie

🐛 - Robbie Martinus
Robbie Martinus

💻 🐛 - Robert Henry
Robert Henry

🐛 + Robbie Martinus
Robbie Martinus

💻 🐛 + Robert Henry
Robert Henry

🐛 Robert Mihaly
Robert Mihaly

🐛 Robert Painsi
Robert Painsi

🐛 Robert Russell
Robert Russell

🐛 Robert Sösemann
Robert Sösemann

💻 📖 📢 🐛 Robert Whitebit
Robert Whitebit

🐛 - Robin Richtsfeld
Robin Richtsfeld

🐛 - Robin Stocker
Robin Stocker

💻 🐛 + Robin Richtsfeld
Robin Richtsfeld

🐛 + Robin Stocker
Robin Stocker

💻 🐛 Robin Wils
Robin Wils

🐛 RochusOest
RochusOest

🐛 Rodolfo Noviski
Rodolfo Noviski

🐛 Rodrigo Casara
Rodrigo Casara

🐛 Rodrigo Fernandes
Rodrigo Fernandes

🐛 - Roman Salvador
Roman Salvador

💻 🐛 - Ronald Blaschke
Ronald Blaschke

🐛 + Roman Salvador
Roman Salvador

💻 🐛 + Ronald Blaschke
Ronald Blaschke

🐛 Róbert Papp
Róbert Papp

🐛 Saikat Sengupta
Saikat Sengupta

🐛 Saksham Handu
Saksham Handu

🐛 Saladoc
Saladoc

🐛 Salesforce Bob Lightning
Salesforce Bob Lightning

🐛 - Sam Carlberg
Sam Carlberg

🐛 - Sashko
Sashko

💻 + Sam Carlberg
Sam Carlberg

🐛 + Sashko
Sashko

💻 Satoshi Kubo
Satoshi Kubo

🐛 Scott Kennedy
Scott Kennedy

🐛 Scott Wells
Scott Wells

🐛 💻 Scrates1
Scrates1

🐛 💻 Scrsloota
Scrsloota

💻 - Sebastian Bögl
Sebastian Bögl

🐛 - Sebastian Davids
Sebastian Davids

🐛 + Sebastian Bögl
Sebastian Bögl

🐛 + Sebastian Davids
Sebastian Davids

🐛 Sebastian Schuberth
Sebastian Schuberth

🐛 Sebastian Schwarz
Sebastian Schwarz

🐛 Seren
Seren

🐛 💻 Sergey Gorbaty
Sergey Gorbaty

🐛 Sergey Kozlov
Sergey Kozlov

🐛 - Sergey Yanzin
Sergey Yanzin

💻 🐛 - Seth Wilcox
Seth Wilcox

💻 + Sergey Yanzin
Sergey Yanzin

💻 🐛 + Seth Wilcox
Seth Wilcox

💻 Shai Bennathan
Shai Bennathan

🐛 💻 Shubham
Shubham

💻 🐛 Simon Abykov
Simon Abykov

💻 🐛 Simon Xiao
Simon Xiao

🐛 Srinivasan Venkatachalam
Srinivasan Venkatachalam

🐛 - Stanislav Gromov
Stanislav Gromov

🐛 - Stanislav Myachenkov
Stanislav Myachenkov

💻 + Stanislav Gromov
Stanislav Gromov

🐛 + Stanislav Myachenkov
Stanislav Myachenkov

💻 Stefan Birkner
Stefan Birkner

🐛 Stefan Bohn
Stefan Bohn

🐛 Stefan Endrullis
Stefan Endrullis

🐛 Stefan Klöss-Schuster
Stefan Klöss-Schuster

🐛 Stefan Wolf
Stefan Wolf

🐛 - Stephan H. Wissel
Stephan H. Wissel

🐛 - Stephen
Stephen

🐛 + Stephan H. Wissel
Stephan H. Wissel

🐛 + Stephen
Stephen

🐛 + Stephen Carter
Stephen Carter

🐛 Stephen Friedrich
Stephen Friedrich

🐛 Steve Babula
Steve Babula

💻 Steven Stearns
Steven Stearns

🐛 💻 Stexxe
Stexxe

🐛 + + Stian Lågstad
Stian Lågstad

🐛 StuartClayton5
StuartClayton5

🐛 Supun Arunoda
Supun Arunoda

🐛 - - Suren Abrahamyan
Suren Abrahamyan

🐛 Suvashri
Suvashri

📖 SwatiBGupta1110
SwatiBGupta1110

🐛 SyedThoufich
SyedThoufich

🐛 + + Szymon Sasin
Szymon Sasin

🐛 T-chuangxin
T-chuangxin

🐛 TERAI Atsuhiro
TERAI Atsuhiro

🐛 - - TIOBE Software
TIOBE Software

💻 🐛 Tarush Singh
Tarush Singh

💻 Taylor Smock
Taylor Smock

🐛 Techeira Damián
Techeira Damián

💻 🐛 + + Ted Husted
Ted Husted

🐛 TehBakker
TehBakker

🐛 The Gitter Badger
The Gitter Badger

🐛 - - Theodoor
Theodoor

🐛 Thiago Henrique Hüpner
Thiago Henrique Hüpner

🐛 Thibault Meyer
Thibault Meyer

🐛 Thomas Güttler
Thomas Güttler

🐛 + + Thomas Jones-Low
Thomas Jones-Low

🐛 Thomas Smith
Thomas Smith

💻 🐛 ThrawnCA
ThrawnCA

🐛 - - Thu Vo
Thu Vo

🐛 Thunderforge
Thunderforge

💻 🐛 Tim van der Lippe
Tim van der Lippe

🐛 Tobias Weimer
Tobias Weimer

💻 🐛 + + Tom Copeland
Tom Copeland

🐛 💻 📖 Tom Daly
Tom Daly

🐛 Tomer Figenblat
Tomer Figenblat

🐛 - - Tomi De Lucca
Tomi De Lucca

💻 🐛 Torsten Kleiber
Torsten Kleiber

🐛 TrackerSB
TrackerSB

🐛 Tyson Stewart
Tyson Stewart

🐛 + + Ullrich Hafner
Ullrich Hafner

🐛 Utku Cuhadaroglu
Utku Cuhadaroglu

💻 🐛 Valentin Brandl
Valentin Brandl

🐛 - - Valeria
Valeria

🐛 Valery Yatsynovich
Valery Yatsynovich

📖 Vasily Anisimov
Vasily Anisimov

🐛 Vibhor Goyal
Vibhor Goyal

🐛 + + Vickenty Fesunov
Vickenty Fesunov

🐛 Victor Noël
Victor Noël

🐛 Vincent Galloy
Vincent Galloy

💻 - - Vincent HUYNH
Vincent HUYNH

🐛 Vincent Maurin
Vincent Maurin

🐛 Vincent Privat
Vincent Privat

🐛 Vishhwas
Vishhwas

🐛 + + Vishv_Android
Vishv_Android

🐛 Vitaly
Vitaly

🐛 Vitaly Polonetsky
Vitaly Polonetsky

🐛 - - Vojtech Polivka
Vojtech Polivka

🐛 Vsevolod Zholobov
Vsevolod Zholobov

🐛 Vyom Yadav
Vyom Yadav

💻 Wang Shidong
Wang Shidong

🐛 + + Waqas Ahmed
Waqas Ahmed

🐛 Wayne J. Earl
Wayne J. Earl

🐛 Wchenghui
Wchenghui

🐛 - - Wener
Wener

💻 Will Winder
Will Winder

🐛 William Brockhus
William Brockhus

💻 🐛 Wilson Kurniawan
Wilson Kurniawan

🐛 + + Wim Deblauwe
Wim Deblauwe

🐛 Woongsik Choi
Woongsik Choi

🐛 XenoAmess
XenoAmess

💻 🐛 - - Yang
Yang

💻 YaroslavTER
YaroslavTER

🐛 Yasar Shaikh
Yasar Shaikh

💻 Young Chan
Young Chan

💻 🐛 + + YuJin Kim
YuJin Kim

🐛 Yuri Dolzhenko
Yuri Dolzhenko

🐛 Yurii Dubinka
Yurii Dubinka

🐛 - - Zoltan Farkas
Zoltan Farkas

🐛 Zustin
Zustin

🐛 aaronhurst-google
aaronhurst-google

🐛 💻 alexmodis
alexmodis

🐛 + + andreoss
andreoss

🐛 andrey81inmd
andrey81inmd

💻 🐛 anicoara
anicoara

🐛 - - arunprasathav
arunprasathav

🐛 asiercamara
asiercamara

🐛 astillich-igniti
astillich-igniti

💻 avesolovksyy
avesolovksyy

🐛 + + avishvat
avishvat

🐛 avivmu
avivmu

🐛 axelbarfod1
axelbarfod1

🐛 - - b-3-n
b-3-n

🐛 balbhadra9
balbhadra9

🐛 base23de
base23de

🐛 bergander
bergander

🐛 💻 + + berkam
berkam

💻 🐛 breizh31
breizh31

🐛 caesarkim
caesarkim

🐛 - - carolyujing
carolyujing

🐛 cbfiddle
cbfiddle

🐛 cesares-basilico
cesares-basilico

🐛 chrite
chrite

🐛 + + ciufudean
ciufudean

📖 cobratbq
cobratbq

🐛 coladict
coladict

🐛 - - cosmoJFH
cosmoJFH

🐛 cristalp
cristalp

🐛 crunsk
crunsk

🐛 cwholmes
cwholmes

🐛 + + cyberjj999
cyberjj999

🐛 cyw3
cyw3

🐛 📖 d1ss0nanz
d1ss0nanz

🐛 - - dague1
dague1

📖 dalizi007
dalizi007

💻 danbrycefairsailcom
danbrycefairsailcom

🐛 dariansanity
dariansanity

🐛 + + darrenmiliband
darrenmiliband

🐛 davidburstrom
davidburstrom

🐛 dbirkman-paloalto
dbirkman-paloalto

🐛 - - deepak-patra
deepak-patra

🐛 dependabot[bot]
dependabot[bot]

💻 🐛 dinesh150
dinesh150

🐛 diziaq
diziaq

🐛 + + dreaminpast123
dreaminpast123

🐛 duanyanan
duanyanan

🐛 dutt-sanjay
dutt-sanjay

🐛 - - dylanleung
dylanleung

🐛 dzeigler
dzeigler

🐛 eant60
eant60

🐛 ekkirala
ekkirala

🐛 + + emersonmoura
emersonmoura

🐛 emouty
emouty

💻 eugenepugach
eugenepugach

🐛 - - fairy
fairy

🐛 filiprafalowicz
filiprafalowicz

💻 flxbl-io
flxbl-io

💵 foxmason
foxmason

🐛 + + frankegabor
frankegabor

🐛 frankl
frankl

🐛 freafrea
freafrea

🐛 - - fsapatin
fsapatin

🐛 gracia19
gracia19

🐛 guo fei
guo fei

🐛 gurmsc5
gurmsc5

🐛 + + gwilymatgearset
gwilymatgearset

💻 🐛 haigsn
haigsn

🐛 hemanshu070
hemanshu070

🐛 - - henrik242
henrik242

🐛 hongpuwu
hongpuwu

🐛 hvbtup
hvbtup

💻 🐛 igniti GmbH
igniti GmbH

🐛 + + ilovezfs
ilovezfs

🐛 itaigilo
itaigilo

🐛 jakivey32
jakivey32

🐛 - - jbennett2091
jbennett2091

🐛 jcamerin
jcamerin

🐛 jkeener1
jkeener1

🐛 jmetertea
jmetertea

🐛 - johnra2
johnra2

💻 - josemanuelrolon
josemanuelrolon

💻 🐛 - kabroxiko
kabroxiko

💻 🐛 + johnra2
johnra2

💻 + johnzhao9
johnzhao9

🐛 + josemanuelrolon
josemanuelrolon

💻 🐛 + kabroxiko
kabroxiko

💻 🐛 karwer
karwer

🐛 kaulonline
kaulonline

🐛 kdaemonv
kdaemonv

🐛 + + kdebski85
kdebski85

🐛 💻 kenji21
kenji21

💻 🐛 kfranic
kfranic

🐛 khalidkh
khalidkh

🐛 - - koalalam
koalalam

🐛 krzyk
krzyk

🐛 lasselindqvist
lasselindqvist

🐛 + + lgemeinhardt
lgemeinhardt

🐛 lihuaib
lihuaib

🐛 liqingjun123
liqingjun123

🐛 lonelyma1021
lonelyma1021

🐛 - - lpeddy
lpeddy

🐛 lujiefsi
lujiefsi

💻 lukelukes
lukelukes

💻 + + lyriccoder
lyriccoder

🐛 marcelmore
marcelmore

🐛 matchbox
matchbox

🐛 matthiaskraaz
matthiaskraaz

🐛 - - meandonlyme
meandonlyme

🐛 mikesive
mikesive

🐛 milossesic
milossesic

🐛 + + mluckam
mluckam

💻 🐛 mohan-chinnappan-n
mohan-chinnappan-n

💻 mriddell95
mriddell95

🐛 mrlzh
mrlzh

🐛 - - msloan
msloan

🐛 mucharlaravalika
mucharlaravalika

🐛 mvenneman
mvenneman

🐛 + + nareshl119
nareshl119

🐛 nicolas-harraudeau-sonarsource
nicolas-harraudeau-sonarsource

🐛 noerremark
noerremark

🐛 novsirion
novsirion

🐛 - - nwcm
nwcm

📖 🐛 💻 oggboy
oggboy

🐛 oinume
oinume

🐛 + + orimarko
orimarko

💻 🐛 pablogomez2197
pablogomez2197

🐛 pacvz
pacvz

💻 pallavi agarwal
pallavi agarwal

🐛 parksungrin
parksungrin

🐛 - - patpatpat123
patpatpat123

🐛 patriksevallius
patriksevallius

🐛 + + pbrajesh1
pbrajesh1

🐛 phoenix384
phoenix384

🐛 piotrszymanski-sc
piotrszymanski-sc

💻 plan3d
plan3d

🐛 poojasix
poojasix

🐛 - - prabhushrikant
prabhushrikant

🐛 pujitha8783
pujitha8783

🐛 + + r-r-a-j
r-r-a-j

🐛 raghujayjunk
raghujayjunk

🐛 rajeshveera
rajeshveera

🐛 rajeswarreddy88
rajeswarreddy88

🐛 recdevs
recdevs

🐛 - - reudismam
reudismam

💻 🐛 rijkt
rijkt

🐛 + + rillig-tk
rillig-tk

🐛 rmohan20
rmohan20

💻 🐛 rnveach
rnveach

🐛 rxmicro
rxmicro

🐛 ryan-gustafson
ryan-gustafson

💻 🐛 - - sabi0
sabi0

🐛 scais
scais

🐛 + + screamingfrog
screamingfrog

💵 sebbASF
sebbASF

🐛 sergeygorbaty
sergeygorbaty

💻 shilko2013
shilko2013

🐛 shiomiyan
shiomiyan

📖 - - simeonKondr
simeonKondr

🐛 snajberk
snajberk

🐛 + + sniperrifle2004
sniperrifle2004

🐛 snuyanzin
snuyanzin

🐛 💻 soyodream
soyodream

🐛 sratz
sratz

🐛 stonio
stonio

🐛 - - sturton
sturton

💻 🐛 sudharmohan
sudharmohan

🐛 + + suruchidawar
suruchidawar

🐛 svenfinitiv
svenfinitiv

🐛 + szymanp23
szymanp23

🐛 💻 tashiscool
tashiscool

🐛 test-git-hook
test-git-hook

🐛 testation21
testation21

💻 🐛 + thanosa
thanosa

🐛 - thanosa
thanosa

🐛 tiandiyixian
tiandiyixian

🐛 tobwoerk
tobwoerk

🐛 tprouvot
tprouvot

🐛 💻 trentchilders
trentchilders

🐛 triandicAnt
triandicAnt

🐛 trishul14
trishul14

🐛 + tsui
tsui

🐛 - tsui
tsui

🐛 wangzitom12306
wangzitom12306

🐛 winhkey
winhkey

🐛 witherspore
witherspore

🐛 wjljack
wjljack

🐛 wuchiuwong
wuchiuwong

🐛 xingsong
xingsong

🐛 + xioayuge
xioayuge

🐛 - xioayuge
xioayuge

🐛 xnYi9wRezm
xnYi9wRezm

💻 🐛 xuanuy
xuanuy

🐛 xyf0921
xyf0921

🐛 yalechen-cyw3
yalechen-cyw3

🐛 yasuharu-sato
yasuharu-sato

🐛 zenglian
zenglian

🐛 + zgrzyt93
zgrzyt93

💻 🐛 - zgrzyt93
zgrzyt93

💻 🐛 zh3ng
zh3ng

🐛 zt_soft
zt_soft

🐛 ztt79
ztt79

🐛 zzzzfeng
zzzzfeng

🐛 Árpád Magosányi
Árpád Magosányi

🐛 任贵杰
任贵杰

🐛 - - 茅延安
茅延安

💻 From 2d07aa756161579b0316093a59fcab287a09bce9 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 10:42:31 +0200 Subject: [PATCH 57/66] Prepare pmd release 7.3.0 --- docs/_config.yml | 2 +- docs/pages/release_notes.md | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 29e464a84f..b3a4daea7a 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,7 +1,7 @@ repository: pmd/pmd pmd: - version: 7.3.0-SNAPSHOT + version: 7.3.0 previous_version: 7.2.0 date: 2024-06-28 # release types: major, minor, bugfix diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7c5b020ef5..0a9697aefd 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -21,6 +21,7 @@ This is a {{ site.pmd.release_type }} release. ### 🚀 New and noteworthy #### ✨ New Rules + * The new Java rule {%rule java/bestpractices/UseEnumCollections %} reports usages for `HashSet` and `HashMap` when the keys are of an enum type. The specialized enum collections are more space- and time-efficient. @@ -36,6 +37,7 @@ to the latest version (3.23.0 or newer). See also [Maven PMD Plugin]({{ baseurl }}pmd_userdocs_tools_maven.html). ### 🐛 Fixed Issues + * cli * [#2827](https://github.com/pmd/pmd/issues/2827): \[cli] Consider processing errors in exit status * core @@ -132,7 +134,9 @@ read the XML format should be updated. The already deprecated PMD 6 compatibility module (pmd-compat6) has been removed. See above for details. -### ✨ External Contributions +### 📈 Stats +* 88 commits +* 32 closed tickets & PRs +* Days since last release: 27 {% endtocmaker %} - From c5dbc29bea2769016dfb9949dd3a20f242b828f8 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 11:00:04 +0200 Subject: [PATCH 58/66] [release] prepare release pmd_releases/7.3.0 --- pmd-ant/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-cli/pom.xml | 2 +- pmd-coco/pom.xml | 2 +- pmd-core/pom.xml | 2 +- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- pmd-doc/pom.xml | 2 +- pmd-fortran/pom.xml | 2 +- pmd-gherkin/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-groovy/pom.xml | 2 +- pmd-html/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-julia/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-languages-deps/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-perl/pom.xml | 2 +- pmd-php/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-ruby/pom.xml | 2 +- pmd-scala-modules/pmd-scala-common/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.12/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.13/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-tsql/pom.xml | 2 +- pmd-velocity/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 6 +++--- 42 files changed, 44 insertions(+), 44 deletions(-) diff --git a/pmd-ant/pom.xml b/pmd-ant/pom.xml index dc93238cd3..f2b0f47dbb 100644 --- a/pmd-ant/pom.xml +++ b/pmd-ant/pom.xml @@ -7,7 +7,7 @@ pmd net.sourceforge.pmd - 7.3.0-SNAPSHOT + 7.3.0 4.0.0 diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index e3b9f32e27..8688be4747 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml index e971574645..2904462392 100644 --- a/pmd-cli/pom.xml +++ b/pmd-cli/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-coco/pom.xml b/pmd-coco/pom.xml index bb12f86503..addd8b836d 100644 --- a/pmd-coco/pom.xml +++ b/pmd-coco/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index b5140a25fa..0bcba4b7f6 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 9c430cc4f4..48a18eb658 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 026de2bee2..3370fcabf3 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index 47d2c87ad6..f7c2ef95b2 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 9f8e02fdf8..ab0afc2799 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 7ebb6d3d00..3e22bdb27c 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index 86e87edcb9..9986fa2e0e 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index a62a575cda..3d74ba665b 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index d69f0d58af..d46455d37a 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index a700b821d9..e2c0f2ba58 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index 223deed571..3d30c88c63 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index ea6d0daefb..37b038bfe9 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 4fa7fda466..305dfec4e7 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index 68d2a90afb..2023442e64 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-julia/pom.xml b/pmd-julia/pom.xml index bf449e6a41..3d9ba4b6b8 100644 --- a/pmd-julia/pom.xml +++ b/pmd-julia/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 47bb2e54d2..7c25f4748f 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index a4a634f09c..b35ea1f081 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml index 501f61a841..a91cbfc5cb 100644 --- a/pmd-languages-deps/pom.xml +++ b/pmd-languages-deps/pom.xml @@ -4,7 +4,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 pmd-languages-deps diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index 23834ba393..c671c93757 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index 4b4e840b74..554b2dfa80 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 5ee4d15a7a..1ce9e01d9d 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index 3dab6880c0..70bd708b7a 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index e2a21f93ac..858b448cae 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index 1d98f18865..e536d0a476 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index f94aa65cfd..9972843fba 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 1096c0ee06..634ac8256a 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index 605c3a4221..54fc0c84da 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index c7f99d9081..6e41bc7d18 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../../pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index a217eb5904..c7f8f48cbc 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 7.3.0-SNAPSHOT + 7.3.0 ../pmd-scala-common/pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index 7df4503d28..c2a6cd0837 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 7.3.0-SNAPSHOT + 7.3.0 ../pmd-scala-common/pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 73f00c27bf..1380380ac0 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index 4e622b3c43..aa343e4ffa 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 9d8a9d9ec7..c2e1c69bb4 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml index e76c560cb6..5f12615b6a 100644 --- a/pmd-tsql/pom.xml +++ b/pmd-tsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-velocity/pom.xml b/pmd-velocity/pom.xml index ce1dd8f862..f26db46bfd 100644 --- a/pmd-velocity/pom.xml +++ b/pmd-velocity/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index b2c0986219..6f6948d8e7 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index 1de90d9424..816644e249 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 ../pom.xml diff --git a/pom.xml b/pom.xml index 95db8b37e6..2dad367367 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 7.3.0-SNAPSHOT + 7.3.0 pom PMD @@ -62,7 +62,7 @@ scm:git:git://github.com/pmd/pmd.git scm:git:ssh://git@github.com/pmd/pmd.git https://github.com/pmd/pmd - HEAD + pmd_releases/7.3.0 @@ -83,7 +83,7 @@ - 2024-05-31T10:33:57Z + 2024-06-28T08:42:40Z 8 From d952a1079057f493123a9b937ef5e0fc0afdcf77 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 11:27:41 +0200 Subject: [PATCH 59/66] [release] Prepare next development version [skip ci] --- docs/_config.yml | 6 +- docs/pages/release_notes.md | 122 +----------------- docs/pages/release_notes_old.md | 143 +++++++++++++++++++++ pmd-ant/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-cli/pom.xml | 2 +- pmd-coco/pom.xml | 2 +- pmd-core/pom.xml | 2 +- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- pmd-doc/pom.xml | 2 +- pmd-fortran/pom.xml | 2 +- pmd-gherkin/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-groovy/pom.xml | 2 +- pmd-html/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-julia/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-languages-deps/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-perl/pom.xml | 2 +- pmd-php/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-ruby/pom.xml | 2 +- pmd-scala-modules/pmd-scala-common/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.12/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.13/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-tsql/pom.xml | 2 +- pmd-velocity/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 4 +- 45 files changed, 191 insertions(+), 166 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index b3a4daea7a..3302938c99 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,9 +1,9 @@ repository: pmd/pmd pmd: - version: 7.3.0 - previous_version: 7.2.0 - date: 2024-06-28 + version: 7.4.0-SNAPSHOT + previous_version: 7.3.0 + date: 2024-07-26 # release types: major, minor, bugfix release_type: minor diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 0a9697aefd..bc1a36ec7a 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -4,12 +4,6 @@ permalink: pmd_release_notes.html keywords: changelog, release notes --- -{% if is_release_notes_processor %} -{% capture baseurl %}https://docs.pmd-code.org/pmd-doc-{{ site.pmd.version }}/{% endcapture %} -{% else %} -{% assign baseurl = "" %} -{% endif %} - ## {{ site.pmd.date | date: "%d-%B-%Y" }} - {{ site.pmd.version }} The PMD team is pleased to announce PMD {{ site.pmd.version }}. @@ -20,123 +14,11 @@ This is a {{ site.pmd.release_type }} release. ### 🚀 New and noteworthy -#### ✨ New Rules - -* The new Java rule {%rule java/bestpractices/UseEnumCollections %} reports usages for `HashSet` and `HashMap` - when the keys are of an enum type. The specialized enum collections are more space- and time-efficient. - -#### 💥 pmd-compat6 removed (breaking) - -The already deprecated PMD 6 compatibility module (pmd-compat6) has been removed. It was intended to be used with -older versions of the maven-pmd-plugin, but since maven-pmd-plugin 3.22.0, PMD 7 is supported directly and this -module is not needed anymore. - -If you currently use this dependency (`net.sourceforge.pmd:pmd-compat6`), remove it and upgrade maven-pmd-plugin -to the latest version (3.23.0 or newer). - -See also [Maven PMD Plugin]({{ baseurl }}pmd_userdocs_tools_maven.html). - ### 🐛 Fixed Issues -* cli - * [#2827](https://github.com/pmd/pmd/issues/2827): \[cli] Consider processing errors in exit status -* core - * [#4396](https://github.com/pmd/pmd/issues/4396): \[core] CPD is always case sensitive - * [#4992](https://github.com/pmd/pmd/pull/4992): \[core] CPD: Include processing errors in XML report - * [#5066](https://github.com/pmd/pmd/issues/5066): \[core] CPD throws java.lang.OutOfMemoryError: Java heap space (since 7.1.0) -* apex - * [#4922](https://github.com/pmd/pmd/issues/4922): \[apex] SOQL syntax error with TYPEOF in sub-query - * [#5053](https://github.com/pmd/pmd/issues/5053): \[apex] CPD fails to parse string literals with escaped characters - * [#5055](https://github.com/pmd/pmd/issues/5055): \[apex] SOSL syntax error with WITH USER_MODE or WITH SYSTEM_MODE -* apex-bestpractices - * [#5000](https://github.com/pmd/pmd/issues/5000): \[apex] UnusedLocalVariable FP with binds in SOSL / SOQL -* java - * [#4885](https://github.com/pmd/pmd/issues/4885): \[java] AssertionError: Method should be accessible - * [#5050](https://github.com/pmd/pmd/issues/5050): \[java] Problems with pattern variables in switch branches -* java-bestpractices - * [#577](https://github.com/pmd/pmd/issues/577): \[java] New Rule: Check that Map is an EnumMap if K is an enum value - * [#5047](https://github.com/pmd/pmd/issues/5047): \[java] UnusedPrivateMethod FP for Generics & Overloads -* plsql - * [#1934](https://github.com/pmd/pmd/issues/1934): \[plsql] ParseException with MERGE statement in anonymous block - * [#2779](https://github.com/pmd/pmd/issues/2779): \[plsql] Error while parsing statement with (Oracle) DML Error Logging - * [#4270](https://github.com/pmd/pmd/issues/4270): \[plsql] Parsing exception COMPOUND TRIGGER with EXCEPTION handler - ### 🚨 API Changes -#### CPD Report Format XML - -There are some important changes: - -1. The XML format will now use an XSD schema, that is available at . - This schema defines the valid elements and attributes that one can expect from a CPD report. -2. The root element `pmd-cpd` contains the new attributes `pmdVersion`, `timestamp` and `version`. The latter is - the schema version and is currently "1.0.0". -3. The CPD XML report will now also contain recoverable errors as additional `` elements. - -See [Report formats for CPD](pmd_userdocs_cpd_report_formats.html#xml) for an example. - -The XML format should be compatible as only attributes and elements have been added. However, if you parse -the document with a namespace aware parser, you might encounter some issues like no elements being found. -In case the new format doesn't work for you (e.g. namespaces, unexpected error elements), you can -go back using the old format with the renderer "xmlold" ({%jdoc core::cpd.XMLOldRenderer %}). Note, that -this old renderer is deprecated and only there for compatibility reasons. Whatever tooling is used to -read the XML format should be updated. - -#### CLI - -* New exit code 5 introduced. PMD and CPD will exit now by default with exit code 5, if any recoverable error - (e.g. parsing exception, lexing exception or rule exception) occurred. PMD will still create a report with - all detected violations or duplications if recoverable errors occurred. Such errors mean, that the report - might be incomplete, as either violations or duplications for an entire file or for a specific rule are missing. - These cases can be considered as false-negatives. - - In any case, the root cause should be investigated. If it's a problem in PMD itself, please create a bug report. - -* New CLI parameter `--no-fail-on-error` to ignore such errors and not exit with code 5. By default, - a build with errors will now fail and with that parameter, the previous behavior can be restored. - This parameter is available for both PMD and CPD. - -* The CLI parameter `--skip-lexical-errors` is deprecated. By default, lexical errors are skipped but the - build is failed. Use the new parameter `--[no-]fail-on-error` instead to control whether to fail the build or not. - -#### Ant - -* CPDTask has a new parameter `failOnError`. It controls, whether to fail the build if any recoverable error occurred. - By default, the build will fail. CPD will still create a report with all detected duplications, but the report might - be incomplete. -* The parameter `skipLexicalError` in CPDTask is deprecated and ignored. Lexical errors are now always skipped. - Use the new parameter `failOnError` instead to control whether to fail the build or not. - -#### Deprecated API - -* pmd-ant - * {% jdoc !!ant::ant.CPDTask#setSkipLexicalErrors(boolean) %}: Use {% jdoc ant::ant.CPDTask#setFailOnError(boolean) %} - instead to control, whether to ignore errors or fail the build. -* pmd-core - * {% jdoc !!core::cpd.CPDConfiguration#isSkipLexicalErrors() %} and {% jdoc core::cpd.CPDConfiguration#setSkipLexicalErrors(boolean) %}: - Use {%jdoc core::AbstractConfiguration#setFailOnError(boolean) %} to control whether to ignore errors or fail the build. - * {%jdoc !!core::cpd.XMLOldRenderer %} (the CPD format "xmlold"). - * The constructor - {%jdoc !!core::lang.ast.impl.antlr4.AntlrToken#AntlrToken(org.antlr.v4.runtime.Token,core::lang.ast.impl.antlr4.AntlrToken,core::lang.document.TextDocument) %} - shouldn't be used directly. Use {%jdoc core::lang.ast.impl.antlr4.AntlrTokenManager %} instead. -* pmd-java - * {% jdoc !!java::lang.java.ast.ASTResource#getStableName() %} and the corresponding attribute `@StableName`. - * {%jdoc !!java::lang.java.ast.ASTRecordPattern#getVarId() %} This method was added here by mistake. Record - patterns don't declare a pattern variable for the whole pattern, but rather for individual record - components, which can be accessed via {%jdoc java::lang.java.ast.ASTRecordPattern#getComponentPatterns() %}. -* pmd-plsql - * {%jdoc plsql::lang.plsql.ast.PLSQLParserImpl %} is deprecated now. It should have been package-private - because this is an implementation class that should not be used directly. - * The node {%jdoc plsql::lang.plsql.ast.ASTKEYWORD_UNRESERVED %} is deprecated and is now removed from the AST. - -#### Breaking changes: pmd-compat6 removed - -The already deprecated PMD 6 compatibility module (pmd-compat6) has been removed. -See above for details. - -### 📈 Stats -* 88 commits -* 32 closed tickets & PRs -* Days since last release: 27 +### ✨ External Contributions {% endtocmaker %} + diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md index 4bd8722d4a..7e5f11b546 100644 --- a/docs/pages/release_notes_old.md +++ b/docs/pages/release_notes_old.md @@ -5,6 +5,149 @@ permalink: pmd_release_notes_old.html Previous versions of PMD can be downloaded here: [Releases - pmd/pmd (GitHub)](https://github.com/pmd/pmd/releases) + + +## 28-June-2024 - 7.3.0 + +The PMD team is pleased to announce PMD 7.3.0. + +This is a minor release. + +### Table Of Contents + +* [🚀 New and noteworthy](#new-and-noteworthy) + * [✨ New Rules](#new-rules) + * [💥 pmd-compat6 removed (breaking)](#pmd-compat6-removed-breaking) +* [🐛 Fixed Issues](#fixed-issues) +* [🚨 API Changes](#api-changes) + * [CPD Report Format XML](#cpd-report-format-xml) + * [CLI](#cli) + * [Ant](#ant) + * [Deprecated API](#deprecated-api) + * [Breaking changes: pmd-compat6 removed](#breaking-changes-pmd-compat6-removed) +* [📈 Stats](#stats) + +### 🚀 New and noteworthy + +#### ✨ New Rules + +* The new Java rule [`UseEnumCollections`](https://docs.pmd-code.org/pmd-doc-7.3.0/pmd_rules_java_bestpractices.html#useenumcollections) reports usages for `HashSet` and `HashMap` + when the keys are of an enum type. The specialized enum collections are more space- and time-efficient. + +#### 💥 pmd-compat6 removed (breaking) + +The already deprecated PMD 6 compatibility module (pmd-compat6) has been removed. It was intended to be used with +older versions of the maven-pmd-plugin, but since maven-pmd-plugin 3.22.0, PMD 7 is supported directly and this +module is not needed anymore. + +If you currently use this dependency (`net.sourceforge.pmd:pmd-compat6`), remove it and upgrade maven-pmd-plugin +to the latest version (3.23.0 or newer). + +See also [Maven PMD Plugin](https://docs.pmd-code.org/pmd-doc-7.3.0/pmd_userdocs_tools_maven.html). + +### 🐛 Fixed Issues + +* cli + * [#2827](https://github.com/pmd/pmd/issues/2827): \[cli] Consider processing errors in exit status +* core + * [#4396](https://github.com/pmd/pmd/issues/4396): \[core] CPD is always case sensitive + * [#4992](https://github.com/pmd/pmd/pull/4992): \[core] CPD: Include processing errors in XML report + * [#5066](https://github.com/pmd/pmd/issues/5066): \[core] CPD throws java.lang.OutOfMemoryError: Java heap space (since 7.1.0) +* apex + * [#4922](https://github.com/pmd/pmd/issues/4922): \[apex] SOQL syntax error with TYPEOF in sub-query + * [#5053](https://github.com/pmd/pmd/issues/5053): \[apex] CPD fails to parse string literals with escaped characters + * [#5055](https://github.com/pmd/pmd/issues/5055): \[apex] SOSL syntax error with WITH USER_MODE or WITH SYSTEM_MODE +* apex-bestpractices + * [#5000](https://github.com/pmd/pmd/issues/5000): \[apex] UnusedLocalVariable FP with binds in SOSL / SOQL +* java + * [#4885](https://github.com/pmd/pmd/issues/4885): \[java] AssertionError: Method should be accessible + * [#5050](https://github.com/pmd/pmd/issues/5050): \[java] Problems with pattern variables in switch branches +* java-bestpractices + * [#577](https://github.com/pmd/pmd/issues/577): \[java] New Rule: Check that Map is an EnumMap if K is an enum value + * [#5047](https://github.com/pmd/pmd/issues/5047): \[java] UnusedPrivateMethod FP for Generics & Overloads +* plsql + * [#1934](https://github.com/pmd/pmd/issues/1934): \[plsql] ParseException with MERGE statement in anonymous block + * [#2779](https://github.com/pmd/pmd/issues/2779): \[plsql] Error while parsing statement with (Oracle) DML Error Logging + * [#4270](https://github.com/pmd/pmd/issues/4270): \[plsql] Parsing exception COMPOUND TRIGGER with EXCEPTION handler + +### 🚨 API Changes + +#### CPD Report Format XML + +There are some important changes: + +1. The XML format will now use an XSD schema, that is available at . + This schema defines the valid elements and attributes that one can expect from a CPD report. +2. The root element `pmd-cpd` contains the new attributes `pmdVersion`, `timestamp` and `version`. The latter is + the schema version and is currently "1.0.0". +3. The CPD XML report will now also contain recoverable errors as additional `` elements. + +See [Report formats for CPD](pmd_userdocs_cpd_report_formats.html#xml) for an example. + +The XML format should be compatible as only attributes and elements have been added. However, if you parse +the document with a namespace aware parser, you might encounter some issues like no elements being found. +In case the new format doesn't work for you (e.g. namespaces, unexpected error elements), you can +go back using the old format with the renderer "xmlold" (XMLOldRenderer). Note, that +this old renderer is deprecated and only there for compatibility reasons. Whatever tooling is used to +read the XML format should be updated. + +#### CLI + +* New exit code 5 introduced. PMD and CPD will exit now by default with exit code 5, if any recoverable error + (e.g. parsing exception, lexing exception or rule exception) occurred. PMD will still create a report with + all detected violations or duplications if recoverable errors occurred. Such errors mean, that the report + might be incomplete, as either violations or duplications for an entire file or for a specific rule are missing. + These cases can be considered as false-negatives. + + In any case, the root cause should be investigated. If it's a problem in PMD itself, please create a bug report. + +* New CLI parameter `--no-fail-on-error` to ignore such errors and not exit with code 5. By default, + a build with errors will now fail and with that parameter, the previous behavior can be restored. + This parameter is available for both PMD and CPD. + +* The CLI parameter `--skip-lexical-errors` is deprecated. By default, lexical errors are skipped but the + build is failed. Use the new parameter `--[no-]fail-on-error` instead to control whether to fail the build or not. + +#### Ant + +* CPDTask has a new parameter `failOnError`. It controls, whether to fail the build if any recoverable error occurred. + By default, the build will fail. CPD will still create a report with all detected duplications, but the report might + be incomplete. +* The parameter `skipLexicalError` in CPDTask is deprecated and ignored. Lexical errors are now always skipped. + Use the new parameter `failOnError` instead to control whether to fail the build or not. + +#### Deprecated API + +* pmd-ant + * CPDTask#setSkipLexicalErrors: Use setFailOnError + instead to control, whether to ignore errors or fail the build. +* pmd-core + * CPDConfiguration#isSkipLexicalErrors and setSkipLexicalErrors: + Use setFailOnError to control whether to ignore errors or fail the build. + * net.sourceforge.pmd.cpd.XMLOldRenderer (the CPD format "xmlold"). + * The constructor + AntlrToken#AntlrToken + shouldn't be used directly. Use AntlrTokenManager instead. +* pmd-java + * ASTResource#getStableName and the corresponding attribute `@StableName`. + * ASTRecordPattern#getVarId This method was added here by mistake. Record + patterns don't declare a pattern variable for the whole pattern, but rather for individual record + components, which can be accessed via getComponentPatterns. +* pmd-plsql + * PLSQLParserImpl is deprecated now. It should have been package-private + because this is an implementation class that should not be used directly. + * The node ASTKEYWORD_UNRESERVED is deprecated and is now removed from the AST. + +#### Breaking changes: pmd-compat6 removed + +The already deprecated PMD 6 compatibility module (pmd-compat6) has been removed. +See above for details. + +### 📈 Stats +* 88 commits +* 32 closed tickets & PRs +* Days since last release: 27 + ## 31-May-2024 - 7.2.0 The PMD team is pleased to announce PMD 7.2.0. diff --git a/pmd-ant/pom.xml b/pmd-ant/pom.xml index f2b0f47dbb..2d24dc491c 100644 --- a/pmd-ant/pom.xml +++ b/pmd-ant/pom.xml @@ -7,7 +7,7 @@ pmd net.sourceforge.pmd - 7.3.0 + 7.4.0-SNAPSHOT 4.0.0 diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index 8688be4747..a89fbebb49 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml index 2904462392..415b1a72eb 100644 --- a/pmd-cli/pom.xml +++ b/pmd-cli/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-coco/pom.xml b/pmd-coco/pom.xml index addd8b836d..4dafe93c48 100644 --- a/pmd-coco/pom.xml +++ b/pmd-coco/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index 0bcba4b7f6..a0067a6174 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 48a18eb658..921d7515cd 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 3370fcabf3..3641191746 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index f7c2ef95b2..e5e54e3987 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index ab0afc2799..4ca2949d3a 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 3e22bdb27c..7aa5ad9343 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index 9986fa2e0e..128c8c857a 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index 3d74ba665b..b054c8552f 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index d46455d37a..4bdaa9b8e3 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index e2c0f2ba58..40fad655a7 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index 3d30c88c63..06ca2d4c23 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index 37b038bfe9..354802ca58 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 305dfec4e7..2fef18a0b4 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index 2023442e64..a4452b174e 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-julia/pom.xml b/pmd-julia/pom.xml index 3d9ba4b6b8..72bb59e026 100644 --- a/pmd-julia/pom.xml +++ b/pmd-julia/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 7c25f4748f..0a7cf896ef 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index b35ea1f081..fe39bb602d 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml index a91cbfc5cb..358ecf6234 100644 --- a/pmd-languages-deps/pom.xml +++ b/pmd-languages-deps/pom.xml @@ -4,7 +4,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT pmd-languages-deps diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index c671c93757..e1c07de633 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index 554b2dfa80..4cc4232138 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 1ce9e01d9d..83e9f19c5e 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index 70bd708b7a..d45fab3959 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index 858b448cae..b2d709d222 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index e536d0a476..4aa8fffef4 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index 9972843fba..cefb499611 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 634ac8256a..30961424e9 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index 54fc0c84da..d480993717 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index 6e41bc7d18..02e24ea8bb 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../../pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index c7f8f48cbc..de0ac943c8 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 7.3.0 + 7.4.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index c2a6cd0837..eba570c541 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 7.3.0 + 7.4.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 1380380ac0..198560d743 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index aa343e4ffa..5744a993a5 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index c2e1c69bb4..ea1d1c0700 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml index 5f12615b6a..f3f513368a 100644 --- a/pmd-tsql/pom.xml +++ b/pmd-tsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-velocity/pom.xml b/pmd-velocity/pom.xml index f26db46bfd..305f484614 100644 --- a/pmd-velocity/pom.xml +++ b/pmd-velocity/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index 6f6948d8e7..150a52cae1 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index 816644e249..6e6876f751 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 2dad367367..ea9b4acc1e 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 7.3.0 + 7.4.0-SNAPSHOT pom PMD @@ -62,7 +62,7 @@ scm:git:git://github.com/pmd/pmd.git scm:git:ssh://git@github.com/pmd/pmd.git https://github.com/pmd/pmd - pmd_releases/7.3.0 + HEAD From 88483cd9897441722375dbf28787be58ce5219ea Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 12:08:45 +0200 Subject: [PATCH 60/66] Bump maven-pmd-plugin from 3.22.0 to 3.23.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ea9b4acc1e..2cad81b7af 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ 3.2.5 10.14.0 3.3.1 - 3.22.0 + 3.23.0 1.10.14 3.6.3 4.9.3 From e8c16bb6836eae7464c067cf7e07d5c435c19479 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 12:09:02 +0200 Subject: [PATCH 61/66] Bump pmd from 7.1.0 to 7.3.0 --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 2cad81b7af..4dd3a79fe1 100644 --- a/pom.xml +++ b/pom.xml @@ -562,22 +562,22 @@ net.sourceforge.pmd pmd-core - 7.1.0 + 7.3.0 net.sourceforge.pmd pmd-java - 7.1.0 + 7.3.0 net.sourceforge.pmd pmd-jsp - 7.1.0 + 7.3.0 net.sourceforge.pmd pmd-javascript - 7.1.0 + 7.3.0 From 0d18146f05905f459db498f7d592dd3ae95798b5 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 12:57:07 +0200 Subject: [PATCH 62/66] [ci] Improve release and build scripts - clarification for instructions - twitter -> x - try to avoid build failures due to missing dependencies --- .ci/build.sh | 10 ++++++++++ .github/workflows/build.yml | 2 -- do-release.sh | 14 +++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 291a10b424..4e843d4311 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -83,6 +83,16 @@ function build() { ./mvnw clean verify -Dskip-cli-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}" else # b) only pmd-cli and pmd-dist + # + # In the first stage build (without pmd-cli and pmd-dist), cyclonedx:makeAggregateBom tries to + # fetch the jars of the to-be-released modules, which don't exist yet. This is recorded in *.lastUpdated + # files in the local repo and might end up in the cache, that is used for this 2nd stage build. + # Trying to delete the files now, if they exist. + # Alternatively, we could run maven with flag "-U" to force update all dependencies... + pmd_ci_log_info "Cleanup local maven repo..." + find ~/.m2/repository -wholename "*/net/sourceforge/pmd/*/${PMD_CI_MAVEN_PROJECT_VERSION}/*.lastUpdated" | xargs rm -v + pmd_ci_log_info "Cleanup local maven repo finished." + ./mvnw clean verify -pl pmd-cli,pmd-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}" fi else diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c27288ee6f..9f4bc12a42 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,8 +48,6 @@ jobs: ~/.cache ~/work/pmd/target/repositories vendor/bundle - # avoid caching missed dependencies - !~/.m2/repository/**/*.lastUpdated key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} restore-keys: | v3-${{ runner.os }}- diff --git a/do-release.sh b/do-release.sh index ef34e1063a..269b2d8589 100755 --- a/do-release.sh +++ b/do-release.sh @@ -108,12 +108,12 @@ if [ "${BUILD_TOOLS_VERSION}" != "${BUILD_TOOLS_VERSION_RELEASE}" ]; then exit 1 fi -echo "* Update date info in **docs/_config.yml**." -echo " date: $(date -u +%d-%B-%Y)" -echo echo "* Update version info in **docs/_config.yml**." echo " remove the SNAPSHOT from site.pmd.version" echo +echo "* Update date info in **docs/_config.yml**." +echo " date: $(date -u +%Y-%m-%d)" +echo echo "* Update **pmd-apex/src/main/resources/rulesets/apex/quickstart.xml** and" echo " **pmd-java/src/main/resources/rulesets/java/quickstart.xml** with the new rules." echo @@ -204,7 +204,7 @@ echo echo "Tag has been pushed.... now check github actions: " echo echo "Now wait, until first stage of the release is finished successfully..." -echo "You don't need to wait until artifacts are in maven central, just the github action must be successful." +echo "You don't need to wait until artifacts are in maven central, just the GitHub Action must be successful." echo echo "If it is failing, you can fix the code/scripts and force push the tag via" echo @@ -214,7 +214,7 @@ echo " git push origin tag \"pmd_releases/${RELEASE_VERSION}\" --force" echo echo "However: This is only possible, if the artefacts have not been pushed to maven central yet..." echo -echo "Press enter to continue..." +echo "Press enter to continue, once the GitHub Action finished successfully..." read -r echo @@ -344,8 +344,8 @@ tweet="${tweet//#/%23}" tweet="${tweet//\//%2F}" tweet="${tweet//$'\r'/}" tweet="${tweet//$'\n'/%0A}" -echo "* Tweet about this release on https://twitter.com/pmd_analyzer:" -echo " " +echo "* Tweet about this release on https://x.com/pmd_analyzer:" +echo " " echo "* Post this also into :" echo " PMD ${RELEASE_VERSION} released: https://github.com/pmd/pmd/releases/tag/pmd_releases/${RELEASE_VERSION} #PMD" echo From e6397d5d5ce613d57280c04bf97cddd679259e09 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 28 Jun 2024 12:58:29 +0200 Subject: [PATCH 63/66] Bump maven from 3.9.6 to 3.9.8 --- .mvn/wrapper/maven-wrapper.jar | Bin 58727 -> 0 bytes .mvn/wrapper/maven-wrapper.properties | 9 +- mvnw | 477 ++++++++++++-------------- mvnw.cmd | 267 ++++++-------- 4 files changed, 329 insertions(+), 424 deletions(-) delete mode 100644 .mvn/wrapper/maven-wrapper.jar diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index c1dd12f17644411d6e840bd5a10c6ecda0175f18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 58727 zcmb5W18`>1vNjyPv28mO+cqb*Z6_1kwr$(?#I}=(ZGUs`Jr}3`|DLbDUA3!L?dtC8 zUiH*ktDo+@6r@4HP=SCTA%WmZqm^Ro`Ls)bfPkcdfq?#g1(Fq27W^S8Cq^$TC?_c< zs-#ROD;6C)1wFuk7<3)nGuR^#!H;n&3*IjzXg+s8Z_S!!E0jUq(`}Itt=YdYa5Z_s z&e>2={87knpF*PKNzU;lsbk#P(l^WBvb$yEz)z+nYH43pKodrDkMp@h?;n{;K}hl>Fb^ zqx}C0|D7kg|Cj~3f7hn_zkAE}|6t|cZT|S5Hvb#3nc~C14u5UI{6#F<|FkJ0svs&S zA}S{=DXLT*BM1$`2rK%`D@vEw9l9%*=92X_2g?Fwfi=6Zfpr7+<~sgP#Bav+Df2ts zwtu~70zhqV?mrzM)}r7mMS`Hk_)NrI5K%CTtQtDxqw5iv5F0!ksIon{qqpPVnU?ds zN$|Vm{MHKEReUy>1kVfT-$3))Js0p2W_LFy3cjjZ7za0R zPdBH>y&pb0vr1|ckDpt2p$IQhwnPs5G*^b-y}sg4W!ALn}a`pY0JIa$H0$eV2T8WjWD= zWaENacQhlTyK4O!+aOXBurVR2k$eb8HVTCxy-bcHlZ4Xr!`juLAL#?t6|Ba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k;_}2_{-bW`h~t&2$ObtlbS?k2k|5Kbu?FZLDMTVW_Z6p#A)c)`3DD?a*hxHS2Zj zcIiebfsINfWvwY7Z{YOlIQ61b`j=%6{>MPs+`()Q{wq0z0?|jwRN(1IrMQsj40BHx zvBC_Xfcr;55&}MeoP_@#nz$avCh%FJfE5NNAE~fW@L7~f8Y=?Wno31128EYOK8+O! zc4Vaj-DCsB6CPH$?pQQVbb_(tg^x{$STYM_WKLtrh-_-Hq-M%Ubpt6$mCHY!B{ISD zz}grIo^bNVDw4={SA2*nDNq5`e@ZO5r4TbQpHM)~qfD9!s0h(Jf>vYd;I~j<2fD4)_>ctbwNX6S*8>i^*4 zYKI5<4}d;hM!!N|A$@eg09J|HV;!UUVIau_I~dxZp#?a3u0G)pts6GKdCNk>FKxdh_`Xu!>zO3Kv?u+W6cYJPy!@=PuY868>3|Zg} z$7galV~M`d!q(`I{;CJsq6G9>W0}H6gVY`q7S@9s8ak1r{>}*Q0JyH&f!f8(NZxhC zkn|KS64r^A1fniFel2KkxYByk%erCx9UgFLI)`yuA)X z8SU?6kj!numPNCAj}>1ipax(t{%rxU;6`(Nqt$~Z4~76TQ$9d8l`yJ}rniII%HbH= zlS_7o!qB{55at^>N!Voer%)`KMh9Yd@Z?~nc19*hs)NGN954`O9zA&&vJHbm&|D@E za(&z6A=3NfC;>I)hlI@ulP8E@W-ziGe{iCf_mHvWGldxw8{ng-hI({EtOdALnD9zG ze)fU?I(DNt)Bzdd9Cs^>!|+2!xv1SK=I zJ+y_;=Sq-zqD~GKy@{5(my&aPgFfGY&_mayR_)?dF_^Fwc-n!UAG+fQQGfjWE-1MF YM{}PByk10KD_nuQ4E7Du?}+~TKh4V)`~Uy| diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 4a95a1367b..f95f1ee807 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -5,14 +5,15 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar +wrapperVersion=3.3.2 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip diff --git a/mvnw b/mvnw index 5643201c7d..19529ddf8c 100755 --- a/mvnw +++ b/mvnw @@ -19,298 +19,241 @@ # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Maven Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir +# Apache Maven Wrapper startup batch script, version 3.3.2 # # Optional ENV vars # ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output # ---------------------------------------------------------------------------- -if [ -z "$MAVEN_SKIP_RC" ] ; then +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x - if [ -f /usr/local/etc/mavenrc ] ; then - . /usr/local/etc/mavenrc - fi - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; esac -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" else JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi fi else - JAVACMD="`\\unset -f command; \\command -v java`" - fi -fi + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" done - echo "${basedir}" + printf %x\\n $h } -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 } -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" fi -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` + die "cannot create temp dir" fi -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS +mkdir -p -- "${MAVEN_HOME%/*}" -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" -exec "$JAVACMD" \ - $MAVEN_OPTS \ - $MAVEN_DEBUG_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" \ - "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd index 8a15b7f311..249bdf3822 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -1,3 +1,4 @@ +<# : batch portion @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @@ -18,171 +19,131 @@ @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- -@REM Maven Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir +@REM Apache Maven Wrapper startup batch script, version 3.3.2 @REM @REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output @REM ---------------------------------------------------------------------------- -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* -if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - -FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) ) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} -%MAVEN_JAVA_EXE% ^ - %JVM_CONFIG_MAVEN_PROPS% ^ - %MAVEN_OPTS% ^ - %MAVEN_DEBUG_OPTS% ^ - -classpath %WRAPPER_JAR% ^ - "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ - %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" -:error -set ERROR_CODE=1 +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} -if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" -if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" -:skipRcPost +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%"=="on" pause +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null -if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" -cmd /C exit /B %ERROR_CODE% +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" From fc128c18ddbfa9dc4257abe0c36ba8576ce8f8d4 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 5 Jul 2024 09:16:42 +0200 Subject: [PATCH 64/66] [java] Fix example of JUnitStaticSuite A method can be declared only once, so split the example into two examples. --- .../resources/category/java/errorprone.xml | 8 ++++++ .../rule/errorprone/xml/JUnitStaticSuite.xml | 28 +++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index 88d2b1fe2c..2900e6dd7c 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -1920,6 +1920,14 @@ import junit.framework.*; public class Foo extends TestCase { public void suite() {} // oops, should be static +} +]]> +
+ + diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/JUnitStaticSuite.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/JUnitStaticSuite.xml index 9493e6498f..657f0f3d4a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/JUnitStaticSuite.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/JUnitStaticSuite.xml @@ -12,7 +12,7 @@ import junit.framework.TestCase; import junit.framework.TestSuite; public class Foo extends TestCase { - public TestSuite suite() {} + public TestSuite suite() {} // oops, should be static } ]]>
@@ -37,7 +37,7 @@ public class Foo extends TestCase { import junit.framework.TestCase; import junit.framework.TestSuite; public class Foo extends TestCase { - private static TestSuite suite() {} + private static TestSuite suite() {} // oops, should be public } ]]> @@ -64,4 +64,28 @@ public class Foo { } ]]> + + + should be static - void suite() + 1 + + + + + should be public - void suite() + 1 + + From b5127b3c7bb3f1651b435d4d8b30950131e9ee4e Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 11 Jul 2024 09:16:19 +0200 Subject: [PATCH 65/66] Add @duursma as a contributor --- .all-contributorsrc | 9 ++++++ docs/pages/pmd/projectdocs/credits.md | 45 ++++++++++++++------------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 02a86f1818..92b95c9c8c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7645,6 +7645,15 @@ "contributions": [ "bug" ] + }, + { + "login": "duursma", + "name": "duursma", + "avatar_url": "https://avatars.githubusercontent.com/u/9378973?v=4", + "profile": "https://github.com/duursma", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index 97c0ea98da..d9cffe897d 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -891,198 +891,201 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d dreaminpast123
dreaminpast123

🐛 duanyanan
duanyanan

🐛 dutt-sanjay
dutt-sanjay

🐛 + duursma
duursma

💻 dylanleung
dylanleung

🐛 dzeigler
dzeigler

🐛 eant60
eant60

🐛 - ekkirala
ekkirala

🐛 + ekkirala
ekkirala

🐛 emersonmoura
emersonmoura

🐛 emouty
emouty

💻 eugenepugach
eugenepugach

🐛 fairy
fairy

🐛 filiprafalowicz
filiprafalowicz

💻 flxbl-io
flxbl-io

💵 - foxmason
foxmason

🐛 + foxmason
foxmason

🐛 frankegabor
frankegabor

🐛 frankl
frankl

🐛 freafrea
freafrea

🐛 fsapatin
fsapatin

🐛 gracia19
gracia19

🐛 guo fei
guo fei

🐛 - gurmsc5
gurmsc5

🐛 + gurmsc5
gurmsc5

🐛 gwilymatgearset
gwilymatgearset

💻 🐛 haigsn
haigsn

🐛 hemanshu070
hemanshu070

🐛 henrik242
henrik242

🐛 hongpuwu
hongpuwu

🐛 hvbtup
hvbtup

💻 🐛 - igniti GmbH
igniti GmbH

🐛 + igniti GmbH
igniti GmbH

🐛 ilovezfs
ilovezfs

🐛 itaigilo
itaigilo

🐛 jakivey32
jakivey32

🐛 jbennett2091
jbennett2091

🐛 jcamerin
jcamerin

🐛 jkeener1
jkeener1

🐛 - jmetertea
jmetertea

🐛 + jmetertea
jmetertea

🐛 johnra2
johnra2

💻 johnzhao9
johnzhao9

🐛 josemanuelrolon
josemanuelrolon

💻 🐛 kabroxiko
kabroxiko

💻 🐛 karwer
karwer

🐛 kaulonline
kaulonline

🐛 - kdaemonv
kdaemonv

🐛 + kdaemonv
kdaemonv

🐛 kdebski85
kdebski85

🐛 💻 kenji21
kenji21

💻 🐛 kfranic
kfranic

🐛 khalidkh
khalidkh

🐛 koalalam
koalalam

🐛 krzyk
krzyk

🐛 - lasselindqvist
lasselindqvist

🐛 + lasselindqvist
lasselindqvist

🐛 lgemeinhardt
lgemeinhardt

🐛 lihuaib
lihuaib

🐛 liqingjun123
liqingjun123

🐛 lonelyma1021
lonelyma1021

🐛 lpeddy
lpeddy

🐛 lujiefsi
lujiefsi

💻 - lukelukes
lukelukes

💻 + lukelukes
lukelukes

💻 lyriccoder
lyriccoder

🐛 marcelmore
marcelmore

🐛 matchbox
matchbox

🐛 matthiaskraaz
matthiaskraaz

🐛 meandonlyme
meandonlyme

🐛 mikesive
mikesive

🐛 - milossesic
milossesic

🐛 + milossesic
milossesic

🐛 mluckam
mluckam

💻 🐛 mohan-chinnappan-n
mohan-chinnappan-n

💻 mriddell95
mriddell95

🐛 mrlzh
mrlzh

🐛 msloan
msloan

🐛 mucharlaravalika
mucharlaravalika

🐛 - mvenneman
mvenneman

🐛 + mvenneman
mvenneman

🐛 nareshl119
nareshl119

🐛 nicolas-harraudeau-sonarsource
nicolas-harraudeau-sonarsource

🐛 noerremark
noerremark

🐛 novsirion
novsirion

🐛 nwcm
nwcm

📖 🐛 💻 oggboy
oggboy

🐛 - oinume
oinume

🐛 + oinume
oinume

🐛 orimarko
orimarko

💻 🐛 pablogomez2197
pablogomez2197

🐛 pacvz
pacvz

💻 pallavi agarwal
pallavi agarwal

🐛 parksungrin
parksungrin

🐛 patpatpat123
patpatpat123

🐛 - patriksevallius
patriksevallius

🐛 + patriksevallius
patriksevallius

🐛 pbrajesh1
pbrajesh1

🐛 phoenix384
phoenix384

🐛 piotrszymanski-sc
piotrszymanski-sc

💻 plan3d
plan3d

🐛 poojasix
poojasix

🐛 prabhushrikant
prabhushrikant

🐛 - pujitha8783
pujitha8783

🐛 + pujitha8783
pujitha8783

🐛 r-r-a-j
r-r-a-j

🐛 raghujayjunk
raghujayjunk

🐛 rajeshveera
rajeshveera

🐛 rajeswarreddy88
rajeswarreddy88

🐛 recdevs
recdevs

🐛 reudismam
reudismam

💻 🐛 - rijkt
rijkt

🐛 + rijkt
rijkt

🐛 rillig-tk
rillig-tk

🐛 rmohan20
rmohan20

💻 🐛 rnveach
rnveach

🐛 rxmicro
rxmicro

🐛 ryan-gustafson
ryan-gustafson

💻 🐛 sabi0
sabi0

🐛 - scais
scais

🐛 + scais
scais

🐛 screamingfrog
screamingfrog

💵 sebbASF
sebbASF

🐛 sergeygorbaty
sergeygorbaty

💻 shilko2013
shilko2013

🐛 shiomiyan
shiomiyan

📖 simeonKondr
simeonKondr

🐛 - snajberk
snajberk

🐛 + snajberk
snajberk

🐛 sniperrifle2004
sniperrifle2004

🐛 snuyanzin
snuyanzin

🐛 💻 soyodream
soyodream

🐛 sratz
sratz

🐛 stonio
stonio

🐛 sturton
sturton

💻 🐛 - sudharmohan
sudharmohan

🐛 + sudharmohan
sudharmohan

🐛 suruchidawar
suruchidawar

🐛 svenfinitiv
svenfinitiv

🐛 szymanp23
szymanp23

🐛 💻 tashiscool
tashiscool

🐛 test-git-hook
test-git-hook

🐛 testation21
testation21

💻 🐛 - thanosa
thanosa

🐛 + thanosa
thanosa

🐛 tiandiyixian
tiandiyixian

🐛 tobwoerk
tobwoerk

🐛 tprouvot
tprouvot

🐛 💻 trentchilders
trentchilders

🐛 triandicAnt
triandicAnt

🐛 trishul14
trishul14

🐛 - tsui
tsui

🐛 + tsui
tsui

🐛 wangzitom12306
wangzitom12306

🐛 winhkey
winhkey

🐛 witherspore
witherspore

🐛 wjljack
wjljack

🐛 wuchiuwong
wuchiuwong

🐛 xingsong
xingsong

🐛 - xioayuge
xioayuge

🐛 + xioayuge
xioayuge

🐛 xnYi9wRezm
xnYi9wRezm

💻 🐛 xuanuy
xuanuy

🐛 xyf0921
xyf0921

🐛 yalechen-cyw3
yalechen-cyw3

🐛 yasuharu-sato
yasuharu-sato

🐛 zenglian
zenglian

🐛 - zgrzyt93
zgrzyt93

💻 🐛 + zgrzyt93
zgrzyt93

💻 🐛 zh3ng
zh3ng

🐛 zt_soft
zt_soft

🐛 ztt79
ztt79

🐛 zzzzfeng
zzzzfeng

🐛 Árpád Magosányi
Árpád Magosányi

🐛 任贵杰
任贵杰

🐛 + + 茅延安
茅延安

💻 From dcb56dc04f3e403fd16906f86a95e68d71875c2e Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 11 Jul 2024 09:16:46 +0200 Subject: [PATCH 66/66] [doc] Update release notes (#5086) --- docs/pages/release_notes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index bc1a36ec7a..68fffd2835 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -15,10 +15,13 @@ This is a {{ site.pmd.release_type }} release. ### 🚀 New and noteworthy ### 🐛 Fixed Issues +* plsql + * [#5086](https://github.com/pmd/pmd/pull/5086): \[plsql] Fixed issue with missing optional table alias in MERGE usage ### 🚨 API Changes ### ✨ External Contributions +* [#5086](https://github.com/pmd/pmd/pull/5086): \[plsql] Fixed issue with missing optional table alias in MERGE usage - [Arjen Duursma](https://github.com/duursma) (@duursma) {% endtocmaker %}