diff --git a/.all-contributorsrc b/.all-contributorsrc
index 8d11a3745a..95ebc05d6e 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -7453,7 +7453,8 @@
"avatar_url": "https://avatars.githubusercontent.com/u/16755668?v=4",
"profile": "https://github.com/emouty",
"contributions": [
- "code"
+ "code",
+ "bug"
]
},
{
@@ -7820,6 +7821,15 @@
"bug"
]
},
+ {
+ "login": "thesunlover",
+ "name": "Iskren Stanislavov",
+ "avatar_url": "https://avatars.githubusercontent.com/u/6734600?v=4",
+ "profile": "https://interop.io/",
+ "contributions": [
+ "bug"
+ ]
+ },
{
"login": "gudzpoz",
"name": "gudzpoz",
@@ -7846,6 +7856,15 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "jdupak",
+ "name": "Jakub Dupak",
+ "avatar_url": "https://avatars.githubusercontent.com/u/22683640?v=4",
+ "profile": "https://github.com/jdupak",
+ "contributions": [
+ "code"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/docs/_config.yml b/docs/_config.yml
index 912d463cc1..27190ef965 100644
--- a/docs/_config.yml
+++ b/docs/_config.yml
@@ -1,9 +1,9 @@
repository: pmd/pmd
pmd:
- version: 7.7.0-SNAPSHOT
- previous_version: 7.6.0
- date: 2024-10-25
+ version: 7.8.0-SNAPSHOT
+ previous_version: 7.7.0
+ date: 2024-11-29
# release types: major, minor, bugfix
release_type: minor
diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md
index 0a1cd02cb0..9497ea7378 100644
--- a/docs/pages/pmd/projectdocs/credits.md
+++ b/docs/pages/pmd/projectdocs/credits.md
@@ -341,778 +341,779 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Iroha_ 🐛 |
Ishan Srivastava 🐛 |
+ Iskren Stanislavov 🐛 |
Ivan Vakhrushev 🐛 |
Ivano Guerini 🐛 |
Ivar Andreas Bonsaksen 🐛 |
Ivo Šmíd 🐛 |
- JJengility 🐛 |
+ JJengility 🐛 |
Jake Hemmerle 🐛 |
James Harrison 🐛 💻 |
Jamie Bisotti 🐛 |
Jan 🐛 |
Jan Aertgeerts 💻 🐛 |
Jan Brümmer 🐛 |
- Jan Tříska 🐛 |
+ Jan Tříska 🐛 |
Jan-Lukas Else 🐛 |
Jason Qiu 💻 📖 |
Jason Williams 🐛 |
Javier Spagnoletti 🐛 |
Jean-Paul Mayer 🐛 |
Jean-Simon Larochelle 🐛 |
- Jeff Bartolotta 💻 🐛 |
+ Jeff Bartolotta 💻 🐛 |
Jeff Hube 💻 🐛 |
Jeff Jensen 🐛 |
Jeff May 🐛 |
Jens Gerdes 🐛 |
Jeroen Borgers 🐛 💻 📢 |
Jeroen Meijer 🐛 |
- Jeroen van Wilgenburg 📖 |
+ Jeroen van Wilgenburg 📖 |
Jerome Russ 🐛 |
JerritEic 💻 📖 🐛 |
Jiri Pejchal 🐛 |
Jithin Sunny 🐛 |
Jiří Škorpil 🐛 |
Joao Machado 🐛 |
- Jochen Krauss 🐛 |
+ Jochen Krauss 🐛 |
Johan Hammar 🐛 |
John Karp 🐛 |
John Zhang 🐛 |
John-Teng 💻 🐛 |
Jon Moroney 💻 🐛 |
Jonas Geiregat 🐛 |
- Jonas Keßler 🐛 |
+ Jonas Keßler 🐛 |
Jonathan Wiesel 💻 🐛 |
Jordan 🐛 |
Jordi Llach 🐛 |
Jorge Solórzano 🐛 |
JorneVL 🐛 |
Jose Palafox 🐛 |
- Jose Stovall 🐛 |
+ Jose Stovall 🐛 |
Joseph 💻 |
Joseph Heenan 🐛 |
Josh Feingold 💻 🐛 |
Josh Holthaus 🐛 |
Joshua S Arquilevich 🐛 |
João Dinis Ferreira 📖 |
- João Ferreira 💻 🐛 |
+ João Ferreira 💻 🐛 |
João Pedro Schmitt 🐛 |
Juan Martín Sotuyo Dodero 💻 📖 🐛 🚧 |
Juan Pablo Civile 🐛 |
Julian Voronetsky 🐛 |
Julien 🐛 |
Julius 🐛 |
- JustPRV 🐛 |
+ JustPRV 🐛 |
Justin Stroud 💻 |
Jörn Huxhorn 🐛 |
KThompso 🐛 |
Kai Amundsen 🐛 |
Karel Vervaeke 🐛 |
Karl-Andero Mere 🐛 |
- Karl-Philipp Richter 🐛 |
+ Karl-Philipp Richter 🐛 |
Karsten Silz 🐛 |
Kazuma Watanabe 🐛 |
Kev 🐛 |
Keve Müller 🐛 |
Kevin Guerra 💻 |
Kevin Jones 🐛 💻 |
- Kevin Poorman 🐛 |
+ Kevin Poorman 🐛 |
Kevin Wayne 🐛 |
Kieran Black 🐛 |
Kirill Zubov 🐛 |
Kirk Clemens 💻 🐛 |
Klaus Hartl 🐛 |
Koen Van Looveren 🐛 |
- Kris Scheibe 💻 🐛 |
+ Kris Scheibe 💻 🐛 |
Krystian Dabrowski 🐛 💻 |
Kunal Thanki 🐛 |
LaLucid 💻 |
Larry Diamond 💻 🐛 |
Lars Knickrehm 🐛 |
Laurent Bovet 🐛 💻 |
- Leo Gutierrez 🐛 |
+ Leo Gutierrez 🐛 |
LiGaOg 💻 |
Liam Sharp 🐛 |
Lintsi 🐛 |
Linus Fernandes 🐛 |
Lixon Lookose 🐛 |
Logesh 🐛 |
- Lorenzo Gabriele 🐛 |
+ Lorenzo Gabriele 🐛 |
Loïc Ledoyen 🐛 |
Lucas 🐛 |
Lucas Silva 🐛 |
Lucas Soncini 💻 🐛 |
Luis Alcantar 💻 |
Lukas Gräf 💻 |
- Lukasz Slonina 🐛 |
+ Lukasz Slonina 🐛 |
Lukebray 🐛 |
Lynn 💻 🐛 |
Lyor Goldstein 🐛 |
MCMicS 🐛 |
Macarse 🐛 |
Machine account for PMD 💻 |
- Maciek Siemczyk 🐛 |
+ Maciek Siemczyk 🐛 |
Maikel Steneker 💻 🐛 |
Maksim Moiseikin 🐛 |
Manfred Koch 🐛 |
Manuel Moya Ferrer 💻 🐛 |
Manuel Ryan 🐛 |
Marat Vyshegorodtsev 🐛 |
- Marcel Härle 🐛 |
+ Marcel Härle 🐛 |
Marcello Fialho 🐛 |
Marcin Dąbrowski 💻 |
Marcin Rataj 🐛 |
Marcono1234 🐛 |
Mark Adamcin 🐛 |
Mark Hall 💻 🐛 |
- Mark Kolich 🐛 |
+ Mark Kolich 🐛 |
Mark Pritchard 🐛 |
Markus Rathgeb 🐛 |
Marquis Wang 🐛 |
MartGit 🐛 |
Martin Feldsztejn 🐛 |
Martin Lehmann 🐛 |
- Martin Spamer 🐛 |
+ Martin Spamer 🐛 |
Martin Tarjányi 🐛 |
MatFl 🐛 |
Mateusz Stefanski 🐛 |
Mathieu Gouin 🐛 |
MatiasComercio 💻 🐛 |
Matt Benson 🐛 |
- Matt De Poorter 🐛 |
+ Matt De Poorter 🐛 |
Matt Hargett 💻 💵 |
Matt Harrah 🐛 |
Matt Nelson 🐛 |
Matthew Amos 🐛 |
Matthew Duggan 🐛 |
Matthew Hall 🐛 |
- Matthew Rossner 🐛 |
+ Matthew Rossner 🐛 |
Matías Fraga 💻 🐛 |
Maxime Robert 💻 🐛 |
MetaBF 🐛 |
Metin Dagcilar 🐛 |
Michael 🐛 |
Michael Bell 🐛 |
- Michael Bernstein 🐛 |
+ Michael Bernstein 🐛 |
Michael Clay 🐛 |
Michael Dombrowski 🐛 |
Michael Hausegger 🐛 |
Michael Hoefer 🐛 |
Michael Kolesnikov 🐛 |
Michael Möbius 🐛 |
- Michael N. Lipp 🐛 |
+ Michael N. Lipp 🐛 |
Michael Pellegrini 🐛 |
Michal Kordas 🐛 |
Michał Borek 🐛 |
Michał Kuliński 🐛 |
Miguel Núñez Díaz-Montes 🐛 |
Mihai Ionut 🐛 |
- Mikhail Kuchma 🐛 |
+ Mikhail Kuchma 🐛 |
Mirek Hankus 🐛 |
Mitch Spano 🐛 |
Mladjan Gadzic 🐛 |
MrAngry52 🐛 |
Muminur Choudhury 🐛 |
Mykhailo Palahuta 💻 🐛 |
- Nagendra Kumar Singh 🐛 |
+ Nagendra Kumar Singh 🐛 |
Nahuel Barrios 🐛 |
Nakul Sharma 🐛 |
Nathan Braun 🐛 |
Nathan Reynolds 🐛 |
Nathan Reynolds 🐛 |
Nathanaël 🐛 |
- Naveen 💻 |
+ Naveen 💻 |
Nazdravi 🐛 |
Neha-Dhonde 🐛 |
Nicholas Doyle 🐛 |
Nick Butcher 🐛 |
Nico Gallinal 🐛 |
Nicola Dal Maso 🐛 |
- Nicolas Filotto 💻 |
+ Nicolas Filotto 💻 |
Nicolas Vervelle 🐛 |
Nicolas Vuillamy 📖 |
Nikita Chursin 🐛 |
Niklas Baudy 🐛 |
Nikolas Havrikov 🐛 |
Nilesh Virkar 🐛 |
- Nimit Patel 🐛 |
+ Nimit Patel 🐛 |
Niranjan Harpale 🐛 |
Nirvik Patel 💻 |
Noah Sussman 🐛 |
Noah0120 🐛 |
Noam Tamim 🐛 |
Noel Grandin 🐛 |
- Olaf Haalstra 🐛 |
+ Olaf Haalstra 🐛 |
Oleg Andreych 💻 🐛 |
Oleg Pavlenko 🐛 |
Oleksii Dykov 💻 🐛 |
Oliver Eikemeier 🐛 |
Oliver Siegmar 💵 |
Olivier Parent 💻 🐛 |
- Ollie Abbey 💻 🐛 |
+ Ollie Abbey 💻 🐛 |
Ondrej Kratochvil 🐛 |
OverDrone 🐛 |
Ozan Gulle 💻 🐛 |
PUNEET JAIN 🐛 |
Parbati Bose 🐛 |
Paul Berg 🐛 |
- Paul Guyot 💻 |
+ Paul Guyot 💻 |
Pavel Bludov 🐛 |
Pavel Mička 🐛 |
Pedro Nuno Santos 🐛 |
Pedro Rijo 🐛 |
Pelisse Romain 💻 📖 🐛 |
Per Abich 💻 |
- Pete Davids 🐛 |
+ Pete Davids 🐛 |
Peter Bruin 🐛 |
Peter Chittum 💻 🐛 |
Peter Cudmore 🐛 |
Peter Kasson 🐛 |
Peter Kofler 🐛 |
Peter Paul Bakker 💻 |
- Peter Rader 🐛 |
+ Peter Rader 🐛 |
Pham Hai Trung 🐛 |
Philip Graf 💻 🐛 |
Philip Hachey 🐛 |
Philippe Ozil 🐛 |
Phinehas Artemix 🐛 |
Phokham Nonava 🐛 |
- Pim van der Loos 💻 ⚠️ |
+ Pim van der Loos 💻 ⚠️ |
Piotr Szymański 🐛 |
Piotrek Żygieło 💻 🐛 📖 |
Pranay Jaiswal 🐛 |
Prasad Kamath 🐛 |
Prasanna 🐛 |
Presh-AR 🐛 |
- Puneet1726 🐛 |
+ Puneet1726 🐛 |
RBRi 🐛 |
Rafael Cortês 🐛 |
RaheemShaik999 🐛 |
RajeshR 💻 🐛 |
Ramachandra Mohan 🐛 |
Ramel0921 🐛 |
- Raquel Pau 🐛 |
+ Raquel Pau 🐛 |
Ravikiran Janardhana 🐛 |
Reda Benhemmouche 🐛 |
Reinhard Schiedermeier 🐛 |
Renato Oliveira 💻 🐛 |
Rich DiCroce 🐛 |
Richard Corfield 💻 |
- Richard Corfield 🐛 💻 |
+ Richard Corfield 🐛 💻 |
Riot R1cket 🐛 |
Rishabh Jain 🐛 |
RishabhDeep Singh 🐛 |
Rob Baillie 🐛 |
Robbie Martinus 💻 🐛 |
Robert Henry 🐛 |
- Robert Mihaly 🐛 |
+ Robert Mihaly 🐛 |
Robert Painsi 🐛 |
Robert Russell 🐛 |
Robert Sösemann 💻 📖 📢 🐛 |
Robert Whitebit 🐛 |
Robin Richtsfeld 🐛 |
Robin Stocker 💻 🐛 |
- Robin Wils 🐛 |
+ Robin Wils 🐛 |
RochusOest 🐛 |
Rodolfo Noviski 🐛 |
Rodrigo Casara 🐛 |
Rodrigo Fernandes 🐛 |
Roman Salvador 💻 🐛 |
Ronald Blaschke 🐛 |
- Róbert Papp 🐛 |
+ Róbert Papp 🐛 |
Saikat Sengupta 🐛 |
Saksham Handu 🐛 |
Saladoc 🐛 |
Salesforce Bob Lightning 🐛 |
Sam Carlberg 🐛 |
Sascha Riemer 🐛 |
- Sashko 💻 |
+ Sashko 💻 |
Satoshi Kubo 🐛 |
Scott Kennedy 🐛 |
Scott Wells 🐛 💻 |
Scrates1 🐛 💻 |
Scrsloota 💻 |
Sebastian Bögl 🐛 |
- Sebastian Davids 🐛 |
+ Sebastian Davids 🐛 |
Sebastian Schuberth 🐛 |
Sebastian Schwarz 🐛 |
Seren 🐛 💻 |
Sergey Gorbaty 🐛 |
Sergey Kozlov 🐛 |
Sergey Yanzin 💻 🐛 |
- Seth Wilcox 💻 |
+ Seth Wilcox 💻 |
Shai Bennathan 🐛 💻 |
Shubham 💻 🐛 |
Simon Abykov 💻 🐛 |
Simon Xiao 🐛 |
Srinivasan Venkatachalam 🐛 |
Stanislav Gromov 🐛 |
- Stanislav Myachenkov 💻 |
+ Stanislav Myachenkov 💻 |
Stefan Birkner 🐛 |
Stefan Bohn 🐛 |
Stefan Endrullis 🐛 |
Stefan Klöss-Schuster 🐛 |
Stefan Wolf 🐛 |
Stephan H. Wissel 🐛 |
- Stephen 🐛 |
+ Stephen 🐛 |
Stephen Carter 🐛 |
Stephen Friedrich 🐛 |
Steve Babula 💻 |
Steven Stearns 🐛 💻 |
Stexxe 🐛 |
Stian Lågstad 🐛 |
- StuartClayton5 🐛 |
+ StuartClayton5 🐛 |
Supun Arunoda 🐛 |
Suren Abrahamyan 🐛 |
Suvashri 📖 |
SwatiBGupta1110 🐛 |
SyedThoufich 🐛 |
Szymon Sasin 🐛 |
- T-chuangxin 🐛 |
+ T-chuangxin 🐛 |
TERAI Atsuhiro 🐛 |
TIOBE Software 💻 🐛 |
Tarush Singh 💻 |
Taylor Smock 🐛 |
Techeira Damián 💻 🐛 |
Ted Husted 🐛 |
- TehBakker 🐛 |
+ TehBakker 🐛 |
The Gitter Badger 🐛 |
Theodoor 🐛 |
Thiago Henrique Hüpner 🐛 |
Thibault Meyer 🐛 |
Thomas Güttler 🐛 |
Thomas Jones-Low 🐛 |
- Thomas Smith 💻 🐛 |
+ Thomas Smith 💻 🐛 |
ThrawnCA 🐛 |
Thu Vo 🐛 |
Thunderforge 💻 🐛 |
Tim van der Lippe 🐛 |
Tobias Weimer 💻 🐛 |
Tom Copeland 🐛 💻 📖 |
- Tom Daly 🐛 |
+ Tom Daly 🐛 |
Tomas 🐛 |
Tomer Figenblat 🐛 |
Tomi De Lucca 💻 🐛 |
Tony 📖 |
Torsten Kleiber 🐛 |
TrackerSB 🐛 |
- Tyson Stewart 🐛 |
+ Tyson Stewart 🐛 |
Ullrich Hafner 🐛 |
Utku Cuhadaroglu 💻 🐛 |
Valentin Brandl 🐛 |
Valeria 🐛 |
Valery Yatsynovich 📖 |
Vasily Anisimov 🐛 |
- Vedant Chokshi 🐛 |
+ Vedant Chokshi 🐛 |
Vibhor Goyal 🐛 |
Vickenty Fesunov 🐛 |
Victor Noël 🐛 |
Vincent Galloy 💻 |
Vincent HUYNH 🐛 |
Vincent Maurin 🐛 |
- Vincent Privat 🐛 |
+ Vincent Privat 🐛 |
Vishhwas 🐛 |
Vishv_Android 🐛 |
Vitaly 🐛 |
Vitaly Polonetsky 🐛 |
Vojtech Polivka 🐛 |
Vsevolod Zholobov 🐛 |
- Vyom Yadav 💻 |
+ Vyom Yadav 💻 |
Wang Shidong 🐛 |
Waqas Ahmed 🐛 |
Wayne J. Earl 🐛 |
Wchenghui 🐛 |
Wener 💻 |
Will Winder 🐛 |
- William Brockhus 💻 🐛 |
+ William Brockhus 💻 🐛 |
Wilson Kurniawan 🐛 |
Wim Deblauwe 🐛 |
Woongsik Choi 🐛 |
XenoAmess 💻 🐛 |
Yang 💻 |
YaroslavTER 🐛 |
- Yasar Shaikh 💻 |
+ Yasar Shaikh 💻 |
Young Chan 💻 🐛 |
YuJin Kim 🐛 |
Yuri Dolzhenko 🐛 |
Yurii Dubinka 🐛 |
Zoltan Farkas 🐛 |
Zustin 🐛 |
- aaronhurst-google 🐛 💻 |
+ aaronhurst-google 🐛 💻 |
alexmodis 🐛 |
andreoss 🐛 |
andrey81inmd 💻 🐛 |
anicoara 🐛 |
arunprasathav 🐛 |
asiercamara 🐛 |
- astillich-igniti 💻 |
+ astillich-igniti 💻 |
avesolovksyy 🐛 |
avishvat 🐛 |
avivmu 🐛 |
axelbarfod1 🐛 |
b-3-n 🐛 |
balbhadra9 🐛 |
- base23de 🐛 |
+ base23de 🐛 |
bergander 🐛 💻 |
berkam 💻 🐛 |
breizh31 🐛 |
caesarkim 🐛 |
carolyujing 🐛 |
cbfiddle 🐛 |
- cesares-basilico 🐛 |
+ cesares-basilico 🐛 |
chrite 🐛 |
ciufudean 📖 |
cobratbq 🐛 |
coladict 🐛 |
cosmoJFH 🐛 |
cristalp 🐛 |
- crunsk 🐛 |
+ crunsk 🐛 |
cwholmes 🐛 |
cyberjj999 🐛 |
cyw3 🐛 📖 |
d1ss0nanz 🐛 |
dague1 📖 |
dalizi007 💻 |
- danbrycefairsailcom 🐛 |
+ danbrycefairsailcom 🐛 |
dariansanity 🐛 |
darrenmiliband 🐛 |
davidburstrom 🐛 |
dbirkman-paloalto 🐛 |
deepak-patra 🐛 |
dependabot[bot] 💻 🐛 |
- dinesh150 🐛 |
+ dinesh150 🐛 |
diziaq 🐛 |
dreaminpast123 🐛 |
duanyanan 🐛 |
dutt-sanjay 🐛 |
duursma 💻 |
dylanleung 🐛 |
- dzeigler 🐛 |
+ dzeigler 🐛 |
eant60 🐛 |
ekkirala 🐛 |
emersonmoura 🐛 |
- emouty 💻 |
+ emouty 💻 🐛 |
eugenepugach 🐛 |
fairy 🐛 |
- filiprafalowicz 💻 |
+ filiprafalowicz 💻 |
flxbl-io 💵 |
foxmason 🐛 |
frankegabor 🐛 |
frankl 🐛 |
freafrea 🐛 |
fsapatin 🐛 |
- gearsethenry 🐛 |
+ gearsethenry 🐛 |
gracia19 🐛 |
gudzpoz 🐛 |
guo fei 🐛 |
gurmsc5 🐛 |
gwilymatgearset 💻 🐛 |
haigsn 🐛 |
- hemanshu070 🐛 |
+ hemanshu070 🐛 |
henrik242 🐛 |
hongpuwu 🐛 |
hvbtup 💻 🐛 |
igniti GmbH 🐛 |
ilovezfs 🐛 |
imax-erik 🐛 |
- itaigilo 🐛 |
+ itaigilo 🐛 |
jakivey32 🐛 |
jbennett2091 🐛 |
jcamerin 🐛 |
jkeener1 🐛 |
jmetertea 🐛 |
johnra2 💻 |
- johnzhao9 🐛 |
+ johnzhao9 🐛 |
josemanuelrolon 💻 🐛 |
kabroxiko 💻 🐛 |
karthikaiyasamy 📖 |
karwer 🐛 |
kaulonline 🐛 |
kdaemonv 🐛 |
- kdebski85 🐛 💻 |
+ kdebski85 🐛 💻 |
kenji21 💻 🐛 |
kfranic 🐛 |
khalidkh 🐛 |
koalalam 🐛 |
krzyk 🐛 |
lasselindqvist 🐛 |
- lgemeinhardt 🐛 |
+ lgemeinhardt 🐛 |
lihuaib 🐛 |
liqingjun123 🐛 |
lonelyma1021 🐛 |
lpeddy 🐛 |
lujiefsi 💻 |
lukelukes 💻 |
- lyriccoder 🐛 |
+ lyriccoder 🐛 |
marcelmore 🐛 |
matchbox 🐛 |
matthiaskraaz 🐛 |
meandonlyme 🐛 |
mikesive 🐛 |
milossesic 🐛 |
- mluckam 💻 🐛 |
+ mluckam 💻 🐛 |
mohan-chinnappan-n 💻 |
mriddell95 🐛 |
mrlzh 🐛 |
msloan 🐛 |
mucharlaravalika 🐛 |
mvenneman 🐛 |
- nareshl119 🐛 |
+ nareshl119 🐛 |
nicolas-harraudeau-sonarsource 🐛 |
noerremark 🐛 |
novsirion 🐛 |
nwcm 📖 🐛 💻 |
oggboy 🐛 |
oinume 🐛 |
- orimarko 💻 🐛 |
+ orimarko 💻 🐛 |
pablogomez2197 🐛 |
pacvz 💻 |
pallavi agarwal 🐛 |
parksungrin 🐛 |
patpatpat123 🐛 |
patriksevallius 🐛 |
- pbrajesh1 🐛 |
+ pbrajesh1 🐛 |
phoenix384 🐛 |
piotrszymanski-sc 💻 |
plan3d 🐛 |
poojasix 🐛 |
prabhushrikant 🐛 |
pujitha8783 🐛 |
- r-r-a-j 🐛 |
+ r-r-a-j 🐛 |
raghujayjunk 🐛 |
rajeshveera 🐛 |
rajeswarreddy88 🐛 |
recdevs 🐛 |
reudismam 💻 🐛 |
rijkt 🐛 |
- rillig-tk 🐛 |
+ rillig-tk 🐛 |
rmohan20 💻 🐛 |
rnveach 🐛 |
rxmicro 🐛 |
ryan-gustafson 💻 🐛 |
sabi0 🐛 |
scais 🐛 |
- schosin 🐛 |
+ schosin 🐛 |
screamingfrog 💵 |
sebbASF 🐛 |
sergeygorbaty 💻 |
shilko2013 🐛 |
shiomiyan 📖 |
simeonKondr 🐛 |
- snajberk 🐛 |
+ snajberk 🐛 |
sniperrifle2004 🐛 |
snuyanzin 🐛 💻 |
soloturn 🐛 |
soyodream 🐛 |
sratz 🐛 |
stonio 🐛 |
- sturton 💻 🐛 |
+ sturton 💻 🐛 |
sudharmohan 🐛 |
suruchidawar 🐛 |
svenfinitiv 🐛 |
szymanp23 🐛 💻 |
tashiscool 🐛 |
test-git-hook 🐛 |
- testation21 💻 🐛 |
+ testation21 💻 🐛 |
thanosa 🐛 |
tiandiyixian 🐛 |
tobwoerk 🐛 |
tprouvot 🐛 💻 |
trentchilders 🐛 |
triandicAnt 🐛 |
- trishul14 🐛 |
+ trishul14 🐛 |
tsui 🐛 |
wangzitom12306 🐛 |
winhkey 🐛 |
witherspore 🐛 |
wjljack 🐛 |
wuchiuwong 🐛 |
- xingsong 🐛 |
+ xingsong 🐛 |
xioayuge 🐛 |
xnYi9wRezm 💻 🐛 |
xuanuy 🐛 |
xyf0921 🐛 |
yalechen-cyw3 🐛 |
yasuharu-sato 🐛 |
- zenglian 🐛 |
+ zenglian 🐛 |
zgrzyt93 💻 🐛 |
zh3ng 🐛 |
zt_soft 🐛 |
ztt79 🐛 |
zzzzfeng 🐛 |
Árpád Magosányi 🐛 |
- 任贵杰 🐛 |
+ 任贵杰 🐛 |
茅延安 💻 |
diff --git a/docs/pages/pmd/userdocs/cpd/cpd.md b/docs/pages/pmd/userdocs/cpd/cpd.md
index 1bf2954c18..0580732bb4 100644
--- a/docs/pages/pmd/userdocs/cpd/cpd.md
+++ b/docs/pages/pmd/userdocs/cpd/cpd.md
@@ -163,7 +163,7 @@ exactly identical.
{% include custom/cli_option_row.html options="--ignore-literals"
description="Ignore literal values such as numbers and strings when comparing text.
By default, literals are not ignored."
- languages="Java"
+ languages="Java, C++"
%}
{% include custom/cli_option_row.html options="--ignore-literal-sequences"
description="Ignore sequences of literals such as list initializers.
@@ -173,7 +173,7 @@ exactly identical.
{% include custom/cli_option_row.html options="--ignore-identifiers"
description="Ignore names of classes, methods, variables, constants, etc. when comparing text.
By default, identifier names are not ignored."
- languages="Java"
+ languages="Java, C++"
%}
{% include custom/cli_option_row.html options="--ignore-annotations"
description="Ignore language annotations (Java) or attributes (C#) when comparing text.
diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md
index 8b0a13de9b..bc1a36ec7a 100644
--- a/docs/pages/release_notes.md
+++ b/docs/pages/release_notes.md
@@ -14,48 +14,11 @@ This is a {{ site.pmd.release_type }} release.
### 🚀 New and noteworthy
-### 🌟 Rule Changes
-
-#### Renamed Rules
-* Several rules for unit testing have been renamed to better reflect their actual scope. Lots of them were called
- after JUnit / JUnit 4, even when they applied to JUnit 5 and / or TestNG.
- * {% rule java/bestpractices/UnitTestAssertionsShouldIncludeMessage %} (Java Best Practices) has been renamed from `JUnitAssertionsShouldIncludeMessage`.
- * {% rule java/bestpractices/UnitTestContainsTooManyAsserts %} (Java Best Practices) has been renamed from `JUnitTestContainsTooManyAsserts`.
- * {% rule java/bestpractices/UnitTestShouldIncludeAssert %} (Java Best Practices) has been renamed from `JUnitTestsShouldIncludeAssert`.
- * {% rule java/bestpractices/UnitTestShouldUseAfterAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseAfterAnnotation`.
- * {% rule java/bestpractices/UnitTestShouldUseBeforeAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseBeforeAnnotation`.
- * {% rule java/bestpractices/UnitTestShouldUseTestAnnotation %} (Java Best Practices) has been renamed from `JUnit4TestShouldUseTestAnnotation`.
-
-The old rule names still work but are deprecated.
-
### 🐛 Fixed Issues
-* java
- * [#4532](https://github.com/pmd/pmd/issues/4532): \[java] Rule misnomer for JUnit* rules
- * [#5261](https://github.com/pmd/pmd/issues/5261): \[java] Record patterns with empty deconstructor lists lead to NPE
-* java-codestyle
- * [#5253](https://github.com/pmd/pmd/issues/5253): \[java] BooleanGetMethodName: False-negatives with `Boolean` wrapper
-* java-errorprone
- * [#5067](https://github.com/pmd/pmd/issues/5067): \[java] CloseResource: False positive for FileSystems.getDefault()
### 🚨 API Changes
-* java-bestpractices
- * The old rule name `JUnit4TestShouldUseAfterAnnotation` has been deprecated. Use the new name {% rule java/bestpractices/UnitTestShouldUseAfterAnnotation %} instead.
- * The old rule name `JUnit4TestShouldUseBeforeAnnotation` has been deprecated. Use the new name {% rule java/bestpractices/UnitTestShouldUseBeforeAnnotation %} instead.
- * The old rule name `JUnit4TestShouldUseTestAnnotation` has been deprecated. Use the new name {% rule java/bestpractices/UnitTestShouldUseTestAnnotation %} instead.
- * The old rule name `JUnitAssertionsShouldIncludeMessage` has been deprecated. Use the new name {% rule java/bestpractices/UnitTestAssertionsShouldIncludeMessage %} instead.
- * The old rule name `JUnitTestContainsTooManyAsserts` has been deprecated. Use the new name {% rule java/bestpractices/UnitTestContainsTooManyAsserts %} instead.
- * The old rule name `JUnitTestsShouldIncludeAssert` has been deprecated. Use the new name {% rule java/bestpractices/UnitTestShouldIncludeAssert %} instead.
-
-### ✨ Merged pull requests
-* [#4965](https://github.com/pmd/pmd/pull/4965): Fix #4532: \[java] Rename JUnit rules with overly restrictive names - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
-* [#5225](https://github.com/pmd/pmd/pull/5225): Fix #5067: \[java] CloseResource: False positive for FileSystems.getDefault() - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef)
-* [#5241](https://github.com/pmd/pmd/pull/5241): Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
-* [#5258](https://github.com/pmd/pmd/pull/5258): Ignore generated antlr classes in coverage reports - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
-* [#5264](https://github.com/pmd/pmd/pull/5264): Fix #5261: \[java] Fix NPE with empty pattern list - [Clément Fournier](https://github.com/oowekyala) (@oowekyala)
-* [#5269](https://github.com/pmd/pmd/pull/5269): Fix #5253: \[java] Support Boolean wrapper class for BooleanGetMethodName rule - [Aryant Tripathi](https://github.com/Aryant-Tripathi) (@Aryant-Tripathi)
-* [#5275](https://github.com/pmd/pmd/pull/5275): Use plugin-classpath to simplify javacc-wrapper.xml - [Andreas Dangel](https://github.com/adangel) (@adangel)
-* [#5278](https://github.com/pmd/pmd/pull/5278): \[java] CouplingBetweenObjects: improve violation message - [Andreas Dangel](https://github.com/adangel) (@adangel)
+### ✨ External Contributions
{% endtocmaker %}
diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md
index 6a7983db8b..74a1cfcd25 100644
--- a/docs/pages/release_notes_old.md
+++ b/docs/pages/release_notes_old.md
@@ -5,6 +5,132 @@ permalink: pmd_release_notes_old.html
Previous versions of PMD can be downloaded here: [Releases - pmd/pmd (GitHub)](https://github.com/pmd/pmd/releases)
+## 25-October-2024 - 7.7.0
+
+The PMD team is pleased to announce PMD 7.7.0.
+
+This is a minor release.
+
+### Table Of Contents
+
+* [🚀 New and noteworthy](#new-and-noteworthy)
+ * [CPD can now ignore literals and identifiers in C++ code](#cpd-can-now-ignore-literals-and-identifiers-in-c-code)
+* [🌟 Rule Changes](#rule-changes)
+ * [Changed Rules](#changed-rules)
+ * [Renamed Rules](#renamed-rules)
+* [🐛 Fixed Issues](#fixed-issues)
+* [🚨 API Changes](#api-changes)
+* [✨ Merged pull requests](#merged-pull-requests)
+* [📦 Dependency updates](#dependency-updates)
+* [📈 Stats](#stats)
+
+### 🚀 New and noteworthy
+
+#### CPD can now ignore literals and identifiers in C++ code
+
+When searching for duplicated code in C++ differences in literals or identifiers can be
+ignored now (like in Java). This can be enabled via the command line options `--ignore-literal`
+and `--ignore-identifiers`.
+See [PR #5040](https://github.com/pmd/pmd/pull/5040) for details.
+
+### 🌟 Rule Changes
+
+#### Changed Rules
+* [`SwitchStmtsShouldHaveDefault`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#switchstmtsshouldhavedefault) (Java Best Practices) doesn't report empty switch statements anymore.
+ To detect these, use [`EmptyControlStatement`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#emptycontrolstatement).
+* [`UnitTestShouldUseAfterAnnotation`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshoulduseafterannotation) (Java Best Practices) now also considers JUnit 5 and TestNG tests.
+* [`UnitTestShouldUseBeforeAnnotation`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshouldusebeforeannotation) (Java Best Practices) now also considers JUnit 5 and TestNG tests.
+* [`TooFewBranchesForSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_performance.html#toofewbranchesforswitch) (Java Performance) doesn't report empty switches anymore.
+ To detect these, use [`EmptyControlStatement`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_codestyle.html#emptycontrolstatement).
+
+#### Renamed Rules
+* Several rules for unit testing have been renamed to better reflect their actual scope. Lots of them were called
+ after JUnit / JUnit 4, even when they applied to JUnit 5 and / or TestNG.
+ * [`UnitTestAssertionsShouldIncludeMessage`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestassertionsshouldincludemessage) (Java Best Practices) has been renamed from `JUnitAssertionsShouldIncludeMessage`.
+ * [`UnitTestContainsTooManyAsserts`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestcontainstoomanyasserts) (Java Best Practices) has been renamed from `JUnitTestContainsTooManyAsserts`.
+ * [`UnitTestShouldIncludeAssert`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshouldincludeassert) (Java Best Practices) has been renamed from `JUnitTestsShouldIncludeAssert`.
+ * [`UnitTestShouldUseAfterAnnotation`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshoulduseafterannotation) (Java Best Practices) has been renamed from `JUnit4TestShouldUseAfterAnnotation`.
+ * [`UnitTestShouldUseBeforeAnnotation`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshouldusebeforeannotation) (Java Best Practices) has been renamed from `JUnit4TestShouldUseBeforeAnnotation`.
+ * [`UnitTestShouldUseTestAnnotation`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshouldusetestannotation) (Java Best Practices) has been renamed from `JUnit4TestShouldUseTestAnnotation`.
+* Several rules about switch statements and switch expression have been renamed, as they apply both to Switch Statements
+ and to Switch Expressions:
+ * [`DefaultLabelNotLastInSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#defaultlabelnotlastinswitch) (Java Best Practices) has been renamed from `DefaultLabelNotLastInSwitchStmt`.
+ * [`NonCaseLabelInSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_errorprone.html#noncaselabelinswitch) (Java Error Prone) has been renamed from `NonCaseLabelInSwitchStatement`.
+ * [`TooFewBranchesForSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_performance.html#toofewbranchesforswitch) (Java Performance) has been renamed from `TooFewBranchesForASwitchStatement`.
+ * [`NonExhaustiveSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#nonexhaustiveswitch) (Java Best Practices) has been renamed from `SwitchStmtsShouldHaveDefault`.
+
+The old rule names still work but are deprecated.
+
+### 🐛 Fixed Issues
+* apex-performance
+ * [#5270](https://github.com/pmd/pmd/issues/5270): \[apex] AvoidNonRestrictiveQueries when LIMIT is followed by bind expression
+* java
+ * [#4532](https://github.com/pmd/pmd/issues/4532): \[java] Rule misnomer for JUnit* rules
+ * [#5261](https://github.com/pmd/pmd/issues/5261): \[java] Record patterns with empty deconstructor lists lead to NPE
+* java-bestpractices
+ * [#4286](https://github.com/pmd/pmd/issues/4286): \[java] Rename rule SwitchStmtsShouldHaveDefault to NonExhaustiveSwitch
+ * [#4813](https://github.com/pmd/pmd/issues/4813): \[java] SwitchStmtsShouldHaveDefault false positive with pattern matching
+* java-codestyle
+ * [#5253](https://github.com/pmd/pmd/issues/5253): \[java] BooleanGetMethodName: False-negatives with `Boolean` wrapper
+* java-design
+ * [#5030](https://github.com/pmd/pmd/issues/5030): \[java] SwitchDensity false positive with pattern matching
+* java-errorprone
+ * [#3362](https://github.com/pmd/pmd/issues/3362): \[java] ImplicitSwitchFallThrough should consider switch expressions
+ * [#5067](https://github.com/pmd/pmd/issues/5067): \[java] CloseResource: False positive for FileSystems.getDefault()
+ * [#5244](https://github.com/pmd/pmd/issues/5244): \[java] UselessOperationOnImmutable should detect java.time types
+ * [#5257](https://github.com/pmd/pmd/issues/5257): \[java] NonCaseLabelInSwitch should consider switch expressions
+* java-performance
+ * [#5249](https://github.com/pmd/pmd/issues/5249): \[java] TooFewBranchesForASwitchStatement false positive for Pattern Matching
+ * [#5250](https://github.com/pmd/pmd/issues/5250): \[java] TooFewBranchesForASwitchStatement should consider Switch Expressions
+
+### 🚨 API Changes
+* java-bestpractices
+ * The old rule name `JUnit4TestShouldUseAfterAnnotation` has been deprecated. Use the new name [`UnitTestShouldUseAfterAnnotation`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshoulduseafterannotation) instead.
+ * The old rule name `JUnit4TestShouldUseBeforeAnnotation` has been deprecated. Use the new name [`UnitTestShouldUseBeforeAnnotation`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshouldusebeforeannotation) instead.
+ * The old rule name `JUnit4TestShouldUseTestAnnotation` has been deprecated. Use the new name [`UnitTestShouldUseTestAnnotation`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshouldusetestannotation) instead.
+ * The old rule name `JUnitAssertionsShouldIncludeMessage` has been deprecated. Use the new name [`UnitTestAssertionsShouldIncludeMessage`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestassertionsshouldincludemessage) instead.
+ * The old rule name `JUnitTestContainsTooManyAsserts` has been deprecated. Use the new name [`UnitTestContainsTooManyAsserts`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestcontainstoomanyasserts) instead.
+ * The old rule name `JUnitTestsShouldIncludeAssert` has been deprecated. Use the new name [`UnitTestShouldIncludeAssert`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unittestshouldincludeassert) instead.
+ * The old rule name `DefaultLabelNotLastInSwitchStmt` has been deprecated. Use the new name [`DefaultLabelNotLastInSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#defaultlabelnotlastinswitch) instead.
+ * The old rule name `SwitchStmtsShouldHaveDefault` has been deprecated. USe the new name [`NonExhaustiveSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#nonexhaustiveswitch) instead.
+* java-errorprone
+ * The old rule name `NonCaseLabelInSwitchStatement` has been deprecated. Use the new name [`NonCaseLabelInSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_errorprone.html#noncaselabelinswitch) instead.
+* java-performance
+ * The old rule name `TooFewBranchesForASwitchStatement` has been deprecated. Use the new name [`TooFewBranchesForSwitch`](https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_performance.html#toofewbranchesforswitch) instead.
+
+### ✨ Merged pull requests
+* [#4965](https://github.com/pmd/pmd/pull/4965): Fix #4532: \[java] Rename JUnit rules with overly restrictive names - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
+* [#5040](https://github.com/pmd/pmd/pull/5040): \[cpp] Ignore literals and ignore identifiers capability to C++ CPD - [Jakub Dupak](https://github.com/jdupak) (@jdupak)
+* [#5225](https://github.com/pmd/pmd/pull/5225): Fix #5067: \[java] CloseResource: False positive for FileSystems.getDefault() - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef)
+* [#5241](https://github.com/pmd/pmd/pull/5241): Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
+* [#5245](https://github.com/pmd/pmd/pull/5245): \[java] Improve UnitTestShouldUse{After,Before}Annotation rules to support JUnit5 and TestNG - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5247](https://github.com/pmd/pmd/pull/5247): Fix #5030: \[java] SwitchDensity false positive with pattern matching - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5248](https://github.com/pmd/pmd/pull/5248): Fix #3362: \[java] ImplicitSwitchFallThrough should consider switch expressions - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5251](https://github.com/pmd/pmd/pull/5251): Fix #5249 and #5250: \[java] TooFewBranchesForSwitch ignore pattern matching and support switch expressions - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5252](https://github.com/pmd/pmd/pull/5252): Fix #4813: \[java] SwitchStmtsShouldHaveDefault false positive with pattern matching - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5255](https://github.com/pmd/pmd/pull/5255): \[java] Rename rule DefaultLabelNotLastInSwitch - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5256](https://github.com/pmd/pmd/pull/5256): Fix #5257: \[java] NonCaseLabelInSwitch - support switch expressions - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5258](https://github.com/pmd/pmd/pull/5258): Ignore generated antlr classes in coverage reports - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
+* [#5264](https://github.com/pmd/pmd/pull/5264): Fix #5261: \[java] Fix NPE with empty pattern list - [Clément Fournier](https://github.com/oowekyala) (@oowekyala)
+* [#5267](https://github.com/pmd/pmd/pull/5267): \[java] Rename rule SwitchStmtsShouldHaveDefault to NonExhaustiveSwitch - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5269](https://github.com/pmd/pmd/pull/5269): Fix #5253: \[java] Support Boolean wrapper class for BooleanGetMethodName rule - [Aryant Tripathi](https://github.com/Aryant-Tripathi) (@Aryant-Tripathi)
+* [#5273](https://github.com/pmd/pmd/pull/5273): Fix #5270: \[apex] AvoidNonRestrictiveQueries: Fix regex for detecting LIMIT clause - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5275](https://github.com/pmd/pmd/pull/5275): Use plugin-classpath to simplify javacc-wrapper.xml - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5278](https://github.com/pmd/pmd/pull/5278): \[java] CouplingBetweenObjects: improve violation message - [Andreas Dangel](https://github.com/adangel) (@adangel)
+* [#5279](https://github.com/pmd/pmd/pull/5279): Fix #5244: \[java] UselessOperationOnImmutable: consider java.time.* types - [Andreas Dangel](https://github.com/adangel) (@adangel)
+
+### 📦 Dependency updates
+* [#5234](https://github.com/pmd/pmd/issues/5234): Bump com.google.protobuf:protobuf-java from 3.25.3 to 4.28.2
+* [#5274](https://github.com/pmd/pmd/issues/5274): Bump org.junit from 5.8.2 to 5.11.2
+* [#5276](https://github.com/pmd/pmd/issues/5276): Bump org.checkerframework:checker-qual from 2.11.1 to 3.48.1
+* [#5280](https://github.com/pmd/pmd/issues/5280): Bump danger from 9.5.0 to 9.5.1 in the all-gems group across 1 directory
+* [#5281](https://github.com/pmd/pmd/issues/5281): Bump org.scala-lang:scala-reflect from 2.13.13 to 2.13.15
+
+### 📈 Stats
+* 98 commits
+* 32 closed tickets & PRs
+* Days since last release: 27
+
## 27-September-2024 - 7.6.0
The PMD team is pleased to announce PMD 7.6.0.
diff --git a/pmd-ant/pom.xml b/pmd-ant/pom.xml
index bc57065dc2..6f6d37badf 100644
--- a/pmd-ant/pom.xml
+++ b/pmd-ant/pom.xml
@@ -7,7 +7,7 @@
pmd
net.sourceforge.pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
4.0.0
diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java
index f6ec0a9518..159f19d7e1 100644
--- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java
+++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java
@@ -11,6 +11,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
+import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.charset.Charset;
@@ -21,8 +22,6 @@ import java.util.List;
import java.util.Properties;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.reflect.FieldUtils;
-import org.apache.commons.lang3.reflect.MethodUtils;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Parameter;
@@ -200,10 +199,12 @@ public class Formatter {
if (console != null) {
// Since Java 22, this returns a console even for redirected streams.
// In that case, we need to check Console.isTerminal()
+ // https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/io/Console.html#isTerminal()
// See: JLine As The Default Console Provider (JDK-8308591)
try {
- Boolean isTerminal = (Boolean) MethodUtils.invokeMethod(console, "isTerminal");
- if (!isTerminal) {
+ Method method = Console.class.getMethod("isTerminal");
+ Object isTerminal = method.invoke(console);
+ if (isTerminal instanceof Boolean && !(Boolean) isTerminal) {
// stop here, we don't have an interactive console.
return null;
}
@@ -211,39 +212,58 @@ public class Formatter {
// fall-through - we use a Java Runtime < 22.
}
+ // Maybe this is Java17+? Then there will be a public method charset()
+ // https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/Console.html#charset()
try {
- Object res = FieldUtils.readDeclaredField(console, "cs", true);
- if (res instanceof Charset) {
- return ((Charset) res).name();
+ Method method = Console.class.getMethod("charset");
+ Object charset = method.invoke(console);
+ if (charset instanceof Charset) {
+ return ((Charset) charset).name();
+ }
+ } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException ignored) {
+ // fall-through
+ }
+
+ {
+ // try to use the system property "sun.jnu.encoding", which is the platform encoding.
+ // this property is not specified and might not always be available, but it is for
+ // openjdk 11: https://github.com/openjdk/jdk11u/blob/cee8535a9d3de8558b4b5028d68e397e508bef71/src/java.base/share/native/libjava/System.c#L384
+ // if it exists, we use it - this avoids illegal reflective access below.
+ String jnuEncoding = System.getProperty("sun.jnu.encoding");
+ if (jnuEncoding != null) {
+ return jnuEncoding;
+ }
+ }
+
+ // the following parts are accessing private/protected fields via reflection
+ // this should work with Java 8 and 11. With Java 11, you'll see warnings abouts
+ // illegal reflective access, see #1860. However, the access still works.
+
+ // Fall-Back 1: private field "cs" in java.io.Console
+ try {
+ Field field = Console.class.getDeclaredField("cs");
+ field.setAccessible(true);
+ Object csField = field.get(console);
+ if (csField instanceof Charset) {
+ return ((Charset) csField).name();
}
} catch (IllegalArgumentException | ReflectiveOperationException ignored) {
// fall-through
}
- // Maybe this is Java17+? Then there will be
- // https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/Console.html#charset()
- // instead of the field "cs".
+ // Fall-Back 2: private native method "encoding()" in java.io.Console
try {
- Method charsetMethod = Console.class.getDeclaredMethod("charset");
- Charset charset = (Charset) charsetMethod.invoke(console);
- return charset.name();
- } catch (IllegalArgumentException | ReflectiveOperationException ignored) {
+ Method method = Console.class.getDeclaredMethod("encoding");
+ method.setAccessible(true);
+ Object encoding = method.invoke(console);
+ if (encoding instanceof String) {
+ return (String) encoding;
+ }
+ } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException ignored) {
// fall-through
}
- return getNativeConsoleEncoding();
- }
- return null;
- }
-
- private static String getNativeConsoleEncoding() {
- try {
- Object res = MethodUtils.invokeStaticMethod(Console.class, "encoding");
- if (res instanceof String) {
- return (String) res;
- }
- } catch (IllegalArgumentException | ReflectiveOperationException ignored) {
- // fall-through
}
+ // we couldn't determine the correct platform console encoding
return null;
}
diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml
index 1c1c8045fe..4bcd6b9199 100644
--- a/pmd-apex/pom.xml
+++ b/pmd-apex/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidNonRestrictiveQueriesRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidNonRestrictiveQueriesRule.java
index e62363eb7e..fd3c5bf392 100644
--- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidNonRestrictiveQueriesRule.java
+++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidNonRestrictiveQueriesRule.java
@@ -24,7 +24,7 @@ import net.sourceforge.pmd.lang.rule.RuleTargetSelector;
import net.sourceforge.pmd.reporting.RuleContext;
public class AvoidNonRestrictiveQueriesRule extends AbstractApexRule {
- private static final Pattern RESTRICTIVE_PATTERN = Pattern.compile("(where\\s+)|(limit\\s+)", Pattern.CASE_INSENSITIVE);
+ private static final Pattern RESTRICTIVE_PATTERN = Pattern.compile("\\b(where|limit)\\b", Pattern.CASE_INSENSITIVE);
private static final Pattern SELECT_OR_FIND_PATTERN = Pattern.compile("(select\\s+|find\\s+)", Pattern.CASE_INSENSITIVE);
private static final Pattern SUB_QUERY_PATTERN = Pattern.compile("(?i)\\(\\s*select\\s+[^)]+\\)");
diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/performance/xml/AvoidNonRestrictiveQueries.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/performance/xml/AvoidNonRestrictiveQueries.xml
index 289a049261..c18ad9538a 100644
--- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/performance/xml/AvoidNonRestrictiveQueries.xml
+++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/performance/xml/AvoidNonRestrictiveQueries.xml
@@ -260,6 +260,36 @@ public class Something {
.isEmpty();
}
}
+]]>
+
+
+
+ [apex] AvoidNonRestrictiveQueries when LIMIT is followed by bind expression #5270
+ 0
+ getTwoAccounts() {
+ List result = [
+ SELECT Id, Name FROM Account WITH SECURITY_ENFORCED
+ LIMIT:LIMIT_ACCOUNTS // note: no spaces... - false positive here
+ ];
+ List result2 = [
+ SELECT Id, Name FROM Account WITH SECURITY_ENFORCED
+ LIMIT :LIMIT_ACCOUNTS
+ ];
+ List result3 = [
+ SELECT Id, Name FROM Account WITH SECURITY_ENFORCED
+ LIMIT : LIMIT_ACCOUNTS
+ ];
+
+ // sosl:
+ List> searchList = [FIND 'map*' IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead LIMIT:LIMIT_ACCOUNTS];
+
+ return result;
+ }
+}
]]>
diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml
index adca9527ba..c75f5f91fe 100644
--- a/pmd-cli/pom.xml
+++ b/pmd-cli/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-coco/pom.xml b/pmd-coco/pom.xml
index 147966f7b6..c060429a45 100644
--- a/pmd-coco/pom.xml
+++ b/pmd-coco/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml
index 531a06515f..e84a30f8c9 100644
--- a/pmd-core/pom.xml
+++ b/pmd-core/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml
index a42c4f850a..5c75467663 100644
--- a/pmd-cpp/pom.xml
+++ b/pmd-cpp/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppLanguageModule.java b/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppLanguageModule.java
index 520fc7327c..5312f8abaf 100644
--- a/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppLanguageModule.java
+++ b/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/CppLanguageModule.java
@@ -47,6 +47,8 @@ public class CppLanguageModule extends CpdOnlyLanguageModuleBase {
LanguagePropertyBundle bundle = super.newPropertyBundle();
bundle.definePropertyDescriptor(CpdLanguageProperties.CPD_IGNORE_LITERAL_SEQUENCES);
bundle.definePropertyDescriptor(CpdLanguageProperties.CPD_IGNORE_LITERAL_AND_IDENTIFIER_SEQUENCES);
+ bundle.definePropertyDescriptor(CpdLanguageProperties.CPD_ANONYMIZE_IDENTIFIERS);
+ bundle.definePropertyDescriptor(CpdLanguageProperties.CPD_ANONYMIZE_LITERALS);
bundle.definePropertyDescriptor(CPD_SKIP_BLOCKS);
return bundle;
}
diff --git a/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexer.java b/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexer.java
index 5d0e423a51..69287747ba 100644
--- a/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexer.java
+++ b/pmd-cpp/src/main/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexer.java
@@ -9,8 +9,9 @@ import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import net.sourceforge.pmd.cpd.CpdLanguageProperties;
-import net.sourceforge.pmd.cpd.impl.CpdLexerBase;
+import net.sourceforge.pmd.cpd.TokenFactory;
import net.sourceforge.pmd.cpd.impl.JavaCCTokenFilter;
+import net.sourceforge.pmd.cpd.impl.JavaccCpdLexer;
import net.sourceforge.pmd.lang.LanguagePropertyBundle;
import net.sourceforge.pmd.lang.TokenManager;
import net.sourceforge.pmd.lang.ast.impl.javacc.CharStream;
@@ -26,17 +27,21 @@ import net.sourceforge.pmd.lang.document.TextDocument;
*
* Note: This class has been called CPPTokenizer in PMD 6
.
*/
-public class CppCpdLexer extends CpdLexerBase {
+public class CppCpdLexer extends JavaccCpdLexer {
private boolean skipBlocks;
private Pattern skipBlocksStart;
private Pattern skipBlocksEnd;
private final boolean ignoreIdentifierAndLiteralSeqences;
private final boolean ignoreLiteralSequences;
+ private final boolean ignoreLiterals;
+ private final boolean ignoreIdentifiers;
public CppCpdLexer(LanguagePropertyBundle cppProperties) {
ignoreLiteralSequences = cppProperties.getProperty(CpdLanguageProperties.CPD_IGNORE_LITERAL_SEQUENCES);
ignoreIdentifierAndLiteralSeqences = cppProperties.getProperty(CpdLanguageProperties.CPD_IGNORE_LITERAL_AND_IDENTIFIER_SEQUENCES);
+ ignoreLiterals = cppProperties.getProperty(CpdLanguageProperties.CPD_ANONYMIZE_LITERALS);
+ ignoreIdentifiers = cppProperties.getProperty(CpdLanguageProperties.CPD_ANONYMIZE_IDENTIFIERS);
String skipBlocksPattern = cppProperties.getProperty(CppLanguageModule.CPD_SKIP_BLOCKS);
if (StringUtils.isNotBlank(skipBlocksPattern)) {
skipBlocks = true;
@@ -73,6 +78,23 @@ public class CppCpdLexer extends CpdLexerBase {
return new CppTokenFilter(tokenManager, ignoreLiteralSequences, ignoreIdentifierAndLiteralSeqences);
}
+ @Override
+ protected void processToken(TokenFactory tokenEntries, JavaccToken currentToken) {
+ int kind = currentToken.getKind();
+ String image = currentToken.getImage();
+
+ boolean isLiteral = kind == CppTokenKinds.STRING || kind == CppTokenKinds.RSTRING || kind == CppTokenKinds.CHARACTER || kind == CppTokenKinds.DECIMAL_INT_LITERAL || kind == CppTokenKinds.HEXADECIMAL_INT_LITERAL || kind == CppTokenKinds.OCTAL_INT_LITERAL || kind == CppTokenKinds.FLOAT_LITERAL || kind == CppTokenKinds.BINARY_INT_LITERAL || kind == CppTokenKinds.ZERO;
+ if (ignoreLiterals && isLiteral) {
+ image = CppTokenKinds.describe(kind);
+ }
+
+ if (ignoreIdentifiers && (kind == CppTokenKinds.ID)) {
+ image = CppTokenKinds.describe(kind);
+ }
+
+ tokenEntries.recordToken(image, currentToken.getReportLocation());
+ }
+
private static class CppTokenFilter extends JavaCCTokenFilter {
private final boolean ignoreLiteralSequences;
diff --git a/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexerTest.java b/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexerTest.java
index 805bb9a86d..90bfe90a32 100644
--- a/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexerTest.java
+++ b/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdLexerTest.java
@@ -59,6 +59,16 @@ class CppCpdLexerTest extends CpdTextComparisonTest {
doTest("specialComments");
}
+ @Test
+ void testIgnoreLiterals() {
+ doTest("ignoreLiterals", "", ignoreLiterals());
+ }
+
+ @Test
+ void testIgnoreIdents() {
+ doTest("ignoreIdents", "", ignoreIdents());
+ }
+
@Test
void testMultiLineMacros() {
doTest("multilineMacros");
@@ -142,7 +152,7 @@ class CppCpdLexerTest extends CpdTextComparisonTest {
}
private static LanguagePropertyConfig skipBlocks(String skipPattern) {
- return properties(true, skipPattern, false, false);
+ return properties(true, skipPattern, false, false, false, false);
}
private static LanguagePropertyConfig skipBlocks() {
@@ -150,22 +160,31 @@ class CppCpdLexerTest extends CpdTextComparisonTest {
}
private static LanguagePropertyConfig dontSkipBlocks() {
- return properties(false, null, false, false);
+ return properties(false, null, false, false, false, false);
}
private static LanguagePropertyConfig skipLiteralSequences() {
- return properties(false, null, true, false);
+ return properties(false, null, true, false, false, false);
}
private static LanguagePropertyConfig skipIdentifierAndLiteralsSequences() {
- return properties(false, null, true, true);
+ return properties(false, null, true, true, false, false);
}
private static LanguagePropertyConfig skipIdentifierSequences() {
- return properties(false, null, false, true);
+ return properties(false, null, false, true, false, false);
}
- private static LanguagePropertyConfig properties(boolean skipBlocks, String skipPattern, boolean skipLiteralSequences, boolean skipSequences) {
+ private static LanguagePropertyConfig ignoreIdents() {
+ return properties(false, null, false, false, false, true);
+ }
+
+ private static LanguagePropertyConfig ignoreLiterals() {
+ return properties(false, null, false, false, true, false);
+ }
+
+
+ private static LanguagePropertyConfig properties(boolean skipBlocks, String skipPattern, boolean skipLiteralSequences, boolean skipSequences, boolean ignoreLiterals, boolean ignoreIdents) {
return properties -> {
if (!skipBlocks) {
properties.setProperty(CppLanguageModule.CPD_SKIP_BLOCKS, "");
@@ -174,6 +193,8 @@ class CppCpdLexerTest extends CpdTextComparisonTest {
}
properties.setProperty(CpdLanguageProperties.CPD_IGNORE_LITERAL_SEQUENCES, skipLiteralSequences);
properties.setProperty(CpdLanguageProperties.CPD_IGNORE_LITERAL_AND_IDENTIFIER_SEQUENCES, skipSequences);
+ properties.setProperty(CpdLanguageProperties.CPD_ANONYMIZE_LITERALS, ignoreLiterals);
+ properties.setProperty(CpdLanguageProperties.CPD_ANONYMIZE_IDENTIFIERS, ignoreIdents);
};
}
}
diff --git a/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreIdents.cpp b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreIdents.cpp
new file mode 100644
index 0000000000..91473e3e67
--- /dev/null
+++ b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreIdents.cpp
@@ -0,0 +1,6 @@
+class Test {
+ void f(int a, float b) {
+ auto c = a + b;
+ int d = 6;
+ }
+}
\ No newline at end of file
diff --git a/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreIdents.txt b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreIdents.txt
new file mode 100644
index 0000000000..b564fde247
--- /dev/null
+++ b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreIdents.txt
@@ -0,0 +1,35 @@
+ [Image] or [Truncated image[ Bcol Ecol
+L1
+ [class] 1 6
+ [] 7 11
+ [{] 12 13
+L2
+ [void] 2 6
+ [] 7 8
+ [(] 8 9
+ [int] 9 12
+ [] 13 14
+ [,] 14 15
+ [float] 16 21
+ [] 22 23
+ [)] 23 24
+ [{] 25 26
+L3
+ [auto] 3 7
+ [] 8 9
+ [=] 10 11
+ [] 12 13
+ [+] 14 15
+ [] 16 17
+ [;] 17 18
+L4
+ [int] 3 6
+ [] 7 8
+ [=] 9 10
+ [6] 11 12
+ [;] 12 13
+L5
+ [}] 2 3
+L6
+ [}] 1 2
+EOF
diff --git a/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreLiterals.cpp b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreLiterals.cpp
new file mode 100644
index 0000000000..cbae7336ba
--- /dev/null
+++ b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreLiterals.cpp
@@ -0,0 +1,43 @@
+ void main() {
+ char x = L'a'; // wide chars
+ x = '\0x05'; // hex
+ // x = L''; // empty character is an error
+
+ print("\ oMedia"); // whitespace escape
+
+
+ // char prefixes
+ char16_t c = u'\u00F6';
+ wchar_t b = L'\xFFEF';
+ char a = '\x30';
+ char32_t d = U'\U0010FFFF';
+
+ // string prefixes
+ char A[] = "Hello\x0A";
+ wchar_t B[] = L"Hell\xF6\x0A";
+ char16_t C[] = u"Hell\u00F6";
+ char32_t D[] = U"Hell\U000000F6\U0010FFFF";
+ auto E[] = u8"\u00F6\U0010FFFF";
+
+
+
+ char* rawString = R"(
+ [Sinks.1]
+ Destination=Console
+ AutoFlush=true
+ Format="[%TimeStamp%] %ThreadId% %QueryIdHigh% %QueryIdLow% %LoggerFile%:%Line% (%Severity%) - %Message%"
+ Filter="%Severity% >= WRN"
+ )";
+
+
+
+ // digit separators
+ auto integer_literal = 1'000''000;
+ auto floating_point_literal = 0.000'015'3;
+ auto hex_literal = 0x0F00'abcd'6f3d;
+ auto silly_example = 1'0'0'000'00;
+
+ // boolean literals
+ int b1 = 0B001101; // C++ 14 binary literal
+ int b2 = 0b000001; // C++ 14 binary literal
+}
\ No newline at end of file
diff --git a/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreLiterals.txt b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreLiterals.txt
new file mode 100644
index 0000000000..ef31240e44
--- /dev/null
+++ b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/ignoreLiterals.txt
@@ -0,0 +1,135 @@
+ [Image] or [Truncated image[ Bcol Ecol
+L1
+ [void] 2 6
+ [main] 7 11
+ [(] 11 12
+ [)] 12 13
+ [{] 14 15
+L2
+ [char] 5 9
+ [x] 10 11
+ [=] 12 13
+ [] 14 18
+ [;] 18 19
+L3
+ [x] 5 6
+ [=] 7 8
+ [] 9 16
+ [;] 16 17
+L6
+ [print] 5 10
+ [(] 10 11
+ [] 11 24
+ [)] 24 25
+ [;] 25 26
+L10
+ [char16_t] 5 13
+ [c] 14 15
+ [=] 16 17
+ [] 18 27
+ [;] 27 28
+L11
+ [wchar_t] 5 12
+ [b] 13 14
+ [=] 15 16
+ [] 17 26
+ [;] 26 27
+L12
+ [char] 5 9
+ [a] 10 11
+ [=] 12 13
+ [] 15 21
+ [;] 21 22
+L13
+ [char32_t] 5 13
+ [d] 14 15
+ [=] 16 17
+ [] 18 31
+ [;] 31 32
+L16
+ [char] 5 9
+ [A] 10 11
+ [\[] 11 12
+ [\]] 12 13
+ [=] 14 15
+ [] 16 27
+ [;] 27 28
+L17
+ [wchar_t] 5 12
+ [B] 13 14
+ [\[] 14 15
+ [\]] 15 16
+ [=] 17 18
+ [] 19 34
+ [;] 34 35
+L18
+ [char16_t] 5 13
+ [C] 14 15
+ [\[] 15 16
+ [\]] 16 17
+ [=] 18 19
+ [] 20 33
+ [;] 33 34
+L19
+ [char32_t] 5 13
+ [D] 14 15
+ [\[] 15 16
+ [\]] 16 17
+ [=] 18 19
+ [] 20 47
+ [;] 47 48
+L20
+ [auto] 5 9
+ [E] 10 11
+ [\[] 11 12
+ [\]] 12 13
+ [=] 14 15
+ [] 16 36
+ [;] 36 37
+L24
+ [char] 5 9
+ [*] 9 10
+ [rawString] 11 20
+ [=] 21 22
+ [] 23 7
+L30
+ [;] 7 8
+L35
+ [auto] 5 9
+ [integer_literal] 10 25
+ [=] 26 27
+ [] 28 38
+ [;] 38 39
+L36
+ [auto] 5 9
+ [floating_point_literal] 10 32
+ [=] 33 34
+ [] 35 46
+ [;] 46 47
+L37
+ [auto] 5 9
+ [hex_literal] 10 21
+ [=] 22 23
+ [] 24 40
+ [;] 40 41
+L38
+ [auto] 5 9
+ [silly_example] 10 23
+ [=] 24 25
+ [] 26 38
+ [;] 38 39
+L41
+ [int] 5 8
+ [b1] 9 11
+ [=] 12 13
+ [] 14 22
+ [;] 22 23
+L42
+ [int] 5 8
+ [b2] 9 11
+ [=] 12 13
+ [] 14 22
+ [;] 22 23
+L43
+ [}] 1 2
+EOF
diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml
index 0eec39f809..97580cbf23 100644
--- a/pmd-cs/pom.xml
+++ b/pmd-cs/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml
index 496115127b..3cc180bb9c 100644
--- a/pmd-dart/pom.xml
+++ b/pmd-dart/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml
index 9ad286e9a4..7bfaf114e5 100644
--- a/pmd-dist/pom.xml
+++ b/pmd-dist/pom.xml
@@ -8,7 +8,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AntIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AntIT.java
index d52070662f..6a0402d8a5 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AntIT.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/dist/AntIT.java
@@ -5,6 +5,8 @@
package net.sourceforge.pmd.dist;
import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.not;
import java.io.File;
import java.io.IOException;
@@ -40,9 +42,9 @@ class AntIT extends AbstractBinaryDistributionTest {
ExecutionResult result = runAnt(antBasepath, pmdHome, antTestProjectFolder);
result.assertExitCode(0)
- .assertStdOut(containsString("BUILD SUCCESSFUL"));
- // the no package rule
- result.assertExitCode(0)
+ .assertStdOut(containsString("BUILD SUCCESSFUL"))
+ .assertStdOut(not(containsStringIgnoringCase("Illegal reflective access"))) // #1860
+ // the no package rule
.assertStdOut(containsString("NoPackage"));
}
diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml
index c0b7991017..4a6b36ac2e 100644
--- a/pmd-doc/pom.xml
+++ b/pmd-doc/pom.xml
@@ -8,7 +8,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml
index 94bc7d94bd..fac80382f4 100644
--- a/pmd-fortran/pom.xml
+++ b/pmd-fortran/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml
index 6aee2c1be5..2c79671490 100644
--- a/pmd-gherkin/pom.xml
+++ b/pmd-gherkin/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml
index 4df297ebc9..aef9290837 100644
--- a/pmd-go/pom.xml
+++ b/pmd-go/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml
index bf716ac77c..1ffd4b60f4 100644
--- a/pmd-groovy/pom.xml
+++ b/pmd-groovy/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml
index 86f19c7c01..51cffc8823 100644
--- a/pmd-html/pom.xml
+++ b/pmd-html/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml
index 2d82829d15..184e6ece62 100644
--- a/pmd-java/pom.xml
+++ b/pmd-java/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java
index 8391284ec8..2b489d4fde 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java
@@ -50,8 +50,9 @@ public final class ASTSwitchLabel extends AbstractJavaNode implements Iterable getExprList() {
return children(ASTExpression.class);
@@ -66,4 +67,12 @@ public final class ASTSwitchLabel extends AbstractJavaNode implements Iterable iterator() {
return children(ASTExpression.class).iterator();
}
+
+ /**
+ * Checks whether this label tests a {@link ASTTypePattern} or a {@link ASTRecordPattern}.
+ * @since 7.7.0
+ */
+ public boolean isPatternLabel() {
+ return children(ASTPattern.class).nonEmpty();
+ }
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityRule.java
index 1360d29458..a8a6fe6fbe 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityRule.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityRule.java
@@ -55,7 +55,7 @@ public class SwitchDensityRule extends AbstractJavaRulechainRule {
int stmtCount = node.descendants(ASTStatement.class).count();
int labelCount = node.getBranches()
.map(ASTSwitchBranch::getLabel)
- .sumBy(label -> label.isDefault() ? 1 : label.getExprList().count());
+ .sumBy(label -> label.isDefault() || label.isPatternLabel() ? 1 : label.getExprList().count());
// note: if labelCount is zero, double division will produce +Infinity or NaN, not ArithmeticException
double density = stmtCount / (double) labelCount;
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughRule.java
index 29d91c111c..fb0a9298f5 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughRule.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughRule.java
@@ -9,28 +9,40 @@ import java.util.regex.Pattern;
import net.sourceforge.pmd.lang.ast.GenericToken;
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken;
import net.sourceforge.pmd.lang.java.ast.ASTSwitchBranch;
+import net.sourceforge.pmd.lang.java.ast.ASTSwitchExpression;
import net.sourceforge.pmd.lang.java.ast.ASTSwitchFallthroughBranch;
+import net.sourceforge.pmd.lang.java.ast.ASTSwitchLike;
import net.sourceforge.pmd.lang.java.ast.ASTSwitchStatement;
import net.sourceforge.pmd.lang.java.ast.JavaNode;
import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils;
import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule;
import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass;
import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass.DataflowResult;
+import net.sourceforge.pmd.reporting.RuleContext;
import net.sourceforge.pmd.util.OptionalBool;
public class ImplicitSwitchFallThroughRule extends AbstractJavaRulechainRule {
- //todo should consider switch exprs
-
private static final Pattern IGNORED_COMMENT = Pattern.compile("/[/*].*\\bfalls?[ -]?thr(ough|u)\\b.*",
Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
public ImplicitSwitchFallThroughRule() {
- super(ASTSwitchStatement.class);
+ super(ASTSwitchStatement.class, ASTSwitchExpression.class);
}
@Override
public Object visit(ASTSwitchStatement node, Object data) {
+ checkSwitchLike(node, asCtx(data));
+ return null;
+ }
+
+ @Override
+ public Object visit(ASTSwitchExpression node, Object data) {
+ checkSwitchLike(node, asCtx(data));
+ return null;
+ }
+
+ private void checkSwitchLike(ASTSwitchLike node, RuleContext ruleContext) {
DataflowResult dataflow = DataflowPass.getDataflowResult(node.getRoot());
for (ASTSwitchBranch branch : node.getBranches()) {
@@ -38,15 +50,14 @@ public class ImplicitSwitchFallThroughRule extends AbstractJavaRulechainRule {
ASTSwitchFallthroughBranch fallthrough = (ASTSwitchFallthroughBranch) branch;
OptionalBool bool = dataflow.switchBranchFallsThrough(branch);
if (bool != OptionalBool.NO
- && fallthrough.getStatements().nonEmpty()
- && !nextBranchHasComment(branch)) {
- asCtx(data).addViolation(branch.getNextBranch().getLabel());
+ && fallthrough.getStatements().nonEmpty()
+ && !nextBranchHasComment(branch)) {
+ ruleContext.addViolation(branch.getNextBranch().getLabel());
}
} else {
- return null;
+ return;
}
}
- return null;
}
boolean nextBranchHasComment(ASTSwitchBranch branch) {
@@ -62,5 +73,4 @@ public class ImplicitSwitchFallThroughRule extends AbstractJavaRulechainRule {
}
return false;
}
-
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableRule.java
index ac59da9d76..89434b830d 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableRule.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableRule.java
@@ -6,6 +6,9 @@ package net.sourceforge.pmd.lang.java.rule.errorprone;
import java.math.BigDecimal;
import java.math.BigInteger;
+import java.time.Duration;
+import java.time.Period;
+import java.time.temporal.Temporal;
import net.sourceforge.pmd.lang.java.ast.ASTExpression;
import net.sourceforge.pmd.lang.java.ast.ASTExpressionStatement;
@@ -27,7 +30,8 @@ public class UselessOperationOnImmutableRule extends AbstractJavaRulechainRule {
@Override
public Object visit(ASTMethodCall node, Object data) {
ASTExpression qualifier = node.getQualifier();
- if (node.getParent() instanceof ASTExpressionStatement && qualifier != null) {
+ boolean returnsVoid = node.getTypeMirror().isVoid();
+ if (node.getParent() instanceof ASTExpressionStatement && qualifier != null && !returnsVoid) {
// these types are immutable, so any method of those whose
// result is ignored is a violation
@@ -38,6 +42,10 @@ public class UselessOperationOnImmutableRule extends AbstractJavaRulechainRule {
} else if (TypeTestUtil.isA(BigDecimal.class, qualifier)
|| TypeTestUtil.isA(BigInteger.class, qualifier)) {
asCtx(data).addViolation(node);
+ } else if (TypeTestUtil.isA(Temporal.class, qualifier)
+ || TypeTestUtil.isA(Duration.class, qualifier)
+ || TypeTestUtil.isA(Period.class, qualifier)) {
+ asCtx(data).addViolation(node);
}
}
return null;
diff --git a/pmd-java/src/main/resources/category/java/bestpractices.xml b/pmd-java/src/main/resources/category/java/bestpractices.xml
index 03b23ad1ca..282cf5466c 100644
--- a/pmd-java/src/main/resources/category/java/bestpractices.xml
+++ b/pmd-java/src/main/resources/category/java/bestpractices.xml
@@ -457,14 +457,18 @@ public interface YetAnotherConstantInterface {
-
+
+
+ externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_bestpractices.html#defaultlabelnotlastinswitch">
-By convention, the default label should be the last label in a switch statement.
+By convention, the default label should be the last label in a switch statement or switch expression.
+
+Note: This rule has been renamed from "DefaultLabelNotLastInSwitchStmt" with PMD 7.7.0.
3
@@ -904,6 +908,48 @@ public class SecureSystem {
+
+
+ Switch statements should be exhaustive, to make their control flow
+ easier to follow. This can be achieved by adding a `default` case, or,
+ if the switch is on an enum type, by ensuring there is one switch branch
+ for each enum constant.
+
+ This rule doesn't consider Switch Statements, that use Pattern Matching, since for these the
+ compiler already ensures that all cases are covered. The same is true for Switch Expressions,
+ which are also not considered by this rule.
+
+ 3
+
+
+
+
+
+
+
+
+
+
-
-
- Switch statements should be exhaustive, to make their control flow
- easier to follow. This can be achieved by adding a `default` case, or,
- if the switch is on an enum type, by ensuring there is one switch branch
- for each enum constant.
-
- 3
-
-
-
-
-
-
-
-
-
+
- This rule detects methods called `tearDown()` that are not properly annotated as a cleanup method.
- This is primarily intended to assist in upgrading from JUnit 3, where tear down methods were required to be called `tearDown()`.
- To a lesser extent, this may help detect omissions under newer JUnit versions, as long as you are following this convention to name the methods.
+This rule detects methods called `tearDown()` that are not properly annotated as a cleanup method.
+This is primarily intended to assist in upgrading from JUnit 3, where tear down methods were required to be called `tearDown()`.
+To a lesser extent, this may help detect omissions even under newer JUnit versions or under TestNG,
+as long as you are following this convention to name the methods.
- JUnit 4 will only execute methods annotated with `@After` after running each test.
- JUnit 5 introduced `@AfterEach` and `@AfterAll` annotations to execute methods after each test or after all tests in the class, respectively.
+* JUnit 4 will only execute methods annotated with `@After` after running each test.
+* JUnit 5 introduced `@AfterEach` and `@AfterAll` annotations to execute methods after each test or after
+ all tests in the class, respectively.
+* TestNG provides the annotations `@AfterMethod` and `@AfterClass` to execute methods after each test or after
+ tests in the class, respectively.
- Note: This rule was named JUnit4TestShouldUseAfterAnnotation before PMD 7.7.0.
+Note: This rule was named JUnit4TestShouldUseAfterAnnotation before PMD 7.7.0.
3
-
-
- This rule detects methods called `setUp()` that are not properly annotated as a setup method.
- This is primarily intended to assist in upgrading from JUnit 3, where setup methods were required to be called `setUp()`.
- To a lesser extent, this may help detect omissions even under newer JUnit versions, as long as you are following this convention to name the methods.
+This rule detects methods called `setUp()` that are not properly annotated as a setup method.
+This is primarily intended to assist in upgrading from JUnit 3, where setup methods were required to be called `setUp()`.
+To a lesser extent, this may help detect omissions even under newer JUnit versions or under TestNG,
+as long as you are following this convention to name the methods.
- JUnit 4 will only execute methods annotated with `@Before` before all tests.
- JUnit 5 introduced `@BeforeEach` and `@BeforeAll` annotations to execute methods before each test or before all tests in the class, respectively.
+* JUnit 4 will only execute methods annotated with `@Before` before all tests.
+* JUnit 5 introduced `@BeforeEach` and `@BeforeAll` annotations to execute methods before each test or before all
+ tests in the class, respectively.
+* TestNG provides the annotations `@BeforeMethod` and `@BeforeClass` to execute methods before each test or before
+ tests in the class, respectively.
- Note: This rule was named JUnit4TestShouldUseBeforeAnnotation before PMD 7.7.0.
+Note: This rule was named JUnit4TestShouldUseBeforeAnnotation before PMD 7.7.0.
3
@@ -1401,9 +1429,15 @@ public class MyTest2 {
pmd-java:typeIs('org.junit.Before')
or pmd-java:typeIs('org.junit.jupiter.api.BeforeEach')
or pmd-java:typeIs('org.junit.jupiter.api.BeforeAll')
- or pmd-java:typeIs('org.testng.annotations.BeforeMethod')])]
- (: Make sure this is a junit 4 class :)
- [../MethodDeclaration[pmd-java:hasAnnotation('org.junit.Test')]]
+ or pmd-java:typeIs('org.testng.annotations.BeforeMethod')
+ or pmd-java:typeIs('org.testng.annotations.BeforeClass')
+ ])]
+ (: Make sure this is a JUnit 4/5 or TestNG class :)
+ [../MethodDeclaration[
+ pmd-java:hasAnnotation('org.junit.Test')
+ or pmd-java:hasAnnotation('org.junit.jupiter.api.Test')
+ or pmd-java:hasAnnotation('org.testng.annotations.Test')
+ ]]
]]>
diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml
index 1f9ed37765..1dd3096af4 100644
--- a/pmd-java/src/main/resources/category/java/errorprone.xml
+++ b/pmd-java/src/main/resources/category/java/errorprone.xml
@@ -2185,20 +2185,24 @@ public class Foo {
-
+
+
+ externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_errorprone.html#noncaselabelinswitch">
-A non-case label (e.g. a named break/continue label) was present in a switch statement.
+A non-case label (e.g. a named break/continue label) was present in a switch statement or switch expression.
This is legal, but confusing. It is easy to mix up the case labels and the non-case labels.
+
+Note: This rule was renamed from `NonCaseLabelInSwitchStatement` with PMD 7.7.0.
3
- //SwitchStatement//LabeledStatement
+ //(SwitchStatement|SwitchExpression)//LabeledStatement
@@ -2208,7 +2212,6 @@ public class Foo {
switch (a) {
case 1:
// do something
- break;
mylabel: // this is legal, but confusing!
break;
default:
@@ -3127,12 +3130,14 @@ public boolean test(String s) {
-An operation on an Immutable object (String, BigDecimal or BigInteger) won't change the object itself
-since the result of the operation is a new object. Therefore, ignoring the operation result is an error.
+An operation on an immutable object will not change the object itself since the result of the operation is a new object.
+Therefore, ignoring the result of such an operation is likely a mistake. The operation can probably be removed.
+
+This rule recognizes the types `String`, `BigDecimal`, `BigInteger` or any type from `java.time.*` as immutable.
3
diff --git a/pmd-java/src/main/resources/category/java/performance.xml b/pmd-java/src/main/resources/category/java/performance.xml
index 376b536499..a8e4c37142 100644
--- a/pmd-java/src/main/resources/category/java/performance.xml
+++ b/pmd-java/src/main/resources/category/java/performance.xml
@@ -607,16 +607,20 @@ private String baz() {
-
+
+
+ externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_performance.html#toofewbranchesforswitch">
Switch statements are intended to be used to support complex branching behaviour. Using a switch for only a few
cases is ill-advised, since switches are not as easy to understand as if-else statements. In these cases use the
if-else statement to increase code readability.
+
+Note: This rule was named TooFewBranchesForASwitchStatement before PMD 7.7.0.
3
@@ -624,7 +628,10 @@ if-else statement to increase code readability.
diff --git a/pmd-java/src/main/resources/rulesets/java/quickstart.xml b/pmd-java/src/main/resources/rulesets/java/quickstart.xml
index 3ac03a493c..bdf8ca0704 100644
--- a/pmd-java/src/main/resources/rulesets/java/quickstart.xml
+++ b/pmd-java/src/main/resources/rulesets/java/quickstart.xml
@@ -18,7 +18,7 @@
-
+
@@ -30,6 +30,7 @@
+
@@ -37,7 +38,6 @@
-
@@ -243,7 +243,7 @@
-
+
@@ -307,7 +307,7 @@
-
+
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchTest.java
similarity index 79%
rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchTest.java
index 1e413f1bde..a012153e0e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchTest.java
@@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices;
import net.sourceforge.pmd.test.PmdRuleTst;
-class SwitchStmtsShouldHaveDefaultTest extends PmdRuleTst {
+class DefaultLabelNotLastInSwitchTest extends PmdRuleTst {
// no additional unit tests
}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/NonExhaustiveSwitchTest.java
similarity index 78%
rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/NonExhaustiveSwitchTest.java
index b316a1881f..2d7b18f754 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/NonExhaustiveSwitchTest.java
@@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices;
import net.sourceforge.pmd.test.PmdRuleTst;
-class DefaultLabelNotLastInSwitchStmtTest extends PmdRuleTst {
+class NonExhaustiveSwitchTest extends PmdRuleTst {
// no additional unit tests
}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchTest.java
similarity index 78%
rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchTest.java
index 9d914a9552..8644b8d91c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchTest.java
@@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone;
import net.sourceforge.pmd.test.PmdRuleTst;
-class NonCaseLabelInSwitchStatementTest extends PmdRuleTst {
+class NonCaseLabelInSwitchTest extends PmdRuleTst {
// no additional unit tests
}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForSwitchTest.java
similarity index 77%
rename from pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForSwitchTest.java
index 3916959a96..1787e14681 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForSwitchTest.java
@@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.performance;
import net.sourceforge.pmd.test.PmdRuleTst;
-class TooFewBranchesForASwitchStatementTest extends PmdRuleTst {
+class TooFewBranchesForSwitchTest extends PmdRuleTst {
// no additional unit tests
}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt
index 553f930c10..bea2307a18 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt
@@ -107,39 +107,39 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "instruction", @Name = "instruction", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b11110000", @IntLiteral = true, @Integral = true, @LiteralText = "0b11110000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 240.0, @ValueAsFloat = 240.0, @ValueAsInt = 240, @ValueAsLong = 240]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00000000", @IntLiteral = true, @Integral = true, @LiteralText = "0b00000000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00010000", @IntLiteral = true, @Integral = true, @LiteralText = "0b00010000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 16.0, @ValueAsFloat = 16.0, @ValueAsInt = 16, @ValueAsLong = 16]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00100000", @IntLiteral = true, @Integral = true, @LiteralText = "0b00100000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 32.0, @ValueAsFloat = 32.0, @ValueAsInt = 32, @ValueAsLong = 32]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00110000", @IntLiteral = true, @Integral = true, @LiteralText = "0b00110000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 48.0, @ValueAsFloat = 48.0, @ValueAsInt = 48, @ValueAsLong = 48]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b01000000", @IntLiteral = true, @Integral = true, @LiteralText = "0b01000000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 64.0, @ValueAsFloat = 64.0, @ValueAsInt = 64, @ValueAsLong = 64]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b01010000", @IntLiteral = true, @Integral = true, @LiteralText = "0b01010000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 80.0, @ValueAsFloat = 80.0, @ValueAsInt = 80, @ValueAsLong = 80]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b01100000", @IntLiteral = true, @Integral = true, @LiteralText = "0b01100000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 96.0, @ValueAsFloat = 96.0, @ValueAsInt = 96, @ValueAsLong = 96]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b01110000", @IntLiteral = true, @Integral = true, @LiteralText = "0b01110000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 112.0, @ValueAsFloat = 112.0, @ValueAsInt = 112, @ValueAsLong = 112]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- ThrowStatement[]
| +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
| +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"]
@@ -258,7 +258,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "dayOfWeekArg", @Name = "dayOfWeekArg", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Monday", @Empty = false, @Image = "\"Monday\"", @Length = 6, @LiteralText = "\"Monday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- ExpressionStatement[]
| | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -266,13 +266,13 @@
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Start of work week", @Empty = false, @Image = "\"Start of work week\"", @Length = 18, @LiteralText = "\"Start of work week\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Tuesday", @Empty = false, @Image = "\"Tuesday\"", @Length = 7, @LiteralText = "\"Tuesday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Wednesday", @Empty = false, @Image = "\"Wednesday\"", @Length = 9, @LiteralText = "\"Wednesday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Thursday", @Empty = false, @Image = "\"Thursday\"", @Length = 8, @LiteralText = "\"Thursday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- ExpressionStatement[]
| | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -280,7 +280,7 @@
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Midweek", @Empty = false, @Image = "\"Midweek\"", @Length = 7, @LiteralText = "\"Midweek\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Friday", @Empty = false, @Image = "\"Friday\"", @Length = 6, @LiteralText = "\"Friday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- ExpressionStatement[]
| | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -288,10 +288,10 @@
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "End of work week", @Empty = false, @Image = "\"End of work week\"", @Length = 16, @LiteralText = "\"End of work week\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Saturday", @Empty = false, @Image = "\"Saturday\"", @Length = 8, @LiteralText = "\"Saturday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Sunday", @Empty = false, @Image = "\"Sunday\"", @Length = 6, @LiteralText = "\"Sunday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- ExpressionStatement[]
| | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -299,7 +299,7 @@
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Weekend", @Empty = false, @Image = "\"Weekend\"", @Length = 7, @LiteralText = "\"Weekend\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- ThrowStatement[]
| | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt
index 70874b1031..dbfa7a4509 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt
@@ -16,16 +16,16 @@
+- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
+- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchFallthroughBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| +- ExpressionStatement[]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -36,4 +36,4 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1", @Empty = false, @Image = "\"1\"", @Length = 1, @LiteralText = "\"1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- BreakStatement[@Label = null]
+- SwitchFallthroughBranch[@Default = true]
- +- SwitchLabel[@Default = true]
+ +- SwitchLabel[@Default = true, @PatternLabel = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt
index 49574ca1a0..5f16e3c6a7 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt
@@ -16,7 +16,7 @@
+- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchFallthroughBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+- SwitchFallthroughBranch[@Default = true]
- +- SwitchLabel[@Default = true]
+ +- SwitchLabel[@Default = true, @PatternLabel = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt
index 5600a4c3d8..a9007b4787 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt
@@ -65,7 +65,7 @@
+- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchFallthroughBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "MONDAY", @Name = "MONDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "FRIDAY", @Name = "FRIDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "SUNDAY", @Name = "SUNDAY", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -78,7 +78,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 6", @Empty = false, @Image = "\" 6\"", @Length = 3, @LiteralText = "\" 6\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- BreakStatement[@Label = null]
+- SwitchFallthroughBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "TUESDAY", @Name = "TUESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| +- ExpressionStatement[]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -89,7 +89,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 7", @Empty = false, @Image = "\" 7\"", @Length = 3, @LiteralText = "\" 7\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- BreakStatement[@Label = null]
+- SwitchFallthroughBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "THURSDAY", @Name = "THURSDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "SATURDAY", @Name = "SATURDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| +- ExpressionStatement[]
@@ -101,7 +101,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 8", @Empty = false, @Image = "\" 8\"", @Length = 3, @LiteralText = "\" 8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- BreakStatement[@Label = null]
+- SwitchFallthroughBranch[@Default = false]
- +- SwitchLabel[@Default = false]
+ +- SwitchLabel[@Default = false, @PatternLabel = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "WEDNESDAY", @Name = "WEDNESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
+- ExpressionStatement[]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt
index 7eb7d249f3..63cbacf6b4 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt
@@ -69,26 +69,26 @@
| | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "MONDAY", @Name = "MONDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "FRIDAY", @Name = "FRIDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "SUNDAY", @Name = "SUNDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "TUESDAY", @Name = "TUESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "THURSDAY", @Name = "THURSDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "SATURDAY", @Name = "SATURDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LiteralText = "8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "WEDNESDAY", @Name = "WEDNESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LiteralText = "9", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9]
| | +- SwitchArrowBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- Block[@Empty = false, @Size = 3, @containsComment = false]
| | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt
index 029dca3fd9..72c512b849 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt
@@ -55,7 +55,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = true, @ExhaustiveEnumSwitch = true, @FallthroughSwitch = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "MONDAY", @Name = "MONDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FRIDAY", @Name = "FRIDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "SUNDAY", @Name = "SUNDAY", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -66,7 +66,7 @@
| | | +- ArgumentList[@Empty = false, @Size = 1]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TUESDAY", @Name = "TUESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -75,7 +75,7 @@
| | | +- ArgumentList[@Empty = false, @Size = 1]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "THURSDAY", @Name = "THURSDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "SATURDAY", @Name = "SATURDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -85,7 +85,7 @@
| | | +- ArgumentList[@Empty = false, @Size = 1]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LiteralText = "8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8]
| | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "WEDNESDAY", @Name = "WEDNESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -101,22 +101,22 @@
| | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = true, @ExhaustiveEnumSwitch = true, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "MONDAY", @Name = "MONDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FRIDAY", @Name = "FRIDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "SUNDAY", @Name = "SUNDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TUESDAY", @Name = "TUESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "THURSDAY", @Name = "THURSDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "SATURDAY", @Name = "SATURDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LiteralText = "8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8]
| | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "WEDNESDAY", @Name = "WEDNESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LiteralText = "9", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9]
| +- ExpressionStatement[]
@@ -159,15 +159,15 @@
| | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "MONDAY", @Name = "MONDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TUESDAY", @Name = "TUESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| | +- SwitchArrowBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- Block[@Empty = false, @Size = 3, @containsComment = false]
| | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
@@ -211,24 +211,24 @@
| | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- YieldStatement[]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- YieldStatement[]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Baz", @Empty = false, @Image = "\"Baz\"", @Length = 3, @LiteralText = "\"Baz\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- YieldStatement[]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "BAZ", @Name = "BAZ", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SwitchExpressions"]
| | +- SwitchFallthroughBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- ExpressionStatement[]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -258,7 +258,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "k", @Name = "k", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -267,7 +267,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "one", @Empty = false, @Image = "\"one\"", @Length = 3, @LiteralText = "\"one\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -276,7 +276,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "two", @Empty = false, @Image = "\"two\"", @Length = 3, @LiteralText = "\"two\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -301,15 +301,15 @@
| +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "k", @Name = "k", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "one", @Empty = false, @Image = "\"one\"", @Length = 3, @LiteralText = "\"one\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "two", @Empty = false, @Image = "\"two\"", @Length = 3, @LiteralText = "\"two\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "many", @Empty = false, @Image = "\"many\"", @Length = 4, @LiteralText = "\"many\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "f", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false]
+- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt
index 812fecf840..4eb465db71 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt
@@ -65,7 +65,7 @@
+- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "MONDAY", @Name = "MONDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "FRIDAY", @Name = "FRIDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "SUNDAY", @Name = "SUNDAY", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -76,7 +76,7 @@
| +- ArgumentList[@Empty = false, @Size = 1]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 6", @Empty = false, @Image = "\" 6\"", @Length = 3, @LiteralText = "\" 6\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "TUESDAY", @Name = "TUESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -85,7 +85,7 @@
| +- ArgumentList[@Empty = false, @Size = 1]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 7", @Empty = false, @Image = "\" 7\"", @Length = 3, @LiteralText = "\" 7\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "THURSDAY", @Name = "THURSDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "SATURDAY", @Name = "SATURDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -95,7 +95,7 @@
| +- ArgumentList[@Empty = false, @Size = 1]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 8", @Empty = false, @Image = "\" 8\"", @Length = 3, @LiteralText = "\" 8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "WEDNESDAY", @Name = "WEDNESDAY", @ParenthesisDepth = 0, @Parenthesized = false]
| +- Block[@Empty = false, @Size = 1, @containsComment = false]
| +- ExpressionStatement[]
@@ -106,7 +106,7 @@
| +- ArgumentList[@Empty = false, @Size = 1]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 9", @Empty = false, @Image = "\" 9\"", @Length = 3, @LiteralText = "\" 9\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = true]
- +- SwitchLabel[@Default = true]
+ +- SwitchLabel[@Default = true, @PatternLabel = false]
+- ThrowStatement[]
+- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt
index bbab68e109..766c74cde2 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt
@@ -29,7 +29,7 @@
+- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchArrowBranch[@Default = false]
- +- SwitchLabel[@Default = false]
+ +- SwitchLabel[@Default = false, @PatternLabel = false]
| +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+- Block[@Empty = false, @Size = 12, @containsComment = true]
+- ExpressionStatement[]
@@ -67,7 +67,7 @@
| +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "foo", @Name = "foo", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4]
| +- Block[@Empty = false, @Size = 1, @containsComment = false]
| +- YieldStatement[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt
index fe8144121b..1eb5bde018 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt
@@ -14,7 +14,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -23,7 +23,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Oops", @Empty = false, @Image = "\"Oops\"", @Length = 4, @LiteralText = "\"Oops\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -33,7 +33,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Great", @Empty = false, @Image = "\"Great\"", @Length = 5, @LiteralText = "\"Great\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -52,7 +52,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -66,7 +66,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -75,7 +75,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -94,7 +94,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -108,7 +108,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -128,14 +128,14 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ThrowStatement[]
| | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NullPointerException"]
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -149,7 +149,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"]
@@ -161,7 +161,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -180,7 +180,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ExpressionStatement[]
| | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -191,7 +191,7 @@
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -205,7 +205,7 @@
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- ExpressionStatement[]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -217,7 +217,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -226,7 +226,7 @@
| | | +- ArgumentList[@Empty = false, @Size = 1]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -238,7 +238,7 @@
| | | +- ArgumentList[@Empty = false, @Size = 1]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- SwitchArrowBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -248,10 +248,10 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchFallthroughBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- ExpressionStatement[]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -262,7 +262,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt
index 71d642290e..aec1b52224 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt
@@ -38,7 +38,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -47,7 +47,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -59,7 +59,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"]
@@ -75,7 +75,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"]
@@ -91,7 +91,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ArrayType[@ArrayDepth = 1]
@@ -109,7 +109,7 @@
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ia", @Name = "ia", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt
index b43f4f1caf..0690ebc5ba 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt
@@ -15,7 +15,7 @@
| +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -24,14 +24,14 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "coverageStatement", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
| +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)]
@@ -45,7 +45,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -59,7 +59,7 @@
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"]
@@ -73,7 +73,7 @@
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- BreakStatement[@Label = null]
+- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$S", @CanonicalName = "ExhaustiveSwitch.S", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "S", @Static = true, @TopLevel = false, @UnnamedToplevelClass = false, @Visibility = Visibility.V_PACKAGE]
| +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)]
@@ -115,21 +115,21 @@
| +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "B"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"]
@@ -147,7 +147,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"]
@@ -161,7 +161,7 @@
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A", @Empty = false, @Image = "\"A\"", @Length = 1, @LiteralText = "\"A\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"]
@@ -175,7 +175,7 @@
| | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C", @Empty = false, @Image = "\"C\"", @Length = 1, @LiteralText = "\"C\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- ExpressionStatement[]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -226,7 +226,7 @@
| +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "F"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt
index 6e33db0bd7..e9ec43cda3 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt
@@ -14,7 +14,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -32,7 +32,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -44,7 +44,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"]
@@ -62,7 +62,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -118,7 +118,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -136,7 +136,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -148,7 +148,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"]
@@ -166,7 +166,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -175,7 +175,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null!", @Empty = false, @Image = "\"null!\"", @Length = 5, @LiteralText = "\"null!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt
index 84f45093b7..8756417a53 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt
@@ -260,7 +260,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pair", @Name = "pair", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyPair"]
| | +- PatternList[@Empty = false, @Size = 2]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt
index 97893e90d3..fce6b81fdf 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt
@@ -15,7 +15,7 @@
| +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"]
@@ -27,7 +27,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "int %d", @Empty = false, @Image = "\"int %d\"", @Length = 6, @LiteralText = "\"int %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Long"]
@@ -39,7 +39,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long %d", @Empty = false, @Image = "\"long %d\"", @Length = 7, @LiteralText = "\"long %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Double"]
@@ -51,7 +51,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double %f", @Empty = false, @Image = "\"double %f\"", @Length = 9, @LiteralText = "\"double %f\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -63,7 +63,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String %s", @Empty = false, @Image = "\"String %s\"", @Length = 9, @LiteralText = "\"String %s\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| +- ArgumentList[@Empty = true, @Size = 0]
@@ -79,7 +79,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -88,7 +88,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Oops", @Empty = false, @Image = "\"Oops\"", @Length = 4, @LiteralText = "\"Oops\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -98,7 +98,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Great", @Empty = false, @Image = "\"Great\"", @Length = 5, @LiteralText = "\"Great\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -117,11 +117,11 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "response", @Name = "response", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Block[@Empty = true, @Size = 0, @containsComment = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -140,7 +140,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -159,7 +159,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -184,11 +184,11 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "response", @Name = "response", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Block[@Empty = true, @Size = 0, @containsComment = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "y", @Empty = false, @Image = "\"y\"", @Length = 1, @LiteralText = "\"y\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Y", @Empty = false, @Image = "\"Y\"", @Length = 1, @LiteralText = "\"Y\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- Block[@Empty = false, @Size = 1, @containsComment = false]
@@ -200,7 +200,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "n", @Empty = false, @Image = "\"n\"", @Length = 1, @LiteralText = "\"n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "N", @Empty = false, @Image = "\"N\"", @Length = 1, @LiteralText = "\"N\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- Block[@Empty = false, @Size = 1, @containsComment = false]
@@ -212,7 +212,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -231,7 +231,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -250,7 +250,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -303,7 +303,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"]
@@ -323,7 +323,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s clubs", @Empty = false, @Image = "\"It\'s clubs\"", @Length = 10, @LiteralText = "\"It\'s clubs\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"]
@@ -343,7 +343,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @Empty = false, @Image = "\"It\'s diamonds\"", @Length = 13, @LiteralText = "\"It\'s diamonds\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"]
@@ -363,7 +363,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s hearts", @Empty = false, @Image = "\"It\'s hearts\"", @Length = 11, @LiteralText = "\"It\'s hearts\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"]
@@ -377,7 +377,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Tarot"]
@@ -402,7 +402,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "CLUBS", @Name = "CLUBS", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"]
@@ -415,7 +415,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s clubs", @Empty = false, @Image = "\"It\'s clubs\"", @Length = 10, @LiteralText = "\"It\'s clubs\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "DIAMONDS", @Name = "DIAMONDS", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"]
@@ -428,7 +428,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @Empty = false, @Image = "\"It\'s diamonds\"", @Length = 13, @LiteralText = "\"It\'s diamonds\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "HEARTS", @Name = "HEARTS", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"]
@@ -441,7 +441,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s hearts", @Empty = false, @Image = "\"It\'s hearts\"", @Length = 11, @LiteralText = "\"It\'s hearts\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "SPADES", @Name = "SPADES", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"]
@@ -454,7 +454,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Tarot"]
@@ -495,7 +495,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "HEADS", @Name = "HEADS", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Coin"]
@@ -508,7 +508,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Heads", @Empty = false, @Image = "\"Heads\"", @Length = 5, @LiteralText = "\"Heads\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TAILS", @Name = "TAILS", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Coin"]
@@ -532,7 +532,7 @@
+- SwitchStatement[@DefaultCase = false, @EnumSwitch = true, @ExhaustiveEnumSwitch = true, @FallthroughSwitch = false]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "HEADS", @Name = "HEADS", @ParenthesisDepth = 0, @Parenthesized = false]
| +- Block[@Empty = false, @Size = 1, @containsComment = false]
| +- ExpressionStatement[]
@@ -543,7 +543,7 @@
| +- ArgumentList[@Empty = false, @Size = 1]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Heads", @Empty = false, @Image = "\"Heads\"", @Length = 5, @LiteralText = "\"Heads\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = false]
- +- SwitchLabel[@Default = false]
+ +- SwitchLabel[@Default = false, @PatternLabel = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TAILS", @Name = "TAILS", @ParenthesisDepth = 0, @Parenthesized = false]
| +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Coin"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt
index c77d9dc179..c78fee3b6c 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt
@@ -28,7 +28,7 @@
| +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"]
@@ -40,7 +40,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "int %d", @Empty = false, @Image = "\"int %d\"", @Length = 6, @LiteralText = "\"int %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Long"]
@@ -52,7 +52,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long %d", @Empty = false, @Image = "\"long %d\"", @Length = 7, @LiteralText = "\"long %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Double"]
@@ -64,7 +64,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double %f", @Empty = false, @Image = "\"double %f\"", @Length = 9, @LiteralText = "\"double %f\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
@@ -76,7 +76,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String %s", @Empty = false, @Image = "\"String %s\"", @Length = 9, @LiteralText = "\"String %s\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- ArgumentList[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt
index ce5ef0f93d..78a8d5d495 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt
@@ -64,7 +64,7 @@
+- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"]
| | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
@@ -85,7 +85,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"]
| | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
@@ -106,7 +106,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
@@ -129,7 +129,7 @@
+- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"]
| | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
@@ -150,7 +150,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
@@ -173,7 +173,7 @@
+- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
@@ -194,7 +194,7 @@
| +- ArgumentList[@Empty = false, @Size = 1]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
@@ -215,7 +215,7 @@
| +- ArgumentList[@Empty = false, @Size = 1]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = false]
- +- SwitchLabel[@Default = false]
+ +- SwitchLabel[@Default = false, @PatternLabel = true]
| +- RecordPattern[]
| +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"]
| | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt
index 60f0406293..8090943eaf 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt
@@ -52,11 +52,11 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"]
@@ -77,7 +77,7 @@
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- ExpressionStatement[]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -97,12 +97,12 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Block[@Empty = false, @Size = 1, @containsComment = false]
| | +- BreakStatement[@Label = null]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"]
@@ -120,7 +120,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -139,12 +139,12 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Block[@Empty = false, @Size = 1, @containsComment = false]
| | +- BreakStatement[@Label = null]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"]
@@ -162,7 +162,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"]
@@ -174,7 +174,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Small triangle", @Empty = false, @Image = "\"Small triangle\"", @Length = 14, @LiteralText = "\"Small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt
index 34fed8bb67..ee01695dd4 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt
@@ -14,7 +14,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Character"]
@@ -34,7 +34,7 @@
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- BreakStatement[@Label = null]
+- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSwitchRule", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
| +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)]
@@ -48,7 +48,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Character"]
@@ -76,7 +76,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Character", @Empty = false, @Image = "\"Character\"", @Length = 9, @LiteralText = "\"Character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"]
@@ -91,7 +91,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- Block[@Empty = false, @Size = 1, @containsComment = false]
| +- BreakStatement[@Label = null]
+- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
@@ -106,7 +106,7 @@
| +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Character"]
@@ -147,7 +147,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "character", @Empty = false, @Image = "\"character\"", @Length = 9, @LiteralText = "\"character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
+ | +- SwitchLabel[@Default = true, @PatternLabel = false]
| +- ExpressionStatement[]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt
index e77a4d2574..06b6a2128c 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt
@@ -181,7 +181,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
@@ -193,7 +193,7 @@
| | | +- ArgumentList[@Empty = false, @Size = 1]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
@@ -205,7 +205,7 @@
| | | +- ArgumentList[@Empty = false, @Size = 1]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | | +- PatternList[@Empty = false, @Size = 1]
@@ -218,7 +218,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- RecordPattern[]
| | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | | | | +- PatternList[@Empty = false, @Size = 1]
@@ -237,7 +237,7 @@
| | | +- ArgumentList[@Empty = false, @Size = 1]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
@@ -248,7 +248,7 @@
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ArgumentList[@Empty = true, @Size = 0]
| | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | | +- PatternList[@Empty = false, @Size = 1]
@@ -264,7 +264,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
@@ -287,7 +287,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | +- PatternList[@Empty = false, @Size = 1]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt
index 7490fc68a2..9fa3cd2810 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt
@@ -105,7 +105,7 @@
| | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RSAKey"]
@@ -119,7 +119,7 @@
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StandardCharsets"]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "DSAPublicKey"]
@@ -133,7 +133,7 @@
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StandardCharsets"]
| | +- SwitchArrowBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayType[@ArrayDepth = 1]
| | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java23p/Jep455_PrimitiveTypesInPatternsInstanceofAndSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java23p/Jep455_PrimitiveTypesInPatternsInstanceofAndSwitch.txt
index c80a09fff6..850597a25e 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java23p/Jep455_PrimitiveTypesInPatternsInstanceofAndSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java23p/Jep455_PrimitiveTypesInPatternsInstanceofAndSwitch.txt
@@ -347,7 +347,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE]
@@ -381,11 +381,11 @@
| | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "v", @Name = "v", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = true, @Image = "0f", @IntLiteral = false, @Integral = false, @LiteralText = "0f", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = true, @Image = "5f", @IntLiteral = false, @Integral = false, @LiteralText = "5f", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.FLOAT]
@@ -398,7 +398,7 @@
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = true, @Image = "6f", @IntLiteral = false, @Integral = false, @LiteralText = "6f", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | +- PrimitiveType[@Kind = PrimitiveTypeKind.FLOAT]
@@ -424,7 +424,7 @@
| +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
+ | | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | | +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "true", @ParenthesisDepth = 0, @Parenthesized = false, @True = true]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -433,7 +433,7 @@
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b was true", @Empty = false, @Image = "\"b was true\"", @Length = 10, @LiteralText = "\"b was true\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
+ | +- SwitchLabel[@Default = false, @PatternLabel = false]
| | +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "false", @ParenthesisDepth = 0, @Parenthesized = false, @True = false]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java23p/Jep482_FlexibleConstructorBodies.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java23p/Jep482_FlexibleConstructorBodies.txt
index 549c591ece..a796c0b585 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java23p/Jep482_FlexibleConstructorBodies.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java23p/Jep482_FlexibleConstructorBodies.txt
@@ -105,7 +105,7 @@
| | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RSAKey"]
@@ -119,7 +119,7 @@
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StandardCharsets"]
| | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
+ | | | +- SwitchLabel[@Default = false, @PatternLabel = true]
| | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "DSAPublicKey"]
@@ -133,7 +133,7 @@
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StandardCharsets"]
| | +- SwitchArrowBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
+ | | +- SwitchLabel[@Default = true, @PatternLabel = false]
| | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayType[@ArrayDepth = 1]
| | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/DefaultLabelNotLastInSwitch.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/DefaultLabelNotLastInSwitch.xml
new file mode 100644
index 0000000000..5212dbe022
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/DefaultLabelNotLastInSwitch.xml
@@ -0,0 +1,136 @@
+
+
+
+
+ ok
+ 0
+
+
+
+
+ bad
+ 1
+
+
+
+
+ ok, no default
+ 0
+
+
+
+
+ switch expression, ok
+ 0
+
+
+
+
+ switch expression, not ok
+ 1
+
+
+
+
+ switch arrow, ok
+ 0
+ System.out.println("a");
+ default -> System.out.println("default");
+ }
+ }
+}
+ ]]>
+
+
+
+ switch arrow, not ok
+ 1
+ System.out.println("a");
+ default -> System.out.println("default");
+ case 2 -> System.out.println("b");
+ }
+ }
+}
+ ]]>
+
+
+
+ switch with pattern and default case, ok
+ 0
+
+
+
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/DefaultLabelNotLastInSwitchStmt.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/DefaultLabelNotLastInSwitchStmt.xml
deleted file mode 100644
index df892c6141..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/DefaultLabelNotLastInSwitchStmt.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
- ok
- 0
-
-
-
-
- bad
- 1
-
-
-
-
- ok, no default
- 0
-
-
-
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/SwitchStmtsShouldHaveDefault.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/NonExhaustiveSwitch.xml
similarity index 62%
rename from pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/SwitchStmtsShouldHaveDefault.xml
rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/NonExhaustiveSwitch.xml
index 758b97b43b..eba1aef001 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/SwitchStmtsShouldHaveDefault.xml
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/NonExhaustiveSwitch.xml
@@ -19,6 +19,19 @@ public class Foo {
]]>
+
+ empty switch is ok
+ 0
+
+
+
simple ok case
0
@@ -240,4 +253,128 @@ public enum GradeSystem {
}
]]>
+
+
+ [java] SwitchStmtsShouldHaveDefault false positive with pattern matching #4813
+ 0
+ System.out.println("WARNING " + failure.message());
+ case Success success -> System.out.println(success.message());
+ }
+ }
+ public void test2(AcceptableResult result) {
+ switch (result) {
+ case ProviderWarning failure: System.out.println("Provider WARNING " + failure.message()); break;
+ case Warning failure: System.out.println("WARNING " + failure.message()); break;
+ case Success success: System.out.println(success.message()); break;
+ }
+ }
+ public void test3(AcceptableResult result) {
+ switch (result) {
+ case ProviderWarning failure -> System.out.println("Provider WARNING " + failure.message());
+ case Success success -> System.out.println(success.message());
+ default -> System.out.println("default case");
+ }
+ }
+}
+]]>
+
+
+
+ [java] SwitchStmtsShouldHaveDefault false positive with pattern matching #4813, example 2
+ 0
+ { return 1; }
+ case C c -> { return 2; }
+ case D d -> { return 3; }
+ // case B b -> { return 4; } // not explicitly necessary, but possible
+ }
+ }
+}
+]]>
+
+
+
+ With Record Patterns #4813
+ 0
+ System.out.println(a);
+ }
+ }
+}
+]]>
+
+
+
+ Multiple Case Constants
+ 0
+ System.out.println("a or b");
+ case C -> System.out.println("c");
+ }
+ String s = switch(e) {
+ case A,B -> "a or b";
+ case C -> "c";
+ };
+ System.out.println(s);
+ }
+}
+]]>
+
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseAfterAnnotation.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseAfterAnnotation.xml
index 7a3121d8fe..8b8c06285e 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseAfterAnnotation.xml
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseAfterAnnotation.xml
@@ -5,129 +5,69 @@
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
- Contains tearDown
+ JUnit4 test class contains tearDown
1
+ 3
- Contains @After tearDown
+ JUnit4 test class contains tearDown with different signature is ok
+ 0
+
+
+
+
+ JUnit4 test class contains @After tearDown is ok
0
- Renamed tearDown
+ JUnit4 test class contains renamed tearDown is ok
0
- #1446 False positive with JUnit4TestShouldUseBeforeAnnotation when TestNG is used
- 0
-
-
-
-
- #940 False positive with JUnit4TestShouldUseAfterAnnotation when JUnit5's 'AfterEach' is used
- 0
-
-
-
-
- #940 False positive with JUnit4TestShouldUseAfterAnnotation when JUnit5's 'AfterAll' is used
- 0
-
-
-
- Contains tearDown, not a junit 4 test
+ Contains tearDown, not a JUnit 4/5 or TestNG test is ok
0
-
-
- Contains tearDown with different signature
- 0
-
@@ -151,4 +91,119 @@ public class AReallyCoolFeatureTest extends BaseTest {
}
]]>
+
+
+ TestNG test contains tearDown
+ 1
+ 4
+
+
+
+
+ TestNG test contains tearDown with different signature is ok (#1446)
+ 0
+
+
+
+
+ TestNG test contains tearDown with @AfterMethod is ok
+ 0
+
+
+
+
+ TestNG test contains tearDown with @AfterClass is ok
+ 0
+
+
+
+
+ JUnit 5 test class contains tearDown
+ 1
+ 4
+
+
+
+
+ JUnit 5 test class contains tearDown with @AfterEach is ok (#940)
+ 0
+
+
+
+
+ JUnit 5 test class contains tearDown with @AfterAll is ok (#940)
+ 0
+
+
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseBeforeAnnotation.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseBeforeAnnotation.xml
index 10d6fbc524..d9ae22cfd4 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseBeforeAnnotation.xml
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnitTestShouldUseBeforeAnnotation.xml
@@ -5,8 +5,9 @@
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
- Contains setUp
+ JUnit4 Test class contains setUp
1
+ 3
- Contains @setUp
+ JUnit4 Test class with Before is ok
0
- Renamed setup
+ JUnit4 Test class with renamed setup using Before is ok
0
- #1446 False positive with JUnit4TestShouldUseBeforeAnnotation when TestNG is used
+ Contains setUp, not a JUnit 4/5/TestNG test
0
+
+
+
+ JUnit4 Test class contains setUp with different signature is ok
+ 0
+
-
-
-
- #940 False positive with JUnit4TestShouldUseBeforeAnnotation when JUnit5's 'BeforeEach' is used
- 0
-
-
-
-
- #940 False positive with JUnit4TestShouldUseBeforeAnnotation when JUnit5's 'BeforeAll' is used
- 0
-
-
-
- Contains setUp, not a junit 4 test
- 0
-
-
-
- Contains setUp with different signature
- 0
-
+]]>
@@ -173,4 +118,120 @@ public class AReallyCoolFeatureTest extends BaseTest {
}
]]>
+
+
+ TestNG class contains setUp
+ 1
+ 4
+
+
+
+
+ TestNG class contains setUp with different signature is ok (#1446)
+ 0
+
+
+
+
+ TestNG with @BeforeMethod is ok (#1446)
+ 0
+
+
+
+
+ TestNG with @BeforeClass is ok
+ 0
+
+
+
+
+ JUnit5 Test class contains setUp
+ 1
+ 4
+
+
+
+
+ JUnit5 Test class with BeforeEach is ok (#940)
+ 0
+
+
+
+
+ JUnit5 Test class with BeforeAll is ok (#940)
+ 0
+
+
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/SwitchDensity.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/SwitchDensity.xml
index 8af61b0af7..1c3c21bf4d 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/SwitchDensity.xml
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/SwitchDensity.xml
@@ -155,4 +155,104 @@ public class SwitchWithDefault
}
]]>
+
+
+ [java] SwitchDensity false positive with pattern matching #5030
+ 4
+ 0
+ 0 ->
+ {
+ System.err.println("I am a fish.");
+ }
+ case Integer i ->
+ {
+ System.err.println("I am not a fish.");
+ }
+ default ->
+ {
+ System.err.println("default");
+ }
+ }
+ }
+}
+ ]]>
+
+
+
+ [java] SwitchDensity with pattern matching #5030
+ 4
+ 1
+ 0 ->
+ {
+ System.err.println("I am a fish.");
+ System.err.println("I am a fish.");
+ System.err.println("I am a fish.");
+ System.err.println("I am a fish.");
+ System.err.println("I am a fish.");
+ }
+ case Integer i ->
+ {
+ System.err.println("I am not a fish.");
+ System.err.println("I am not a fish.");
+ System.err.println("I am not a fish.");
+ System.err.println("I am not a fish.");
+ System.err.println("I am not a fish.");
+ System.err.println("I am not a fish.");
+ }
+ default ->
+ {
+ System.err.println("default");
+ }
+ }
+ }
+}
+ ]]>
+
+
+
+ Switch with Record Pattern, ok
+ 0
+ System.out.println(a);
+ }
+ }
+}
+]]>
+
+
+
+ Switch with Record Pattern, not ok
+ 4
+ 1
+ {
+ System.out.println(a);
+ System.out.println(a);
+ System.out.println(a);
+ System.out.println(a);
+ System.out.println(a);
+ }
+ }
+ }
+}
+]]>
+
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ImplicitSwitchFallThrough.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ImplicitSwitchFallThrough.xml
index 6d86131b0d..0ddd50e522 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ImplicitSwitchFallThrough.xml
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ImplicitSwitchFallThrough.xml
@@ -581,4 +581,24 @@ public class Test {
}
]]>
+
+
+ switch expression with one case, which is not empty
+ 1
+ 6
+
+
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/NonCaseLabelInSwitch.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/NonCaseLabelInSwitch.xml
new file mode 100644
index 0000000000..d40af2f6c9
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/NonCaseLabelInSwitch.xml
@@ -0,0 +1,155 @@
+
+
+
+
+ label inside switch statement, not ok
+ 1
+ 5
+
+
+
+
+ label inside switch expression, not ok
+ 1
+ 5
+
+
+
+
+ only cases in switch statement, ok
+ 0
+
+
+
+
+ only cases in switch expression, ok
+ 0
+
+
+
+
+ label in switch statement with arrow syntax, not ok
+ 1
+ 6
+ {
+ int y=8;
+ somelabel:
+ break;
+ }
+ default -> {
+ int j=8;
+ }
+ }
+ }
+}
+]]>
+
+
+
+ label in switch expression with arrow syntax, not ok
+ 1
+ 5
+ { int y=8;
+ somelabel:
+ yield y;
+ }
+ default -> {
+ int j=8;
+ yield j;
+ }
+ };
+ }
+}
+]]>
+
+
+
+ only cases in switch stmt/expr with arrow syntax, ok
+ 0
+ {
+ int y=8;
+ break;
+ }
+ default -> {
+ int j=8;
+ }
+ }
+ }
+ void barArrow(int x) {
+ x = switch (x) {
+ case 2 -> { int y=8;
+ yield y;
+ }
+ default -> {
+ int j=8;
+ yield j;
+ }
+ };
+ }
+}
+]]>
+
+
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/NonCaseLabelInSwitchStatement.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/NonCaseLabelInSwitchStatement.xml
deleted file mode 100644
index b2ba4cecd0..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/NonCaseLabelInSwitchStatement.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
- label inside switch
- 1
- 6
-
-
-
-
- ok
- 0
-
-
-
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/UselessOperationOnImmutable.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/UselessOperationOnImmutable.xml
index 111295638e..35ee48f112 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/UselessOperationOnImmutable.xml
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/UselessOperationOnImmutable.xml
@@ -210,6 +210,128 @@ public class TestCase {
String.valueOf(0).trim();
}
}
+]]>
+
+
+
+ [java] UselessOperationOnImmutable should detect java.time types #5244
+ 44
+ 7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,61,66,71,76
+
+
+
+
+ [java] UselessOperationOnImmutable should detect java.time types #5244 - Duration, Period
+ 2
+ 5,10
+
+
+
+
+ False positive for package private method calls in openjdk
+ 0
+
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForASwitchStatement.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForASwitchStatement.xml
deleted file mode 100644
index 006c56c1e5..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForASwitchStatement.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
- Only one case, this is useless
- 3
- 1
-
-
-
-
- Even two branches is not enough for a switch statement
- 3
- 1
-
-
-
-
- Three branches in a switch statement is ok.
- 3
- 0
-
-
-
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForSwitch.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForSwitch.xml
new file mode 100644
index 0000000000..e603390ec6
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForSwitch.xml
@@ -0,0 +1,141 @@
+
+
+
+
+ Switch Statement with no case, ok
+ 3
+ 0
+
+
+
+
+ Switch Statement with only one case, not ok
+ 3
+ 1
+
+
+
+
+ Switch Expression with only one case, not ok #5250
+ 3
+ 1
+
+
+
+
+ Even two branches is not enough for a switch statement
+ 3
+ 1
+
+
+
+
+ Three branches in a switch statement is ok.
+ 3
+ 0
+
+
+
+
+ [java] TooFewBranchesForASwitchStatement false positive for Pattern Matching #5249
+ 0
+ System.out.println("a");
+ }
+ }
+
+ public void simpleSwitchExpression(S s) {
+ String result = switch(s) {
+ case A a -> "a";
+ };
+ }
+}
+]]>
+
+
+
+ Record patterns are ignored, too #5249
+ 0
+ System.out.println(a);
+ }
+ }
+}
+]]>
+
+
diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml
index ea4d55938d..bb46814cfc 100644
--- a/pmd-javascript/pom.xml
+++ b/pmd-javascript/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml
index 790d5353f8..749144cd60 100644
--- a/pmd-jsp/pom.xml
+++ b/pmd-jsp/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-julia/pom.xml b/pmd-julia/pom.xml
index ac3ed6eed1..2dae0d4d57 100644
--- a/pmd-julia/pom.xml
+++ b/pmd-julia/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml
index 40f19513de..db57e02584 100644
--- a/pmd-kotlin/pom.xml
+++ b/pmd-kotlin/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml
index 49f8aade09..6b32cbca37 100644
--- a/pmd-lang-test/pom.xml
+++ b/pmd-lang-test/pom.xml
@@ -12,7 +12,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml
index 38f0d009e8..31428dbacc 100644
--- a/pmd-languages-deps/pom.xml
+++ b/pmd-languages-deps/pom.xml
@@ -4,7 +4,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
pmd-languages-deps
diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml
index f3a24be6d3..1a5924d3f6 100644
--- a/pmd-lua/pom.xml
+++ b/pmd-lua/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml
index 42a69e2497..997cd9179c 100644
--- a/pmd-matlab/pom.xml
+++ b/pmd-matlab/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml
index d551bc25a1..c8db88656a 100644
--- a/pmd-modelica/pom.xml
+++ b/pmd-modelica/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml
index 197c6dac58..015222667c 100644
--- a/pmd-objectivec/pom.xml
+++ b/pmd-objectivec/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml
index 3cb972b403..3a7b91adcc 100644
--- a/pmd-perl/pom.xml
+++ b/pmd-perl/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml
index 88f09db7a4..928d7d78c5 100644
--- a/pmd-php/pom.xml
+++ b/pmd-php/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml
index 26a5614255..c694ce4fca 100644
--- a/pmd-plsql/pom.xml
+++ b/pmd-plsql/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml
index 30326faeeb..ca86db7ca6 100644
--- a/pmd-python/pom.xml
+++ b/pmd-python/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml
index 9acaabbf96..2c953e41f5 100644
--- a/pmd-ruby/pom.xml
+++ b/pmd-ruby/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.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 80ad4da7bd..81159650ef 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.7.0-SNAPSHOT
+ 7.8.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 3f73f1cbfb..ed15aa35f8 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.7.0-SNAPSHOT
+ 7.8.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 ee66fca93a..31bdc20be3 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.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pmd-scala-common/pom.xml
diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml
index 023fa8dd39..78c80b613c 100644
--- a/pmd-swift/pom.xml
+++ b/pmd-swift/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml
index 43a990e8dc..ad89145dcf 100644
--- a/pmd-test-schema/pom.xml
+++ b/pmd-test-schema/pom.xml
@@ -11,7 +11,7 @@
pmd
net.sourceforge.pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml
index 0fd57a4437..a4fbf656eb 100644
--- a/pmd-test/pom.xml
+++ b/pmd-test/pom.xml
@@ -8,7 +8,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml
index e3a2489eff..8094d1662d 100644
--- a/pmd-tsql/pom.xml
+++ b/pmd-tsql/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-velocity/pom.xml b/pmd-velocity/pom.xml
index 905cd6b41c..485ee45b6c 100644
--- a/pmd-velocity/pom.xml
+++ b/pmd-velocity/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml
index 164795a623..49da6f0858 100644
--- a/pmd-visualforce/pom.xml
+++ b/pmd-visualforce/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml
index 676ba39759..3c51ee552e 100644
--- a/pmd-xml/pom.xml
+++ b/pmd-xml/pom.xml
@@ -7,7 +7,7 @@
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
../pom.xml
diff --git a/pom.xml b/pom.xml
index 87bf5c3641..d09220f92b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
net.sourceforge.pmd
pmd
- 7.7.0-SNAPSHOT
+ 7.8.0-SNAPSHOT
pom
PMD
@@ -83,7 +83,7 @@
- 2024-09-27T08:50:09Z
+ 2024-10-25T06:47:53Z
8
@@ -115,7 +115,7 @@
-Xmx512m -Dfile.encoding=${project.build.sourceEncoding} ${extraArgLine}
- 27
+ 28-SNAPSHOT
7.2.0
@@ -179,7 +179,7 @@
org.apache.maven.plugins
maven-assembly-plugin
- 3.6.0
+ 3.7.1
org.apache.maven.plugins
@@ -569,22 +569,22 @@
net.sourceforge.pmd
pmd-core
- 7.5.0
+ 7.7.0
net.sourceforge.pmd
pmd-java
- 7.5.0
+ 7.7.0
net.sourceforge.pmd
pmd-jsp
- 7.5.0
+ 7.7.0
net.sourceforge.pmd
pmd-javascript
- 7.5.0
+ 7.7.0
@@ -592,11 +592,11 @@
pmd-build-tools-config
${pmd.build-tools.version}
-
+
org.ow2.asm
asm
- 9.7
+ 9.7.1
@@ -828,7 +828,7 @@
org.ow2.asm
asm
- 9.7
+ 9.7.1
org.pcollections
@@ -910,7 +910,7 @@
org.scala-lang
scala-reflect
- 2.13.13
+ 2.13.15
org.scala-lang